-
-
Notifications
You must be signed in to change notification settings - Fork 465
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move genus method to libsingular in function field #38369
base: develop
Are you sure you want to change the base?
Conversation
Documentation preview for this PR (built with commit a3c8d42; changes) is ready! 🎉 |
On my system: sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^3 - (x^3 + 2*x*y + 1/x))
sage: self = L
sage: from sage.libs.singular.function import singular_function, lib as singular_lib
....: # making the auxiliary ring which only has polynomials
....: # with integral coefficients.
....: tmpAuxRing = PolynomialRing(self._base_field.constant_field(),
....: str(self._base_field.gen()) + ',' + str(self._ring.gen()))
....: intMinPoly, d = self._make_monic_integral(self._polynomial)
....: curveIdeal = tmpAuxRing.ideal(intMinPoly)
....:
sage: singular_lib('normal.lib') # loading genus method in Singular
sage: genus = singular_function("genus")
sage: from sage.interfaces.singular import singular
sage: singular.lib('normal.lib') # loading genus method in Singular
sage: timeit('genus(curveIdeal)')
5 loops, best of 3: 62.5 ms per loop
sage: timeit('int(curveIdeal._singular_().genus())')
25 loops, best of 3: 20.3 ms per loop
sage: timeit('genus(curveIdeal)')
5 loops, best of 3: 62.4 ms per loop
sage: timeit('int(curveIdeal._singular_().genus())')
25 loops, best of 3: 20.4 ms per loop |
damn.. This is a bit schoking.. |
Yeah.. That is against my expectation too :-( |
We may be just unlucky -- The example may be too small. I didn't try other examples. |
on my system (ubuntu Linux 22.04), with your exemple :
so libsingular wins for me by a small amount.. |
This may hint at a serious underlying speed issue for libsingular on mac ? |
switch the genus method to use libsingular
📝 Checklist