From: Michael Orlitzky Date: Fri, 27 Nov 2020 14:18:02 +0000 (-0500) Subject: eja: switch HadamardEJA to the new constructor. X-Git-Url: http://gitweb.michael.orlitzky.com/?p=sage.d.git;a=commitdiff_plain;h=e1dfaabb339864bb4bb4034ab90903e17b15f6c8 eja: switch HadamardEJA to the new constructor. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 05b9a5a..4609ca2 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -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)