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
reindex(Yijk,[3,1,2])
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
Yijk[1,1,2]
Type: Expression(Integer)
fricas
Yijk[1,2,1]
Type: Expression(Integer)
fricas
Yijk[2,1,1]
Type: Expression(Integer)
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 to yield a vector W
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))
fricas
Wk:=(reindex(Yijk,[3,2,1])*Ui)*Vj
Type: CartesianTensor
?(1,
2,
Expression(Integer))
Take 2
An n-dimensional algebra is represented by a tensor
viewed as an operator with two inputs i,j and one output k.
fricas
Ykji:=unravel(concat concat
[[[script(y,[[i,j],[k]])
for i in 1..n]
for j in 1..n]
for k in 1..n]
)$T
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
contract(contract(Ykji,3,product(Ui,Vj),1),2,3)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
fricas
Wk:=(Ykji*Ui)*Vj
Type: CartesianTensor
?(1,
2,
Expression(Integer))