Sage code supporting
The previous version of the code was not a pip package, and can be found here.
This code depends on pyrforest.
sage -pip install --upgrade git+https://github.com/edgarcosta/amortizedHGM.git@main
If you don't have permissions to install it system wide, please add the flag --user
to install it just for you.
sage -pip install --user --upgrade git+https://github.com/edgarcosta/amortizedHGM.git@main
sage: from amortizedHGM import AmortizingHypergeometricDatamodp # the version of the first paper
....: H = AmortizingHypergeometricDatamodp(10**2, cyclotomic=([4,2,2], [3,3]))
....: H.amortized_padic_H_values(1/5) # this uses the rforest library
{11: 9,
13: 9,
17: 13,
19: 13,
23: 21,
29: 2,
31: 25,
37: 4,
41: 0,
43: 35,
47: 29,
53: 39,
59: 54,
61: 57,
67: 59,
71: 62,
73: 65,
79: 75,
83: 2,
89: 83,
97: 6}
sage: H.amortized_padic_H_values(1/5, use_c=False) # this code uses AccRemForest
{11: 9,
13: 9,
17: 13,
19: 13,
23: 21,
29: 2,
31: 25,
37: 4,
41: 0,
43: 35,
47: 29,
53: 39,
59: 54,
61: 57,
67: 59,
71: 62,
73: 65,
79: 75,
83: 2,
89: 83,
97: 6}
sage: from amortizedHGM import AmortizingHypergeometricData # the version of the second paper
sage: H = AmortizingHypergeometricData(cyclotomic=[[3,3],[2,1,1,1]])
sage: H.weight()
2
sage: _ = H.compare(12, 314/159, log2N_sage=12, verbose=True)
2^12
Amortized Gamma: 0.02 s
Additional precomputation: 0.01 s
Amortized HG: 0.04 s
Sage (p): 7.28 s
To recreate the timings in Table 1 of the paper, run sage -python amortizedHGM/generate_table_paper.py
; it will print latex to generate the table.