[GiNaC-list] Are Clifford units of different bases equal?
Javier Ros Ganuza
jros at unavarra.es
Tue May 8 19:14:38 CEST 2007
Hello all, I think that I can explain myself better with this simplistic
example (THE OUTPUTS OF COUTS ARE INLINED):
//gcc -o main1 main1.cc -lginac -lcln
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;
int main(){
realsymbol a1("a1"), b1("b1"), c1("c1");
varidx nu(symbol("nu", "\\nu"), 3), mu(symbol("mu", "\\mu"), 3);
ex basis1 = clifford_unit(mu, diag_matrix(lst(1, 1, 1)),0),
basis2 = clifford_unit(nu, diag_matrix(lst(1, 1, 1)),1);
ex vector1 = lst_to_clifford(lst(a1,b1,c1), mu, basis1),
vector2 = lst_to_clifford(lst(a1,b1,c1), nu, basis2);
ex result=2*vector1+vector2;
cout << result << endl;
//GIVES: e~nu*[[a1],[b1],[c1]].nu+2*[[a1],[b1],[c1]].mu*e~mu
cout <<
result.expand(expand_options::expand_indexed).simplify_indexed() <<
endl;
//GIVES: 3*e~nu*[[a1],[b1],[c1]].nu
cout << expand_dummy_sum(result) << endl;
//GIVES: 3*a1*e~0+3*c1*e~2+3*b1*e~1
cout << canonicalize_clifford(expand_dummy_sum(result)) << endl;
//GIVES: 3*a1*e~0+3*c1*e~2+3*b1*e~1
}
So I understand that basis1 and basis2 are the units of two different
bases, the last parameter (0 or 1) in the call of clifford_unit(...)
does not affect the output (about this parameter the tutorial says:
"optional parameter rl allows to distinguish different Clifford algebras
(wich will commute each other))". I recognize that I don't understand
the meaning of "wich will commute each other" ).
I understand then that vector1 and vector2 are vectors with the same
components but with different bases.
But Outputs reveal:
Output 1: Clifford_unit names are the same for both bases
Output 2: Clifford_units are the same for both bases
Output 3: Clifford_units are the same for both bases
Output 4: Clifford_units are the same for both bases
Is this intended behaviour?
Can it be changed so that Outputs can be something like this:
e_basis2~nu*[[a1],[b1],[c1]].nu+2*[[a1],[b1],[c1]].mu*e_basis1~mu
e_basis2~nu*[[a1],[b1],[c1]].nu+2*[[a1],[b1],[c1]].mu*e_basis1~mu
2*a1*e_basis2~0+2*c1*e_basis2~2+2*b1*e_basis2~1+a1*e_basis1~0
+c1*e_basis1~2+b1*e_basis1~1
2*a1*e_basis2~0+2*c1*e_basis2~2+2*b1*e_basis2~1+a1*e_basis1~0
+c1*e_basis1~2+b1*e_basis1~1
???
Another question:
In expresion vector1*vector2, Does * stands for the Inner product?
How can I write a expression involving the Outer product?
As Vladimir may remember, this is a rework of a example that appeared in
this list a couple of years ago. I have implemented a multibody dynamics
kernel based in GiNaC around clases derived form GiNaC's matrix, but I
want to investigate this path also.
Javier
PD: I'm ussing ginac-1.3.4-1.fc4
for if it is relevant.
More information about the GiNaC-list
mailing list