gh-37098: Fixed random_element() for fractional ideals in rational quaternion algebras
Added `QuaternionFractionalIdeal_rational.random_element()` to fix
random sampling in fractional ideals of quaternion algebras.
The method `.random_element()` of the ideal class refers to the ring
over which the ideal is defined, but for fractional ideals Sage often
(incorrectly) gives the base field of the algebra as a base ring. To
work around this, we implement a new function
`QuaternionFractionalIdeal_rational.random_element()` that hardcodes
$\mathbb{Z}$ to return a random $\mathbb{Z}$-linear combination of the
(lattice) generators of the fractional ideal.
Note: The deeper issue of separating ideals and fractional ideals still
remains - see #3680.
#sd123
URL: https://github.com/sagemath/sage/pull/37098
Reported by: Sebastian Spindler
Reviewer(s): Peter Bruin