[GiNaC-list] A.i B~i != A.0 B~0 + A.1 B~1 + ... [WAS: Bug or feature?]

Sheplyakov Alexei varg at theor.jinr.ru
Tue Jun 28 03:36:29 CEST 2005


On Tue, Jun 21, 2005 at 09:15:38PM +0200, Javier Ros Ganuza wrote:
> I think the following expressions are mathematically equivalent:
> 
>  cout << (indexed(matrix(3,1, lst(a1,b1,c1)), mu.toggle_variance
> ())+indexed(matrix(3,1, lst(a2,b2,c2)), mu.toggle_variance
> ())).simplify_indexed()*basis1 << endl;
> 
>  cout << ((indexed(matrix(3,1, lst(a1,b1,c1)), mu.toggle_variance
> ())+indexed(matrix(3,1, lst(a2,b2,c2)), mu.toggle_variance
> ()))*basis1).simplify_indexed() << endl;
> 
>  cout << (indexed(matrix(3,1, lst(a1,b1,c1)), mu.toggle_variance
> ())*basis1+indexed(matrix(3,1, lst(a2,b2,c2)), mu.toggle_variance
> ())*basis1).simplify_indexed() << endl;
> 
> Where
> 
> varidx mu(symbol("mu", "\\mu"), 3);
> ex basis1 = clifford_unit(mu, diag_matrix(lst(1, 1, 1)),1);
>  
> 
> But output is different
> 
> > [[a2+a1],[b1+b2],[c2+c1]].mu*e~mu
> > [[a2],[b2],[c2]].mu*e~mu+[[a1],[b1],[c1]].mu*e~mu
> > [[a2],[b2],[c2]].mu*e~mu+[[a1],[b1],[c1]].mu*e~mu
> 
> Is this intended behaviour?


First of all, most of GiNaC's indexed objects are tensors, and 
a.i*b~i != a.0*b~0 + a.1*b~1 + ..., since the dimension of index can
be arbitrary (e.g. complex). 

Obviously, matrix indices should have non-negative integer dimension,
so matrices are NOT tensors, and product of matrix expression and 
tensor expression is [almost] meaningless.

See also 

http://thep.physik.uni-mainz.de/pipermail/ginac-list/2005-April/000638.html

and

http://thep.physik.uni-mainz.de/pipermail/ginac-list/2004-December/000576.html


P.S.

This question tends to become a FAQ.

-- 
ROOT: an octopus made by nailing extra legs onto a cat.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20050628/e3813066/attachment.pgp


More information about the GiNaC-list mailing list