def minimal_polynomial(self):
"""
+ Return the minimal polynomial of this element,
+ as a function of the variable `t`.
+
ALGORITHM:
We restrict ourselves to the associative subalgebra
polynomial of this element's operator matrix (in that
subalgebra). This works by Baes Proposition 2.3.16.
- EXAMPLES::
+ TESTS:
+
+ The minimal polynomial of the identity and zero elements are
+ always the same::
sage: set_random_seed()
- sage: x = random_eja().random_element()
- sage: x.degree() == x.minimal_polynomial().degree()
- True
+ sage: J = random_eja()
+ sage: J.one().minimal_polynomial()
+ t - 1
+ sage: J.zero().minimal_polynomial()
+ t
- ::
+ The degree of an element is (by one definition) the degree
+ of its minimal polynomial::
sage: set_random_seed()
sage: x = random_eja().random_element()
sage: y0 = y.vector()[0]
sage: y_bar = y.vector()[1:]
sage: actual = y.minimal_polynomial()
- sage: x = SR.symbol('x', domain='real')
- sage: expected = x^2 - 2*y0*x + (y0^2 - norm(y_bar)^2)
+ sage: t = PolynomialRing(J.base_ring(),'t').gen(0)
+ sage: expected = t^2 - 2*y0*t + (y0^2 - norm(y_bar)^2)
sage: bool(actual == expected)
True
# and subalgebra_generated_by() must be the same, and in
# the same order!
elt = assoc_subalg(V.coordinates(self.vector()))
- return elt.operator_matrix().minimal_polynomial()
+
+ # We get back a symbolic polynomial in 'x' but want a real
+ # polynomial in 't'.
+ p_of_x = elt.operator_matrix().minimal_polynomial()
+ return p_of_x.change_variable_name('t')
def natural_representation(self):