haochenuw/zero-modform

how to fix it??

Opened this issue · 9 comments

Hi,

How to fix this package to work with sage 10.1?
is it possible

can you please supply me with some references that you used in your work?

1-I ahve found your thesis, chapter 2, ok background and i am now reading chapter three.
2- after fixing the obvious print to print()
3- now it loads i try the following example
sage: load('zero-modform.sage')
:244: DeprecationWarning: invalid escape sequence '\s'
:261: DeprecationWarning: invalid escape sequence '\p'
:318: DeprecationWarning: invalid escape sequence '\p'
:410: DeprecationWarning: invalid escape sequence '\c'
:530: DeprecationWarning: invalid escape sequence '\p'
sage: E = EllipticCurve('26a1')
sage: f = E.modular_form()
sage: E
Elliptic Curve defined by y^2 + xy + y = x^3 - 5x - 8 over Rational Field
sage: f
q - q^2 + q^3 + q^4 - 3*q^5 + O(q^6)
sage: F = zero_poly_comp(f,26,2,'critical')

<<<<<<<<<<<=============Here the error=====================>>>>>>>>>>

UnboundLocalError Traceback (most recent call last)
Cell In [6], line 1
----> 1 F = zero_poly_comp(f,Integer(26),Integer(2),'critical')

File :481, in zero_poly_comp(f, level, weight, algorithm)

UnboundLocalError: local variable 'N' referenced before assignment

ok, i will try
first i added to the second line without inserting new CR
from sage.misc.verbose import verbose

i fixed the N problem
if level is None:
level = f.level()
N = level

.to <<<<<<<<line 470
if level is None:
level = f.level()
N = level

and also

if weight is None:
weight = f.weight()
k = weight

Now it works the N, but still have more to fix

sage: F = zero_poly_comp(f, 26, 2, 'critical')

ValueError Traceback (most recent call last)
File :551, in Norm_int(f, m, use_cc, multiply_by_f)

File ~/sage/src/sage/structure/parent.pyx:1279, in sage.structure.parent.Parent.getitem()
1278 return self.list()[n]
-> 1279 return meth(n)
1280

File ~/sage/src/sage/categories/rings.py:1188, in Rings.ParentMethods.getitem(self, arg)
1187 from sage.rings.power_series_ring import PowerSeriesRing
-> 1188 return PowerSeriesRing(self, elts)
1190 if isinstance(arg, tuple):

File ~/sage/src/sage/rings/power_series_ring.py:391, in PowerSeriesRing(base_ring, name, arg2, names, sparse, default_prec, order, num_gens, implementation)
390 name = names
--> 391 name = normalize_names(1, name)
393 if name is None:

File ~/sage/src/sage/structure/category_object.pyx:903, in sage.structure.category_object.normalize_names()
902
--> 903 cpdef normalize_names(Py_ssize_t ngens, names):
904 r"""

File ~/sage/src/sage/structure/category_object.pyx:1017, in sage.structure.category_object.normalize_names()
1016
-> 1017 certify_names(names)
1018 if ngens >= 0 and len(names) != ngens:

File ~/sage/src/sage/structure/category_object.pyx:1067, in sage.structure.category_object.certify_names()
1066 # We must be alphanumeric, but we make an exception for non-leading '_' characters.
-> 1067 raise ValueError("variable name {!r} is not alphanumeric".format(N))
1068 if not N[0].isalpha():

ValueError: variable name '0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 + 1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000*q' is not alphanumeric

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
Cell In [4], line 1
----> 1 F = zero_poly_comp(f, Integer(26), Integer(2), 'critical')

File :490, in zero_poly_comp(f, level, weight, algorithm)

File :446, in Norm_comp(f, N, weight, algorithm)

File :553, in Norm_int(f, m, use_cc, multiply_by_f)

ValueError: f must have rational coefficients

i shall look to the precession and keep you informed

ok it mess up spaces sorry i don't how to fix the typing i shall work with it
then give you when finish the new files.
Thank you for your nice work.......

just out of the blue it seems
F = zero_poly_comp(f)
works without the precession proble, good news,
but stucks somewhere else

count = 62
output[1] = []
count = 63
output[1] = []
count = 64
Number of vectors mod p obtained = 16

ArithmeticError Traceback (most recent call last)
Cell In [6], line 1
----> 1 F = zero_poly_comp(f)

File :490, in zero_poly_comp(f, level, weight, algorithm)

File :444, in Norm_comp(f, N, weight, algorithm)

File :401, in Norm(f, p, k)

File :396, in norm(f, p, k, proof, ncpus)

File ~/sage/src/sage/matrix/matrix_integer_dense.pyx:6020, in sage.matrix.matrix_integer_dense._lift_crt()
6018
6019
-> 6020 cpdef _lift_crt(Matrix_integer_dense M, residues, moduli=None):
6021 """
6022 INPUT:

File ~/sage/src/sage/matrix/matrix_integer_dense.pyx:6081, in sage.matrix.matrix_integer_dense._lift_crt()
6079
6080 if moduli is None:
-> 6081 moduli = MultiModularBasis([m.base_ring().order() for m in residues])
6082 else:
6083 if len(residues) != len(moduli):

File ~/sage/src/sage/arith/multi_modular.pyx:182, in sage.arith.multi_modular.MultiModularBasis_base.init()
180
181 if isinstance(val, (list, tuple, GeneratorType)):
--> 182 self.extend_with_primes(val, check=True)
183 else:
184 self._extend_moduli_to_height(val)

File ~/sage/src/sage/arith/multi_modular.pyx:248, in sage.arith.multi_modular.MultiModularBasis_base.extend_with_primes()
246 else:
247 self._refresh_prod()
--> 248 self._refresh_precomputations(old_count)
249 return self.n
250

File ~/sage/src/sage/arith/multi_modular.pyx:476, in sage.arith.multi_modular.MultiModularBasis_base._refresh_precomputations()
474 self.C[0] = 1
475 for i in range(start, self.n):
--> 476 self.C[i] = ai.c_inverse_mod_longlong(mpz_fdiv_ui(self.partial_products[i-1], self.moduli[i]), self.moduli[i])
477
478 cdef int min_moduli_count(self, mpz_t height) except -1:

File ~/sage/src/sage/rings/fast_arith.pyx:416, in sage.rings.fast_arith.arith_llong.c_inverse_mod_longlong()
414 g = self.c_xgcd_longlong(a,m, &s, &t)
415 if g != 1:
--> 416 raise ArithmeticError("The inverse of %s modulo %s is not defined."%(a,m))
417 s = s % m
418 if s < 0:

ArithmeticError: The inverse of 0 modulo 3 is not defined.

i shall see it.

it seems that the old file
https://github.com/williamstein/zero-modform
is easier to fix. i think it works now.
but i need to do more tests to be sure.
then i will read mazur-swinerton-dyer paper weil curve and look back to your code.

Thank you for the code.

i sheifted to your new files so i can latter use the new features.
i am close for
EllipticCurve('57a')
i ended up with

x^8 - 399605224650077321034x^7 - 7988115657939719162004803379126x^6 + 873716843067581693619194554436282722x^5 - 24481852017552373716931335846213927887346x^4 + 32145150953268674922033057747071873605815816x^3 - 2155260079326975178738819609496763173551639108x^2 + 1413132515836344662779390251945561050169809487774*x + 2003873371147048884559839183789789373855204223193732

it should be

x^8 - 399605224650084684000x^7 - 7985173378257198280817820000000x^6 + 59689950891031489715714346624000000000x^5 - 6256639888329097735685434759680000000000000x^4 + 158578943897462664762570247593984000000000000000x^3 + 349979076689055309851088897589248000000000000000000x^2

before factorization.
i hope to fix it this night.

Now, I am fixing norm - norm_int - norm_mod_l