X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=mjo%2Feja%2Feja_element.py;h=0983ea0607a438464b3e9ab6245a344ba59a5aef;hb=07d8d3f5ce02c2d2693244d541561f264b5037c7;hp=6997766319798e5188683972c303ce450f0303e3;hpb=3595f45fb1dd7e218c81e2ccb0b9f3473f7de681;p=sage.d.git diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 6997766..0983ea0 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -375,7 +375,8 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): Ensure that the determinant is multiplicative on an associative subalgebra as in Faraut and Korányi's Proposition II.2.2:: - sage: J = random_eja().random_element().subalgebra_generated_by() + sage: x0 = random_eja().random_element() + sage: J = x0.subalgebra_generated_by(orthonormalize=False) sage: x,y = J.random_elements(2) sage: (x*y).det() == x.det()*y.det() True @@ -506,15 +507,18 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): True """ not_invertible_msg = "element is not invertible" - if self.parent()._charpoly_coefficients.is_in_cache(): + + algebra = self.parent() + if algebra._charpoly_coefficients.is_in_cache(): # We can invert using our charpoly if it will be fast to # compute. If the coefficients are cached, our rank had # better be too! if self.det().is_zero(): raise ZeroDivisionError(not_invertible_msg) - r = self.parent().rank() + r = algebra.rank() a = self.characteristic_polynomial().coefficients(sparse=False) - return (-1)**(r+1)*sum(a[i+1]*self**i for i in range(r))/self.det() + return (-1)**(r+1)*algebra.sum(a[i+1]*self**i + for i in range(r))/self.det() try: inv = (~self.quadratic_representation())(self) @@ -1373,7 +1377,7 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): This subalgebra, being composed of only powers, is associative:: sage: x0 = random_eja().random_element() - sage: A = x0.subalgebra_generated_by() + sage: A = x0.subalgebra_generated_by(orthonormalize=False) sage: x,y,z = A.random_elements(3) sage: (x*y)*z == x*(y*z) True @@ -1382,7 +1386,7 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): the superalgebra:: sage: x = random_eja().random_element() - sage: A = x.subalgebra_generated_by() + sage: A = x.subalgebra_generated_by(orthonormalize=False) sage: A(x^2) == A(x)*A(x) True @@ -1421,7 +1425,7 @@ class FiniteDimensionalEJAElement(IndexedFreeModuleElement): where there are non-nilpotent elements, or that we get the dumb solution in the trivial algebra:: - sage: J = random_eja() + sage: J = random_eja(field=QQ, orthonormalize=False) sage: x = J.random_element() sage: while x.is_nilpotent() and not J.is_trivial(): ....: x = J.random_element()