Processing math: 100%
Cadabra
a field-theory motivated approach to computer algebra

expand

Write out products of objects with implicit indices.
Write out products of matrices and vectors inside indexbrackets, inserting new dummy indices for the contraction. This requires that the objects inside the index bracket are properly declared to have Matrix or ImplicitIndex properties. Here is an example with multiple matrices:
{a,b,c,d,e}::Indices; {A,B,C,D}::Matrix; ex:= (A B C D)_{a b};
Attached property Indices(position=free) to (a,b,c,d,e).
Attached property Matrix to (A,B,C,D).
(ABCD)ab
expand(_);
AacBcdCdeDeb
Compare the above to the following example, in which one of the objects inside the bracket is no longer a matrix:
ex:= (A B Q D)_{a b};
(ABQD)ab
expand(_);
AacBcdQDdb
Finally, an example with matrices carrying additional labels, as well as a vector object:
{\alpha,\beta}::Indices; \Gamma{#}::Matrix; v::ImplicitIndex;
Attached property Indices(position=free) to (α,β).
Attached property Matrix to Γ(#).
Attached property ImplicitIndex to v.
ex:=(\Gamma_{r} v)_{\alpha};
(Γrv)α
expand(_);
(Γr)αβvβ
Copyright © 2001-2024 Kasper Peeters
Questions? info@cadabra.science