[GiNaC-devel] patch for canonicalize_clifford

Chris Dams C.Dams at science.ru.nl
Mon Mar 21 14:46:17 CET 2005


Dear developers,

I found out that the result of

	ex f=dirac_gamma(varidx(nu,dim))
	     *dirac_slash(k,dim)
	     *dirac_gamma(varidx(mu,dim))
	     *indexed(n,varidx(nu,dim,true))
	     *indexed(k,varidx(mu,dim,true));
	cout << "before canon_cl: " << f << endl;
	f=canonicalize_clifford(f);
	cout << "after canon_cl: " << f << endl;

is

	before canon_cl: n.nu*(gamma~nu*k\*gamma~mu)*k.mu
	after canon_cl: 2*n\*k.mu*k~mu-2*n~mu*k.mu*k\+k\*n\*k\

I think it is strange that canonicalize_clifford can return something that
contains k\*n\*k\ because this looks particularly uncanonicalized.

I suggest the patch

Index: ginac/clifford.cpp
===================================================================
RCS file: /home/cvs/GiNaC/ginac/clifford.cpp,v
retrieving revision 1.84
diff -r1.84 clifford.cpp
940c940
< ex canonicalize_clifford(const ex & e)
---
> ex canonicalize_clifford(const ex & e_)
941a942
>       ex e=simplify_indexed(e_);

With this patch the test program gives
before canon_cl: n.nu*(gamma~nu*k\*gamma~mu)*k.mu
after canon_cl: n\*k.symbol8*k~symbol8

Best wishes,
Chris





More information about the GiNaC-devel mailing list