From a6e62436370d29479f5158d49599ba12e46a437f Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 6 Nov 2020 17:42:49 -0500 Subject: [PATCH] eja: make an inverse() test work in trivial algebras. --- mjo/eja/eja_element.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index c5cbef9..de12bb1 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -438,11 +438,11 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement): sage: while not x.is_invertible(): ....: x = J.random_element() sage: x_vec = x.to_vector() - sage: x0 = x_vec[0] + sage: x0 = x_vec[:1] sage: x_bar = x_vec[1:] - 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: coeff = x0.inner_product(x0) - x_bar.inner_product(x_bar) + sage: x_inverse = x_vec.parent()(x0.list() + (-x_bar).list()) + sage: if not coeff.is_zero(): x_inverse = x_inverse/coeff sage: x.inverse() == J.from_vector(x_inverse) True -- 2.44.2