This project is in an early alpha stage. It could already be useful but there are likely quite some issue (that we'd like to hear about 🙂)
All p-adic rings currently available in Sage are backed by elements that consist of an approximation and a precision. It can sometimes be tedious to work with such elements since error propagation needs to be analyzed and many algorithms in Sage don't play nice with such inexact elements.
This package implements an exact alternative where p-adic rings are backed by absolute number fields. The idea is to use exact elements in number fields where possible and describe algebraic elements as limits of Mac Lane valuations. Since computations in number fields (and in particular in relative extensions) are slow in Sage, extensions are always rewritten as isomorphic rings defined by an absolute number field with defining (Eisenstein) polynomials with small coefficients.
You need at least Sage 8.2 for the following examples to work.
If you can not install Sage on your local machine, you can also click to try this in an interactive Jupyter notebook.
The package can be loaded with
sage: from henselization import *
One can of course not expect arithmetic to be as fast as in the inexact p-adic
rings but the approach seems to have its merits. With a few
tweaks in Sage, this
implementation can compute the degree 384 splitting field (unramified of degree
2) of a degree 12 polynomial over ℚ2 in less than three minutes (having
PYTHONOPTIMIZE=yes
set):
sage: from henselization import *
sage: from henselization.benchmarks.splitting_fields import splitting_field
sage: K = QQ.henselization(2)
sage: R.<T> = K[]
sage: f = T^12 - 4*T^11 + 2*T^10 + 13*T^8 - 16*T^7 - 36*T^6 + 168*T^5 - 209*T^4 + 52*T^3 + 26*T^2 + 8*T - 13
sage: splitting_field(f)
Extension defined by a192^4 + …
of Extension defined by a48^4 + …
of Extension defined by a12^12 - 4*a12^11 + 2*a12^10 + 13*a12^8 - 16*a12^7 - 36*a12^6 + 168*a12^5 - 209*a12^4 + 52*a12^3 + 26*a12^2 + 8*a12 - 13
of Extension defined by z2^2 + z2 + 1
of Henselization of Rational Field with respect to 2-adic valuation
See our issues list, and tell us of any bugs or ommissions that are not covered there.