gh-37100: Quaternion Algebra Fractional Ideal improvements - equivalence and reduced bases
Includes the following changes
1. Added `.is_definite()` to quaternion algebras, which performs a check
on the invariants.
2. Added `.reduced_basis()` to quaternion fractional ideals which uses
LLL to find the basis of shortest elements
3. Modified quaternion fractional ideal `.is_equivalent` to include a
`side` parameter which can be set to `'left'` or `'right'` to do left-
ideal or right-ideal equivalence, and a `certificate` parameter which if
true, returns the element a such that I = J*a. Throws a
`NotImplementedError` for indefinite quaternion algebras which fixes
#37080 . Backwards compatible.
4. Also added `.is_left_equivalent` and `.is_right_equivalent`.
5. Added `.is_principal` to quaternion fractional ideals of rank 4 in
definite quaternion algebras. Includes `certificate` parameter for
finding generator. Finds the shortest norm element in the lattice and
checks its norm.
6. Fixes #37337, bug in quaternion order `.isomorphism_to` where it
cannot find the isomorphism between $\mathcal{O}$ and $\alpha^{-1}
\mathcal{O} \alpha$ if $nrd(\alpha)$ is a ramified prime times a square.
Fixed this by repeating the previous `isomorphism_to` method multiple
times on inputs $\mathcal{O}$ and $\alpha^{-1} \mathcal{O} \alpha$ with
$\alpha = 1, i, j, k$. Throws a `NotImplementedError` in cases not
covered.
@S17A05 @Jonathke
#sd123
URL: https://github.com/sagemath/sage/pull/37100
Reported by: jtcc2
Reviewer(s): Lorenz Panny, Sebastian A. Spindler