# Revision history [back]

The capabilities for Sage in this respect are bounded by what GP/PARI provides. If you can figure out how to define an order in PARI with a given basis then you can just do the transformations manually: Given an integral basis for OO and a root c of y^2-kappa12, it's pretty straightforward to write down a ZZ-basis for the order OO[c] (assuming kappa12 is integral) and then you may be able to use that as a starting point for getting the ring of integers of OO. If PARI can do that then getting that functionality exposed in Sage would be relatively straightforward. If PARI cannot do that yet, it should probably be fixed there.

A while ago, I think PARI demanded that integral bases were in triangular form wrt. the underlying power basis (which prevents storing an LLL-reduced integral basis straight into the nf or bnf data structure), but this may have been relaxed. That shouldn't keep you from accomplishing your goal, though: taking a Hermite Normal Form at the right place should make things triangular.

Another option that exists in MAGMA and may exist in PARI as well is that MaximalOrder allows an optional argument (called Discriminant) that promises that the discriminant of the maximal order to be computed only contains prime factors from the specified argument. Rather than trying to factorize the discriminant completely, it will just try to remove extraneous factors with a lazy factorization approach. In your case, including 2Discriminant(OO)Norm(kappa12) would do the trick.

A while ago, I think Since PARI demanded that integral bases were in triangular form wrt. the underlying eventually computes an LLL-reduced ZZ-basis for the ring of integers (see nf.zk), it knows how to work with arbitrary bases, so it would just be a question of getting nfmaxord started with a different basis than just a power basis (which prevents storing an LLL-reduced integral basis straight into the nf or bnf data structure), basis. The interface of the library routine nfmaxord doesn't seem to provide the possibility, but this may have been relaxed. That shouldn't keep you from accomplishing your goal, though: taking a Hermite Normal Form at the right place with a bit of hacking it should make things triangular.be possible.
Another option that exists in MAGMA and may exist in PARI as well is that MaximalOrder allows an optional argument (called Discriminant) that promises that the discriminant of the maximal order to be computed only contains prime factors from the specified argument. Rather than trying to factorize the discriminant completely, it will just try to remove extraneous factors with a lazy factorization approach. In your case, including 2Discriminant(OO)Norm(kappa12) would do the trick.
Reading the documentation of nfmaxord there are several ways of doing something similar in PARI: nf_PARTIALFACT and fa. These parameters do not seem to be exposed in sage. (there is an optional argument to K.maximal_order that allows the computation of p-maximal orders, but that's not what you want).