from sage.categories.map import Map
class FiniteDimensionalEuclideanJordanAlgebraOperator(Map):
+ r"""
+ An operator between two finite-dimensional Euclidean Jordan algebras.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import HadamardEJA
+ sage: from mjo.eja.eja_operator import FiniteDimensionalEuclideanJordanAlgebraOperator
+
+ EXAMPLES:
+
+ The domain and codomain must be finite-dimensional Euclidean
+ Jordan algebras; if either is not, then an error is raised::
+
+ sage: J = HadamardEJA(3)
+ sage: V = VectorSpace(J.base_ring(), 3)
+ sage: M = matrix.identity(J.base_ring(), 3)
+ sage: FiniteDimensionalEuclideanJordanAlgebraOperator(V,J,M)
+ Traceback (most recent call last):
+ ...
+ TypeError: domain must be a finite-dimensional Euclidean
+ Jordan algebra
+ sage: FiniteDimensionalEuclideanJordanAlgebraOperator(J,V,M)
+ Traceback (most recent call last):
+ ...
+ TypeError: codomain must be a finite-dimensional Euclidean
+ Jordan algebra
+
+ """
+
def __init__(self, domain_eja, codomain_eja, mat):
- # if not (
- # isinstance(domain_eja, FiniteDimensionalEuclideanJordanAlgebra) and
- # isinstance(codomain_eja, FiniteDimensionalEuclideanJordanAlgebra) ):
- # raise ValueError('(co)domains must be finite-dimensional Euclidean '
- # 'Jordan algebras')
+ from mjo.eja.eja_algebra import FiniteDimensionalEuclideanJordanAlgebra
+
+ # I guess we should check this, because otherwise you could
+ # pass in pretty much anything algebraish.
+ if not isinstance(domain_eja,
+ FiniteDimensionalEuclideanJordanAlgebra):
+ raise TypeError('domain must be a finite-dimensional '
+ 'Euclidean Jordan algebra')
+ if not isinstance(codomain_eja,
+ FiniteDimensionalEuclideanJordanAlgebra):
+ raise TypeError('codomain must be a finite-dimensional '
+ 'Euclidean Jordan algebra')
F = domain_eja.base_ring()
if not (F == codomain_eja.base_ring()):