for idx in range(count) )
+ def operator_polynomial_matrix(self):
+ r"""
+ Return the matrix of polynomials (over this algebra's
+ :meth:`coordinate_polynomial_ring`) that, when evaluated at
+ the basis coordinates of an element `x`, produces the basis
+ representation of `L_{x}`.
+
+ SETUP::
+
+ sage: from mjo.eja.eja_algebra import (HadamardEJA,
+ ....: JordanSpinEJA)
+
+ EXAMPLES::
+
+ sage: J = HadamardEJA(4)
+ sage: L_x = J.operator_polynomial_matrix()
+ sage: L_x
+ [X0 0 0 0]
+ [ 0 X1 0 0]
+ [ 0 0 X2 0]
+ [ 0 0 0 X3]
+ sage: x = J.one()
+ sage: d = zip(J.coordinate_polynomial_ring().gens(), x.to_vector())
+ sage: L_x.subs(dict(d))
+ [1 0 0 0]
+ [0 1 0 0]
+ [0 0 1 0]
+ [0 0 0 1]
+
+ ::
+
+ sage: J = JordanSpinEJA(4)
+ sage: L_x = J.operator_polynomial_matrix()
+ sage: L_x
+ [X0 X1 X2 X3]
+ [X1 X0 0 0]
+ [X2 0 X0 0]
+ [X3 0 0 X0]
+ sage: x = J.one()
+ sage: d = zip(J.coordinate_polynomial_ring().gens(), x.to_vector())
+ sage: L_x.subs(dict(d))
+ [1 0 0 0]
+ [0 1 0 0]
+ [0 0 1 0]
+ [0 0 0 1]
+
+ """
+ R = self.coordinate_polynomial_ring()
+
+ def L_x_i_j(i,j):
+ # From a result in my book, these are the entries of the
+ # basis representation of L_x.
+ return sum( v*self.monomial(k).operator().matrix()[i,j]
+ for (k,v) in enumerate(R.gens()) )
+
+ n = self.dimension()
+ return matrix(R, n, n, L_x_i_j)
+
@cached_method
def _charpoly_coefficients(self):
r"""
"""
n = self.dimension()
R = self.coordinate_polynomial_ring()
- vars = R.gens()
F = R.fraction_field()
- def L_x_i_j(i,j):
- # From a result in my book, these are the entries of the
- # basis representation of L_x.
- return sum( vars[k]*self.monomial(k).operator().matrix()[i,j]
- for k in range(n) )
-
- L_x = matrix(F, n, n, L_x_i_j)
+ L_x = self.operator_polynomial_matrix()
r = None
if self.rank.is_in_cache():