42.12 Elements of modular forms spaces

Module: sage.modular.modform.element

Elements of modular forms spaces.

Module-level Functions

delta_lseries( [prec=53], [max_imaginary_part=0], [max_asymp_coeffs=40])

Return the L-series of the modular form Delta.

This actually returns an interface to Tim Dokchitser's program for computing with the L-series of the modular form $ \Delta$ .

Input:

prec
- integer (bits precision)
max_imaginary_part
- real number
max_asymp_coeffs
- integer

Output: The L-series of $ \Delta$ .

sage: L = delta_lseries()
sage: L(1)
0.0374412812685155

is_ModularFormElement( x)

Return True if x is a modular form.

sage: is_ModularFormElement(5)
False
sage: is_ModularFormElement(ModularForms(11).0)
True

Class: EisensteinSeries

class EisensteinSeries
An Eisenstein series.

sage: E = EisensteinForms(1,12)
sage: E.eisenstein_series()
[
691/65520 + q + 2049*q^2 + 177148*q^3 + 4196353*q^4 + 48828126*q^5 + O(q^6)
]
sage: E = EisensteinForms(11,2)
sage: E.eisenstein_series()
[
5/12 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6)
]
sage: E = EisensteinForms(Gamma1(7),2)
sage: E.set_precision(4)
sage: E.eisenstein_series()
[
1/4 + q + 3*q^2 + 4*q^3 + O(q^4),
1/7*zeta6 - 3/7 + q + (-2*zeta6 + 1)*q^2 + (3*zeta6 - 2)*q^3 + O(q^4),
q + (-zeta6 + 2)*q^2 + (zeta6 + 2)*q^3 + O(q^4),
-1/7*zeta6 - 2/7 + q + (2*zeta6 - 1)*q^2 + (-3*zeta6 + 1)*q^3 + O(q^4),
q + (zeta6 + 1)*q^2 + (-zeta6 + 3)*q^3 + O(q^4)
]
EisensteinSeries( self, parent, vector, t, chi, psi)

An Eisenstein series.

sage: E = EisensteinForms(1,12) ## indirect doctest
sage: E.eisenstein_series()
[
691/65520 + q + 2049*q^2 + 177148*q^3 + 4196353*q^4 + 48828126*q^5 + O(q^6)
]
sage: E = EisensteinForms(11,2)
sage: E.eisenstein_series()
[
5/12 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + O(q^6)
]
sage: E = EisensteinForms(Gamma1(7),2)
sage: E.set_precision(4)
sage: E.eisenstein_series()
[
1/4 + q + 3*q^2 + 4*q^3 + O(q^4),
1/7*zeta6 - 3/7 + q + (-2*zeta6 + 1)*q^2 + (3*zeta6 - 2)*q^3 + O(q^4),
q + (-zeta6 + 2)*q^2 + (zeta6 + 2)*q^3 + O(q^4),
-1/7*zeta6 - 2/7 + q + (2*zeta6 - 1)*q^2 + (-3*zeta6 + 1)*q^3 + O(q^4),
q + (zeta6 + 1)*q^2 + (-zeta6 + 3)*q^3 + O(q^4)
]

Functions: character,$ \,$ chi,$ \,$ L,$ \,$ M,$ \,$ new_level,$ \,$ parameters,$ \,$ psi,$ \,$ t

character( self)

Return the character associated to self.

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].character()
[zeta16]

chi( self)

Return the parameter chi associated to self.

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].chi()
[zeta16]

L( self)

Return the conductor of self.chi().

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].L()
17

M( self)

Return the conductor of self.psi().

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].M()
1

new_level( self)

Return level at which self is new.

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].level()
17
sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].new_level()
17
sage: [ [x.level(), x.new_level()] for x in EisensteinForms(DirichletGroup(60).0^2,2).eisenstein_series() ]
[[60, 2], [60, 3], [60, 2], [60, 5], [60, 2], [60, 2], [60, 2], [60, 3],
[60, 2], [60, 2], [60, 2]]

parameters( self)

Return chi, psi, and t, which are the defining parameters of self.

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].parameters()
([zeta16], [1], 1)

psi( self)

Return the parameter psi associated to self.

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].psi()
[1]

t( self)

Return the parameter t associated to self.

sage: EisensteinForms(DirichletGroup(17).0,99).eisenstein_series()[1].t()
1

Special Functions: __init__,$ \,$ _compute,$ \,$ _compute_q_expansion,$ \,$ _EisensteinSeries__compute_general_case,$ \,$ _EisensteinSeries__compute_weight2_trivial_character,$ \,$ _EisensteinSeries__defining_parameters

_compute( self, X)

Compute the coefficients of $ q^n$ of the power series of self, for $ n$ in the list $ X$ . The results are not cached. (Use coefficients for cached results).

sage: e = DirichletGroup(11).gen()
sage: f = EisensteinForms(e, 3).eisenstein_series()[0]
sage: f._compute([3,4,5])
[-9*zeta10^3 + 1,
 16*zeta10^2 + 4*zeta10 + 1,
 25*zeta10^3 - 25*zeta10^2 + 25*zeta10 - 24]

_compute_q_expansion( self, [prec=None])

Compute the q-expansion of self to precision prec.

sage: EisensteinForms(11,2).eisenstein_series()[0]._compute_q_expansion(10)
5/12 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 + 12*q^6 + 8*q^7 + 15*q^8 + 13*q^9
+ O(q^10)

_EisensteinSeries__compute_general_case( self, X)

Returns the list coefficients of $ q^n$ of the power series of self, for $ n$ in the list $ X$ . The results are not cached. (Use coefficients for cached results).

General case (except weight 2, trivial character, where this is wrong!) $ \chi$ is a primitive character of conductor $ L$ $ \psi$ is a primitive character of conductor $ M$ We have $ MLt \mid N$ , and

$\displaystyle E_k(chi,psi,t) =
c_0 + sum_{m \geq 1}[sum_{n\vert m} psi(n) * chi(m/n) * n^(k-1)] q^{mt},
$

with $ c_0=0$ if $ L>1$ , and $ c_0=L(1-k,psi)/2$ if $ L=1$ (that second $ L$ is an $ L$ -function $ L$ ).

sage: e = DirichletGroup(11).gen()
sage: f = EisensteinForms(e, 3).eisenstein_series()[0]
sage: f._EisensteinSeries__compute_general_case([1])
[1]
sage: f._EisensteinSeries__compute_general_case([2])
[4*zeta10 + 1]
sage: f._EisensteinSeries__compute_general_case([0,1,2])
[15/11*zeta10^3 - 9/11*zeta10^2 - 26/11*zeta10 - 10/11, 1, 4*zeta10 + 1]

_EisensteinSeries__compute_weight2_trivial_character( self, X)

Compute coefficients for self an Eisenstein series of the form $ E_2 - t*E_2(q^t)$ . Computes $ a_n$ for each $ n\in X$ .

sage: EisensteinForms(14,2).eisenstein_series()[0]._EisensteinSeries__compute_weight2_trivial_character([0])
[1/24]
sage: EisensteinForms(14,2).eisenstein_series()[0]._EisensteinSeries__compute_weight2_trivial_character([0,4,11,38])
[1/24, 1, 12, 20]

_EisensteinSeries__defining_parameters( self)

Return defining parameters for self.

sage: EisensteinForms(11,2).eisenstein_series()[0]._EisensteinSeries__defining_parameters()
(-1/24, [1], [1], Rational Field, 2, 11, 1, 1)

Class: ModularForm_abstract

class ModularForm_abstract
Constructor for generic class of a modular form. This should never be called directly; instead one should instantiate one of the derived classes of this class.

Functions: base_ring,$ \,$ character,$ \,$ coefficients,$ \,$ group,$ \,$ level,$ \,$ padded_list,$ \,$ prec,$ \,$ q_expansion,$ \,$ qexp,$ \,$ valuation,$ \,$ weight

base_ring( self)

Return the base_ring of self.

sage: (ModularForms(117, 2).13).base_ring()
Rational Field
sage: (ModularForms(119, 2, base_ring=GF(7)).12).base_ring()
Finite Field of size 7

character( self)

Return the character of self.

sage: ModularForms(DirichletGroup(17).0^2,2).2.character()
[zeta8]

coefficients( self, X)

The coefficients a_n of self, for integers n>=0 in the list X. If X is an Integer, return coefficients for indices from 1 to X.

This function caches the results of the compute function.

TESTS:

sage: e = DirichletGroup(11).gen()
sage: f = EisensteinForms(e, 3).eisenstein_series()[0]
sage: f.coefficients([0,1])
[15/11*zeta10^3 - 9/11*zeta10^2 - 26/11*zeta10 - 10/11,
1]
sage: f.coefficients([0,1,2,3])
[15/11*zeta10^3 - 9/11*zeta10^2 - 26/11*zeta10 - 10/11,
1,
4*zeta10 + 1,
-9*zeta10^3 + 1]
sage: f.coefficients([2,3])
[4*zeta10 + 1,
-9*zeta10^3 + 1]

level( self)

Return the level of self.

sage: ModularForms(25,4).0.level()
25

padded_list( self, n)

Return a list of length n whose entries are the first n coefficients of the q-expansion of self.

sage: CuspForms(1,12).0.padded_list(20) 
[0, 1, -24, 252, -1472, 4830, -6048, -16744, 84480, -113643, -115920,
534612, -370944, -577738, 401856, 1217160, 987136, -6905934, 2727432,
10661420]

prec( self)

Return the precision to which self.q_expansion() is currently known. Note that this may be 0.

sage: M = ModularForms(2,14)  
sage: f = M.0
sage: f.prec()
0

sage: M.prec(20)
20
sage: f.prec()
0
sage: x = f.q_expansion() ; f.prec()
20

q_expansion( self, [prec=None])

The $ q$ -expansion of the modular form to precision $ O(q^$prec$ )$ . This function takes one argument, which is the integer prec.

We compute the cusp form $ \Delta$ .

sage: delta = CuspForms(1,12).0
sage: delta.q_expansion()
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)

We compute the $ q$ -expansion of one of the cusp forms of level 23:

sage: f = CuspForms(23,2).0
sage: f.q_expansion()
q - q^3 - q^4 + O(q^6)
sage: f.q_expansion(10)
q - q^3 - q^4 - 2*q^6 + 2*q^7 - q^8 + 2*q^9 + O(q^10)
sage: f.q_expansion(2)
q + O(q^2)
sage: f.q_expansion(1)
O(q^1)
sage: f.q_expansion(0)
O(q^0)

qexp( self, [prec=None])

Same as self.q_expansion(prec).

sage: CuspForms(1,12).0.qexp()
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6)

valuation( self)

Return the valuation of self (i.e. as an element of the power series ring in q).

sage: ModularForms(11,2).0.valuation()
1
sage: ModularForms(11,2).1.valuation()
0
sage: ModularForms(25,6).1.valuation()
2
sage: ModularForms(25,6).6.valuation()
7

weight( self)

Return the weight of self.

sage: (ModularForms(Gamma1(9),2).6).weight()
2

Special Functions: __call__,$ \,$ __cmp__,$ \,$ __eq__,$ \,$ __getitem__,$ \,$ __getslice__,$ \,$ _compute,$ \,$ _ensure_is_compatible,$ \,$ _latex_,$ \,$ _repr_

__call__( self, x, [prec=None])

Evaluate the q-expansion of this modular form at x.

sage: f = ModularForms(DirichletGroup(17).0^2,2).2

sage: f(7) ## indirect doctest
-4851*zeta8^2 - 16464*zeta8 + 92372

sage: f(0)
0

__cmp__( self, other)

Compare self to other. If they are not the same object, but are of the same type, compare them as vectors.

sage: f = ModularForms(DirichletGroup(17).0^2,2).2
sage: g = ModularForms(DirichletGroup(17).0^2,2).1
sage: f == g ## indirect doctest
False
sage: f == f
True

__eq__( self, other)

Compare self to other.

sage: f = ModularForms(6,4).0
sage: g = ModularForms(23,2).0
sage: f == g ## indirect doctest
False
sage: f == f
True
sage: f == loads(dumps(f))
True

__getitem__( self, n)

Return the $ q^n$ coefficient of the $ q$ -expansion of self.

sage: f = ModularForms(DirichletGroup(17).0^2,2).2
sage: f.__getitem__(10)
zeta8^3 - 5*zeta8^2 - 2*zeta8 + 10
sage: f[30]
-2*zeta8^3 - 17*zeta8^2 + 4*zeta8 + 29

__getslice__( self, i, j)

Return a list containing the $ q^i$ through $ q^j$ coefficients of self.

sage: f = ModularForms(DirichletGroup(17).0^2,2).2
sage: f[10:15]
[zeta8^3 - 5*zeta8^2 - 2*zeta8 + 10,
-zeta8^3 + 11,
-2*zeta8^3 - 6*zeta8^2 + 3*zeta8 + 9,
12,
2*zeta8^3 - 7*zeta8^2 + zeta8 + 14]

sage: f.__getslice__(10,15)
[zeta8^3 - 5*zeta8^2 - 2*zeta8 + 10,
-zeta8^3 + 11,
-2*zeta8^3 - 6*zeta8^2 + 3*zeta8 + 9,
12,
2*zeta8^3 - 7*zeta8^2 + zeta8 + 14]

_compute( self, X)

Compute the coefficients of $ q^n$ of the power series of self, for $ n$ in the list $ X$ . The results are not cached. (Use coefficients for cached results).

_ensure_is_compatible( self, other)

Make sure self and other are compatible for arithmetic or comparison operations. Raise an error if incompatible, do nothing otherwise.

sage: f = ModularForms(DirichletGroup(17).0^2,2).2
sage: g = ModularForms(DirichletGroup(17).0^2,2).1
sage: h = ModularForms(17,4).0

sage: f._ensure_is_compatible(g)

sage: f._ensure_is_compatible(h)
Traceback (most recent call last):
...
ArithmeticError: Modular forms must be in the same ambient space.

_latex_( self)

Return the LaTeX expression of self.

sage: ModularForms(25,4).0._latex_()
'q + O(q^{6})'

sage: ModularForms(25,4).4._latex_()
'q^{5} + O(q^{6})'

_repr_( self)

Return the string representation of self.

sage: ModularForms(25,4).0._repr_()
'q + O(q^6)'

sage: ModularForms(25,4).3._repr_()
'q^4 + O(q^6)'

Class: ModularFormElement

class ModularFormElement
ModularFormElement( self, parent, x, [check=True])

An element of a space of modular forms.

Input:

parent
- ModularForms (an ambient space of modular forms)
x
- a vector on the basis for parent
check
- if check is $ \code{True}$ , check the types of the inputs.

Output:
ModularFormElement
- a modular form

sage: M = ModularForms(Gamma0(11),2)
sage: f = M.0
sage: f.parent()
Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of
weight 2 over Rational Field

Functions: cuspform_lseries,$ \,$ modform_lseries

cuspform_lseries( self, [prec=53], [max_imaginary_part=0], [max_asymp_coeffs=40])

Return the L-series of the weight k cusp form f on $ \Gamma_0(N)$ .

This actually returns an interface to Tim Dokchitser's program for computing with the L-series of the cusp form.

Input:

prec
- integer (bits precision)
max_imaginary_part
- real number
max_asymp_coeffs
- integer

Output: The L-series of the cusp form.

sage: f = CuspForms(2,8).0
sage: L = f.cuspform_lseries()
sage: L(1)
0.0884317737041015
sage: L(0.5)
0.0296568512531983

Consistency check with delta_lseries (which computes coefficients in pari):

sage: delta = CuspForms(1,12).0
sage: L = delta.cuspform_lseries()
sage: L(1)
0.0374412812685155 
sage: L = delta_lseries()
sage: L(1)
0.0374412812685155

modform_lseries( self, [prec=53], [max_imaginary_part=0], [max_asymp_coeffs=40])

Return the L-series of the weight $ k$ modular form $ f$ on $ \SL _2(\mathbf{Z})$ .

This actually returns an interface to Tim Dokchitser's program for computing with the L-series of the modular form.

Input:

prec
- integer (bits precision)
max_imaginary_part
- real number
max_asymp_coeffs
- integer

Output: The L-series of the modular form.

We commpute with the L-series of the Eisenstein series $ E_4$ :

sage: f = ModularForms(1,4).0
sage: L = f.modform_lseries()
sage: L(1)
-0.0304484570583933

Special Functions: __init__,$ \,$ _add_,$ \,$ _compute_q_expansion

_add_( self, other)

Add self to other.

sage: f = ModularForms(DirichletGroup(17).0^2,2).2
sage: g = ModularForms(DirichletGroup(17).0^2,2).1
sage: f
q + (-zeta8^2 + 2)*q^2 + (zeta8 + 3)*q^3 + (-2*zeta8^2 + 3)*q^4 + (-zeta8 +
5)*q^5 + O(q^6)

sage: g
1 + (-14/73*zeta8^3 + 57/73*zeta8^2 + 13/73*zeta8 - 6/73)*q^2 +
(-90/73*zeta8^3 + 64/73*zeta8^2 - 52/73*zeta8 + 24/73)*q^3 +
(-81/73*zeta8^3 + 189/73*zeta8^2 - 3/73*zeta8 + 153/73)*q^4 +
(72/73*zeta8^3 + 124/73*zeta8^2 + 100/73*zeta8 + 156/73)*q^5 + O(q^6)

sage: f+g ## indirect doctest
1 + q + (-14/73*zeta8^3 - 16/73*zeta8^2 + 13/73*zeta8 + 140/73)*q^2 +
(-90/73*zeta8^3 + 64/73*zeta8^2 + 21/73*zeta8 + 243/73)*q^3 +
(-81/73*zeta8^3 + 43/73*zeta8^2 - 3/73*zeta8 + 372/73)*q^4 + (72/73*zeta8^3
+ 124/73*zeta8^2 + 27/73*zeta8 + 521/73)*q^5 + O(q^6)

_compute_q_expansion( self, prec)

Computes the q-expansion of self to precision prec.

sage: f = EllipticCurve('37a').modular_form()                       
sage: f.q_expansion() ## indirect doctest
q - 2*q^2 - 3*q^3 + 2*q^4 - 2*q^5 + O(q^6)

sage: f._compute_q_expansion(10)
q - 2*q^2 - 3*q^3 + 2*q^4 - 2*q^5 + 6*q^6 - q^7 + 6*q^9 + O(q^10)

Class: ModularFormElement_elliptic_curve

class ModularFormElement_elliptic_curve
A modular form attached to an elliptic curve.
ModularFormElement_elliptic_curve( self, parent, E)

Modular form attached to an elliptic curve as an element of a space of modular forms.

sage: E = EllipticCurve('5077a')
sage: f = E.modular_form()
sage: f
q - 2*q^2 - 3*q^3 + 2*q^4 - 4*q^5 + O(q^6)
sage: f.q_expansion(10)
q - 2*q^2 - 3*q^3 + 2*q^4 - 4*q^5 + 6*q^6 - 4*q^7 + 6*q^9 + O(q^10)
sage: f.parent()
Modular Forms space of dimension 423 for Congruence Subgroup Gamma0(5077)
of weight 2 over Rational Field

sage: E = EllipticCurve('37a')
sage: f = E.modular_form() ; f
q - 2*q^2 - 3*q^3 + 2*q^4 - 2*q^5 + O(q^6)
sage: f == loads(dumps(f))
True

Functions: elliptic_curve

elliptic_curve( self)

Return elliptic curve associated to self.

sage: E = EllipticCurve('11a')
sage: f = E.modular_form()
sage: f.elliptic_curve()
Elliptic Curve defined by y^2 + y = x^3 - x^2 - 10*x - 20 over Rational
Field
sage: f.elliptic_curve() is E
True

Special Functions: __init__,$ \,$ _compute_element,$ \,$ _compute_q_expansion

_compute_element( self)

Compute self as a linear combination of the basis elements of parent.

sage: EllipticCurve('11a1').modular_form()._compute_element()
[1, 0]
sage: EllipticCurve('389a1').modular_form()._compute_element()
[1, -2, -2, 2, -3, 4, -5, 0, 1, 6, -4, -4, -3, 10, 6, -4, -6, -2, 5, -6,
10, 8, -4, 0, 4, 6, 4, -10, -6, -12, 4, 8, 0]

_compute_q_expansion( self, prec)

The $ q$ -expansion of the modular form to precision $ O(q^$prec$ )$ . This function takes one argument, which is the integer prec.

sage: E = EllipticCurve('11a') ; f = E.modular_form()
sage: f._compute_q_expansion(10)
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 - 2*q^9 + O(q^10)

sage: f._compute_q_expansion(30)
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 - 2*q^9 - 2*q^10 + q^11 -
2*q^12 + 4*q^13 + 4*q^14 - q^15 - 4*q^16 - 2*q^17 + 4*q^18 + 2*q^20 +
2*q^21 - 2*q^22 - q^23 - 4*q^25 - 8*q^26 + 5*q^27 - 4*q^28 + O(q^30)

sage: f._compute_q_expansion(10)
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 - 2*q^9 + O(q^10)

Class: Newform

class Newform
Newform( self, parent, component, names, [check=True])

TODO

Input:

parent
- An ambient cuspidal space of modular forms for which self is a newform.
component
- A simple component of a cuspidal modular symbols space of any sign corresponding to this newform.
check
- If check is $ \code{True}$ , check that parent and component have the same weight, level, and character, that component has sign 1 and is simple, and that the types are correct on all inputs.

Functions: abelian_variety,$ \,$ element,$ \,$ hecke_eigenvalue_field,$ \,$ modular_symbols,$ \,$ number

element( self)

Find an element of the ambient space of modular forms which represents this newform.

NOTE: This can be quite expensive.

hecke_eigenvalue_field( self)

Return the field generated over the rationals by the coefficients of this newform.

modular_symbols( self, [sign=0])

Return the subspace with the specified sign of the space of modular symbols corresponding to this newform.

Special Functions: __cmp__,$ \,$ __eq__,$ \,$ __init__,$ \,$ _compute,$ \,$ _compute_q_expansion,$ \,$ _defining_modular_symbols,$ \,$ _name

_compute( self, X)

Compute the coefficients of $ q^n$ of the power series of self, for $ n$ in the list $ X$ . The results are not cached. (Use coefficients for cached results).

_compute_q_expansion( self, prec)

Return the q-expansion of self.

See About this document... for information on suggesting changes.