From d6c744ecba0a22fdd76cb17e663594d323d1bb38 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sun, 7 Mar 2021 01:28:45 -0500 Subject: [PATCH] eja: make OctonionHermitianEJAs RationalBasisEJAs. --- mjo/eja/TODO | 8 +++++--- mjo/eja/eja_algebra.py | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/mjo/eja/TODO b/mjo/eja/TODO index cd516fc..1742285 100644 --- a/mjo/eja/TODO +++ b/mjo/eja/TODO @@ -24,9 +24,11 @@ sage: a0 = (1/4)*X[4]**2*X[6]**2 - (1/2)*X[2]*X[5]*X[6]**2 - (1/2)*X[3]*X[4]*X[6 sage: e0*[[[[]]]] [[[[]]]]*e0 -6. Figure out how to make OctonionHermitianEJA a RationalBasisEJA, - and then convert the complex/quaternion algebras to avoid real- - (un)embeddings. +6. Can we convert the complex/quaternion algebras to avoid real- + (un)embeddings? Quaternions would need their own + QuaternionMatrixAlgebra, since Sage matrices have to have entries + in a commutative ring. Those and the octonion stuff could be moved + to hurwitz.py along with the HurwitzMatrixAlgebra. 7. Every once in a long while, the test diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index ca3df5f..6b5b090 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1575,7 +1575,11 @@ class RationalBasisEJA(FiniteDimensionalEJA): if check_field: # Abuse the check_field parameter to check that the entries of # out basis (in ambient coordinates) are in the field QQ. - if not all( all(b_i in QQ for b_i in b.list()) for b in basis ): + # Use _all2list to get the vector coordinates of octonion + # entries and not the octonions themselves (which are not + # rational). + if not all( all(b_i in QQ for b_i in _all2list(b)) + for b in basis ): raise TypeError("basis not rational") super().__init__(basis, @@ -1832,7 +1836,7 @@ class RealEmbeddedMatrixEJA(MatrixEJA): # as a REAL matrix will be 2*a = 2*Re(z_1). And so forth. return (X*Y).trace()/cls.dimension_over_reals() -class RealSymmetricEJA(ConcreteEJA, RationalBasisEJA, MatrixEJA): +class RealSymmetricEJA(RationalBasisEJA, ConcreteEJA, MatrixEJA): """ The rank-n simple EJA consisting of real symmetric n-by-n matrices, the usual symmetric Jordan product, and the trace inner @@ -2114,7 +2118,7 @@ class ComplexMatrixEJA(RealEmbeddedMatrixEJA): return matrix(F, n/d, elements) -class ComplexHermitianEJA(ConcreteEJA, RationalBasisEJA, ComplexMatrixEJA): +class ComplexHermitianEJA(RationalBasisEJA, ConcreteEJA, ComplexMatrixEJA): """ The rank-n simple EJA consisting of complex Hermitian n-by-n matrices over the real numbers, the usual symmetric Jordan product, @@ -2416,8 +2420,8 @@ class QuaternionMatrixEJA(RealEmbeddedMatrixEJA): return matrix(Q, n/d, elements) -class QuaternionHermitianEJA(ConcreteEJA, - RationalBasisEJA, +class QuaternionHermitianEJA(RationalBasisEJA, + ConcreteEJA, QuaternionMatrixEJA): r""" The rank-n simple EJA consisting of self-adjoint n-by-n quaternion @@ -2586,7 +2590,7 @@ class QuaternionHermitianEJA(ConcreteEJA, n = ZZ.random_element(cls._max_random_instance_size() + 1) return cls(n, **kwargs) -class OctonionHermitianEJA(ConcreteEJA, MatrixEJA): +class OctonionHermitianEJA(RationalBasisEJA, ConcreteEJA, MatrixEJA): r""" SETUP:: @@ -2780,7 +2784,7 @@ class AlbertEJA(OctonionHermitianEJA): SETUP:: - from mjo.eja.eja_algebra import AlbertEJA + sage: from mjo.eja.eja_algebra import AlbertEJA EXAMPLES:: @@ -2794,7 +2798,7 @@ class AlbertEJA(OctonionHermitianEJA): super().__init__(3, *args, **kwargs) -class HadamardEJA(ConcreteEJA, RationalBasisEJA): +class HadamardEJA(RationalBasisEJA, ConcreteEJA): """ Return the Euclidean Jordan Algebra corresponding to the set `R^n` under the Hadamard product. @@ -2886,7 +2890,7 @@ class HadamardEJA(ConcreteEJA, RationalBasisEJA): return cls(n, **kwargs) -class BilinearFormEJA(ConcreteEJA, RationalBasisEJA): +class BilinearFormEJA(RationalBasisEJA, ConcreteEJA): r""" The rank-2 simple EJA consisting of real vectors ``x=(x0, x_bar)`` with the half-trace inner product and jordan product ``x*y = @@ -3134,7 +3138,7 @@ class JordanSpinEJA(BilinearFormEJA): return cls(n, **kwargs) -class TrivialEJA(ConcreteEJA, RationalBasisEJA): +class TrivialEJA(RationalBasisEJA, ConcreteEJA): """ The trivial Euclidean Jordan algebra consisting of only a zero element. -- 2.44.2