from mjo.eja.eja_element import FiniteDimensionalEuclideanJordanAlgebraElement
lazy_import('mjo.eja.eja_subalgebra',
'FiniteDimensionalEuclideanJordanSubalgebra')
+from mjo.eja.eja_operator import FiniteDimensionalEuclideanJordanAlgebraOperator
from mjo.eja.eja_utils import _mat2vec
class FiniteDimensionalEuclideanJordanAlgebra(CombinatorialFreeModule):
SETUP::
- sage: from mjo.eja.eja_algebra import (HadamardEJA,
+ sage: from mjo.eja.eja_algebra import (random_eja,
+ ....: HadamardEJA,
....: RealSymmetricEJA,
....: DirectSumEJA)
sage: J.rank()
5
+ TESTS:
+
+ The external direct sum construction is only valid when the two factors
+ have the same base ring; an error is raised otherwise::
+
+ sage: set_random_seed()
+ sage: J1 = random_eja(AA)
+ sage: J2 = random_eja(QQ)
+ sage: J = DirectSumEJA(J1,J2)
+ Traceback (most recent call last):
+ ...
+ ValueError: algebras must share the same base field
+
"""
- def __init__(self, J1, J2, field=AA, **kwargs):
+ def __init__(self, J1, J2, **kwargs):
+ if J1.base_ring() != J2.base_ring():
+ raise ValueError("algebras must share the same base field")
+ field = J1.base_ring()
+
self._factors = (J1, J2)
n1 = J1.dimension()
n2 = J2.dimension()
"""
(J1,J2) = self.factors()
n = J1.dimension()
- pi_left = lambda x: J1.from_vector(x.to_vector()[:n])
- pi_right = lambda x: J2.from_vector(x.to_vector()[n:])
+ V_basis = self.vector_space().basis()
+ P1 = matrix(self.base_ring(), V_basis[:n])
+ P2 = matrix(self.base_ring(), V_basis[n:])
+ pi_left = FiniteDimensionalEuclideanJordanAlgebraOperator(self,J1,P1)
+ pi_right = FiniteDimensionalEuclideanJordanAlgebraOperator(self,J2,P2)
return (pi_left, pi_right)
def inclusions(self):
SETUP::
- sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+ sage: from mjo.eja.eja_algebra import (random_eja,
+ ....: JordanSpinEJA,
....: RealSymmetricEJA,
....: DirectSumEJA)
sage: J.one().to_vector()
(1, 0, 0, 1, 0, 1)
+ TESTS:
+
+ Composing a projection with the corresponding inclusion should
+ produce the identity map, and mismatching them should produce
+ the zero map::
+
+ sage: set_random_seed()
+ sage: J1 = random_eja()
+ sage: J2 = random_eja()
+ sage: J = DirectSumEJA(J1,J2)
+ sage: (iota_left, iota_right) = J.inclusions()
+ sage: (pi_left, pi_right) = J.projections()
+ sage: pi_left*iota_left == J1.one().operator()
+ True
+ sage: pi_right*iota_right == J2.one().operator()
+ True
+ sage: (pi_left*iota_right).is_zero()
+ True
+ sage: (pi_right*iota_left).is_zero()
+ True
+
"""
(J1,J2) = self.factors()
n = J1.dimension()
V_basis = self.vector_space().basis()
I1 = matrix.column(self.base_ring(), V_basis[:n])
I2 = matrix.column(self.base_ring(), V_basis[n:])
- iota_left = lambda x: self.from_vector(I1*x.to_vector())
- iota_right = lambda x: self.from_vector(I2*+x.to_vector())
+ iota_left = FiniteDimensionalEuclideanJordanAlgebraOperator(J1,self,I1)
+ iota_right = FiniteDimensionalEuclideanJordanAlgebraOperator(J2,self,I2)
return (iota_left, iota_right)
def inner_product(self, x, y):
EXAMPLE::
- sage: J1 = HadamardEJA(3)
+ sage: J1 = HadamardEJA(3,QQ)
sage: J2 = QuaternionHermitianEJA(2,QQ,normalize_basis=False)
sage: J = DirectSumEJA(J1,J2)
sage: x1 = J1.one()