#include "debugmsg.h"
#include "utils.h"
-#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
GINAC_IMPLEMENT_REGISTERED_CLASS(simp_lor, indexed)
// public
-basic * simp_lor::duplicate() const
-{
- debugmsg("simp_lor duplicate",LOGLEVEL_DUPLICATE);
- return new simp_lor(*this);
-}
-
void simp_lor::printraw(std::ostream & os) const
{
debugmsg("simp_lor printraw",LOGLEVEL_PRINT);
// at least one off-diagonal
return _ex0();
}
- } else if (idx1.is_symbolic() &&
- idx1.is_co_contra_pair(idx2)) {
- return Dim() - 2;
+ } else if (idx1.is_symbolic() && idx1.is_co_contra_pair(idx2)) {
+ if (idx1.is_orthogonal_only())
+ return Dim() - idx1.get_dim_parallel_space();
+ else
+ return Dim();
}
}
ex simplify_simp_lor(const ex & e, const scalar_products & sp)
{
// all simplification is done on expanded objects
- ex e_expanded=e.expand();
+ ex e_expanded = e.expand();
// simplification of sum=sum of simplifications
if (is_ex_exactly_of_type(e_expanded,add)) {
return spmapkey(strstrpair(v1.name,v2.name),anon);
}
-#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC