Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'u/chapoton/8701' in 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Jul 29, 2017
2 parents 74b0302 + fe759f5 commit e7e267a
Show file tree
Hide file tree
Showing 13 changed files with 3,686 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/doc/en/reference/modfrm/index.rst
Expand Up @@ -37,4 +37,17 @@ Design Notes

sage/modular/modform/notes

Siegel Modular Forms
====================

.. toctree::
:maxdepth: 2

sage/modular/siegel/siegel_modular_form
sage/modular/siegel/siegel_modular_form_prec
sage/modular/siegel/siegel_modular_forms_algebra
sage/modular/siegel/siegel_modular_group
sage/modular/siegel/theta_constant
sage/modular/siegel/fastmult

.. include:: ../footer.txt
3 changes: 3 additions & 0 deletions src/module_list.py
Expand Up @@ -981,6 +981,9 @@ def uname_specific(name, value, alternative):
libraries = ["gmp", "zn_poly"],
extra_compile_args=['-std=c99', '-D_XPG6']),

Extension('sage.modular.siegel.fastmult',
sources = ['sage/modular/siegel/fastmult.pyx']),

################################
##
## sage.modules
Expand Down
110 changes: 110 additions & 0 deletions src/sage/categories/pushout.py
Expand Up @@ -1499,6 +1499,116 @@ def expand(self):
return [InfinitePolynomialFunctor((x,), self._order, self._imple) for x in reversed(self._gens)]


class SiegelModularFormsAlgebraFunctor(ConstructionFunctor):
"""
this is needed to make the coercion system happy
DO NOT REMOVE!
"""
rank = 9

def __init__(self, group, weights, degree, default_prec):
r"""
Initialize the functor.
EXAMPLES::
sage: from sage.categories.pushout import SiegelModularFormsAlgebraFunctor
sage: F = SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'even', 2, 101)
sage: F.rank
9
"""
from sage.categories.all import Rings
Functor.__init__(self, Rings(), Rings())
self._group = group
self._weights = weights
self._degree = degree
self._default_prec = default_prec

def __call__(self, R):
r"""
Apply the functor ``self`` to the ring ``R``.
EXAMPLES::
sage: from sage.categories.pushout import SiegelModularFormsAlgebraFunctor
sage: F = SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'all', 2, 41)
sage: F(QQ)
Algebra of Siegel modular forms of degree 2 and all weights on Sp(4,Z) over Rational Field
TESTS::
sage: F(3)
Traceback (most recent call last):
...
TypeError: The coefficient ring must be a ring
"""
from sage.modular.siegel.all import SiegelModularFormsAlgebra
return SiegelModularFormsAlgebra(coeff_ring=R, group=self._group, weights=self._weights, degree=self._degree, default_prec=self._default_prec)

def __cmp__(self, other):
r"""
Compare the functor ``self`` and the object ``other``.
EXAMPLES::
sage: from sage.categories.pushout import SiegelModularFormsAlgebraFunctor
sage: F = SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'even', 2, 101)
sage: G = SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'even', 2, 101)
sage: F == G
True
sage: F == SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'all', 2, 41)
False
sage: F == SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'even', 2, 61)
True
"""
c = cmp(type(self), type(other))
if c == 0:
# default precision is an implementation detail, not a
# mathematical property, so it is ignored in comparison
c = cmp(self._group, other._group) or cmp(self._weights, other._weights) or cmp(self._degree, other._degree)
return c

def merge(self, other):
r"""
Merge the two functors ``self`` and ``other``.
EXAMPLES::
sage: from sage.categories.pushout import SiegelModularFormsAlgebraFunctor
sage: F = SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'even', 2, 101)
sage: G = SiegelModularFormsAlgebraFunctor('Gamma0(2)', 'all', 2, 61)
sage: F == G
False
sage: F.merge(G) is None
True
sage: G = SiegelModularFormsAlgebraFunctor('Sp(4,Z)', 'even', 2, 61)
sage: F.merge(G) is G
True
"""
if not isinstance(other, SiegelModularFormsAlgebraFunctor):
return None
if (self._group == other._group) and (self._weights == other._weights) and (self._degree == other._degree):
if self._default_prec <= other._default_prec:
return self
else: # self._default_prec > other._default_prec
return other
else:
return None

def __str__(self):
r"""
Return a string describing the functor ``self``.
EXAMPLES::
sage: from sage.categories.pushout import SiegelModularFormsAlgebraFunctor
sage: F = SiegelModularFormsAlgebraFunctor('Gamma0(4)', 'even', 2, 41)
sage: F
SMFAlg{"Gamma0(4)", "even", 2, 41}
"""
return 'SMFAlg{"%s", "%s", %s, %s}' %(self._group, self._weights, self._degree, self._default_prec)


class MatrixFunctor(ConstructionFunctor):
"""
Expand Down
2 changes: 2 additions & 0 deletions src/sage/modular/all.py
Expand Up @@ -38,3 +38,5 @@
from .btquotients.all import *

from .pollack_stevens.all import *

from .siegel.all import *
1 change: 1 addition & 0 deletions src/sage/modular/siegel/__init__.py
@@ -0,0 +1 @@
pass
3 changes: 3 additions & 0 deletions src/sage/modular/siegel/all.py
@@ -0,0 +1,3 @@
from siegel_modular_form import SiegelModularForm
from siegel_modular_forms_algebra import SiegelModularFormsAlgebra
from siegel_modular_group import Sp4Z, Sp4Z_Gamma0_constructor as Sp4Z_Gamma0
11 changes: 11 additions & 0 deletions src/sage/modular/siegel/fastmult.pxd
@@ -0,0 +1,11 @@
include 'sage/ext/interrupt.pxi'
include 'sage/ext/stdsage.pxi'
include 'sage/ext/cdefs.pxi'

from sage.rings.ring cimport Ring
from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
from sage.algebras.group_algebra import GroupAlgebra

cpdef mult_coeff_int(int a, int b, int c, coeffs_dict1, coeffs_dict2)
cpdef mult_coeff_int(int a, int b, int c, coeffs_dict1, coeffs_dict2)
cpdef mult_coeff_generic(int a, int b, int c, coeffs_dict1, coeffs_dict2, Ring R)

0 comments on commit e7e267a

Please sign in to comment.