cartesian_product=False,
check_field=True,
check_axioms=True,
- prefix='e'):
+ prefix="b"):
n = len(basis)
# ambient vector space V that our (vectorized) basis lives in,
# as well as a subspace W of V spanned by those (vectorized)
# basis elements. The W-coordinates are the coefficients that
- # we see in things like x = 1*e1 + 2*e2.
+ # we see in things like x = 1*b1 + 2*b2.
vector_basis = basis
degree = 0
sage: set_random_seed()
sage: J = random_eja()
sage: n = J.dimension()
- sage: ei = J.zero()
- sage: ej = J.zero()
- sage: ei_ej = J.zero()*J.zero()
+ sage: bi = J.zero()
+ sage: bj = J.zero()
+ sage: bi_bj = J.zero()*J.zero()
sage: if n > 0:
....: i = ZZ.random_element(n)
....: j = ZZ.random_element(n)
- ....: ei = J.monomial(i)
- ....: ej = J.monomial(j)
- ....: ei_ej = J.product_on_basis(i,j)
- sage: ei*ej == ei_ej
+ ....: bi = J.monomial(i)
+ ....: bj = J.monomial(j)
+ ....: bi_bj = J.product_on_basis(i,j)
+ sage: bi*bj == bi_bj
True
"""
sage: J2 = RealSymmetricEJA(2)
sage: J = cartesian_product([J1,J2])
sage: J( (J1.matrix_basis()[1], J2.matrix_basis()[2]) )
- e1 + e5
+ b1 + b5
TESTS:
sage: J = JordanSpinEJA(4)
sage: J.multiplication_table()
+----++----+----+----+----+
- | * || e0 | e1 | e2 | e3 |
+ | * || b0 | b1 | b2 | b3 |
+====++====+====+====+====+
- | e0 || e0 | e1 | e2 | e3 |
+ | b0 || b0 | b1 | b2 | b3 |
+----++----+----+----+----+
- | e1 || e1 | e0 | 0 | 0 |
+ | b1 || b1 | b0 | 0 | 0 |
+----++----+----+----+----+
- | e2 || e2 | 0 | e0 | 0 |
+ | b2 || b2 | 0 | b0 | 0 |
+----++----+----+----+----+
- | e3 || e3 | 0 | 0 | e0 |
+ | b3 || b3 | 0 | 0 | b0 |
+----++----+----+----+----+
"""
sage: J = RealSymmetricEJA(2)
sage: J.basis()
- Finite family {0: e0, 1: e1, 2: e2}
+ Finite family {0: b0, 1: b1, 2: b2}
sage: J.matrix_basis()
(
[1 0] [ 0 0.7071067811865475?] [0 0]
sage: J = JordanSpinEJA(2)
sage: J.basis()
- Finite family {0: e0, 1: e1}
+ Finite family {0: b0, 1: b1}
sage: J.matrix_basis()
(
[1] [0]
sage: J = HadamardEJA(5)
sage: J.one()
- e0 + e1 + e2 + e3 + e4
+ b0 + b1 + b2 + b3 + b4
The unit element in the Hadamard EJA is inherited in the
subalgebras generated by its elements::
sage: J = HadamardEJA(5)
sage: J.one()
- e0 + e1 + e2 + e3 + e4
+ b0 + b1 + b2 + b3 + b4
sage: x = sum(J.gens())
sage: A = x.subalgebra_generated_by(orthonormalize=False)
sage: A.one()
- f0
+ c0
sage: A.one().superalgebra_element()
- e0 + e1 + e2 + e3 + e4
+ b0 + b1 + b2 + b3 + b4
TESTS:
EXAMPLES::
sage: J = RealSymmetricEJA(2)
- sage: e0, e1, e2 = J.gens()
- sage: e0*e0
- e0
- sage: e1*e1
- 1/2*e0 + 1/2*e2
- sage: e2*e2
- e2
+ sage: b0, b1, b2 = J.gens()
+ sage: b0*b0
+ b0
+ sage: b1*b1
+ 1/2*b0 + 1/2*b2
+ sage: b2*b2
+ b2
In theory, our "field" can be any subfield of the reals::
This multiplication table can be verified by hand::
sage: J = HadamardEJA(3)
- sage: e0,e1,e2 = J.gens()
- sage: e0*e0
- e0
- sage: e0*e1
+ sage: b0,b1,b2 = J.gens()
+ sage: b0*b0
+ b0
+ sage: b0*b1
0
- sage: e0*e2
+ sage: b0*b2
0
- sage: e1*e1
- e1
- sage: e1*e2
+ sage: b1*b1
+ b1
+ sage: b1*b2
0
- sage: e2*e2
- e2
+ sage: b2*b2
+ b2
TESTS:
This multiplication table can be verified by hand::
sage: J = JordanSpinEJA(4)
- sage: e0,e1,e2,e3 = J.gens()
- sage: e0*e0
- e0
- sage: e0*e1
- e1
- sage: e0*e2
- e2
- sage: e0*e3
- e3
- sage: e1*e2
+ sage: b0,b1,b2,b3 = J.gens()
+ sage: b0*b0
+ b0
+ sage: b0*b1
+ b1
+ sage: b0*b2
+ b2
+ sage: b0*b3
+ b3
+ sage: b1*b2
0
- sage: e1*e3
+ sage: b1*b3
0
- sage: e2*e3
+ sage: b2*b3
0
We can change the generator prefix::
sage: J = cartesian_product([J1,cartesian_product([J2,J3])])
sage: J.multiplication_table()
+----++----+----+----+
- | * || e0 | e1 | e2 |
+ | * || b0 | b1 | b2 |
+====++====+====+====+
- | e0 || e0 | 0 | 0 |
+ | b0 || b0 | 0 | 0 |
+----++----+----+----+
- | e1 || 0 | e1 | 0 |
+ | b1 || 0 | b1 | 0 |
+----++----+----+----+
- | e2 || 0 | 0 | e2 |
+ | b2 || 0 | 0 | b2 |
+----++----+----+----+
sage: HadamardEJA(3).multiplication_table()
+----++----+----+----+
- | * || e0 | e1 | e2 |
+ | * || b0 | b1 | b2 |
+====++====+====+====+
- | e0 || e0 | 0 | 0 |
+ | b0 || b0 | 0 | 0 |
+----++----+----+----+
- | e1 || 0 | e1 | 0 |
+ | b1 || 0 | b1 | 0 |
+----++----+----+----+
- | e2 || 0 | 0 | e2 |
+ | b2 || 0 | 0 | b2 |
+----++----+----+----+
TESTS:
sage: J = HadamardEJA(3)
sage: p1 = J.one().characteristic_polynomial()
sage: q1 = J.zero().characteristic_polynomial()
- sage: e0,e1,e2 = J.gens()
- sage: A = (e0 + 2*e1 + 3*e2).subalgebra_generated_by() # dim 3
+ sage: b0,b1,b2 = J.gens()
+ sage: A = (b0 + 2*b1 + 3*b2).subalgebra_generated_by() # dim 3
sage: p2 = A.one().characteristic_polynomial()
sage: q2 = A.zero().characteristic_polynomial()
sage: p1 == p2
EXAMPLES::
sage: J = JordanSpinEJA(2)
- sage: e0,e1 = J.gens()
sage: x = sum( J.gens() )
sage: x.det()
0
::
sage: J = JordanSpinEJA(3)
- sage: e0,e1,e2 = J.gens()
sage: x = sum( J.gens() )
sage: x.det()
-1
sage: J = JordanSpinEJA(5)
sage: J.one().is_regular()
False
- sage: e0, e1, e2, e3, e4 = J.gens() # e0 is the identity
+ sage: b0, b1, b2, b3, b4 = J.gens()
+ sage: b0 == J.one()
+ True
sage: for x in J.gens():
....: (J.one() + x).is_regular()
False
sage: J = JordanSpinEJA(4)
sage: J.one().degree()
1
- sage: e0,e1,e2,e3 = J.gens()
- sage: (e0 - e1).degree()
+ sage: b0,b1,b2,b3 = J.gens()
+ sage: (b0 - b1).degree()
2
In the spin factor algebra (of rank two), all elements that
sage: J = ComplexHermitianEJA(3)
sage: J.one()
- e0 + e3 + e8
+ b0 + b3 + b8
sage: J.one().to_matrix()
[1 0 0 0 0 0]
[0 1 0 0 0 0]
sage: J = QuaternionHermitianEJA(2)
sage: J.one()
- e0 + e5
+ b0 + b5
sage: J.one().to_matrix()
[1 0 0 0 0 0 0 0]
[0 1 0 0 0 0 0 0]
sage: J = RealSymmetricEJA(3)
sage: J.one()
- e0 + e2 + e5
+ b0 + b2 + b5
sage: J.one().spectral_decomposition()
- [(1, e0 + e2 + e5)]
+ [(1, b0 + b2 + b5)]
sage: J.zero().spectral_decomposition()
- [(0, e0 + e2 + e5)]
+ [(0, b0 + b2 + b5)]
TESTS::
The spectral decomposition should work in subalgebras, too::
sage: J = RealSymmetricEJA(4)
- sage: (e0, e1, e2, e3, e4, e5, e6, e7, e8, e9) = J.gens()
- sage: A = 2*e5 - 2*e8
+ sage: (b0, b1, b2, b3, b4, b5, b6, b7, b8, b9) = J.gens()
+ sage: A = 2*b5 - 2*b8
sage: (lambda1, c1) = A.spectral_decomposition()[1]
sage: (J0, J5, J1) = J.peirce_decomposition(c1)
sage: (f0, f1, f2) = J1.gens()
sage: f0.spectral_decomposition()
- [(0, f2), (1, f0)]
+ [(0, c2), (1, c0)]
"""
A = self.subalgebra_generated_by(orthonormalize=True)
We can scale an operator on a rational algebra by a rational number::
sage: J = RealSymmetricEJA(2)
- sage: e0,e1,e2 = J.gens()
- sage: x = 2*e0 + 4*e1 + 16*e2
+ sage: b0,b1,b2 = J.gens()
+ sage: x = 2*b0 + 4*b1 + 16*b2
sage: x.operator()
Linear operator between finite-dimensional Euclidean Jordan algebras
represented by the matrix:
sage: J = RealSymmetricEJA(3)
sage: x = sum(J.gens())
sage: x
- e0 + e1 + e2 + e3 + e4 + e5
+ b0 + b1 + b2 + b3 + b4 + b5
sage: A = x.subalgebra_generated_by(orthonormalize=False)
sage: A(x)
- f1
+ c1
sage: A(x).superalgebra_element()
- e0 + e1 + e2 + e3 + e4 + e5
+ b0 + b1 + b2 + b3 + b4 + b5
sage: y = sum(A.gens())
sage: y
- f0 + f1
+ c0 + c1
sage: B = y.subalgebra_generated_by(orthonormalize=False)
sage: B(y)
- g1
+ d1
sage: B(y).superalgebra_element()
- f0 + f1
+ c0 + c1
TESTS:
TESTS:
- Ensure that our generator names don't conflict with the superalgebra::
+ Ensure that our generator names don't conflict with the
+ superalgebra::
sage: J = JordanSpinEJA(3)
sage: J.one().subalgebra_generated_by().gens()
- (f0,)
+ (c0,)
sage: J = JordanSpinEJA(3, prefix='f')
sage: J.one().subalgebra_generated_by().gens()
(g0,)
- sage: J = JordanSpinEJA(3, prefix='b')
+ sage: J = JordanSpinEJA(3, prefix='a')
sage: J.one().subalgebra_generated_by().gens()
- (c0,)
+ (b0,)
Ensure that we can find subalgebras of subalgebras::
sage: B = A.one().subalgebra_generated_by()
sage: B.dimension()
1
-
"""
def __init__(self, superalgebra, basis, **kwargs):
self._superalgebra = superalgebra
# try to "increment" the parent algebra's prefix, although
# this idea goes out the window fast because some prefixen
# are off-limits.
- prefixen = [ 'f', 'g', 'h', 'a', 'b', 'c', 'd' ]
+ prefixen = ["b","c","d","e","f","g","h","l","m"]
try:
prefix = prefixen[prefixen.index(self._superalgebra.prefix()) + 1]
except ValueError:
....: associative=True,
....: orthonormalize=False)
sage: K(J.one())
- f1
+ c1
sage: K(J.one() + x)
- f0 + f1
+ c0 + c1
::