An n-dimensional algebra is represented by a (1,2)-tensor
viewed as an operator with two inputs i,j
and one
output k
. For example in 2 dimensions
axiom
)library DEXPR
DistributedExpression is now explicitly exposed in frame initial
DistributedExpression will be automatically loaded when needed from
/var/zope2/var/LatexWiki/DEXPR.NRLIB/DEXPR
n:=2
axiom
--T:=CartesianTensor(1,n,DEXPR INT)
T:=CartesianTensor(1,n,HDMP(concat[concat concat
[[[script(y,[[k],[j,i]])
for i in 1..n]
for j in 1..n]
for k in 1..n],
[script(u,[[i]]) for i in 1..n],
[script(v,[[i]]) for i in 1..n] ],FRAC
INT))
Type: Domain
axiom
Y:=unravel(concat concat
[[[script(y,[[k],[j,i]])
for i in 1..n]
for j in 1..n]
for k in 1..n]
)$T
Type: CartesianTensor
?(1,
2,
HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
Given two vectors and
axiom
U:=unravel([script(u,[[i]]) for i in 1..n])$T
Type: CartesianTensor
?(1,
2,
HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
axiom
V:=unravel([script(v,[[i]]) for i in 1..n])$T
Type: CartesianTensor
?(1,
2,
HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
the tensor Y
operates on their tensor product to
yield a vector
axiom
W:=contract(contract(Y,3,product(U,V),1),2,3)
Type: CartesianTensor
?(1,
2,
HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
Diagram:
U V
2i 3j
\ /
|
1k
W
or in a more convenient notation:
axiom
W:=(Y*U)*V
Type: CartesianTensor
?(1,
2,
HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
The algebra Y
is commutative if the following tensor
(the commutator) is zero
axiom
K:=Y-reindex(Y,[1,3,2])
Type: CartesianTensor
?(1,
2,
HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
A basis for the ideal defined by the coefficients of the
commutator is given by:
axiom
C:=groebner(ravel(K))
Type: List(HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
An algebra is associative if:
Y I = I Y
Y Y
Note: right figure is mirror image of left!
2 3 6 2 5 6 2 3 4
\/ / \ \/ \ | /
\/ = \/ = \|/
\ / |
4 1 1
In other words an algebra is associative if and only
if the following (3,1)-tensor
is zero.
axiom
test(Y*Y = contract(product(Y,Y),3,4))
Type: Boolean
axiom
test(Y*Y = contract(Y,3,Y,1))
Type: Boolean
axiom
test(reindex(reindex(Y,[1,3,2])*reindex(Y,[1,3,2]),[1,4,3,2]) =
reindex(contract(product(Y,Y),1,5),[3,1,2,4]))
Type: Boolean
axiom
test(reindex(reindex(Y,[1,3,2])*reindex(Y,[1,3,2]),[1,4,3,2])=reindex(contract(Y,1,Y,2),[3,1,2,4]))
Type: Boolean
axiom
AA := reindex(contract(Y,1,Y,2),[3,1,2,4])-Y*Y; ravel(AA)
Type: List(HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
axiom
AB:=groebner(ravel(AA))
Type: List(HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
axiom
#AB
The Jacobi identity requires the following tensor to be zero:
2 3 6 2 5 6 2 6 3
\ / / \ \ / \ \/
\/ / \ \/ \/\
\/ - \/ - \/
\ / \
4 1 4
axiom
BA := AA - reindex(contract(Y,1,Y,2),[3,1,4,2]); ravel(BA)
Type: List(HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
axiom
BB:=groebner(ravel(BA));
Type: List(HomogeneousDistributedMultivariatePolynomial
?([*012y111,
*012y112,
*012y121,
*012y122,
*012y211,
*012y212,
*012y221,
*012y222,
*01u1,
*01u2,
*01v1,
*01v2],
Fraction(Integer)))
axiom
#BB