X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_indexed.cpp;h=8f778311ccd0d49968ef780962ec0ea73803d111;hp=e1ee1eb1c8977e84c6b269acd632247db6073e41;hb=f9a87fbf8abf8cd97cfde156372d92275129a38e;hpb=8a5bcc703e54153669eb60ff4d2c3bd64cd2af0c diff --git a/check/exam_indexed.cpp b/check/exam_indexed.cpp index e1ee1eb1..8f778311 100644 --- a/check/exam_indexed.cpp +++ b/check/exam_indexed.cpp @@ -133,9 +133,9 @@ static unsigned epsilon_check(void) result += check_equal_simplify(lorentz_g(mu.toggle_variance(), nu.toggle_variance()) * lorentz_eps(mu, nu, rho, sigma), 0); // contraction with symmetric tensor is zero - result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, indexed::symmetric, mu.toggle_variance(), nu.toggle_variance()), 0); - result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, indexed::symmetric, nu.toggle_variance(), sigma.toggle_variance(), rho.toggle_variance()), 0); - ex e = lorentz_eps(mu, nu, rho, sigma) * indexed(d, indexed::symmetric, mu.toggle_variance(), tau); + result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), mu.toggle_variance(), nu.toggle_variance()), 0); + result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), nu.toggle_variance(), sigma.toggle_variance(), rho.toggle_variance()), 0); + ex e = lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), mu.toggle_variance(), tau); result += check_equal_simplify(e, e); return result; @@ -151,16 +151,25 @@ static unsigned symmetry_check(void) symbol A("A"), B("B"); ex e; - result += check_equal(indexed(A, indexed::symmetric, i, j), indexed(A, indexed::symmetric, j, i)); - result += check_equal(indexed(A, indexed::antisymmetric, i, j) + indexed(A, indexed::antisymmetric, j, i), 0); - result += check_equal(indexed(A, indexed::antisymmetric, i, j, k) - indexed(A, indexed::antisymmetric, j, k, i), 0); - e = indexed(A, indexed::symmetric, i, j, k) * - indexed(B, indexed::antisymmetric, l, k, i); + result += check_equal(indexed(A, sy_symm(), i, j), indexed(A, sy_symm(), j, i)); + result += check_equal(indexed(A, sy_anti(), i, j) + indexed(A, sy_anti(), j, i), 0); + result += check_equal(indexed(A, sy_anti(), i, j, k) - indexed(A, sy_anti(), j, k, i), 0); + e = indexed(A, sy_symm(), i, j, k) * + indexed(B, sy_anti(), l, k, i); result += check_equal_simplify(e, 0); - e = indexed(A, indexed::symmetric, i, i, j, j) * - indexed(B, indexed::antisymmetric, k, l); // GiNaC 0.8.0 had a bug here + e = indexed(A, sy_symm(), i, i, j, j) * + indexed(B, sy_anti(), k, l); // GiNaC 0.8.0 had a bug here result += check_equal_simplify(e, e); + e = indexed(A, i, j); + result += check_equal(symmetrize(e) + antisymmetrize(e), e); + e = indexed(A, sy_symm(), i, j, k, l); + result += check_equal(symmetrize(e), e); + result += check_equal(antisymmetrize(e), 0); + e = indexed(A, sy_anti(), i, j, k, l); + result += check_equal(symmetrize(e), 0); + result += check_equal(antisymmetrize(e), e); + return result; } @@ -203,18 +212,18 @@ static unsigned edyn_check(void) // Lorentz transformation matrix (boost along x axis) matrix L(4, 4); - L.set(0, 0, gamma); - L.set(0, 1, -beta*gamma); - L.set(1, 0, -beta*gamma); - L.set(1, 1, gamma); - L.set(2, 2, 1); L.set(3, 3, 1); + L(0, 0) = gamma; + L(0, 1) = -beta*gamma; + L(1, 0) = -beta*gamma; + L(1, 1) = gamma; + L(2, 2) = 1; L(3, 3) = 1; // Electromagnetic field tensor matrix F(4, 4, lst( 0, -Ex, -Ey, -Ez, Ex, 0, -Bz, By, Ey, Bz, 0, -Bx, - Ez, -By, Bx // 0 + Ez, -By, Bx, 0 )); // Indices @@ -315,6 +324,7 @@ static unsigned dummy_check(void) symbol p("p"), q("q"); idx i(symbol("i"), 3), j(symbol("j"), 3), n(symbol("n"), 3); + varidx mu(symbol("mu"), 4), nu(symbol("nu"), 4); ex e; e = indexed(p, i) * indexed(q, i) - indexed(p, j) * indexed(q, j); @@ -324,6 +334,9 @@ static unsigned dummy_check(void) - indexed(p, n) * indexed(p, n) * indexed(q, j) * indexed(q, j); result += check_equal_simplify(e, 0); + e = indexed(p, mu, mu.toggle_variance()) - indexed(p, nu, nu.toggle_variance()); + result += check_equal_simplify(e, 0); + return result; }