from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement
from mjo.eja.eja_operator import FiniteDimensionalEJAOperator
from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement
from mjo.eja.eja_operator import FiniteDimensionalEJAOperator
# AA because it avoids the RecursionError that gets thrown
# when we have to look too hard for a root.
#
# AA because it avoids the RecursionError that gets thrown
# when we have to look too hard for a root.
#
if self.parent()._matrix_basis_is_cartesian:
# Aaaaand linear combinations don't work in Cartesian
# product spaces, even though they provide a method
if self.parent()._matrix_basis_is_cartesian:
# Aaaaand linear combinations don't work in Cartesian
# product spaces, even though they provide a method
- 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 ),