An n-dimensional algebra is represented by a tensor viewed as an operator with two inputs i,j
and one output k
.
axiom
n:=2
axiom
T:=CartesianTensor(1,n,EXPR INT)
Type: Domain
axiom
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))
axiom
reindex(Yijk,[3,1,2])
Type: CartesianTensor
?(1,
2,
Expression(Integer))
axiom
Y.[1,1,2]
Type: Symbol
axiom
Y.[1,2,1]
Type: Symbol
axiom
Y.[2,1,1]
Type: Symbol
Given two vectors U
and V
axiom
Ui:=unravel([script(u,[[],[i]]) for i in
1..n])$T
Type: CartesianTensor
?(1,
2,
Expression(Integer))
axiom
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
axiom
UVij:=product(Ui,Vj)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
axiom
UVij.[1,2]
Type: Expression(Integer)
axiom
UVij.[2,1]
Type: Expression(Integer)
axiom
YUV:=product(Yijk,UVij)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
axiom
YUV.[1,1,1,1,2]
Type: Expression(Integer)
axiom
YUV.[1,1,1,2,1]
Type: Expression(Integer)
axiom
YUV.[1,1,2,1,1]
Type: Expression(Integer)
axiom
YUV.[1,2,1,1,1]
Type: Expression(Integer)
axiom
YUV.[2,1,1,1,1]
Type: Expression(Integer)
axiom
contract(contract(YUV,1,4),1,3)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
axiom
contract(contract(Yijk,1,UVij,1),1,3)
Type: CartesianTensor
?(1,
2,
Expression(Integer))
axiom
reindex(Yijk,[3,1,2])*Ui*Vj
Type: CartesianTensor
?(1,
2,
Expression(Integer))