Skip to content

Minpoly and charpoly don't check their arguments correctly #13187

@SnarkBoojum

Description

@SnarkBoojum

The following fails in sage (likewise with charpoly):

k=CyclotomicField(10)
U=matrix(k, 1,1,[1])
var('t')
U.minpoly(t)

The error is in a call that the function makes to PolynomialRing :

TypeError: invalid input (Cyclotomic Field of order 10 and degree 4, t, None) to PolynomialRing function; please see the docstring for that function

Strangely, if you use :

k=CyclotomicField(10)
U=matrix(k, 1,1,[1])
var('t')
U.minpoly('t')

everything is fine.

In any case, I would expect charpoly/minpoly to complain themselves if I don't call them correctly (which isn't clear at all!) -- it's definitely not normal (and upsetting for newbies) that another function reacts.

This is with sage-5.1.beta6.

Component: linear algebra

Author: André Apitzsch

Reviewer: Robert Bradshaw

Merged: sage-5.2.beta1

Issue created by migration from https://trac.sagemath.org/ticket/13187

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions