An n-dimensional algebra is represented by a tensor
viewed as an operator with two inputs i,j and one output k.
fricas
(1) -> n:=2
fricas
T:=CartesianTensor(1,n,EXPR INT)
Type: Type
fricas
Yijk:=unravel(concat concat
[[[script(y,[[i,j],[k]])
for k in 1..n]
for j in 1..n]
for i in 1..n]
)$T
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
Y.[1,1,2]
Type: Symbol
fricas
Y.[1,2,1]
Type: Symbol
fricas
Y.[2,1,1]
Type: Symbol
Given two vectors U and V
fricas
Ui:=unravel([script(u,[[],[i]]) for i in 1..n])$T
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
Vj:=unravel([script(v,[[],[i]]) for i in 1..n])$T
Type: CartesianTensor
?(1,
2,
Expression(Integer))
the tensor Y operates on their tensor product
fricas
UVij:=product(Ui,Vj)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
UVij.[1,2]
Type: Expression(Integer)
fricas
UVij.[2,1]
Type: Expression(Integer)
fricas
YUV:=product(Yijk,UVij)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
YUV.[1,1,1,1,2]
Type: Expression(Integer)
fricas
YUV.[1,1,1,2,1]
Type: Expression(Integer)
fricas
YUV.[1,1,2,1,1]
Type: Expression(Integer)
fricas
YUV.[1,2,1,1,1]
Type: Expression(Integer)
fricas
YUV.[2,1,1,1,1]
Type: Expression(Integer)
fricas
contract(contract(YUV,1,4),1,3)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
contract(contract(Yijk,1,UVij,1),1,3)
Type: CartesianTensor
?(1,
2,
Expression(Integer))