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

Wrong modular characteristic polynomial #381

Open
gilvillard opened this issue Sep 4, 2023 · 1 comment
Open

Wrong modular characteristic polynomial #381

gilvillard opened this issue Sep 4, 2023 · 1 comment

Comments

@gilvillard
Copy link
Member

In relation with linbox-team/linbox#305.

The matrix A attached has characteristic polynomial x^35. The largest invariant factor of A over Q (and modulo most primes) is s1=x^13. There are 5 non-trivial invariant factors.

I get (macOS 13.4.1, Apple M2 Pro, clang-1403.0.22.14.1):
example/charpoly 37 issue_sage_35846_matrix.sms
(6)*X^27 + (7)*X^28 + (6)*X^30 + (-8)*X^31 + (-13)*X^32 + (-13)*X^33 + X^35

p=37 >= 35 (or a greater prime) leads to a call to RandomKrylovPrecond, where the bug may seem to be located.
Using a block of two vectors, RandomKrylovPrecond pushes a wrong first dense factor of degree 5.

Among other things I suspect two lines in ffpack_frobenius.inl:

  • L138: the elimination is done on N (35) rows, while the Krylov matrix has noc*degree (60) rows. The computed rank is 18=13+5, which is correct. This could give a first invariant of degree 13 and I would say that the 5 is not relevant.
  • L201: the smallest degree is chosen, here 5, which is wrong.

I dont't think it's a problem of randomization, here the first degree 13 could probably deduced and pushed instead.

issue_sage_35846_matrix.sms.zip

@ClementPernet
Copy link
Member

test-charpoly fails on this branch (running the ArithProgPRecond method). I need to look into further details to see what did I break.

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

No branches or pull requests

2 participants