return cls(n, field, **kwargs)
-class HadamardEJA(RationalBasisEuclideanJordanAlgebra,
+class HadamardEJA(RationalBasisEuclideanJordanAlgebraNg,
ConcreteEuclideanJordanAlgebra):
"""
Return the Euclidean Jordan Algebra corresponding to the set
"""
def __init__(self, n, field=AA, **kwargs):
V = VectorSpace(field, n)
- mult_table = [ [ V.gen(i)*(i == j) for j in range(n) ]
- for i in range(n) ]
+ basis = V.basis()
- # Inner products are real numbers and not algebra
- # elements, so once we turn the algebra element
- # into a vector in inner_product(), we never go
- # back. As a result -- contrary to what we do with
- # self._multiplication_table -- we store the inner
- # product table as a plain old matrix and not as
- # an algebra operator.
- ip_table = matrix.identity(field,n)
- self._inner_product_matrix = ip_table
+ def jordan_product(x,y):
+ return V([ xi*yi for (xi,yi) in zip(x,y) ])
+ def inner_product(x,y):
+ return x.inner_product(y)
super(HadamardEJA, self).__init__(field,
- mult_table,
- check_axioms=False,
+ basis,
+ jordan_product,
+ inner_product,
**kwargs)
self.rank.set_cache(n)