Skip to content
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

Edit hypellfrob.pyx #37424

Merged
merged 2 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,14 @@ REFERENCES:
.. [HarPri] F. Harary and G. Prins. The block-cutpoint-tree of
a graph. Publ. Math. Debrecen 13 1966 103-107.

.. [Harv2007] David Harvey. *Kedlaya's algorithm in larger characteristic*,
:arxiv:`math/0610973`.

.. [BGS2007] Alin Bostan, Pierrick Gaudry, and Eric Schost, *Linear recurrences
with polynomial coefficients and application to integer factorization and
Cartier-Manin operator*, SIAM Journal on Computing 36 (2007), no. 6,
1777-1806

.. [Hat2002] Allen Hatcher, "Algebraic Topology", Cambridge University
Press (2002).

Expand Down
79 changes: 29 additions & 50 deletions src/sage/schemes/hyperelliptic_curves/hypellfrob.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,22 @@
# sage.doctest: needs sage.libs.ntl sage.modules sage.rings.padics

r"""
Frobenius on Monsky-Washnitzer cohomology of a hyperelliptic curve over a
largish prime finite field
Frobenius on Monsky-Washnitzer cohomology of a hyperelliptic curve

This is a wrapper for the matrix() function in hypellfrob.cpp.
This module provides :func:`hypellfrob`, that is a wrapper for the ``matrix()``
function in ``hypellfrob.cpp``.

AUTHOR:
``hypellfrob.cpp`` is a C++ program for computing the zeta function of a
hyperelliptic curve over a largish prime finite field, based on the method
described in the paper [Harv2007]_. More precisely, it computes the matrix of
Frobenius on the Monsky-Washnitzer cohomology of the curve; the zeta function
can be recovered via the characteristic polynomial of the matrix.

- David Harvey (2007-05)
AUTHORS:

- David Harvey (2007-05): initial version
- David Harvey (2007-12): rewrote for ``hypellfrob`` version 2.0

- Alex J. Best (2018-02): added wrapper
"""

# *****************************************************************************
Expand Down Expand Up @@ -66,23 +71,19 @@ cdef extern from "hypellfrob.h":

def interval_products(M0, M1, target):
r"""
Given a matrix `M` with coefficients linear polynomials over `\ZZ/N\ZZ` and
a list of integers `a_0 < b_0 \le a_1 < b_1 \le \cdots \le a_n < b_n`
compute the matrices
``\prod_{t = a_i + 1}^{b_i} M(t)``
for `i = 0` to `n`.

This is a wrapper for code in the ``hypellfrob`` package.
Given matrices `M(t)` with entries linear in `t` over `\ZZ/N\ZZ` and a list
of integers `a_0 < b_0 \le a_1 < b_1 \le \cdots \le a_n < b_n`, compute the
matrices `\prod_{t = a_i + 1}^{b_i} M(t)` for `i = 0` to `n`.

INPUT:

- ``M0``, ``M1`` -- matrices over `\ZZ/N\ZZ`, so that `M = M0 + M1*x`
- ``target`` -- a list of integers
- ``M0``, ``M1`` -- matrices over `\ZZ/N\ZZ`, so that `M(t) = M_0 + M_1t`
- ``target`` -- a list of integers `a_0, b_0, \dots, a_n, b_n`

ALGORITHM:

Described in [Harv2007]_.
Based on the work of Bostan-Gaudry-Schost [BGS2007]_.
Described in [Harv2007]_, Theorem 10. Based on the work of Bostan-Gaudry-Schost
[BGS2007]_.

EXAMPLES::

Expand Down Expand Up @@ -116,20 +117,6 @@ def interval_products(M0, M1, target):
sage: [prod(Matrix(Integers(3^18), 1, 1, [t + 1]) for t in range(3,5))]
[[20]]

AUTHORS:

- David Harvey (2007-12): Original code
- Alex J. Best (2018-02): Wrapper

REFERENCES:

.. [Harv2007] David Harvey. *Kedlaya's algorithm in larger characteristic*,
:arxiv:`math/0610973`.

.. [BGS2007] Alin Bostan, Pierrick Gaudry, and Eric Schost,
*Linear recurrences with polynomial coefficients and application
to integer factorization and Cartier-Manin operator*, SIAM
Journal on Computing 36 (2007), no. 6, 1777-1806
"""
# Sage objects that wrap the NTL objects
cdef mat_ZZ_p_c mm0, mm1
Expand Down Expand Up @@ -175,24 +162,17 @@ def hypellfrob(p, N, Q):
INPUT:

- ``p`` -- a prime
- ``Q`` -- a monic polynomial in `\ZZ[x]` of odd degree.
Must have no multiple roots mod `p`.
- ``N`` -- precision parameter; the output matrix will be correct modulo `p^N`.

PRECONDITIONS:
- ``Q`` -- a monic polynomial in `\ZZ[x]` of odd degree; must have no
multiple roots mod `p`.
- ``N`` -- precision parameter; the output matrix will be correct modulo `p^N`

Must have `p > (2g+1)(2N-1)`, where `g = (\deg(Q)-1)/2` is the genus
of the curve.
The prime `p` should satisfy `p > (2g+1)(2N-1)`, where `g =
\left(\deg Q - 1\right) / 2` is the genus of the curve.

ALGORITHM:

Described in "Kedlaya's algorithm in larger characteristic" by David
Harvey. Running time is theoretically soft-`O(p^{1/2} N^{5/2} g^3)`.

.. TODO::

Remove the restriction on `p`. Probably by merging in Robert's code,
which eventually needs a fast C++/NTL implementation.
Described in [Harv2007]_, Section 7. Running time is theoretically
`\widetilde{O}(p^{1/2} N^{5/2} g^3)`.

EXAMPLES::

Expand All @@ -216,10 +196,11 @@ def hypellfrob(p, N, Q):
[ O(101) O(101) 65 + O(101) 42 + O(101)]
[ O(101) O(101) 89 + O(101) 29 + O(101)]

AUTHORS:
.. TODO::

Remove the restriction on `p`. Probably by merging in Robert's code,
which eventually needs a fast C++/NTL implementation.

- David Harvey (2007-05)
- David Harvey (2007-12): updated for hypellfrob version 2.0
"""
# Sage objects that wrap the NTL objects
cdef ntl_ZZ pp
Expand Down Expand Up @@ -268,5 +249,3 @@ def hypellfrob(p, N, Q):
data = [[mm[j, i]._integer_() + prec for i in range(2 * g)]
for j in range(2 * g)]
return Matrix(R, data)

# end of file
5 changes: 1 addition & 4 deletions src/sage/schemes/hyperelliptic_curves/hypellfrob/README
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ This directory contains the main source files for hypellfrob
version 2.1.1, by David Harvey.

hypellfrob is also maintained as a separate project, see
http://cims.nyu.edu/~harvey/hypellfrob/

At that web site you'll find a standalone demo program and
a test suite.
https://web.maths.unsw.edu.au/~davidharvey/code/hypellfrob

hypellfrob 2.1.1 is Copyright (C) 2007, 2008 David Harvey and is
licensed under the GPL (version 2 or later).
Loading