summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Raum <martin@raum-brothers.eu>2014-06-11 18:44:45 +0200
committerMartin Raum <martin@raum-brothers.eu>2014-11-14 09:47:46 +0100
commitc342417795d47efd320491e83c59e6fe8e1a973f (patch)
tree60fa084ba3a2c26fb6eeb16ec05e93091618c371
parentAdd all to __init__.py (diff)
Refactor index reduction function.
-rw-r--r--src/sage/modular/jacobi/all.py4
-rw-r--r--src/sage/modular/jacobi/classical.py2
-rw-r--r--src/sage/modular/jacobi/classical_weak.py10
-rw-r--r--src/sage/modular/jacobi/higherrank.py38
-rw-r--r--src/sage/modular/jacobi/test_classical.py4
-rw-r--r--src/sage/modular/jacobi/test_classical_weak.py10
-rw-r--r--src/sage/modular/jacobi/test_higherrank.py26
-rw-r--r--src/sage/modular/jacobi/vector_valued.py4
8 files changed, 49 insertions, 49 deletions
diff --git a/src/sage/modular/jacobi/all.py b/src/sage/modular/jacobi/all.py
index 20931e8..89bb9d9 100644
--- a/src/sage/modular/jacobi/all.py
+++ b/src/sage/modular/jacobi/all.py
@@ -1,5 +1,5 @@
from classical_weak import (
- reduce_classical_jacobi_fe_index,
+ classical_jacobi_reduce_fe_index,
classical_weak_jacobi_fe_indices,
classical_weak_jacobi_forms
@@ -13,7 +13,7 @@ from classical import (
from higherrank import (
higherrank_jacobi_fe_indices,
- reduce_higherrank_jacobi_fe_index,
+ higherrank_jacobi_reduce_fe_index,
higherrank_jacobi_r_classes,
higherrank_jacobi_forms
diff --git a/src/sage/modular/jacobi/classical.py b/src/sage/modular/jacobi/classical.py
index ada413b..f5b8b29 100644
--- a/src/sage/modular/jacobi/classical.py
+++ b/src/sage/modular/jacobi/classical.py
@@ -56,7 +56,7 @@ from sage.rings.all import Integer, ZZ
# We do not implement this separately, because this is the same
# reduction as in the case of weak Jacobi forms.
-from sage.modular.jacobi.classical_weak import reduce_classical_jacobi_fe_index
+from sage.modular.jacobi.classical_weak import classical_jacobi_reduce_fe_index
def classical_jacobi_fe_indices(m, prec, reduced=False):
r"""
diff --git a/src/sage/modular/jacobi/classical_weak.py b/src/sage/modular/jacobi/classical_weak.py
index 402b480..c4ac4c2 100644
--- a/src/sage/modular/jacobi/classical_weak.py
+++ b/src/sage/modular/jacobi/classical_weak.py
@@ -10,7 +10,7 @@ REFERENCES:
.. [Sk84] Skoruppa, Uber den Zusammenhang zwischen Jacobiformen und
Modulformen halbganzen Gewichts, 1984, University of Bonn.
-EXAMPLES::
+EXAMPLES:
To compute a basis of weight `k` and index `m \in \ZZ` weak Jacobi
forms, we call ``classical_weak_jacobi_forms``. This compute weight
@@ -32,9 +32,9 @@ accessed directly; If a reduced pair does not occur as a key and `n`
does not exceed the prescribed precision, then the corresponding
Fourier coefficient vanishes.
-To access Fourier coefficients of non reduced index, we compute the attached reduction by ``reduce_classical_jacobi_fe_index``::
+To access Fourier coefficients of non reduced index, we compute the attached reduction by ``classical_jacobi_reduce_fe_index``::
- sage: reduce_classical_jacobi_fe_index((2, 3), 2)
+ sage: classical_jacobi_reduce_fe_index((2, 3), 2)
((1, 1), -1)
As a result, we obtain `(n', r')` and a sign `s`. The Fourier
@@ -77,7 +77,7 @@ from sage.rings import big_oh
import operator
-def reduce_classical_jacobi_fe_index((n, r), m):
+def classical_jacobi_reduce_fe_index((n, r), m):
r"""
Reduce an index `(n, r)` of the Fourier expansion of Jacobi forms
of index `m` suchthat `0 \le r \le m`.
@@ -97,7 +97,7 @@ def reduce_classical_jacobi_fe_index((n, r), m):
EXAMPLES::
sage: from sage.modular.jacobi.all import *
- sage: reduce_classical_jacobi_fe_index((2,2), 1)
+ sage: classical_jacobi_reduce_fe_index((2,2), 1)
((1, 0), 1)
"""
rred = r % (2*m)
diff --git a/src/sage/modular/jacobi/higherrank.py b/src/sage/modular/jacobi/higherrank.py
index 07a4a83..399071b 100644
--- a/src/sage/modular/jacobi/higherrank.py
+++ b/src/sage/modular/jacobi/higherrank.py
@@ -9,7 +9,7 @@ REFERENCE:
.. [Ra] Martin Raum, Computation of Jacobi forms degree 1 and higher rank index.
-EXAMPLES::
+EXAMPLES:
To compute a basis of weight `k` and index `m` Jacobi forms, we call
``higherrank_jacobi_forms``. The index `m` is a quadratic form over
@@ -46,11 +46,11 @@ reduced index. They can be accessed directly; If a reduced pair does
not occur as a key and `n` does not exceed the prescribed precision,
then the corresponding Fourier coefficient vanishes.
-To access Fourier coefficients of non reduced index, we compute the attached reduction by ``reduce_classical_jacobi_fe_index``::
+To access Fourier coefficients of non reduced index, we compute the attached reduction by ``classical_jacobi_reduce_fe_index``::
sage: m_adj = QuadraticForm(2 * m.matrix().adjoint())
sage: m_span = m.matrix().row_module()
- sage: reduce_higherrank_jacobi_fe_index((4, (2,1)), m, r_classes, m_adj, m_span)
+ sage: higherrank_jacobi_reduce_fe_index((4, (2,1)), m, r_classes, m_adj, m_span)
((3, (0, 0)), 1)
As a result, we obtain `(n', r')` and a sign `s`. The Fourier
@@ -85,7 +85,7 @@ from sage.matrix.all import matrix, zero_matrix, identity_matrix
from sage.misc.cython import cython_lambda
from sage.misc.flatten import flatten
from sage.modular.jacobi.classical import (classical_jacobi_forms,
- classical_jacobi_fe_indices, reduce_classical_jacobi_fe_index)
+ classical_jacobi_fe_indices, classical_jacobi_reduce_fe_index)
from sage.modular.jacobi.higherrank_dimension import jacobi_dimension
from sage.modules.all import FreeModule, vector, span, zero_vector
from sage.rings.all import ZZ, QQ
@@ -96,7 +96,7 @@ import operator
from random import Random
-def reduce_higherrank_jacobi_fe_index((n, r), m, r_classes, m_adj, m_span):
+def higherrank_jacobi_reduce_fe_index((n, r), m, r_classes, m_adj, m_span):
r"""
Reduce a Fourier index `(n, r)`.
@@ -121,12 +121,12 @@ def reduce_higherrank_jacobi_fe_index((n, r), m, r_classes, m_adj, m_span):
EXAMPLES::
sage: from sage.modular.jacobi.higherrank import higherrank_jacobi_r_classes
- sage: from sage.modular.jacobi.higherrank import reduce_higherrank_jacobi_fe_index
+ sage: from sage.modular.jacobi.higherrank import higherrank_jacobi_reduce_fe_index
sage: m = QuadraticForm(matrix([[2]]))
sage: m_adj = QuadraticForm(2 * m.matrix().adjoint())
sage: m_span = m.matrix().row_module()
sage: r_classes = higherrank_jacobi_r_classes(m)[0]
- sage: reduce_higherrank_jacobi_fe_index((1,(2,)), m, r_classes, m_adj, m_span)
+ sage: higherrank_jacobi_reduce_fe_index((1,(2,)), m, r_classes, m_adj, m_span)
((0, (0,)), 1)
TESTS:
@@ -134,17 +134,17 @@ def reduce_higherrank_jacobi_fe_index((n, r), m, r_classes, m_adj, m_span):
See ``test_higherrank.py``.
"""
try:
- (rred, sgn) = _reduce_higherrank_jacobi_fe_index__r__cache[(m,r)]
+ (rred, sgn) = _higherrank_jacobi_reduce_fe_index__r__cache[(m,r)]
except KeyError:
- (rred, sgn) = _reduce_higherrank_jacobi_fe_index__r(r, r_classes, m_span)
- _reduce_higherrank_jacobi_fe_index__r__cache[(m,r)] = (rred, sgn)
+ (rred, sgn) = _higherrank_jacobi_reduce_fe_index__r(r, r_classes, m_span)
+ _higherrank_jacobi_reduce_fe_index__r__cache[(m,r)] = (rred, sgn)
nred = n - (m_adj(r) - m_adj(rred)) // (2*m.det())
return ((nred, rred), sgn)
-_reduce_higherrank_jacobi_fe_index__r__cache = {}
-def _reduce_higherrank_jacobi_fe_index__r(r, r_classes, m_span):
+_higherrank_jacobi_reduce_fe_index__r__cache = {}
+def _higherrank_jacobi_reduce_fe_index__r(r, r_classes, m_span):
r"""
Find a representative in `r_classes` that is equivalent modulo `m
\Z^l` and `\pm` to `r`.
@@ -165,11 +165,11 @@ def _reduce_higherrank_jacobi_fe_index__r(r, r_classes, m_span):
EXAMPLES::
sage: from sage.modular.jacobi.higherrank import higherrank_jacobi_r_classes
- sage: from sage.modular.jacobi.higherrank import _reduce_higherrank_jacobi_fe_index__r
+ sage: from sage.modular.jacobi.higherrank import _higherrank_jacobi_reduce_fe_index__r
sage: m = QuadraticForm(matrix([[2]]))
sage: m_span = m.matrix().row_module()
sage: r_classes = higherrank_jacobi_r_classes(m)[0]
- sage: _reduce_higherrank_jacobi_fe_index__r((2,), r_classes, m_span)
+ sage: _higherrank_jacobi_reduce_fe_index__r((2,), r_classes, m_span)
((0,), 1)
TESTS:
@@ -371,12 +371,12 @@ def higherrank_jacobi_forms(k, m, prec, algorithm="restriction"):
::
sage: from sage.modular.jacobi.higherrank import higherrank_jacobi_r_classes
- sage: from sage.modular.jacobi.higherrank import reduce_higherrank_jacobi_fe_index
+ sage: from sage.modular.jacobi.higherrank import higherrank_jacobi_reduce_fe_index
sage: n = 2; r = (2, 2)
sage: m_adj = QuadraticForm(2 * m.matrix().adjoint())
sage: r_classes = higherrank_jacobi_r_classes(m)[0]
sage: m_span = m.matrix().row_module()
- sage: ((nred, rred), _) = reduce_higherrank_jacobi_fe_index((n,r), m, r_classes, m_adj, m_span)
+ sage: ((nred, rred), _) = higherrank_jacobi_reduce_fe_index((n,r), m, r_classes, m_adj, m_span)
sage: jforms[0][(nred, rred)]
-45
@@ -729,7 +729,7 @@ def _restriction_matrix(k, m, prec, rst_vectors, find_relations, r_classes, m_sp
reductions = dict( (nr,[]) for nr in column_labels )
for nr in higherrank_jacobi_fe_indices(m, prec, r_classes, reduced=False):
- (nrred, sgn) = reduce_higherrank_jacobi_fe_index(nr, m, r_classes, m_adj, m_span)
+ (nrred, sgn) = higherrank_jacobi_reduce_fe_index(nr, m, r_classes, m_adj, m_span)
reductions[nrred].append((nr, sgn))
if sum(map(len, reductions.items())) > 10000:
@@ -825,7 +825,7 @@ def _relation_matrix(k, m, prec, rst_vectors, r_classes, m_span) :
for (s, m_rst, start, length) in row_groups:
row_labels_dict = row_labels[m_rst]
for (nr, ix) in row_labels_dict.items():
- (nrred, sgn) = reduce_classical_jacobi_fe_index(nr, m_rst)
+ (nrred, sgn) = classical_jacobi_reduce_fe_index(nr, m_rst)
if nrred == nr: continue
rel = (mat.row(start + row_labels_dict[nrred])
@@ -936,7 +936,7 @@ def _higherrank_jacobi_forms__restriction(
for phi in rst_jacobi_forms[m_rst]:
v = vector(ZZ, len(row_labels_dict))
for (nr, i) in row_labels_dict.items():
- (nrred, sgn) = reduce_classical_jacobi_fe_index(nr, m_rst)
+ (nrred, sgn) = classical_jacobi_reduce_fe_index(nr, m_rst)
v[i] = ((1 if k%2 == 0 else sgn) * phi[nr]) if nr in phi else 0
rst_jacobi_vectors.append(vector(
diff --git a/src/sage/modular/jacobi/test_classical.py b/src/sage/modular/jacobi/test_classical.py
index 182b781..ef2f704 100644
--- a/src/sage/modular/jacobi/test_classical.py
+++ b/src/sage/modular/jacobi/test_classical.py
@@ -36,7 +36,7 @@ from sage.all import (
from sage.modular.jacobi.classical import (
classical_jacobi_forms,
classical_jacobi_fe_indices,
- reduce_classical_jacobi_fe_index
+ classical_jacobi_reduce_fe_index
)
def test_classical_jacobi_forms():
@@ -69,7 +69,7 @@ def _test_classical_jacobi_forms(k, m, k_mod, prec):
indices = list(classical_jacobi_fe_indices(m, prec, reduced=True))
indices_nonreduced = list(classical_jacobi_fe_indices(m, prec, reduced=False))
- red = lambda nr: reduce_classical_jacobi_fe_index(nr,m)
+ red = lambda nr: classical_jacobi_reduce_fe_index(nr,m)
psis = [dict([ (nr, (_psi[nr] if nr in _psi else 0)) for nr in indices])
for _psi in classical_jacobi_forms(k+k_mod, m, prec)]
diff --git a/src/sage/modular/jacobi/test_classical_weak.py b/src/sage/modular/jacobi/test_classical_weak.py
index dd02078..9e71cfe 100644
--- a/src/sage/modular/jacobi/test_classical_weak.py
+++ b/src/sage/modular/jacobi/test_classical_weak.py
@@ -36,7 +36,7 @@ from sage.all import (PolynomialRing, LaurentPolynomialRing,
from sage.modular.jacobi.classical_weak import (
classical_weak_jacobi_fe_indices,
- reduce_classical_jacobi_fe_index,
+ classical_jacobi_reduce_fe_index,
classical_weak_jacobi_forms,
_classical_weak_jacobi_taylor_coefficients
)
@@ -107,7 +107,7 @@ def _taylor_coefficients(expansion, k, m, prec) :
for pw in (range(0, 2*m + 1, 2) if k % 2 == 0 else range(1, 2*m - 1, 2)):
proj = dict( (n, 0) for n in range(prec) )
for (n, r) in classical_weak_jacobi_fe_indices(m, prec):
- ((nred, rred), sign) = reduce_classical_jacobi_fe_index((n,r), m)
+ ((nred, rred), sign) = classical_jacobi_reduce_fe_index((n,r), m)
try :
proj[n] += (sign * r)**pw * expansion[(nred, rred)]
except (KeyError, ValueError) :
@@ -204,7 +204,7 @@ def _corrected_taylor_expansions(nu, phi, k, m, prec):
coeffs = dict( (n, QQ(0)) for n in range(prec) )
for (n, r) in classical_weak_jacobi_fe_indices(m, prec):
- (nrred, s) = reduce_classical_jacobi_fe_index((n,r), m)
+ (nrred, s) = classical_jacobi_reduce_fe_index((n,r), m)
coeffs[n] += s**k * gegenbauer(m*n, r) * phi[nrred]
return PowerSeriesRing(QQ, 'q')(coeffs)
@@ -229,7 +229,7 @@ def _test_classical_weak_jacobi_forms__multiplication(k, m, k_mod, prec):
zeta = P.base_ring().gen(0)
indices = list(classical_weak_jacobi_fe_indices(m, prec, reduced=True))
- red = lambda nr: reduce_classical_jacobi_fe_index(nr,m)
+ red = lambda nr: classical_jacobi_reduce_fe_index(nr,m)
psis = [dict([ (nr, (_psi[nr] if nr in _psi else 0)) for nr in indices]) for _psi in classical_weak_jacobi_forms(k+k_mod, m, prec)]
psi_span = matrix([[psi[nr] for nr in indices] for psi in psis]).row_module()
@@ -288,7 +288,7 @@ def _eval_at_torsion_point(torsion_point, phi, k, m, prec) :
coeffs = dict( (n, QQ(0)) for n in range(prec) )
for (n, r) in classical_weak_jacobi_fe_indices(m, prec):
- (nrred, s) = reduce_classical_jacobi_fe_index((n,r), m)
+ (nrred, s) = classical_jacobi_reduce_fe_index((n,r), m)
if nrred in phi:
coeffs[n] += s**k * zeta**r * phi[nrred]
diff --git a/src/sage/modular/jacobi/test_higherrank.py b/src/sage/modular/jacobi/test_higherrank.py
index 1912407..a6972e5 100644
--- a/src/sage/modular/jacobi/test_higherrank.py
+++ b/src/sage/modular/jacobi/test_higherrank.py
@@ -39,7 +39,7 @@ from sage.modular.jacobi.classical import (
classical_jacobi_forms
)
from sage.modular.jacobi.higherrank import (
- reduce_higherrank_jacobi_fe_index,
+ higherrank_jacobi_reduce_fe_index,
higherrank_jacobi_fe_indices,
higherrank_jacobi_forms,
@@ -56,7 +56,7 @@ def _test_set__jacobi_m():
QuadraticForm(matrix(3, [2,1,1, 1,2,1, 1,1,2]))]
-def test__reduce_higherrank_jacobi_fe_index():
+def test_higherrank_jacobi_reduce_fe_index():
for m in _test_set__jacobi_m():
r_classes = higherrank_jacobi_r_classes(m)[0]
m_span = m.matrix().row_module()
@@ -67,13 +67,13 @@ def test__reduce_higherrank_jacobi_fe_index():
n = randint(0, 20)
for _ in range(10):
r = fm.random_element()
- yield (_test__reduce_higherrank_jacobi_fe_index,
+ yield (_test_higherrank_jacobi_reduce_fe_index,
(n, r), m, r_classes, m_adj, m_span)
-def _test__reduce_higherrank_jacobi_fe_index((n, r), m, r_classes, m_adj, m_span):
- from sage.modular.jacobi.higherrank import reduce_higherrank_jacobi_fe_index
+def _test_higherrank_jacobi_reduce_fe_index((n, r), m, r_classes, m_adj, m_span):
+ from sage.modular.jacobi.higherrank import higherrank_jacobi_reduce_fe_index
- ((nred, rred), s) = reduce_higherrank_jacobi_fe_index((n, r), m, r_classes, m_adj, m_span)
+ ((nred, rred), s) = higherrank_jacobi_reduce_fe_index((n, r), m, r_classes, m_adj, m_span)
if s == 1:
assert vector(r) - vector(rred) in m_span
@@ -84,20 +84,20 @@ def _test__reduce_higherrank_jacobi_fe_index((n, r), m, r_classes, m_adj, m_span
assert 2*m.det()*n - m_adj(r) == 2*m.det()*nred - m_adj(rred)
-def test__reduce_higherrank_jacobi_fe_index__r():
+def test__higherrank_jacobi_reduce_fe_index__r():
for m in _test_set__jacobi_m():
r_classes = higherrank_jacobi_r_classes(m)[0]
m_span = m.matrix().row_module()
fm = FreeModule(ZZ, m.dim())
r = fm.random_element()
- yield (_test__reduce_higherrank_jacobi_fe_index__r,
+ yield (_test__higherrank_jacobi_reduce_fe_index__r,
r, r_classes, m_span)
-def _test__reduce_higherrank_jacobi_fe_index__r(r, r_classes, m_span):
- from sage.modular.jacobi.higherrank import _reduce_higherrank_jacobi_fe_index__r
+def _test__higherrank_jacobi_reduce_fe_index__r(r, r_classes, m_span):
+ from sage.modular.jacobi.higherrank import _higherrank_jacobi_reduce_fe_index__r
- (rred, s) = _reduce_higherrank_jacobi_fe_index__r(r, r_classes, m_span)
+ (rred, s) = _higherrank_jacobi_reduce_fe_index__r(r, r_classes, m_span)
if s == 1:
assert vector(r) - vector(rred) in m_span
@@ -220,7 +220,7 @@ def _test_higherrank_jacobi_forms__restriction(k, m, prec, jforms):
m_adj = QuadraticForm(2 * m.matrix().adjoint())
m_span = m.matrix().row_module()
- indices_red = [(nr, reduce_higherrank_jacobi_fe_index(nr, m, r_classes, m_adj, m_span))
+ indices_red = [(nr, higherrank_jacobi_reduce_fe_index(nr, m, r_classes, m_adj, m_span))
for nr in higherrank_jacobi_fe_indices(m, prec, r_classes, reduced=False)]
@@ -273,7 +273,7 @@ def _test_higherrank_jacobi_forms__multiplication(k, m, k_mod, prec, jforms):
indices = list(higherrank_jacobi_fe_indices(m, prec, r_classes, reduced=True))
indices_nonreduced = list(higherrank_jacobi_fe_indices(m, prec, r_classes, reduced=False))
- red = lambda nr: reduce_higherrank_jacobi_fe_index(nr, m, r_classes, m_adj, m_span)
+ red = lambda nr: higherrank_jacobi_reduce_fe_index(nr, m, r_classes, m_adj, m_span)
psis = [dict([ (nr, (_psi[nr] if nr in _psi else 0))
for nr in indices])
diff --git a/src/sage/modular/jacobi/vector_valued.py b/src/sage/modular/jacobi/vector_valued.py
index 6d60299..a3e02de 100644
--- a/src/sage/modular/jacobi/vector_valued.py
+++ b/src/sage/modular/jacobi/vector_valued.py
@@ -36,7 +36,7 @@ from sage.modular.all import CuspForms
from sage.modular.jacobi.higherrank import (
higherrank_jacobi_forms,
higherrank_jacobi_r_classes,
- _reduce_higherrank_jacobi_fe_index__r
+ _higherrank_jacobi_reduce_fe_index__r
)
from sage.modules.all import vector, zero_vector
from sage.quadratic_forms.all import QuadraticForm
@@ -292,7 +292,7 @@ def theta_decomposition(phi, m, r_classes):
r_to_mu = {}
for mu in mu_list:
try:
- (r, sign) = _reduce_higherrank_jacobi_fe_index__r(mu, r_classes, L_span)
+ (r, sign) = _higherrank_jacobi_reduce_fe_index__r(mu, r_classes, L_span)
except:
raise AssertionError(mu, r_classes)
try: