sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.34k stars 454 forks source link

Riemann Matrix just two lines in Sage #38204

Open kh-abd-kh opened 3 months ago

kh-abd-kh commented 3 months ago

Problem Description

There a code for calculating the Riemann Matrix for hyperelliptic (y^2 = f(x) ) and superelliptic (y^m= f(x) ) here in arb/flint https://github.com/pascalmolin/hcperiods/tree/master/arb

I compiled (in the header replace arb-acb by flint/arb -flint/acb) then copy the libajsec.so to /usr/lib and copy periods to your home dir

Proposed Solution

Now you have a working extremely fast high precession Riemann Matrix in sage

mm = !~/periods -m 2 --prec 10 --pol "x^7 - x" --gp --de --desame --trim mm = gen_to_sage(pari(mm[0]))

two linew just two lines change -m * to whatever you like and change "**" to what you like it is great that the output is gp/pari and sage understands gp/pari very easy.

now you can add g = np.array(mm).shape[0];g for the genus.

Alternatives Considered

It is usable with thetas and so on and really very fast for hyperelliptic and superelliptic.

Additional Information

Riemann Matrix in two lines. Should be added to Sage. you have flint already.

Is there an existing issue for this?

kh-abd-kh commented 3 months ago

https://github.com/flintlib/flint/issues/2017

here how to make use of it with the new Riemann Theta from Flint 3.1 (already in Sage 10.4)

https://github.com/flintlib/flint/issues/2017