[GiNaC-list] Wonderfull!!. WAS: Are Clifford units of different
bases equal?
Vladimir Kisil
kisilv at maths.leeds.ac.uk
Wed May 9 12:43:19 CEST 2007
Dear Javier,
>>>>> "JRG" == Javier Ros Ganuza <jros at unavarra.es> writes:
JRG> It works in ginac-1.3.4
It seems that 1.4 branch contains some improvements which were not
implemented in 1.3.
>> > e~0*a1+2*e~2*c1+2*e~0*a1+2*b1*e~1+b1*e~1+e~2*c1
JRG> Wonderfully I obtain
JRG> 3*a1*e~0+3*c1*e~2+3*b1*e~1
JRG> It seems that the call to canonicalize_clifford asumes that the
JRG> units of both bases are equal, but this is not a problem for
JRG> me.
This should be again due to the difference between 1.3 and 1.4
branches.
JRG> In order to do some practice in clifford algebra in GiNNaC I'm
JRG> trying to do Cliford Geommetric Algebra operations in Cl2.
.....
JRG> They doesn't expand as can be seen.
It works on my computer with GiNaC 1.4, but I have to change
dimensionality of indexes to 2. I include the new program with few
more lines of the additional checks and its output, so you could see
yourself.
Best wishes,
Vladimir
--
Vladimir V. Kisil email: kisilv at maths.leeds.ac.uk
-- www: http://maths.leeds.ac.uk/~kisilv/
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;
int main(){
realsymbol a0("a0"), a1("a1"), a2("a2"), a3("a3"),
b0("b0"), b1("b1"), b2("b2"), b3("b3");
varidx nu(symbol("nu", "\\nu"), 2), mu(symbol("mu", "\\mu"), 2);
ex basis1 = clifford_unit(mu, diag_matrix(lst(1, 1)),0);
ex e00 = basis1.subs(mu == 0),
e01 = basis1.subs(mu == 1);
//cout << latex;
cout << "----------" << endl;
ex multivectora=a0+a1*e00+a2*e01+a3*(e00*e01),
multivectorb=b0+b1*e00+b2*e01+b3*(e00*e01);
cout << "multivectora = " << multivectora << endl;
cout << "multivectorb = " << expand_dummy_sum(multivectorb) << endl;
cout << "----------" << endl;
ex result=multivectora + multivectorb;
cout << "multivectora + multivectorb = " << multivectora + multivectorb
<< endl;
result=multivectora * multivectorb;
cout << "multivectora * multivectorb = " << multivectora *
clifford_bar(multivectorb)<< endl;
cout << "Expanded multivectora * multivectorb = " << (multivectora *
clifford_bar(multivectorb)).expand()<< endl;
cout << "Canonicalized multivectora * multivectorb = " << canonicalize_clifford((multivectora *
clifford_bar(multivectorb)).expand())<< endl;
}
================================================================
----------
multivectora = a0+(e~0*e~1)*a3+e~1*a2+a1*e~0
multivectorb = b0+e~0*b1+b2*e~1+b3*(e~0*e~1)
----------
multivectora + multivectorb =
b0+e~0*b1+a0+(e~0*e~1)*a3+b2*e~1+e~1*a2+b3*(e~0*e~1)+a1*e~0
multivectora * multivectorb =
(a0+(e~0*e~1)*a3+e~1*a2+a1*e~0)*(b0-e~0*b1-b2*e~1+(e~1*e~0)*b3)
Expanded multivectora * multivectorb =
-a1*ONE*b1-e~0*e~1*a2*b1-(e~0*e~1)*a3*b2*e~1+(e~1*e~0)*b3*a0-a0*e~0*b1-b2*ONE*a2+a1*(e~1*e~0)*b3*e~0-a1*b2*e~0*e~1-(e~0*e~1)*a3*e~0*b1+(e~1*e~0)*b3*(e~0*e~1)*a3+b0*a0+(e~1*e~0)*b3*e~1*a2+a1*b0*e~0+b0*(e~0*e~1)*a3+b0*e~1*a2-a0*b2*e~1
Canonicalized multivectora * multivectorb = -e~0*e~1*a2*b1-(e~0*e~1)*a3*b2*e~1-ONE*b2*a2-b3*(e~0*e~1*e~0*e~1)*a3-a0*e~0*b1-a1*b2*e~0*e~1-(e~0*e~1)*a3*e~0*b1+b0*a0+a1*b0*e~0-a1*ONE*b1-b3*a0*(e~0*e~1)+b0*(e~0*e~1)*a3-b3*(e~0*e~1)*e~1*a2-a1*b3*(e~0*e~1)*e~0+b0*e~1*a2-a0*b2*e~1
More information about the GiNaC-list
mailing list