X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_element.py;h=9a770ae5f68b3e19f3946ca7716f299a3ff82685;hb=9efefa3e54fc3e69e3f2c78457d50127a7a10131;hp=876777eff745fb2610dbce5f6856b6fa619a580b;hpb=21fa036e86711c6c28b6d89af2b1bfe4ceb24b29;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 876777e..9a770ae 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -4,7 +4,7 @@ from sage.modules.free_module import VectorSpace 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): """ @@ -910,7 +910,7 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): M = matrix([(self.parent().one()).to_vector()]) old_rank = 1 - # Specifying the row-reduction algorithm can e.g. help over + # Specifying the row-reduction algorithm can e.g. help over # AA because it avoids the RecursionError that gets thrown # when we have to look too hard for a root. # @@ -1128,10 +1128,10 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): 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 @@ -1450,7 +1450,11 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): """ 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