]> www.ginac.de Git - ginac.git/blobdiff - check/exam_clifford.cpp
More evaluation rules: abs(x^n) => abs(x)^n (x > 0, n is real).
[ginac.git] / check / exam_clifford.cpp
index 5b646bf51df4fdd3009cb6774a2dc57781e80a06..9503f162a72a38ed31a0ae03af25ca02990078e9 100644 (file)
@@ -3,7 +3,7 @@
  *  Here we test GiNaC's Clifford algebra objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -504,7 +504,8 @@ static unsigned clifford_check7(const ex & G, const symbol & dim)
        result += check_equal(e, pow(scalar*(dim-2), 2).expand() * clifford_unit(mu, G));
 
        // canonicalize_clifford() checks, only for symmetric metrics
-       if (ex_to<symmetry>(ex_to<indexed>(ex_to<clifford>(clifford_unit(mu, G)).get_metric()).get_symmetry()).has_symmetry()) {
+       if (is_a<indexed>(ex_to<clifford>(clifford_unit(mu, G)).get_metric()) &&
+           ex_to<symmetry>(ex_to<indexed>(ex_to<clifford>(clifford_unit(mu, G)).get_metric()).get_symmetry()).has_symmetry()) {
                e = clifford_unit(mu, G) * clifford_unit(nu, G) + clifford_unit(nu, G) * clifford_unit(mu, G);
                result += check_equal(canonicalize_clifford(e), 2*dirac_ONE()*unit.get_metric(nu, mu));