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

Implement algorithm=pari for characteristic polynomial of a matrix #39824

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Krishnadubey1008
Copy link
Contributor

This PR fixes #39815

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@user202729
Copy link
Contributor

The problem is sage method should probably not return pari Gen object. It is especially confusing when it prints out identical to a sage polynomial.

( conversion from pari polynomial to sage polynomial doesn't work yet → #39814 )

@Krishnadubey1008
Copy link
Contributor Author

Krishnadubey1008 commented Mar 31, 2025

@user202729 I have added following lines to handle the conversion of the PARI Gen object to a SageMath polynomial

pari_poly = pari(x).charpoly(var)
return pari_poly.sage()

@user202729
Copy link
Contributor

Need documentation and doctest. Also avoid importing from .all, all other occurrences of importing pari in the code base doesn't.

@Krishnadubey1008
Copy link
Contributor Author

Krishnadubey1008 commented Mar 31, 2025

@user202729 I have provided a doctest example showing how to use the algorithm="pari" and changed the import statement to import pari from sage.libs.pari.gen instead of from .all.

@user202729
Copy link
Contributor

Need documentation of the possible values of the algorithm input to the function. Also test for polynomials over RR, ZZ, QQ[i], other fields that pari supports

@Krishnadubey1008
Copy link
Contributor Author

@user202729 I have improved documentation and doctests as suggested

@user202729
Copy link
Contributor

this should go to charpoly method instead of here? Also the format of the documentation is incorrect, search for INPUT in documentation of other functions

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

Successfully merging this pull request may close these issues.

Implement algorithm="pari" for characteristic polynomial of a matrix
2 participants