I noticed that Python does not have a good datatype for rational numbers, certainly not for algebraic numbers like $\tfrac{1 + \sqrt{2}}{3}$ or the real root of $x^3 - 5x + 7$. They have the fractions
data type and I was able to hack a solution to my particular problem from there using elaborate arrangements of matrices.
It would be really nice to take advance of the PARI
library which is written in C
. Since GP
is an interface to the PARI, it seems possible to write a Python interface to those libraries.
I can't seem to install Pari-Python so this is a chance to learn to import C libraries directly.
At the heart of it, I just want to learn how to import C++ libraries into Python. Specifically, libraries from the PARI-GP source code.