X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_element.py;h=81c2b54fca757f0696468b5c450a6dda674a0f7a;hb=78bee5c30c1cd2828d9834fc7d652db21331d4fe;hp=9a770ae5f68b3e19f3946ca7716f299a3ff82685;hpb=9efefa3e54fc3e69e3f2c78457d50127a7a10131;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 9a770ae..81c2b54 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -664,7 +664,7 @@ 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() @@ -1125,14 +1125,13 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): B = self.parent().matrix_basis() W = self.parent().matrix_space() - if self.parent()._matrix_basis_is_cartesian: + if hasattr(W, 'cartesian_factors'): # Aaaaand linear combinations don't work in Cartesian - # product spaces, even though they provide a method - # with that name. This is special-cased because the + # product spaces, even though they provide a method with + # that name. This is hidden behind an "if" because the # _scale() function is slow. pairs = zip(B, self.to_vector()) - return sum( ( _scale(b, alpha) for (b,alpha) in pairs ), - W.zero()) + return W.sum( _scale(b, alpha) for (b,alpha) in pairs ) else: # This is just a manual "from_vector()", but of course # matrix spaces aren't vector spaces in sage, so they