from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement
from mjo.eja.eja_operator import FiniteDimensionalEJAOperator
-from mjo.eja.eja_utils import _mat2vec
+from mjo.eja.eja_utils import _mat2vec, _scale
class FiniteDimensionalEJAElement(IndexedFreeModuleElement):
"""
element should always be in terms of minimal idempotents::
sage: J = JordanSpinEJA(4)
- sage: x = sum( i*J.gens()[i] for i in range(len(J.gens())) )
+ sage: x = sum( i*J.monomial(i) for i in range(len(J.gens())) )
sage: x.is_regular()
True
sage: [ c.is_primitive_idempotent()
if self.parent()._matrix_basis_is_cartesian:
# Aaaaand linear combinations don't work in Cartesian
# product spaces, even though they provide a method
- # with that name.
+ # with that name. This is special-cased because the
+ # _scale() function is slow.
pairs = zip(B, self.to_vector())
- return sum( ( W(tuple(alpha*b_i for b_i in b))
- for (b,alpha) in pairs ),
+ return sum( ( _scale(b, alpha) for (b,alpha) in pairs ),
W.zero())
else:
# This is just a manual "from_vector()", but of course
"""
powers = tuple( self**k for k in range(self.degree()) )
- A = self.parent().subalgebra(powers, associative=True, **kwargs)
+ A = self.parent().subalgebra(powers,
+ associative=True,
+ check_field=False,
+ check_axioms=False,
+ **kwargs)
A.one.set_cache(A(self.parent().one()))
return A