From: Michael Orlitzky Date: Fri, 2 Aug 2019 23:36:15 +0000 (-0400) Subject: eja: fix some more super/subalgebra back and forth. X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=ac35ac8e17f42d310d32a59859cc5ee5eeff5efa;p=sage.d.git eja: fix some more super/subalgebra back and forth. This fixes all of the outright crashes in the test suite, but the multiplication table in the subalgebra is still broken (it isn't associative). --- diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index 5b91424..e38012e 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -410,7 +410,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: coeff = ~(x0^2 - x_bar.inner_product(x_bar)) sage: inv_vec = x_vec.parent()([x0] + (-x_bar).list()) sage: x_inverse = coeff*inv_vec - sage: x.inverse() == J(x_inverse) + sage: x.inverse() == J.from_vector(x_inverse) True TESTS: @@ -722,7 +722,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): """ A = self.subalgebra_generated_by() - return A.element_class(A,self).operator().minimal_polynomial() + return A(self).operator().minimal_polynomial() @@ -938,11 +938,17 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: from mjo.eja.eja_algebra import random_eja - TESTS:: + TESTS: + + This subalgebra, being composed of only powers, is associative:: sage: set_random_seed() - sage: x = random_eja().random_element() - sage: x.subalgebra_generated_by().is_associative() + sage: x0 = random_eja().random_element() + sage: A = x0.subalgebra_generated_by() + sage: x = A.random_element() + sage: y = A.random_element() + sage: z = A.random_element() + sage: (x*y)*z == x*(y*z) True Squaring in the subalgebra should work the same as in @@ -983,7 +989,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): raise ValueError("this only works with non-nilpotent elements!") J = self.subalgebra_generated_by() - u = J.from_vector(self.to_vector()) + u = J(self) # The image of the matrix of left-u^m-multiplication # will be minimal for some natural number s... @@ -1008,7 +1014,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): # Our FiniteDimensionalAlgebraElement superclass uses rows. u_next = u**(s+1) A = u_next.operator().matrix() - c = J(A.solve_right(u_next.to_vector())) + c = J.from_vector(A.solve_right(u_next.to_vector())) # Now c is the idempotent we want, but it still lives in the subalgebra. return c.superalgebra_element()