]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: switch HadamardEJA to the new constructor.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 27 Nov 2020 14:18:02 +0000 (09:18 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 27 Nov 2020 14:18:02 +0000 (09:18 -0500)
mjo/eja/eja_algebra.py

index 05b9a5a4191bffa74f3680df50d0327cf12b1d1e..4609ca2a4df7a4ff762e3eef00435a70b85e8cbb 100644 (file)
@@ -2115,7 +2115,7 @@ class QuaternionHermitianEJA(QuaternionMatrixEuclideanJordanAlgebra,
         return cls(n, field, **kwargs)
 
 
-class HadamardEJA(RationalBasisEuclideanJordanAlgebra,
+class HadamardEJA(RationalBasisEuclideanJordanAlgebraNg,
                   ConcreteEuclideanJordanAlgebra):
     """
     Return the Euclidean Jordan Algebra corresponding to the set
@@ -2158,22 +2158,17 @@ class HadamardEJA(RationalBasisEuclideanJordanAlgebra,
     """
     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)