- # Hack around the fact that our multiplication table is in terms of
- # algebra elements but the constructor wants it in terms of vectors.
- vmt = [ tuple(map(lambda x: x.to_vector(), ls))
- for ls in self._multiplication_table ]
- J = FiniteDimensionalEuclideanJordanAlgebra(R, tuple(vmt), r)
-
- idmat = matrix.identity(J.base_ring(), n)
+ V = self.vector_space().change_ring(R)
+
+ # Now let x = (X1,X2,...,Xn) be the vector whose entries are
+ # indeterminates...
+ x = V(names)
+
+ # And figure out the "left multiplication by x" matrix in
+ # that setting.
+ lmbx_cols = []
+ monomial_matrices = [ self.monomial(i).operator().matrix()
+ for i in range(n) ] # don't recompute these!
+ for k in range(n):
+ ek = self.monomial(k).to_vector()
+ lmbx_cols.append(
+ sum( x[i]*(monomial_matrices[i]*ek)
+ for i in range(n) ) )
+ Lx = matrix.column(R, lmbx_cols)
+
+ # Now we can compute powers of x "symbolically"
+ x_powers = [self.one().to_vector(), x]
+ for d in range(2, r+1):
+ x_powers.append( Lx*(x_powers[-1]) )
+
+ idmat = matrix.identity(R, n)