X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Ftensor.cpp;h=c215237d85f9d1225913b7fff4f87e59e0bc8134;hb=62a1dbf52d01b7f50cce2ed16219466ff7174c09;hp=7b1e32338c2b6ead77cb260f6a1e6d54d76c2628;hpb=3ac17e18ada69428fe170c10abcc5f33a30f0676;p=ginac.git diff --git a/ginac/tensor.cpp b/ginac/tensor.cpp index 7b1e3233..c215237d 100644 --- a/ginac/tensor.cpp +++ b/ginac/tensor.cpp @@ -141,6 +141,22 @@ DEFAULT_COMPARE(tensdelta) DEFAULT_COMPARE(tensmetric) DEFAULT_COMPARE(spinmetric) +bool tensdelta::info(unsigned inf) const +{ + if(inf == info_flags::real) + return true; + + return false; +} + +bool tensmetric::info(unsigned inf) const +{ + if(inf == info_flags::real) + return true; + + return false; +} + int minkmetric::compare_same_type(const basic & other) const { GINAC_ASSERT(is_a(other)); @@ -152,6 +168,14 @@ int minkmetric::compare_same_type(const basic & other) const return inherited::compare_same_type(other); } +bool minkmetric::info(unsigned inf) const +{ + if(inf == info_flags::real) + return true; + + return false; +} + int tensepsilon::compare_same_type(const basic & other) const { GINAC_ASSERT(is_a(other)); @@ -165,6 +189,22 @@ int tensepsilon::compare_same_type(const basic & other) const return inherited::compare_same_type(other); } +bool tensepsilon::info(unsigned inf) const +{ + if(inf == info_flags::real) + return true; + + return false; +} + +bool spinmetric::info(unsigned inf) const +{ + if(inf == info_flags::real) + return true; + + return false; +} + DEFAULT_PRINT_LATEX(tensdelta, "delta", "\\delta") DEFAULT_PRINT(tensmetric, "g") DEFAULT_PRINT_LATEX(minkmetric, "eta", "\\eta") @@ -588,6 +628,9 @@ ex epsilon_tensor(const ex & i1, const ex & i2) if (!ex_to(i1).get_dim().is_equal(_ex2)) throw(std::runtime_error("index dimension of epsilon tensor must match number of indices")); + if(is_a(i1.op(0))||is_a(i2.op(0))) + return indexed(epsilon, antisymmetric2(), i1, i2).hold(); + return indexed(epsilon, antisymmetric2(), i1, i2); } @@ -604,6 +647,9 @@ ex epsilon_tensor(const ex & i1, const ex & i2, const ex & i3) if (!ex_to(i1).get_dim().is_equal(_ex3)) throw(std::runtime_error("index dimension of epsilon tensor must match number of indices")); + if(is_a(i1.op(0))||is_a(i2.op(0))||is_a(i3.op(0))) + return indexed(epsilon, antisymmetric3(), i1, i2, i3).hold(); + return indexed(epsilon, antisymmetric3(), i1, i2, i3); } @@ -621,6 +667,9 @@ ex lorentz_eps(const ex & i1, const ex & i2, const ex & i3, const ex & i4, bool if (!ex_to(i1).get_dim().is_equal(_ex4)) throw(std::runtime_error("index dimension of epsilon tensor must match number of indices")); + if(is_a(i1.op(0))||is_a(i2.op(0))||is_a(i3.op(0))||is_a(i4.op(0))) + return indexed(pos_sig ? epsilon_pos : epsilon_neg, antisymmetric4(), i1, i2, i3, i4).hold(); + return indexed(pos_sig ? epsilon_pos : epsilon_neg, antisymmetric4(), i1, i2, i3, i4); }