Computation of algebraic invariants attached to real quadratic fields, using algorithms from D-J23, building on DPV1 and DPV2, implemented in SageMath
. For corresponding code in Magma
, see the DRD repository.
Navigate to the main directory, run
load("main.sage")
This loads the necessary files using sage
’s attach
command.
To run tests to make sure everything works as intended, you can then type in
run_tests()
Let
The diagonal restriction derivative from DPV2, a certain overconvergent
F = BinaryQF([3,3,-5])
p = 7
number_of_terms = 20
diagonal_restriction_derivative(F,p,number_of_terms)
The function GS_unit(D,p)
computes the Gross–Stark units attached to a positive fundamental discriminant
GS_unit(221,3)
By bumping the precision, it is also possible to find units for much bigger primes than in magma
. This is probably due to our slightly different algdep
implementation.
GS_unit(24,41,100,30)
# returns 41*x^2 + 46*x + 41
The file src/quadforms.sage
implements Zagier’s reduction theory for indefinite binary quadratic forms, and in particular uses it to compute the automorph, meaning the stabiliser of a BQF in
F = BinaryQF([3,3,-5])
F.automorph()
# [ 17 -15]
# [ -9 8]
F.is_Zagier_reduced()
# False
F.Zagier_reduce()
# x^2 + 9*x*y + 3*y^2
F.Zagier_reduced_cycle()
# ([x^2 + 9*x*y + 3*y^2, 3*x^2 + 9*x*y + y^2], [9, 3])
On compatibility with magma code
- The function
diagonal_restriction_derivative
has been tested against the magma code in the drd repository. The (finite approximation to) the diagonal restriction copy-pasted fromsage
is found bymagma
in the correct space of overconvergent forms, and the constant term gives rise to a GS unit in the usual way. (Tested for$D = 33$ ,$p = 5$ ,$Q = 2x^2 + 3xy - 3y^2$ .)
- [X] Detach
$p$ -adic precision from number of terms of diagonal restriction derivative, and make intelligent choice automatically - [ ] Implement algorithms to compute Stark–Heegner points using
sage
’s existing$p$ -adic uniformisation framework, see this. This requires in particular porting the ordinary projection routines from Lauder/Vonk. - [X] Add doctests, examples
(can do this using
Pyment
, available frompip
.)