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:
"""
A = self.subalgebra_generated_by()
- return A.element_class(A,self).operator().minimal_polynomial()
+ return A(self).operator().minimal_polynomial()
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
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...
# 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()