patch for clifford.cpp

Chris Dams chrisd at sci.kun.nl
Fri Jan 30 15:25:14 CET 2004


Hello,

I found that the code

	ex e=dirac_slash(a,4)*dirac_slash(b,4)
		+dirac_slash(b,4)*dirac_slash(a,4);
        cout << e << " has trace " << dirac_trace(e) << endl;
        e=canonicalize_clifford(e);
        cout << e << " has trace " << dirac_trace(e) << endl;

gives the output

	b\*a\+a\*b\ has trace 4*b~symbol5*a.symbol5+4*a.symbol3*b~symbol3
	2*b~symbol9*a.symbol9 has trace 2*b~symbol9*a.symbol9

I think this is wrong and that 2*b~symbol9*a.symbol9 should have been
2*ONE*b~symbol9*a.symbol9. A patch is attached.

Bye,
Chris

-------------- next part --------------
Index: clifford.cpp
===================================================================
RCS file: /home/cvs/GiNaC/ginac/clifford.cpp,v
retrieving revision 1.71
diff -r1.71 clifford.cpp
760c760
< 					it[1] = _ex2;
---
> 					it[1] = v.size()==2 ? _ex2*dirac_ONE(ex_to<clifford>(it[1]).get_representation_label()) : _ex2;


More information about the GiNaC-devel mailing list