CoCalc Public FilesSageMath demo, part 2.ipynb
Author: Peter Bruin
Views : 54

# SageMath/CoCalc demo, part 2

In [1]:
%display latex


## Newforms

In [2]:
S = CuspForms(Gamma1(15), 2); S

$\verb|Cuspidal|\phantom{\verb!x!}\verb|subspace|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|dimension|\phantom{\verb!x!}\verb|1|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|Modular|\phantom{\verb!x!}\verb|Forms|\phantom{\verb!x!}\verb|space|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|dimension|\phantom{\verb!x!}\verb|16|\phantom{\verb!x!}\verb|for|\phantom{\verb!x!}\verb|Congruence|\phantom{\verb!x!}\verb|Subgroup|\phantom{\verb!x!}\verb|Gamma1(15)|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|weight|\phantom{\verb!x!}\verb|2|\phantom{\verb!x!}\verb|over|\phantom{\verb!x!}\verb|Rational|\phantom{\verb!x!}\verb|Field|$
In [3]:
NF = S.newforms(); NF

$\left[q - q^{2} - q^{3} - q^{4} + q^{5} + O(q^{6})\right]$
In [4]:
Newforms(Gamma1(15), 2) == NF

$\mathrm{True}$
In [5]:
Newforms(Gamma0(26), 2)

$\left[q - q^{2} + q^{3} + q^{4} - 3q^{5} + O(q^{6}), q + q^{2} - 3q^{3} + q^{4} - q^{5} + O(q^{6})\right]$
In [8]:
NF = Newforms(Gamma1(26), 2, names='a')

In [9]:
[f.character() for f in NF]

In [10]:
S = CuspForms(Gamma1(26), 2)

In [11]:
Sold = S.old_submodule(); Sold

$\verb|Modular|\phantom{\verb!x!}\verb|Forms|\phantom{\verb!x!}\verb|subspace|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|dimension|\phantom{\verb!x!}\verb|4|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|Modular|\phantom{\verb!x!}\verb|Forms|\phantom{\verb!x!}\verb|space|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|dimension|\phantom{\verb!x!}\verb|33|\phantom{\verb!x!}\verb|for|\phantom{\verb!x!}\verb|Congruence|\phantom{\verb!x!}\verb|Subgroup|\phantom{\verb!x!}\verb|Gamma1(26)|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|weight|\phantom{\verb!x!}\verb|2|\phantom{\verb!x!}\verb|over|\phantom{\verb!x!}\verb|Rational|\phantom{\verb!x!}\verb|Field|$
In [12]:
Snew = S.new_submodule(); Snew

$\verb|Modular|\phantom{\verb!x!}\verb|Forms|\phantom{\verb!x!}\verb|subspace|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|dimension|\phantom{\verb!x!}\verb|6|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|Modular|\phantom{\verb!x!}\verb|Forms|\phantom{\verb!x!}\verb|space|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|dimension|\phantom{\verb!x!}\verb|33|\phantom{\verb!x!}\verb|for|\phantom{\verb!x!}\verb|Congruence|\phantom{\verb!x!}\verb|Subgroup|\phantom{\verb!x!}\verb|Gamma1(26)|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|weight|\phantom{\verb!x!}\verb|2|\phantom{\verb!x!}\verb|over|\phantom{\verb!x!}\verb|Rational|\phantom{\verb!x!}\verb|Field|$
In [13]:
NF

$\left[q - q^{2} + q^{3} + q^{4} - 3q^{5} + O(q^{6}), q + q^{2} - 3q^{3} + q^{4} - q^{5} + O(q^{6}), q + a_{2}q^{2} + \left(-a_{2} - 1\right)q^{4} - q^{5} + O(q^{6}), q + a_{3}q^{2} - q^{3} - q^{4} - 3 a_{3}q^{5} + O(q^{6})\right]$
In [14]:
[f.base_ring() for f in NF]

$\left[\Bold{Q}, \Bold{Q}, \Bold{Q}[a_{2}]/(a_{2}^{2} + a_{2} + 1), \Bold{Q}[a_{3}]/(a_{3}^{2} + 1)\right]$

## $L$-functions

In [15]:
f = Newforms(Gamma1(14), 2)[0]; f

$q - q^{2} - 2q^{3} + q^{4} + O(q^{6})$
In [16]:
Lf = f.lseries(); Lf

$\verb|L-series|\phantom{\verb!x!}\verb|associated|\phantom{\verb!x!}\verb|to|\phantom{\verb!x!}\verb|the|\phantom{\verb!x!}\verb|cusp|\phantom{\verb!x!}\verb|form|\phantom{\verb!x!}\verb|q|\phantom{\verb!x!}\verb|-|\phantom{\verb!x!}\verb|q^2|\phantom{\verb!x!}\verb|-|\phantom{\verb!x!}\verb|2*q^3|\phantom{\verb!x!}\verb|+|\phantom{\verb!x!}\verb|q^4|\phantom{\verb!x!}\verb|+|\phantom{\verb!x!}\verb|O(q^6)|$
In [17]:
Lf(3)

$0.826125962101783$
In [18]:
Lf(3+2*I)

$0.995825161298581 + 0.180645100106889i$
In [19]:
Lf(-2-I)

$1.25737321267029 - 0.432187040382323i$
In [20]:
Lf.poles

$\left[\right]$
In [21]:
[Lf(s) for s in [-4..-1]]

$\left[0.000000000000000, 0.000000000000000, 0.000000000000000, 0.000000000000000\right]$
In [23]:
[Lf.eps, Lf.conductor, Lf.weight]

$\left[1.00000000000000, 14, 2\right]$
In [24]:
def Lambda(L, s):
return gamma(s)*L.conductor^(s/2)/(2*pi.n())^s * L(s)


In [25]:
s = 1.345093824 + 0.23492834*I
[Lambda(Lf, s), Lambda(Lf, 2-s)]

$\left[0.198445970814429 + 0.00471005116198735i, 0.198445970814429 + 0.00471005116198735i\right]$
In [26]:
Lf.check_functional_equation()

$-1.68051336735253 \times 10^{-18}$
In [27]:
g = Newforms(Gamma1(16), 2, names='a')[0]
g

$q + a_{0}q^{2} + \left(-a_{0} - 2\right)q^{3} + \left(-2 a_{0} - 2\right)q^{4} + a_{0}q^{5} + O(q^{6})$
In [28]:
g.base_ring()

$\Bold{Q}[a_{0}]/(a_{0}^{2} + 2 a_{0} + 2)$
In [29]:
g.base_ring().discriminant()

$-4$
In [30]:
Lg = g.lseries()

In [31]:
Lgstar = g.lseries(embedding=1)

In [32]:
(Lg.eps, Lgstar.eps)

$\left(0.923879532511287 - 0.382683432365090i, 0.923879532511287 + 0.382683432365090i\right)$
In [33]:
Lg.conductor

$16$
In [34]:
Lgstar.conductor

$16$
In [35]:
s = 0.4203498 + 0.2340982*I
Lambda(Lg, 2 - s), Lg.eps * Lambda(Lgstar, s)

$\left(0.242483842563046 - 0.0499149402198870i, 0.242483842563046 - 0.0499149402198868i\right)$
In [36]:
Lg.check_functional_equation()

$-1.28423747330908 \times 10^{-16} + 6.45303580536216 \times 10^{-17}i$

## Elliptic curves

In [37]:
EllipticCurve([0,0,0,12,294])

$y^2 = x^{3} + 12 x + 294$
In [38]:
E = EllipticCurve('37a1'); E

$y^2 + y = x^{3} - x$
In [39]:
f = E.newform(); f

$q - 2q^{2} - 3q^{3} + 2q^{4} - 2q^{5} + O(q^{6})$
In [40]:
LE = E.lseries(); LE

$\verb|Complex|\phantom{\verb!x!}\verb|L-series|\phantom{\verb!x!}\verb|of|\phantom{\verb!x!}\verb|the|\phantom{\verb!x!}\verb|Elliptic|\phantom{\verb!x!}\verb|Curve|\phantom{\verb!x!}\verb|defined|\phantom{\verb!x!}\verb|by|\phantom{\verb!x!}\verb|y^2|\phantom{\verb!x!}\verb|+|\phantom{\verb!x!}\verb|y|\phantom{\verb!x!}\verb|=|\phantom{\verb!x!}\verb|x^3|\phantom{\verb!x!}\verb|-|\phantom{\verb!x!}\verb|x|\phantom{\verb!x!}\verb|over|\phantom{\verb!x!}\verb|Rational|\phantom{\verb!x!}\verb|Field|$
In [41]:
f.lseries()

$\verb|L-series|\phantom{\verb!x!}\verb|associated|\phantom{\verb!x!}\verb|to|\phantom{\verb!x!}\verb|the|\phantom{\verb!x!}\verb|cusp|\phantom{\verb!x!}\verb|form|\phantom{\verb!x!}\verb|q|\phantom{\verb!x!}\verb|-|\phantom{\verb!x!}\verb|2*q^2|\phantom{\verb!x!}\verb|-|\phantom{\verb!x!}\verb|3*q^3|\phantom{\verb!x!}\verb|+|\phantom{\verb!x!}\verb|2*q^4|\phantom{\verb!x!}\verb|-|\phantom{\verb!x!}\verb|2*q^5|\phantom{\verb!x!}\verb|+|\phantom{\verb!x!}\verb|O(q^6)|$
In [42]:
s = 1.293847 + 3.234098*I

In [ ]:


In [44]:
[LE(s), f.lseries()(s)]

$\left[2.83506617044792 + 0.872802121461768i, 2.83506617044792 + 0.872802121461768i\right]$
In [45]:
E.rank()

$1$
In [46]:
E.torsion_subgroup()

$0$
In [47]:
LE(1)

$0.000000000000000$
In [48]:
LE.at1()

$\left(0.0000000, 0.000000\right)$
In [49]:
LE.deriv_at1()

$\left(0.3059866, 0.000801045\right)$
In [50]:
E.analytic_rank()

$1$
In [ ]: