from mjo.eja.eja_operator import FiniteDimensionalEJAOperator
from mjo.eja.eja_utils import _all2list, _mat2vec
+def EuclideanJordanAlgebras(field):
+ r"""
+ The category of Euclidean Jordan algebras over ``field``, which
+ must be a subfield of the real numbers. For now this is just a
+ convenient wrapper around all of the other category axioms that
+ apply to all EJAs.
+ """
+ category = MagmaticAlgebras(field).FiniteDimensional()
+ category = category.WithBasis().Unital().Commutative()
+ return category
+
class FiniteDimensionalEJA(CombinatorialFreeModule):
r"""
A finite-dimensional Euclidean Jordan algebra.
"""
Element = FiniteDimensionalEJAElement
+ @staticmethod
+ def _check_input_field(field):
+ if not field.is_subring(RR):
+ # Note: this does return true for the real algebraic
+ # field, the rationals, and any quadratic field where
+ # we've specified a real embedding.
+ raise ValueError("scalar field is not real")
+
+ @staticmethod
+ def _check_input_axioms(basis, jordan_product, inner_product):
+ if not all( jordan_product(bi,bj) == jordan_product(bj,bi)
+ for bi in basis
+ for bj in basis ):
+ raise ValueError("Jordan product is not commutative")
+
+ if not all( inner_product(bi,bj) == inner_product(bj,bi)
+ for bi in basis
+ for bj in basis ):
+ raise ValueError("inner-product is not commutative")
+
def __init__(self,
basis,
jordan_product,
n = len(basis)
if check_field:
- if not field.is_subring(RR):
- # Note: this does return true for the real algebraic
- # field, the rationals, and any quadratic field where
- # we've specified a real embedding.
- raise ValueError("scalar field is not real")
+ self._check_input_field(field)
if check_axioms:
# Check commutativity of the Jordan and inner-products.
# This has to be done before we build the multiplication
# and inner-product tables/matrices, because we take
# advantage of symmetry in the process.
- if not all( jordan_product(bi,bj) == jordan_product(bj,bi)
- for bi in basis
- for bj in basis ):
- raise ValueError("Jordan product is not commutative")
-
- if not all( inner_product(bi,bj) == inner_product(bj,bi)
- for bi in basis
- for bj in basis ):
- raise ValueError("inner-product is not commutative")
-
-
- category = MagmaticAlgebras(field).FiniteDimensional()
- category = category.WithBasis().Unital().Commutative()
+ self._check_input_axioms(basis, jordan_product, inner_product)
if n <= 1:
# All zero- and one-dimensional algebras are just the real
for bj in basis
for bk in basis)
+ category = EuclideanJordanAlgebras(field)
+
if associative:
# Element subalgebras can take advantage of this.
category = category.Associative()