From: Michael Orlitzky Date: Sun, 8 Nov 2020 22:54:16 +0000 (-0500) Subject: eja: add DirectSumEJA constructor (and not much else). X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=debb0160c47109a5f2060bffd2c618f2a3a19551;p=sage.d.git eja: add DirectSumEJA constructor (and not much else). --- diff --git a/mjo/eja/all.py b/mjo/eja/all.py index a3b524b..c7d02a2 100644 --- a/mjo/eja/all.py +++ b/mjo/eja/all.py @@ -4,6 +4,7 @@ All imports from mjo.eja modules. from mjo.eja.eja_algebra import (BilinearFormEJA, ComplexHermitianEJA, + DirectSumEJA, HadamardEJA, JordanSpinEJA, QuaternionHermitianEJA, diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 7ae61d5..f327bf5 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -2134,3 +2134,50 @@ class TrivialEJA(FiniteDimensionalEuclideanJordanAlgebra): # largest subalgebra generated by any element. fdeja.__init__(field, mult_table, **kwargs) self.rank.set_cache(0) + + +class DirectSumEJA(FiniteDimensionalEuclideanJordanAlgebra): + r""" + The external (orthogonal) direct sum of two other Euclidean Jordan + algebras. Essentially the Cartesian product of its two factors. + Every Euclidean Jordan algebra decomposes into an orthogonal + direct sum of simple Euclidean Jordan algebras, so no generality + is lost by providing only this construction. + + SETUP:: + + sage: from mjo.eja.eja_algebra import (HadamardEJA, + ....: RealSymmetricEJA, + ....: DirectSumEJA) + + EXAMPLES:: + + sage: J1 = HadamardEJA(2) + sage: J2 = RealSymmetricEJA(3) + sage: J = DirectSumEJA(J1,J2) + sage: J.dimension() + 8 + sage: J.rank() + 5 + + """ + def __init__(self, J1, J2, field=AA, **kwargs): + n1 = J1.dimension() + n2 = J2.dimension() + n = n1+n2 + V = VectorSpace(field, n) + mult_table = [ [ V.zero() for j in range(n) ] + for i in range(n) ] + for i in range(n1): + for j in range(n1): + p = (J1.monomial(i)*J1.monomial(j)).to_vector() + mult_table[i][j] = V(p.list() + [field.zero()]*n2) + + for i in range(n2): + for j in range(n2): + p = (J2.monomial(i)*J2.monomial(j)).to_vector() + mult_table[n1+i][n1+j] = V([field.zero()]*n1 + p.list()) + + fdeja = super(DirectSumEJA, self) + fdeja.__init__(field, mult_table, **kwargs) + self.rank.set_cache(J1.rank() + J2.rank())