ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 23 Nov 2018 11:42:30 -0600How does one get a list of Fourier coefficients from a q-series?http://ask.sagemath.org/question/44395/how-does-one-get-a-list-of-fourier-coefficients-from-a-q-series/ I'm new to working with SAGE, I need to check congruences with modular forms, this requires that I am able to construct a list of Fourier coefficients from the q series of a modular form, how does this work?user12345Fri, 23 Nov 2018 11:42:30 -0600http://ask.sagemath.org/question/44395/Eigenvalues of hecke operatorshttp://ask.sagemath.org/question/40588/eigenvalues-of-hecke-operators/For a project I am trying to build a program that computes a basis for cusp forms of weight 2 over $\Gamma_0(N)$. At one point, I want to represent eigenvalues of multiple Hecke operators. For example, (for $N=23$) I have found the following matrices for the Hecke operators:
$
T_2=\begin{pmatrix} -2 & -1/2 ;
2 & 1 \end{pmatrix}, T_3=\begin{pmatrix} 3 & 1 ;
-4 & -3 \end{pmatrix} \quad T_5=\begin{pmatrix} -2 & -1/2 ;
2 & 1 \end{pmatrix} \quad
$
so we have the following characteristic polynomials $f_2=x^2+x-1$, $f_3=x^2-5$, $f_5=x^2 +2x-4$. Suppose we denote the solution of $f_2$ (eigenvalues of $T_2$) by $a$ and it's conjugate. Then we can denote the solution of $f_3$ by $2a+1$ and of $f_5$ by $2a$.
I am trying to figure out how I can 'make' Sage represent these eigenvalues in this way. Say I have found these matrices above, I can create k.< a >=NumberField(x^2+x-1), then $a$ represents the root of the polynomial. So the question for me is, how can I make Sage give me the eigenvalues of $T_3$ and $T_5$ in terms of $a$?
Furthermore, I am wondering how to get the jordan normal form of $T_2$, or eigenmatrix in terms of $a$. If I ask for jordan_form, I get an error, and if I ask for eigenmatrix_right, I only get a numerical expression.
Remark: A little context, the goal for this project is to represent newforms in a similar way as Sage does, when you ask for example Newforms(23,2,names='a'). We need the eigenvalues of the hecke operators since they correspond with the coefficients of the Fourier series.
----------TheBeiramSat, 13 Jan 2018 04:32:29 -0600http://ask.sagemath.org/question/40588/Eta products for S_6(Gamma0(24))http://ask.sagemath.org/question/10399/eta-products-for-s_6gamma024/We're trying to find a basis for S_6(Gamma0(24)), and we would like it to be in terms of eta products. We have some eta products that we've worked out by hand, and we want to see which on them are linearly independent. We realize that SAGE has a built in function to find the basis of any space, but our professor has asked us to try and do it by hand a few times for practice.
The problem we're encountering is how to represent out eta products in SAGE. The EtaProduct(level, dict) function only recognizes eta products of a certain kind (the powers of eta have to sum to 0).
For example, if we enter EtaProduct(24, {2:12}) we get the following error : ValueError: sum r_d (=12) is not 0
We would also like to compute the Fourier expansion, to then check for linear independence.ÉmileThu, 01 Aug 2013 08:13:24 -0500http://ask.sagemath.org/question/10399/How to define an element in a space of Modular Forms and express it as a linear combination of basis elements?http://ask.sagemath.org/question/8680/how-to-define-an-element-in-a-space-of-modular-forms-and-express-it-as-a-linear-combination-of-basis-elements/Hello, I was trying to solve Exercise 1.4.5 in Alvaro Lozano-Robledo's book *Elliptic Curves, Modular Forms and Their L-functions*, which is about representations of integers as sums of 6 squares and its relation to the theta function
$$\Theta(q) = \sum_{j = -\infty}^{\infty} q^{j^2} $$
I need to define the space of modular forms $M_3(\Gamma_1(4))$ in SAGE, which I already did and find a basis for this 2-dimensional space. I was able to this without any problems.
>But now I'm asked to write $\Theta^6(q)$ as a linear combination of the basis elements just found. This prompts me to ask some questions.
>1) How do I define $\Theta(q)$ and how do I check that $\Theta^6(q) \in M_3(\Gamma_1(4))$?
>2) How would I express $\Theta^6(q)$ as a linear combination of the basis elements?
>3) More generally, is there a way in which one can specify some q-series expansion and ask SAGE if it is in a particular space of modular forms and if it is to express it as a linear combination of the basis elements?
I've already searched in the SAGE manual but I only found how to define Eisenstein series and the like. I apologize if my questions are not very well formulated.
Thank you very much in advance for any help.Adrián BarqueroSat, 28 Jan 2012 16:34:33 -0600http://ask.sagemath.org/question/8680/Modular Symbols with Character & Manin Symbolshttp://ask.sagemath.org/question/9215/modular-symbols-with-character-manin-symbols/1) Let $f= q + aq^2 + (a^3 + \frac{1}{2}a^2 +2)q^3 + a^2q^4 + O(5)$ be the level 28, weight 2 newform where $a$ satisfies $x^4 + 2x^3 + 2x^2 + 4x +4$. This modular form has an associated Dirichlet character (which we'll call eps) of conductor 28 mapping $15 \mapsto -1$ and $17 \mapsto (-\frac{1}{2}a^3 - \frac{1}{2}a^2 - a -1)$.
I want to create the space of Modular Symbols
> ModularSymbols(eps,2,1)
When I attempt to do so, I receive this error:
> TypeError: No compatible natural embeddings found for Complex Lazy Field and Number Field in a2 with defining polynomial x^4 + 2*x^3 + 2*x^2 + 4*x + 4
What's going on here? For many Dirichlet characters, the Modular Symbol space is created just fine. What's breaking in this case?
2) As a secondary question, is there any way to create the space of modular symbols
> MS=f.modular_symbols()
in such a way that MS has a manin symbol list?JeffHTue, 07 Aug 2012 08:28:47 -0500http://ask.sagemath.org/question/9215/Approximating Periods of Modular Symbols on Weight Two Modular Formshttp://ask.sagemath.org/question/28721/approximating-periods-of-modular-symbols-on-weight-two-modular-forms/A modular symbol corresponds to an element of homology on a modular curve (relative to the cusps) and a weight two modular form corresponds to a holomorphic one-form. Given a modular symbol and a weight two modular form, how can I approximate the integral of the modular form over the relative cycle corresponding to the modular symbol?
An example (which fails to work) is the following:
f = Newforms(Gamma0(23), 2, names='a')[0];
M = ModularSymbols(23,2);
H = M.basis();
gamma = H[0];
f.period(gamma)Paul ApisaWed, 29 Jul 2015 18:28:14 -0500http://ask.sagemath.org/question/28721/How would you go about computing special values of L-functions attached to modular form, twisted by a Dirichlet character?http://ask.sagemath.org/question/26488/how-would-you-go-about-computing-special-values-of-l-functions-attached-to-modular-form-twisted-by-a-dirichlet-character/ there seems to be no package, although this should be one of the basic features that SAGE provides.314159265358979Fri, 10 Apr 2015 16:33:34 -0500http://ask.sagemath.org/question/26488/Newforms and basis of new subspace [explanation]http://ask.sagemath.org/question/25132/newforms-and-basis-of-new-subspace-explanation/ Hi,
I am new to Sage and modular forms. I have some conceptual questions.
When I write
sage: S = CuspForms(Gamma0(55),2,prec=14)
sage: S.new_subspace().basis()
[
q + 2*q^3 - 2*q^5 - 4*q^6 - 3*q^7 + 5*q^8 + 9*q^9 - q^10 + 2*q^11 - 10*q^12 - 9*q^13 + O(q^14),
q^2 - 2*q^3 + 2*q^5 + 2*q^6 + 2*q^7 - 5*q^8 - 8*q^9 + q^10 - 2*q^11 + 6*q^12 + 8*q^13 + O(q^14),
q^4 - q^5 - 2*q^6 - q^7 + 3*q^8 + 4*q^9 - q^10 + q^11 - 4*q^12 - 3*q^13 + O(q^14)
]
sage: CuspForms(Gamma0(55),2).newforms(names='a')
[q + q^2 - q^4 + q^5 + O(q^6),
q + a1*q^2 + (-2*a1 + 2)*q^3 + (2*a1 - 1)*q^4 - q^5 + O(q^6)]
What is the difference between those 2 and how to find a coefficient of a1?
Can someone tell me how to find newforms for some S_k if the second function is not correct.
Thank you.
LiorThu, 04 Dec 2014 16:12:37 -0600http://ask.sagemath.org/question/25132/Insufficient RAM for computing newformshttp://ask.sagemath.org/question/7711/insufficient-ram-for-computing-newforms/In a Mac OS X, with a 2.5Ghz processor and 4Gb RAM I ran the following lines in Sage:
D = DirichletGroup(20)
g = D[7].extend(1600) # order 4 character
N = Newforms(g,2,names='a')
In two hours the 4Gb were full and it started writing to swap. Is it normal that 4Gb RAM is not enough to perform the above computation? I'm new to Sage (and to the forum) but since Sage tells me that the space
S = ModularSymbols(g,2,sign=1).cuspidal_subspace().new_submodule()
has dim 34 I was expecting it to be within the powers of my computer. Thanks, NunonbfrSat, 25 Sep 2010 08:36:20 -0500http://ask.sagemath.org/question/7711/Trouble verifying modularity propertieshttp://ask.sagemath.org/question/24216/trouble-verifying-modularity-properties/ Hey all,
I'm having a bit of trouble doing some numerical things with modular forms, and I simply can't figure out where I'm going wrong.
The $j$ function should satisfy $j(\gamma \tau) = j(\tau)$ for every $\tau$ in the upper half plane and every $\gamma\in SL_2(\mathbb{Z})$. I wrote some code to numerically compute some values of the $j$ function (there may be a better way to do it for the $j$ function, but I hope to eventually migrate this code to work for other modular forms which I define). Here it is below.
## Starts Laurent series in q
R.<q> = LaurentSeriesRing(QQ)
I = CC.0 # imaginary unit
precision = 75
##evaluates a function using its q-expansion
def evaluate(f,z):
result = 0
coeffs = f.coefficients()
exps = f.exponents()
for i in range(0,len(coeffs)):
result = result + coeffs[i]*z^(exps[i])
return result
## computes the action of a member of the modular group on tau in the upper half plane
def action(gamma,tau):
return ((gamma[0]*tau + gamma[1])/(gamma[2]*tau + gamma[3]))
## Produce Eisenstein series with specified weight and precision of q-expansion
def eis(weight,precision):
t = EisensteinForms(1,weight)
t.set_precision(precision)
t = t.eisenstein_series()
e = t[0].q_expansion()
return e*(1/e.list()[0])
## gives you q which corresponds to tau
def qt(tau):
return exp(2*pi*I*tau)
## Defining delta cusp form
delta = CuspForms(1,12).0
delta = delta.q_expansion(precision)
# Computes j function
g2 = 60*eis(4,precision)/240
j = 1728*g2^3/(27*delta)
Now when I run the following code:
tau = 1+I
gamma = [3,-1,4,-1]
print(evaluate(j,qt(tau)).n()) #j(tau)
print(evaluate(j,qt(action(gamma,tau))).n()) #j(gamma tau)
the values $j(\tau)$ and $j(\gamma\tau)$ are not equal! I would appreciate any help.
brandonrayhaunFri, 19 Sep 2014 18:52:37 -0500http://ask.sagemath.org/question/24216/<repr(<sage.modular.modform.element.Newform at 0x7f0c8fa15c30>) failed: IndexError: list index out of range>],http://ask.sagemath.org/question/23528/reprsagemodularmodformelementnewform-at-0x7f0c8fa15c30-failed-indexerror-list-index-out-of-range/ M11=ModularForms(11,2,base_ring=Qp(7,10));show(M11.modular_symbols()),show(M11),M11.level(),M11.weight(),M11.character(),M11.dimension(),M11.group().order(),M11.group().gens(),M11.newforms(),M11.free_module(),show(M11.hecke_module_of_level(1)),
1
why \QQ7 is red?maybe 7-adic field Op7?
2
free_module is error.
<repr(<sage.modular.modform.element.Newform at 0x7f0c8fa15c30>) failed: IndexError: list index out of range>],cjshTue, 22 Jul 2014 07:08:39 -0500http://ask.sagemath.org/question/23528/Computing the dimensions of spaces of modular & cusp formshttp://ask.sagemath.org/question/11043/computing-the-dimensions-of-spaces-of-modular-cusp-forms/In OEIS [A159634](http://oeis.org/A159634) Steven Finch gave the following
MAGMA snippet to compute the
*coefficient for dimensions of spaces of modular & cusp forms of weight k/2, level 4n and trivial character, where k >= 5 is odd.*
[[4*n, (Dimension(HalfIntegralWeightForms(4*n, 7/2)) +
Dimension(CuspidalSubspace(HalfIntegralWeightForms(4*n, 5/2))))/2]:n in [1..70]];
*How can this sequence be computed with Sage?*
Note that this question is related to a [conjecture](http://math.stackexchange.com/q/677949/129098) of Enrique Pérez Herrero.
Peter LuschnySat, 15 Feb 2014 23:55:24 -0600http://ask.sagemath.org/question/11043/is there a method to draw fundamental domain for ? 0(N)\Gamma_0(N)http://ask.sagemath.org/question/10924/is-there-a-method-to-draw-fundamental-domain-for-0ngamma_0n/Modular Forms,many half circle and colourfulcjshWed, 15 Jan 2014 23:55:46 -0600http://ask.sagemath.org/question/10924/Can I compute with newforms OEIS A116418 Expansion of a newform level 18 weight 3 and character [3]?http://ask.sagemath.org/question/8543/can-i-compute-with-newforms-oeis-a116418-expansion-of-a-newform-level-18-weight-3-and-character-3/Can I compute with newforms [OEIS A116418 Expansion of a newform level 18 weight 3 and character [3]](http://oeis.org/A116418)
Read the documentation but couldn't find how to describe the newform.
Using pari and the generating function I can compute it, but am interested in the newform method.joroTue, 13 Dec 2011 02:43:03 -0600http://ask.sagemath.org/question/8543/Bug in Atkin Lehner involution for weight 3 forms?http://ask.sagemath.org/question/9492/bug-in-atkin-lehner-involution-for-weight-3-forms/I tried the following example in SAGE
G = DirichletGroup(15)
x=G.gens()
M=ModularForms(x[0]*x[1]^2,3);
S=M.cuspidal_submodule();
f1=S.newforms()[0]
f1.atkin_lehner_eigenvalue()
and got an error saying that the subspace was not invariant! The same happened while trying to compute the L-series, and for level 35 for example. Is this a bug?
arielThu, 01 Nov 2012 09:40:28 -0500http://ask.sagemath.org/question/9492/Abelian varieties attached to modular formshttp://ask.sagemath.org/question/9252/abelian-varieties-attached-to-modular-forms/Hello!
I have two questions:
1. How to compute the Mordell-Weil rank of an abelian variety attached to a moduar form?
2. How to factor a Q-simple abelian variety attached to a modular form into elliptic curves over a number field.
Thank you!JeonSat, 18 Aug 2012 03:06:59 -0500http://ask.sagemath.org/question/9252/hecke_operator_on_basishttp://ask.sagemath.org/question/8512/hecke_operator_on_basis/I am absolutely no expert in sage, and I know next to nothing about Python, so
I apologize if my question is stupid or ill-formulated (and even if it so, I am likely to learn something
from any answer).
I am puzzled by the following: I have a list B of q-expansions of modular forms over GF(2),
which is a basis of a space of modular forms stable by the Hecke operators,
and a list B' which contains the same elements as B but in a different order.
I am trying to compute the matrix of the Hecke operator T_3 in the basis B and B', using
hecke_operator_on_basis(B,3,2) and the same with B'. I get a correct answer for B and an error message for B'. How is that possible? I suspect that it is a question of degree of precision,
but what exactly is happening here? Please see http://www.sagenb.org/home/pub/3733 for
a concrete example.
Thanks
Joel B.Sat, 26 Nov 2011 12:04:48 -0600http://ask.sagemath.org/question/8512/