X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Fexam_indexed.cpp;h=9c7a92a08d8cca85443771b2b01f96e2567bfef2;hp=8f778311ccd0d49968ef780962ec0ea73803d111;hb=6a289cac851857096561ee8ecb32ee4ba8a28ac4;hpb=f9a87fbf8abf8cd97cfde156372d92275129a38e diff --git a/check/exam_indexed.cpp b/check/exam_indexed.cpp index 8f778311..9c7a92a0 100644 --- a/check/exam_indexed.cpp +++ b/check/exam_indexed.cpp @@ -123,21 +123,26 @@ static unsigned epsilon_check(void) symbol s_mu("mu"), s_nu("nu"), s_rho("rho"), s_sigma("sigma"), s_tau("tau"); symbol d("d"); varidx mu(s_mu, 4), nu(s_nu, 4), rho(s_rho, 4), sigma(s_sigma, 4), tau(s_tau, 4); + varidx mu_co(s_mu, 4, true), nu_co(s_nu, 4, true), rho_co(s_rho, 4, true), sigma_co(s_sigma, 4, true), tau_co(s_tau, 4, true); // antisymmetry result += check_equal(lorentz_eps(mu, nu, rho, sigma) + lorentz_eps(sigma, rho, mu, nu), 0); // convolution is zero - result += check_equal(lorentz_eps(mu, nu, rho, nu.toggle_variance()), 0); - result += check_equal(lorentz_eps(mu, nu, mu.toggle_variance(), nu.toggle_variance()), 0); - result += check_equal_simplify(lorentz_g(mu.toggle_variance(), nu.toggle_variance()) * lorentz_eps(mu, nu, rho, sigma), 0); + result += check_equal(lorentz_eps(mu, nu, rho, nu_co), 0); + result += check_equal(lorentz_eps(mu, nu, mu_co, nu_co), 0); + result += check_equal_simplify(lorentz_g(mu_co, nu_co) * 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, 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(lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), mu_co, nu_co), 0); + result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), nu_co, sigma_co, rho_co), 0); + ex e = lorentz_eps(mu, nu, rho, sigma) * indexed(d, sy_symm(), mu_co, tau); result += check_equal_simplify(e, e); + // contractions of epsilon tensors + result += check_equal_simplify(lorentz_eps(mu, nu, rho, sigma) * lorentz_eps(mu_co, nu_co, rho_co, sigma_co), -24); + result += check_equal_simplify(lorentz_eps(tau, nu, rho, sigma) * lorentz_eps(mu_co, nu_co, rho_co, sigma_co), -6 * delta_tensor(tau, mu_co)); + return result; } @@ -161,6 +166,16 @@ static unsigned symmetry_check(void) indexed(B, sy_anti(), k, l); // GiNaC 0.8.0 had a bug here result += check_equal_simplify(e, e); + symmetry R = sy_symm(sy_anti(0, 1), sy_anti(2, 3)); + e = indexed(A, R, i, j, k, l) + indexed(A, R, j, i, k, l); + result += check_equal(e, 0); + e = indexed(A, R, i, j, k, l) + indexed(A, R, i, j, l, k); + result += check_equal(e, 0); + e = indexed(A, R, i, j, k, l) - indexed(A, R, j, i, l, k); + result += check_equal(e, 0); + e = indexed(A, R, i, j, k, l) + indexed(A, R, k, l, j, i); + result += check_equal(e, 0); + e = indexed(A, i, j); result += check_equal(symmetrize(e) + antisymmetrize(e), e); e = indexed(A, sy_symm(), i, j, k, l);