Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characteristic polynomial of integer matrix has wrong degree #305

Open
vneiger opened this issue Jul 17, 2023 · 3 comments
Open

Characteristic polynomial of integer matrix has wrong degree #305

vneiger opened this issue Jul 17, 2023 · 3 comments

Comments

@vneiger
Copy link
Member

vneiger commented Jul 17, 2023

An issue in SageMath was raised here sagemath/sage#35846 . When computing the characteristic polynomial of some 35 x 35 integer matrix, we get x^27, which does not have the correct degree. The same issue already appears within LinBox. Running the piece of code attached, with the current git version of LinBox, and with the matrix from the above Sage issue (attached as well in sms format), I get:

$ ./issue_charpoly
Characteristic Polynomial is X^27

whereas we expect a polynomial of degree 35. Trying with the same matrix on some Modular<double> coefficient domain (for this, comment/uncomment a couple of lines in the code), everything seems to be fine.

I wondered about some problem due to randomization and briefly tried to force a deterministic algorithm, but did not find quickly how to do this. May be related to #53 .

issue_sage_35846_charpoly.zip

@gilvillard
Copy link
Member

I've raised linbox-team/fflas-ffpack#381.
I also get x^27 with ntl. I get a polynomial with nonzero coefficients between x^27 and x^35 without ntl.
The behaviour seems to be wrong mod p already, hence both situations are affected (ok differently).

@bdsaunders
Copy link
Member

bdsaunders commented Sep 4, 2023 via email

@gilvillard
Copy link
Member

Hi Dave,
Yes, that's correct I think.
Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants