"""
tr = (X*Y).trace()
- if hasattr(tr, 'coefficient'):
- # Works for octonions, and has to come first because they
- # also have a "real()" method that doesn't return an
- # element of the scalar ring.
- return tr.coefficient(0)
+ if hasattr(tr, 'real_part'):
+ # Works for octonions.
+ return tr.real_part()
elif hasattr(tr, 'coefficient_tuple'):
# Works for quaternions.
return tr.coefficient_tuple()[0]
sage: from mjo.eja.eja_algebra import (EJA,
....: OctonionHermitianEJA)
- sage: from mjo.hurwitz import Octonions, OctonionMatrixAlgebra
+ sage: from mjo.hurwitz import OctonionMatrixAlgebra
EXAMPLES:
After a change-of-basis, the 2-by-2 algebra has the same
multiplication table as the ten-dimensional Jordan spin algebra::
- sage: A = OctonionMatrixAlgebra(2,Octonions(QQ),QQ)
+ sage: A = OctonionMatrixAlgebra(2, OctonionAlgebra(QQ), QQ)
sage: b = OctonionHermitianEJA._denormalized_basis(A)
sage: basis = (b[0] + b[9],) + b[1:9] + (b[0] - b[9],)
sage: jp = OctonionHermitianEJA.jordan_product
sage: ip = OctonionHermitianEJA.trace_inner_product
- sage: J = EJA(basis,
- ....: jp,
- ....: ip,
- ....: field=QQ,
- ....: orthonormalize=False)
+ sage: J = EJA(basis, jp, ip, field=QQ, orthonormalize=False)
sage: J.multiplication_table()
┌────╥────┬────┬────┬────┬────┬────┬────┬────┬────┬────┐
│ * ║ b0 │ b1 │ b2 │ b3 │ b4 │ b5 │ b6 │ b7 │ b8 │ b9 │
sage: J.one()
b0 + b9 + b26
sage: J.one().to_matrix()
- â\94\8câ\94\80â\94\80â\94\80â\94\80â\94¬â\94\80â\94\80â\94\80â\94\80â\94¬â\94\80───┐
- │ e0 │ 0 │ 0 │
- â\94\9câ\94\80â\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80───┤
- │ 0 │ e0 │ 0 │
- â\94\9câ\94\80â\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94\80â\94¼â\94\80───┤
- │ 0 │ 0 │ e0 │
- â\94\94â\94\80â\94\80â\94\80â\94\80â\94´â\94\80â\94\80â\94\80â\94\80â\94´â\94\80───┘
+ â\94\8câ\94\80â\94\80â\94\80â\94¬â\94\80â\94\80â\94\80â\94¬───┐
+ │ 1 │ 0 │ 0 │
+ â\94\9câ\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94¼───┤
+ │ 0 │ 1 │ 0 │
+ â\94\9câ\94\80â\94\80â\94\80â\94¼â\94\80â\94\80â\94\80â\94¼───┤
+ │ 0 │ 0 │ 1 │
+ â\94\94â\94\80â\94\80â\94\80â\94´â\94\80â\94\80â\94\80â\94´───┘
The 2-by-2 algebra is isomorphic to the ten-dimensional Jordan
spin algebra, but just to be sure, we recompute its rank::
True
There's a formula for the determinant of the Albert algebra
- (Yokota, Section 2.1)::
+ (Yokota, Exceptional Lie Groups, Section 2.1) and ours agrees
+ with it. Note that Sage's octonion multiplication table is
+ transposed from the usual one (i.e. Yokota's), so we have
+ reversed the order of the terms in each octonion product
+ below::
sage: def albert_det(x):
....: X = x.to_matrix()
- ....: res = X[0,0]*X[1,1]*X[2,2]
- ....: res += 2*(X[1,2]*X[2,0]*X[0,1]).real()
- ....: res -= X[0,0]*X[1,2]*X[2,1]
- ....: res -= X[1,1]*X[2,0]*X[0,2]
- ....: res -= X[2,2]*X[0,1]*X[1,0]
- ....: return res.leading_coefficient()
+ ....: res = X[2,2]*X[1,1]*X[0,0]
+ ....: res += 2*(X[0,1]*X[2,0]*X[1,2]).real_part()
+ ....: res -= X[2,1]*X[1,2]*X[0,0]
+ ....: res -= X[0,2]*X[2,0]*X[1,1]
+ ....: res -= X[1,0]*X[0,1]*X[2,2]
+ ....: return res
sage: J = AlbertEJA(field=QQ, orthonormalize=False)
sage: xs = J.random_elements(10)
sage: all( albert_det(x) == x.det() for x in xs )