Skip to content

minpoly() returns incorrect minimal polynomial over RR but correct answer over QQ #40303

Open
@Newtech66

Description

@Newtech66

Steps To Reproduce

In SageCell,

H = matrix(RR,
       [[-3,  0,  0, -1,  0, -1, -1,  0],
       [ 0, -1, -1,  0, -1,  0,  0, -1],
       [ 0, -1, -1,  0, -1,  0,  0, -1],
       [-1,  0,  0,  1,  0, -1, -1,  0],
       [ 0, -1, -1,  0, -1,  0,  0, -1],
       [-1,  0,  0, -1,  0,  1, -1,  0],
       [-1,  0,  0, -1,  0, -1,  1,  0],
       [ 0, -1, -1,  0, -1,  0,  0,  3]]
      )
cp = H.charpoly()
mp = H.minpoly()
print('Characteristic polynomial:', cp)
print('Minimal polynomial:', mp)
print(H^5 + 2*H^4 - 20*H^3 - 24*H^2 + 96*H)

outputs

Characteristic polynomial: x^8 - 24.0000000000000*x^6 + 16.0000000000000*x^5 + 144.000000000000*x^4 - 192.000000000000*x^3
Minimal polynomial: x^8 - 24.0000000000000*x^6 + 16.0000000000000*x^5 + 144.000000000000*x^4 - 192.000000000000*x^3
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]

Defining H with QQ correctly returns the above polynomial as the minimal polynomial.

Expected Behavior

I should get the correct minimal polynomial x^5 + 2*x^4 - 20*x^3 - 24*x^2 + 96*x in RR.

Actual Behavior

I only get the correct answer in QQ.

Additional Information

This is also somewhat strange to me because the matrix given has some eigenvalues which are not in QQ (it has an eigenvalue 2*sqrt(3)).

Environment

  • Sage Version: SageCell

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions