specify charpoly polynomial ring
|Reported by:||was||Owned by:||somebody|
|Report Upstream:||Work issues:|
Joe Wetherell's idea:
On Fri, 22 Sep 2006 00:51:17 -0700, Joseph L Wetherell <jlwether@…> wrote:
I really want to agree with you, but I also want to know: what do we do in the situations I outlined before? For example, if you do
>> >> sage: M = Matrix(QQ, 2, 2, range(4)) >> sage: f = M.charpoly() >> sage: g = M.charpoly()
Now f and g have different parents, but you *can't* coerce g to the parent of f (or vice versa), because you can't assume the generators match up.
OK, so perhaps the problem is that charpoly needs another argument -- namely the variable in which the characteristic polynomial is to be expressed.
That's a great idea. Having an optional
f = M.charpoly(x)
f = M.charpoly(PolynomialRing(ZZ))
wouldn't break anything (it's optional), and would be easy to implement, and really just makes sense. I like it.