$\DeclareMathOperator{\lcm}{lcm} \newcommand{\mt}[4]{\begin{bmatrix}#1&#2\\#3&#4\end{bmatrix}} \newcommand{\Set}[1]{\left\{#1\right\}} \newcommand{\SetDef}[2]{\Set{{#1}\left|\,\vphantom{#1}{#2}\right.}} \newcommand{\abs}[1]{\left\lvert#1\right\rvert} \newcommand{\setQ}{\mathbb{Q}} $ Via jupytext this file can be shown as a jupyter notebook.

Deriving the Relation between $j$ and $\lambda$¶

This file derives the equation \begin{align*} j(\tau) &= \frac{256 (1 - \lambda(\tau) + \lambda(\tau)^2)^3} {\lambda(\tau)^2 (1 - \lambda(\tau))^2} \end{align*} between the Klein $j$ invariant and the modular $\lambda$ function by using their $q$-expansions ($q=e^{\pi i \tau}$) at the cusps of $\Gamma(2)$ and applying the multi-samba algorithm to them.

\begin{align*} \lambda(\tau) &= \frac{16 \eta\left(\frac{\tau}{2}\right)^8 \eta(2\tau)^{16}} {\eta(\tau)^{24}} \\ j(\tau) &= \left( \left(\frac{\eta(\tau)}{\eta(2\tau)}\right)^8 + 2^8 \left(\frac{\eta(2\tau)}{\eta(\tau)}\right)^{16} \right)^3 \end{align*} https://fungrim.org/topic/Modular_j-invariant/#Connection_formulas

https://fungrim.org/topic/Modular_lambda_function/#Dedekind_eta_function_representations

https://fungrim.org/topic/Modular_lambda_function/#Connection_to_the_j-invariant

In [1]:
)cd ..
)read input/jfricas-test-support.input )quiet
The current FriCAS default directory is /home/hemmecke/backup/git/qeta 
All user variables and function definitions have been cleared.
All )browse facility databases have been cleared.
Internally cached functions and constructors have been cleared.
 )clear completely is finished.
The current FriCAS default directory is /home/hemmecke/backup/git/qeta/tmp 

We want to show the variable lambda nicely in the output, so we translate any symbol lambda into the TeX-expression \lambda. That is just technical boilerplate.

In [2]:
setHandler!(operatorHandlers()$FormatMathJax, 0 ,_
            "lambda", formatConstant("\lambda")$FormatMathJax)_
  $ OperatorHandlers((Integer, List OutputForm) -> OutputBox);

Do no execute the following if you are in a jFriCAS notebook.

In [ ]:
)set output formatted off
)set output algebra on
In [ ]:
-------------------------------------------------------------------
--test:modular-equation-j-lambda
-------------------------------------------------------------------

Setting up the stage¶

At the expansions we can work with rational numbers. The following is currently the way to set this up in QEta.

In [3]:
)read convenience )quiet
C ==> QQ
xiord := 2;
EXTENDEDCOEFFICIENTRING(C, xiord, CX, xi);

The cusps and corresponding transformation matrices of $\Gamma(2)$. We have chosen here to work with expansions at the cusps in the order $\infty , 0, 1$. Any other order of the cusps does work with MultiSamba, but, of course, the basis may look different, since the reduction steps may be different. Nevertheless, the modular polynomial does, of course, not depend on which cusp order is chosen for MultiSamba.

In [4]:
spitzen := cusps()$GAMMAN(2);
spitzen := [spitzen.i for i in [3,1,2]]
Out[4]:
\[ \left[\infty , 0, 1\right] \]
In [5]:
trfs := [cuspToMatrix(x)$GAMMAN(2) for x in spitzen]
Out[5]:
\[ \left[\begin{bmatrix}1&0\\0&1\end{bmatrix}, \begin{bmatrix}0&-1\\1&0\end{bmatrix}, \begin{bmatrix}1&-1\\1&0\end{bmatrix}\right] \]

Expansion of $j(\tau)$ at the cusps of $\Gamma(2)$ in terms of $q=e^{\pi i \tau}$.

In [6]:
jinf := multiplyExponents(kleinJInvariant()$QFunctions(C, L1 C), 2)
Out[6]:
\[ {q}^{-2}+744+196884\, {q}^{2}+21493760\, {q}^{4}+864299970\, {q}^{6}+20245856256\, {q}^{8}+O\left({q}^{9}\right) \]

Note that the expansions of $j(\tau)$ at all cusps are identical, i.e., $j_\infty=j_0=j_1$.

In [7]:
htj := table()$XHashTable(SL2Z, L1 C);
for gamma in trfs repeat htj.gamma := jinf
j := htj :: An(C);

Expansion of $\lambda(\tau)$ at the cusps of $\Gamma(2)$ in terms of $q=e^{\pi i \tau}$.

In [8]:
RFC ==> Fraction SparseUnivariatePolynomial C -- rational function over C
QMLTOOL ==> QEtaModularLambdaTools
transformLambda(gamma) ==> _
  transformAtModularLambda(x::RFC, gamma, unitSL2Z, 1)$QMLTOOL(C)
htl := table()$XHashTable(SL2Z, L1 C);
for gamma in trfs repeat htl.gamma  := transformLambda(gamma)
l := htl :: An(C)
Out[8]:
\[ \left[16\, q-128\, {q}^{2}+704\, {q}^{3}-3072\, {q}^{4}+11488\, {q}^{5}-38400\, {q}^{6}+117632\, {q}^{7}-335872\, {q}^{8}+904784\, {q}^{9}-2320128\, {q}^{10}+5702208\, {q}^{11}+O\left({q}^{12}\right), 1-16\, q+128\, {q}^{2}-704\, {q}^{3}+3072\, {q}^{4}-11488\, {q}^{5}+38400\, {q}^{6}-117632\, {q}^{7}+335872\, {q}^{8}-904784\, {q}^{9}+2320128\, {q}^{10}+O\left({q}^{11}\right), -\frac{1}{16}\, {q}^{-1}+\frac{1}{2}-\frac{5}{4}\, q+\frac{31}{8}\, {q}^{3}-\frac{27}{2}\, {q}^{5}+\frac{641}{16}\, {q}^{7}-\frac{409}{4}\, {q}^{9}+O\left({q}^{10}\right)\right] \]

Compute $p(j,\lambda)=0$ with the function call "modularPolynomial"¶

The easiest way in QEta to compute a modular polynomial is by calling a specially tailored function from the package QEtaModularEquation.

In [9]:
mp := modularPolynomial([j,l]) $ QEtaModularEquation(C, An C)
Out[9]:
\[ {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}-3\, y+1 \]

In the above polynomial $x$ appears only with exponent 1. So we can solve for $x$ and get the following.

In [10]:
sol := solve(mp,x)
Out[10]:
\[ \left[x=\frac{256\, {y}^{6}-768\, {y}^{5}+1536\, {y}^{4}-1792\, {y}^{3}+1536\, {y}^{2}-768\, y+256}{{y}^{4}-2\, {y}^{3}+{y}^{2}}\right] \]

Written in a nicer form it gives the known representation of $j$ in terms of $\lambda$.

In [11]:
symj := "j"::Symbol;
symlambda := "lambda"::Symbol;
ratfun := rhs(sol.1);
symj = factor(eval(numer ratfun, y=symlambda))_
       / _
       factor(eval(denom ratfun, y=symlambda))
Out[11]:
\[ j=\frac{256\, {\left({\lambda}^{2}-\lambda+1\right)}^{3}}{{\left(\lambda-1\right)}^{2}\, {\lambda}^{2}} \]
In [12]:
assertEquals(ratfun, 256*(1 - y + y^2)^3 / (y*(1-y))^2)
Out[12]:
\[ \texttt{true} \]

Let's check whether our series j and l really fulfil the relation for all cusps of $\Gamma(2)$.

In [13]:
e := 1$An(C); -- that is [1,1,1]
z := j*(l*(e - l))^2 - 256*(e - l + l^2)^3
assertTrue(zero? z)
Out[13]:
\[ \left[O\left({q}^{21}\right), O\left({q}^{21}\right), O\left({q}^{15}\right)\right] \]
Out[13]:
\[ \texttt{true} \]

We can also just replace the variables of mp by the respective vectors of $q$-expansions at the cusps.

In [14]:
zz := eval(mp, c+->c*1$An(C),[x,y],[j,l])$PolynomialEvaluation(C, An C)
assertTrue(zero? zz)
Out[14]:
\[ \left[O\left({q}^{21}\right), O\left({q}^{21}\right), O\left({q}^{21}\right)\right] \]
Out[14]:
\[ \texttt{true} \]

Compute $p(j,\lambda)=0$ with MultiSamba and an additional reduction¶

Above we used a variant of multisamba that was specifically tailored for the computation of a relation between two modular functions. In this section, we determine the modular polynomial of two modular function with the multisamba algorithm that computes a module basis for the input.

This is a two step process.

  1. Determine $B=\{b_0,b_1,\ldots,b_5\}$ such that \begin{gather*} \setQ[j,\lambda]=\langle B \rangle_{\setQ[j]}, \end{gather*}
  2. then reduce $\lambda^6$ by $j$ and $B$ to 0 and extract from this reduction a representation of $\lambda^6$ in terms of the basis elements.

Since each basis element has a representation in terms of $j$ and $\lambda$, we eventually get the modular polynomial such that $p(j,\lambda)=0$.

There is some boilerplate to setup the input and the respective types for multisamba to work.

In [15]:
Xn C ==> QEtaExtendedAlgebra(C, An C, Polynomial C)
toXn(C, a, b) ==> embed(a, b::Polynomial(C))$Xn(C)
xnPol(C, x) ==> second x -- extract the polynomial part from x
xj := toXn(C, j, "x"::Symbol)
xl := toXn(C, l, "y"::Symbol)
Out[15]:
\[ \left[\left[{q}^{-2}+744+196884\, {q}^{2}+21493760\, {q}^{4}+864299970\, {q}^{6}+20245856256\, {q}^{8}+O\left({q}^{9}\right), {q}^{-2}+744+196884\, {q}^{2}+21493760\, {q}^{4}+864299970\, {q}^{6}+20245856256\, {q}^{8}+O\left({q}^{9}\right), {q}^{-2}+744+196884\, {q}^{2}+21493760\, {q}^{4}+864299970\, {q}^{6}+20245856256\, {q}^{8}+O\left({q}^{9}\right)\right], x\right] \]
Out[15]:
\[ \left[\left[16\, q-128\, {q}^{2}+704\, {q}^{3}-3072\, {q}^{4}+11488\, {q}^{5}-38400\, {q}^{6}+117632\, {q}^{7}-335872\, {q}^{8}+904784\, {q}^{9}-2320128\, {q}^{10}+5702208\, {q}^{11}+O\left({q}^{12}\right), 1-16\, q+128\, {q}^{2}-704\, {q}^{3}+3072\, {q}^{4}-11488\, {q}^{5}+38400\, {q}^{6}-117632\, {q}^{7}+335872\, {q}^{8}-904784\, {q}^{9}+2320128\, {q}^{10}+O\left({q}^{11}\right), -\frac{1}{16}\, {q}^{-1}+\frac{1}{2}-\frac{5}{4}\, q+\frac{31}{8}\, {q}^{3}-\frac{27}{2}\, {q}^{5}+\frac{641}{16}\, {q}^{7}-\frac{409}{4}\, {q}^{9}+O\left({q}^{10}\right)\right], y\right] \]
In [16]:
xab := samba([xj, xl]) $ QMSAMBA(C,Xn,QMRED);
bas := basis xab;
# bas
Out[16]:
\[ 5 \]

The variable xab represents $\langle B \rangle_{\setQ[j]}$.

The computation does not take long and yields the following basis elements. Note that $1$ is silently assumed to be in the bases, but multisamba does not compute or show it explicitly.

In [17]:
bas.1
Out[17]:
\[ \left[\left[-\frac{1}{16}\, {q}^{-1}+\frac{5}{2}-\frac{5}{4}\, q+\frac{31}{8}\, {q}^{3}-\frac{27}{2}\, {q}^{5}+\frac{641}{16}\, {q}^{7}-\frac{409}{4}\, {q}^{9}+O\left({q}^{10}\right), 2-16\, q-128\, {q}^{2}-704\, {q}^{3}-3072\, {q}^{4}-11488\, {q}^{5}-38400\, {q}^{6}-117632\, {q}^{7}-335872\, {q}^{8}-904784\, {q}^{9}-2320128\, {q}^{10}+O\left({q}^{11}\right), 3+16\, q+128\, {q}^{2}+704\, {q}^{3}+3072\, {q}^{4}+11488\, {q}^{5}+38400\, {q}^{6}+117632\, {q}^{7}+335872\, {q}^{8}+904784\, {q}^{9}+2320128\, {q}^{10}+O\left({q}^{11}\right)\right], {y}^{5}-3\, {y}^{4}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{3}+\left(\frac{1}{128}\, x-7\right)\, {y}^{2}+\left(-\frac{1}{256}\, x+6\right)\, y\right] \]
In [18]:
bas.2
Out[18]:
\[ \left[\left[\frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{69}{4}\, q+128\, {q}^{2}+\frac{5601}{8}\, {q}^{3}+3072\, {q}^{4}+\frac{23003}{2}\, {q}^{5}+38400\, {q}^{6}+\frac{1881471}{16}\, {q}^{7}+335872\, {q}^{8}+\frac{3619545}{4}\, {q}^{9}+O\left({q}^{10}\right), \frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{69}{4}\, q+128\, {q}^{2}+\frac{5601}{8}\, {q}^{3}+3072\, {q}^{4}+\frac{23003}{2}\, {q}^{5}+38400\, {q}^{6}+\frac{1881471}{16}\, {q}^{7}+335872\, {q}^{8}+\frac{3619545}{4}\, {q}^{9}+O\left({q}^{10}\right), -3-256\, {q}^{2}-6144\, {q}^{4}-76800\, {q}^{6}-671744\, {q}^{8}-4640256\, {q}^{10}+O\left({q}^{11}\right)\right], {y}^{4}-2\, {y}^{3}+\left(-\frac{1}{256}\, x+4\right)\, {y}^{2}+\left(\frac{1}{256}\, x-3\right)\, y\right] \]
In [19]:
bas.3
Out[19]:
\[ \left[\left[\frac{1}{256}\, {q}^{-2}-\frac{1}{16}\, {q}^{-1}+\frac{109}{32}-\frac{197}{4}\, q+\frac{41029}{64}\, {q}^{2}-\frac{16865}{8}\, {q}^{3}+15352\, {q}^{4}-\frac{68955}{2}\, {q}^{5}+\frac{24581601}{128}\, {q}^{6}-\frac{5645695}{16}\, {q}^{7}+1679168\, {q}^{8}+O\left({q}^{9}\right), \frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{261}{4}\, q-256\, {q}^{2}+\frac{55265}{8}\, {q}^{3}+26624\, {q}^{4}+\frac{648987}{2}\, {q}^{5}+1496064\, {q}^{6}+\frac{143449471}{16}\, {q}^{7}+37863424\, {q}^{8}+\frac{676521625}{4}\, {q}^{9}+O\left({q}^{10}\right), \frac{1}{4}\, {q}^{-1}+1+53\, q+384\, {q}^{2}+\frac{12385}{2}\, {q}^{3}+41984\, {q}^{4}+313046\, {q}^{5}+1688064\, {q}^{6}+\frac{35391359}{4}\, {q}^{7}+39542784\, {q}^{8}+168225929\, {q}^{9}+O\left({q}^{10}\right)\right], {y}^{3}-2\, {y}^{2}-\frac{1}{256}\, x\, y+\frac{1}{256}\, x\right] \]
In [20]:
bas.4
Out[20]:
\[ \left[\left[-\frac{1}{256}\, {q}^{-2}-\frac{93}{32}-\frac{32837}{64}\, {q}^{2}-4096\, {q}^{3}-45048\, {q}^{4}-278528\, {q}^{5}-\frac{220992993}{128}\, {q}^{6}-8495104\, {q}^{7}-39878464\, {q}^{8}+O\left({q}^{9}\right), -\frac{1}{256}\, {q}^{-2}-\frac{61}{32}-32\, q-\frac{16453}{64}\, {q}^{2}-5504\, {q}^{3}-38904\, {q}^{4}-301504\, {q}^{5}-\frac{211162593}{128}\, {q}^{6}-8730368\, {q}^{7}-39206720\, {q}^{8}+O\left({q}^{9}\right), -\frac{1}{16}\, {q}^{-1}-\frac{5}{2}-\frac{5}{4}\, q-768\, {q}^{2}+\frac{31}{8}\, {q}^{3}-83968\, {q}^{4}-\frac{27}{2}\, {q}^{5}-3376128\, {q}^{6}+\frac{641}{16}\, {q}^{7}-79085568\, {q}^{8}-\frac{409}{4}\, {q}^{9}+O\left({q}^{10}\right)\right], {y}^{2}-\frac{1}{256}\, x\right] \]
In [21]:
bas.5
Out[21]:
\[ \left[\left[16\, q-128\, {q}^{2}+704\, {q}^{3}-3072\, {q}^{4}+11488\, {q}^{5}-38400\, {q}^{6}+117632\, {q}^{7}-335872\, {q}^{8}+904784\, {q}^{9}-2320128\, {q}^{10}+5702208\, {q}^{11}+O\left({q}^{12}\right), 1-16\, q+128\, {q}^{2}-704\, {q}^{3}+3072\, {q}^{4}-11488\, {q}^{5}+38400\, {q}^{6}-117632\, {q}^{7}+335872\, {q}^{8}-904784\, {q}^{9}+2320128\, {q}^{10}+O\left({q}^{11}\right), -\frac{1}{16}\, {q}^{-1}+\frac{1}{2}-\frac{5}{4}\, q+\frac{31}{8}\, {q}^{3}-\frac{27}{2}\, {q}^{5}+\frac{641}{16}\, {q}^{7}-\frac{409}{4}\, {q}^{9}+O\left({q}^{10}\right)\right], y\right] \]

The pole orders of the input and the basis elements is given by the following list.

In [22]:
[qetaGrades x for x in concat([xj,xl],bas)]
Out[22]:
\[ \left[\left[2, 2, 2\right], \left[-1, 0, 1\right], \left[1, 0, 0\right], \left[1, 1, 0\right], \left[2, 1, 1\right], \left[2, 2, 1\right], \left[-1, 0, 1\right]\right] \]

Now we reduce to 0 a high enough power of the lambda function by the algebra basis. Since the highest power of $\lambda$ occuring in the representation of the basis is 5, reducing $\lambda^6$ is enough.

Reduction of $\lambda$ modulo $j$ and the basis only gives a the trivial polynomial 0 in the "representation component". That is not useful.

In [23]:
xr := reduce(xl, xab)$QMRED(C,Xn)
mp1 := xnPol(C,xr)
Out[23]:
\[ \left[\left[O\left({q}^{22}\right), O\left({q}^{21}\right), O\left({q}^{20}\right)\right], 0\right] \]
Out[23]:
\[ 0 \]

Also reduction of $\lambda^k$ for $k=2,3,4,5$ finds no relation.

In [24]:
[reduce(xl^k, xab)$QMRED(C,Xn) for k in [2,3,4,5]]
Out[24]:
\[ \left[\left[\left[O\left({q}^{19}\right), O\left({q}^{19}\right), O\left({q}^{20}\right)\right], 0\right], \left[\left[O\left({q}^{19}\right), O\left({q}^{20}\right), O\left({q}^{20}\right)\right], 0\right], \left[\left[O\left({q}^{20}\right), O\left({q}^{20}\right), O\left({q}^{21}\right)\right], 0\right], \left[\left[O\left({q}^{20}\right), O\left({q}^{21}\right), O\left({q}^{21}\right)\right], 0\right]\right] \]

However, reducing $\lambda^6$ is enough.

In [25]:
xr := reduce(xl^6, xab)$QMRED(C,Xn)
mp2 := xnPol(C,xr)
Out[25]:
\[ \left[\left[O\left({q}^{21}\right), O\left({q}^{21}\right), O\left({q}^{21}\right)\right], {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}-3\, y+1\right] \]
Out[25]:
\[ {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}-3\, y+1 \]

The polynomial mp2 equals modular polynomial mp from above.

In [26]:
assertEquals(mp2, mp)
Out[26]:
\[ \texttt{true} \]

In the following we demonstrate the reduction steps that QEta is actually doing in the command reduce(xl^6, xab)$QMRED(C,Xn) from above. We only perform here the reduction on the series vectors and hide the "representation part".

From the pole orders of the expansion of $\lambda^6$, we see that the first reduction step will be done with $j$. Let us compute in terms of the basis elements, how the reduction proceeds.

In [27]:
)set stream calc 1
bs := [first x for x in bas];
b0:=1$An(C);b1:=bs.1;b2:=bs.2;b3:=bs.3;b4:=bs.4;b5:=bs.5;
[qetaGrades x for x in [j, l, l^6]]
[qetaGrades x for x in bs]
Out[27]:
\[ \left[\left[2, 2, 2\right], \left[-1, 0, 1\right], \left[-6, 0, 6\right]\right] \]
Out[27]:
\[ \left[\left[1, 0, 0\right], \left[1, 1, 0\right], \left[2, 1, 1\right], \left[2, 2, 1\right], \left[-1, 0, 1\right]\right] \]

To facilitate the notation, let us introduce an abbreviation for the function that extracts the leading coefficient of the $k$-th component.

In [28]:
lc ==> qetaLeadingCoefficient
)set stream calc 6

Looking at the orders of $\lambda^6$, it is clear that the first step is a reduction by $j^3$ in the third component.

In [29]:
qetaGrades(l^6)
Out[29]:
\[ \left[-6, 0, 6\right] \]
In [30]:
r1 := l^6 - lc(l^6,3) * j^3
qetaGrades r1
Out[30]:
\[ \left[-\frac{1}{16777216}\, {q}^{-6}-\frac{279}{2097152}\, {q}^{-4}-\frac{562815}{4194304}\, {q}^{-2}-\frac{21175035}{262144}+O\left({q}^{1}\right), -\frac{1}{16777216}\, {q}^{-6}-\frac{279}{2097152}\, {q}^{-4}-\frac{562815}{4194304}\, {q}^{-2}-\frac{20912891}{262144}+O\left({q}^{1}\right), -\frac{3}{1048576}\, {q}^{-5}-\frac{9}{131072}\, {q}^{-4}-\frac{235}{262144}\, {q}^{-3}-\frac{1029}{8192}\, {q}^{-2}-\frac{30879}{524288}\, {q}^{-1}-\frac{1318645}{16384}-\frac{132945}{131072}\, q+O\left({q}^{2}\right)\right] \]
Out[30]:
\[ \left[6, 6, 5\right] \]

The result must be reduced in the second component. We must choose b4.

In [31]:
r2 := r1 - lc(r1,1)/lc(b4,1) * j^2*b4
qetaGrades r2
Out[31]:
\[ \left[-\frac{1}{256}\, {q}^{-2}+\frac{1}{16}\, {q}^{-1}-\frac{205}{32}+\frac{389}{4}\, q-\frac{294981}{64}\, {q}^{2}+\frac{525281}{8}\, {q}^{3}-1912824\, {q}^{4}+O\left({q}^{5}\right), -\frac{1}{65536}\, {q}^{-4}+\frac{1}{2048}\, {q}^{-3}-\frac{125}{4096}\, {q}^{-2}+\frac{415}{512}\, {q}^{-1}-\frac{211085}{8192}+\frac{508027}{1024}\, q-\frac{9183601}{1024}\, {q}^{2}+O\left({q}^{3}\right), -\frac{1}{524288}\, {q}^{-5}-\frac{1}{32768}\, {q}^{-4}+\frac{71}{131072}\, {q}^{-3}-\frac{117}{2048}\, {q}^{-2}+\frac{228811}{262144}\, {q}^{-1}-\frac{104973}{4096}+\frac{22108837}{65536}\, q+O\left({q}^{2}\right)\right] \]
Out[31]:
\[ \left[2, 4, 5\right] \]

Again, we must reduce in the third component and use the basis element b5.

In [32]:
r3 := r2 - lc(r2,3)/lc(b5,3) * j^2*b5
qetaGrades r3
Out[32]:
\[ \left[-\frac{1}{2048}\, {q}^{-3}-\frac{351}{512}\, {q}^{-1}-\frac{1}{2}-\frac{407163}{1024}\, q-768\, {q}^{2}-\frac{30529511}{256}\, {q}^{3}+O\left({q}^{4}\right), -\frac{3}{65536}\, {q}^{-4}+\frac{1}{1024}\, {q}^{-3}-\frac{327}{4096}\, {q}^{-2}+\frac{399}{256}\, {q}^{-1}-\frac{496295}{8192}+\frac{507387}{512}\, q-\frac{23615331}{1024}\, {q}^{2}+O\left({q}^{3}\right), -\frac{3}{65536}\, {q}^{-4}+\frac{7}{2048}\, {q}^{-3}-\frac{327}{4096}\, {q}^{-2}+\frac{1401}{512}\, {q}^{-1}-\frac{328359}{8192}+\frac{1038429}{1024}\, q-\frac{11818851}{1024}\, {q}^{2}+O\left({q}^{3}\right)\right] \]
Out[32]:
\[ \left[3, 4, 4\right] \]

r3 must be reduced in the third component by b0.

In [33]:
r4 := r3 - lc(r3,3)/lc(b0,3) * j^2*b0
qetaGrades r4
Out[33]:
\[ \left[\frac{3}{65536}\, {q}^{-4}-\frac{1}{2048}\, {q}^{-3}+\frac{279}{4096}\, {q}^{-2}-\frac{351}{512}\, {q}^{-1}+\frac{351143}{8192}-\frac{407163}{1024}\, q+\frac{14961267}{1024}\, {q}^{2}+O\left({q}^{3}\right), \frac{1}{1024}\, {q}^{-3}-\frac{3}{256}\, {q}^{-2}+\frac{399}{256}\, {q}^{-1}-\frac{551}{32}+\frac{507387}{512}\, q-\frac{491727}{64}\, {q}^{2}+\frac{36852247}{128}\, {q}^{3}+O\left({q}^{4}\right), \frac{7}{2048}\, {q}^{-3}-\frac{3}{256}\, {q}^{-2}+\frac{1401}{512}\, {q}^{-1}+\frac{105}{32}+\frac{1038429}{1024}\, q+\frac{245553}{64}\, {q}^{2}+\frac{57960241}{256}\, {q}^{3}+O\left({q}^{4}\right)\right] \]
Out[33]:
\[ \left[4, 3, 3\right] \]

r4 must be reduced in the first component by b3.

In [34]:
r5 := r4 - lc(r4,1)/lc(b3,1) * j*b3
qetaGrades r5
Out[34]:
\[ \left[\frac{1}{4096}\, {q}^{-3}-\frac{3}{512}\, {q}^{-2}+\frac{447}{1024}\, {q}^{-1}-\frac{215}{64}+\frac{411003}{2048}\, q-\frac{207}{128}\, {q}^{2}+\frac{14797895}{512}\, {q}^{3}+O\left({q}^{4}\right), \frac{1}{4096}\, {q}^{-3}+\frac{3}{512}\, {q}^{-2}+\frac{255}{1024}\, {q}^{-1}-\frac{73}{64}+\frac{403323}{2048}\, q-\frac{294705}{128}\, {q}^{2}+\frac{29483911}{512}\, {q}^{3}+O\left({q}^{4}\right), \frac{1}{2048}\, {q}^{-3}-\frac{3}{128}\, {q}^{-2}-\frac{33}{512}\, {q}^{-1}-\frac{159}{16}-\frac{99717}{1024}\, q-\frac{73935}{32}\, {q}^{2}-\frac{4225433}{256}\, {q}^{3}+O\left({q}^{4}\right)\right] \]
Out[34]:
\[ \left[3, 3, 3\right] \]

r5 must be reduced in the third component by b5.

In [35]:
r6 := r5 - lc(r5,3)/lc(b5,3) * j*b5
qetaGrades r6
Out[35]:
\[ \left[\frac{1}{4096}\, {q}^{-3}-\frac{3}{512}\, {q}^{-2}+\frac{575}{1024}\, {q}^{-1}-\frac{279}{64}+\frac{612731}{2048}\, q-\frac{98511}{128}\, {q}^{2}+\frac{29539527}{512}\, {q}^{3}+O\left({q}^{4}\right), \frac{1}{4096}\, {q}^{-3}+\frac{7}{512}\, {q}^{-2}+\frac{127}{1024}\, {q}^{-1}+\frac{363}{64}+\frac{201595}{2048}\, q+\frac{483}{128}\, {q}^{2}+\frac{14742279}{512}\, {q}^{3}+O\left({q}^{4}\right), -\frac{5}{256}\, {q}^{-2}-\frac{7}{16}\, {q}^{-1}-\frac{225}{32}-\frac{803}{4}\, q-\frac{98649}{64}\, {q}^{2}-\frac{231207}{8}\, {q}^{3}-266200\, {q}^{4}+O\left({q}^{5}\right)\right] \]
Out[35]:
\[ \left[3, 3, 2\right] \]

r6 must be reduced in the second component by b2.

In [36]:
r7 := r6 - lc(r6,2)/lc(b2,2) * j*b2
qetaGrades r7
Out[36]:
\[ \left[\frac{5}{16}\, {q}^{-1}-\frac{1}{2}+\frac{793}{4}\, q+\frac{296805}{8}\, {q}^{3}+98304\, {q}^{4}+\frac{4175239}{2}\, {q}^{5}+O\left({q}^{6}\right), \frac{5}{256}\, {q}^{-2}-\frac{1}{8}\, {q}^{-1}+\frac{305}{32}-\frac{5}{2}\, q+\frac{49497}{64}\, {q}^{2}+\frac{32799}{4}\, {q}^{3}-47144\, {q}^{4}+O\left({q}^{5}\right), -\frac{1}{128}\, {q}^{-2}-\frac{7}{16}\, {q}^{-1}+\frac{43}{16}-\frac{803}{4}\, q+\frac{49083}{32}\, {q}^{2}-\frac{231207}{8}\, {q}^{3}+200720\, {q}^{4}+O\left({q}^{5}\right)\right] \]
Out[36]:
\[ \left[1, 2, 2\right] \]

r7 must be reduced in the third component by b0.

In [37]:
r8 := r7 - lc(r7,3)/lc(b0,3) * j*b0
qetaGrades r8
Out[37]:
\[ \left[\frac{1}{128}\, {q}^{-2}+\frac{5}{16}\, {q}^{-1}+\frac{85}{16}+\frac{793}{4}\, q+\frac{49221}{32}\, {q}^{2}+\frac{296805}{8}\, {q}^{3}+266224\, {q}^{4}+O\left({q}^{5}\right), \frac{7}{256}\, {q}^{-2}-\frac{1}{8}\, {q}^{-1}+\frac{491}{32}-\frac{5}{2}\, q+\frac{147939}{64}\, {q}^{2}+\frac{32799}{4}\, {q}^{3}+120776\, {q}^{4}+O\left({q}^{5}\right), -\frac{7}{16}\, {q}^{-1}+\frac{17}{2}-\frac{803}{4}\, q+3072\, {q}^{2}-\frac{231207}{8}\, {q}^{3}+368640\, {q}^{4}-\frac{3061181}{2}\, {q}^{5}+O\left({q}^{6}\right)\right] \]
Out[37]:
\[ \left[2, 2, 1\right] \]

r8 must be reduced in the second component by b4.

In [38]:
r9 := r8 - lc(r8,2)/lc(b4,2) * b4
qetaGrades r9
Out[38]:
\[ \left[-\frac{5}{256}\, {q}^{-2}+\frac{5}{16}\, {q}^{-1}-\frac{481}{32}+\frac{793}{4}\, q-\frac{131417}{64}\, {q}^{2}+\frac{67429}{8}\, {q}^{3}-49112\, {q}^{4}+O\left({q}^{5}\right), -\frac{1}{8}\, {q}^{-1}+2-\frac{453}{2}\, q+512\, {q}^{2}-\frac{121313}{4}\, {q}^{3}-151552\, {q}^{4}-1553499\, {q}^{5}+O\left({q}^{6}\right), -\frac{7}{8}\, {q}^{-1}-9-\frac{419}{2}\, q-2304\, {q}^{2}-\frac{115495}{4}\, {q}^{3}-219136\, {q}^{4}-1530685\, {q}^{5}+O\left({q}^{6}\right)\right] \]
Out[38]:
\[ \left[2, 1, 1\right] \]

r9 must be reduced in the first component by b3.

In [39]:
r10 := r9 - lc(r9,1)/lc(b3,1) * b3
qetaGrades r10
Out[39]:
\[ \left[2-48\, q+1152\, {q}^{2}-2112\, {q}^{3}+27648\, {q}^{4}-34464\, {q}^{5}+345600\, {q}^{6}+O\left({q}^{7}\right), \frac{3}{16}\, {q}^{-1}-\frac{11}{2}+\frac{399}{4}\, q-768\, {q}^{2}+\frac{33699}{8}\, {q}^{3}-18432\, {q}^{4}+\frac{137937}{2}\, {q}^{5}+O\left({q}^{6}\right), \frac{3}{8}\, {q}^{-1}-4+\frac{111}{2}\, q-384\, {q}^{2}+\frac{8355}{4}\, {q}^{3}-9216\, {q}^{4}+34545\, {q}^{5}+O\left({q}^{6}\right)\right] \]
Out[39]:
\[ \left[0, 1, 1\right] \]

r10 must be reduced in the third component by b5.

In [40]:
r11 := r10 - lc(r10,3)/lc(b5,3) * b5
qetaGrades r11
Out[40]:
\[ \left[2+48\, q+384\, {q}^{2}+2112\, {q}^{3}+9216\, {q}^{4}+34464\, {q}^{5}+115200\, {q}^{6}+O\left({q}^{7}\right), \frac{3}{16}\, {q}^{-1}+\frac{1}{2}+\frac{15}{4}\, q-\frac{93}{8}\, {q}^{3}+\frac{81}{2}\, {q}^{5}+O\left({q}^{6}\right), -1+48\, q-384\, {q}^{2}+2112\, {q}^{3}-9216\, {q}^{4}+34464\, {q}^{5}-115200\, {q}^{6}+O\left({q}^{7}\right)\right] \]
Out[40]:
\[ \left[0, 1, 0\right] \]

r11 must be reduced in the second component by b2.

In [41]:
r12 := r11 - lc(r11,2)/lc(b2,2) * b2
qetaGrades r12
Out[41]:
\[ \left[-\frac{3}{16}\, {q}^{-1}+\frac{13}{2}-\frac{15}{4}\, q+\frac{93}{8}\, {q}^{3}-\frac{81}{2}\, {q}^{5}+O\left({q}^{6}\right), 5-48\, q-384\, {q}^{2}-2112\, {q}^{3}-9216\, {q}^{4}-34464\, {q}^{5}-115200\, {q}^{6}+O\left({q}^{7}\right), 8+48\, q+384\, {q}^{2}+2112\, {q}^{3}+9216\, {q}^{4}+34464\, {q}^{5}+115200\, {q}^{6}+O\left({q}^{7}\right)\right] \]
Out[41]:
\[ \left[1, 0, 0\right] \]

r12 must be reduced in the first component by b1.

In [42]:
r13 := r12 - lc(r12,1)/lc(b1,1) * b1
qetaGrades r13
Out[42]:
\[ \left[-1+O\left({q}^{7}\right), -1+O\left({q}^{7}\right), -1+O\left({q}^{7}\right)\right] \]
Out[42]:
\[ \left[0, 0, 0\right] \]

In the final step, we only need to add b0.

In [43]:
r14 := r13 + b0
assertTrue(zero? r14)
Out[43]:
\[ \left[O\left({q}^{13}\right), O\left({q}^{13}\right), O\left({q}^{13}\right)\right] \]
Out[43]:
\[ \texttt{true} \]

Details of the computations done in the function "modularPolynomial"¶

In this section we give an extended demonstration of what the function modularPolynomial, mentioned at the beginning of this notebook is actually doing.

The $q$-expansions of $j$ at the cusps $\{\infty,0,1\}$ of $\Gamma(2)$ are identical and of order -2. For that reason, we take $j$ as the special element. Since its orders are equal to -2 in each component, it is easy to determine the component in which an element can be reduced. We must just look for its highest pole order (the negation of the order of the respective Laurent series). In QEta the function qetaGrades is the name for the function that returns the vector of pole orders.

The $q$-expansions of $\lambda$ at the cusps $\infty$, 0, 1 are of order 1, 0, -1, respectively.

For the following computation, we form vectors that are stored in the variables xj for for the expansions of $j$ and xl for the expansions of $\lambda$ at the cusps $\infty$, 0, 1 (in exactly this order).

The vectors in these variables xj and xl already have an additional component added, the "representation part", namely, the symbol $x$ at xjand the symbol $y$ at xl. All arithmetic operations are not only performed on the $q$-expansions, but simultaneously also on the representation part. This last component is used for tracing the steps in the reduction algorithm and eventually contains the modular polynomial between $j$ and $\lambda$.

Again note that in FriCAS, the Laurent series contain a method to compute any coefficient. The O-notation only appears at output time and can be controlled by the )set stream calculate command.

In [44]:
)set stream calculate 2

Let us show again the expansions of $j(\tau)$ and $\lambda(\tau)$ at the cusps $\{\infty,0,1\}$ of $\Gamma(2)$

In [45]:
xj
xl
Out[45]:
\[ \left[\left[{q}^{-2}+744+O\left({q}^{1}\right), {q}^{-2}+744+O\left({q}^{1}\right), {q}^{-2}+744+O\left({q}^{1}\right)\right], x\right] \]
Out[45]:
\[ \left[\left[16\, q-128\, {q}^{2}+704\, {q}^{3}+O\left({q}^{4}\right), 1-16\, q+128\, {q}^{2}+O\left({q}^{3}\right), -\frac{1}{16}\, {q}^{-1}+\frac{1}{2}-\frac{5}{4}\, q+O\left({q}^{2}\right)\right], y\right] \]

The multisamba algorithm (adapted to the computation of a modular polynomial) works as follows.

We start with the set $B=\{1\}$ as an initial basis and then roughly do the following steps.

  • (1) Take $\lambda$ and reduce it wrt. $j$ and $B$ to the element $b_1$ (which is then put into $B$).

  • (2) Reduce $\lambda \cdot b_1$ wrt. $j$ and $B$ to the element $b_2$ (which is then put into $B$).

  • (3) Reduce $\lambda \cdot b_2$ wrt. $j$ and $B$ to the element $b_3$ (which is then put into $B$).

  • ...

  • (s) Reduce $\lambda \cdot b_{s-1}$ wrt. $j$ and $B$ to the element $b_s$ (which is then put into $B$).

  • (s+1) Stop the above process if $b_{s+1}=0$ and read off the modular polynomial from the trace of this reduction process.

The grades (or pole orders) are the negation of the orders.

In [46]:
[qetaGrades xj, qetaGrades xl]
Out[46]:
\[ \left[\left[2, 2, 2\right], \left[-1, 0, 1\right]\right] \]

Let us start the variant of the multisamba process for the computation of a modular polynomial.

1. Iteration¶

Clearly $\lambda$ is not reducible by $j$, because the highest pole order of $\lambda$ is in the last component (cusp 1) and is smaller in absolute value then the pole order of $j$ at cusp 1. Therefore, we simply add xl as $b_1$ to the basis.

In [47]:
b0 := toXn(C, 1$An(C), 1);
b1 := xl; B := [b0,b1]; [qetaGrades b for b in B]
Out[47]:
\[ \left[\left[0, 0, 0\right], \left[-1, 0, 1\right]\right] \]

2. Iteration¶

Now we consider $\lambda \cdot b_1$.

In [48]:
z2 := xl*b1
qetaGrades(z2)
Out[48]:
\[ \left[\left[256\, {q}^{2}-4096\, {q}^{3}+38912\, {q}^{4}+O\left({q}^{5}\right), 1-32\, q+512\, {q}^{2}+O\left({q}^{3}\right), \frac{1}{256}\, {q}^{-2}-\frac{1}{16}\, {q}^{-1}+\frac{13}{32}+O\left({q}^{1}\right)\right], {y}^{2}\right] \]
Out[48]:
\[ \left[-2, 0, 2\right] \]

It has pole order 2 in the last component and can be reduced by subtracting $j/256$ from it.

In [49]:
[lc(z2,3), lc(xj*b0,3)]
Out[49]:
\[ \left[\frac{1}{256}, 1\right] \]
In [50]:
z2a := z2 - 1/256 * xj*b0
qetaGrades z2a
Out[50]:
\[ \left[\left[-\frac{1}{256}\, {q}^{-2}-\frac{93}{32}+O\left({q}^{1}\right), -\frac{1}{256}\, {q}^{-2}-\frac{61}{32}+O\left({q}^{1}\right), -\frac{1}{16}\, {q}^{-1}-\frac{5}{2}-\frac{5}{4}\, q+O\left({q}^{2}\right)\right], {y}^{2}-\frac{1}{256}\, x\right] \]
Out[50]:
\[ \left[2, 2, 1\right] \]

Although that reduction step looks like creating an element with a worse pole order vector than that of $z_2$, it nevertheless holds $z_{2} >_j z_{2a}$.

We must find a reducer for the second component. However, none of the basis elements have their highest pole order in the second component, i.e. $z_{2a}$ is irreducible and enters the basis as $b_2$.

In [51]:
b2 := z2a
B := [b0, b1, b2]; [qetaGrades b for b in B]
Out[51]:
\[ \left[\left[-\frac{1}{256}\, {q}^{-2}-\frac{93}{32}+O\left({q}^{1}\right), -\frac{1}{256}\, {q}^{-2}-\frac{61}{32}+O\left({q}^{1}\right), -\frac{1}{16}\, {q}^{-1}-\frac{5}{2}-\frac{5}{4}\, q+O\left({q}^{2}\right)\right], {y}^{2}-\frac{1}{256}\, x\right] \]
Out[51]:
\[ \left[\left[0, 0, 0\right], \left[-1, 0, 1\right], \left[2, 2, 1\right]\right] \]

3. Iteration¶

Now we consider $\lambda\cdot b_2$.

In [52]:
z3 := xl*b2
qetaGrades z3
Out[52]:
\[ \left[\left[-\frac{1}{16}\, {q}^{-1}+\frac{1}{2}-\frac{197}{4}\, q+O\left({q}^{2}\right), -\frac{1}{256}\, {q}^{-2}+\frac{1}{16}\, {q}^{-1}-\frac{77}{32}+O\left({q}^{1}\right), \frac{1}{256}\, {q}^{-2}+\frac{1}{8}\, {q}^{-1}-\frac{35}{32}+O\left({q}^{1}\right)\right], {y}^{3}-\frac{1}{256}\, x\, y\right] \]
Out[52]:
\[ \left[1, 2, 2\right] \]

That product must be reduced in the third component by subtracting an appropriate multiple of $j b_0$ from it.

In [53]:
[lc(z3,3), lc(xj*b0,3)]
Out[53]:
\[ \left[\frac{1}{256}, 1\right] \]
In [54]:
z3a := z3 - 1/256*xj*b0
qetaGrades z3a
Out[54]:
\[ \left[\left[-\frac{1}{256}\, {q}^{-2}-\frac{1}{16}\, {q}^{-1}-\frac{77}{32}+O\left({q}^{1}\right), -\frac{1}{128}\, {q}^{-2}+\frac{1}{16}\, {q}^{-1}-\frac{85}{16}+O\left({q}^{1}\right), \frac{1}{8}\, {q}^{-1}-4+\frac{101}{2}\, q+O\left({q}^{2}\right)\right], {y}^{3}-\frac{1}{256}\, x\, y-\frac{1}{256}\, x\right] \]
Out[54]:
\[ \left[2, 2, 1\right] \]

Now, however, we can use $b_2$ to reduce $z_{3a}$ in the second component.

In [55]:
[lc(z3a,2), lc(b2,2)]
Out[55]:
\[ \left[-\frac{1}{128}, -\frac{1}{256}\right] \]
In [56]:
z3b := z3a - 2*b2
qetaGrades z3b
Out[56]:
\[ \left[\left[\frac{1}{256}\, {q}^{-2}-\frac{1}{16}\, {q}^{-1}+\frac{109}{32}+O\left({q}^{1}\right), \frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{261}{4}\, q+O\left({q}^{2}\right), \frac{1}{4}\, {q}^{-1}+1+53\, q+O\left({q}^{2}\right)\right], {y}^{3}-2\, {y}^{2}-\frac{1}{256}\, x\, y+\frac{1}{256}\, x\right] \]
Out[56]:
\[ \left[2, 1, 1\right] \]

We must find a reducer for the first component, since there is the highest pole order. However, none of the basis elements has their highest pole order in the first component, i.e. $z_{3b}$ is irreducible and enters the basis as $b_3$.

In [57]:
b3 := z3b
B := [b0, b1, b2, b3]; [qetaGrades b for b in B]
Out[57]:
\[ \left[\left[\frac{1}{256}\, {q}^{-2}-\frac{1}{16}\, {q}^{-1}+\frac{109}{32}+O\left({q}^{1}\right), \frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{261}{4}\, q+O\left({q}^{2}\right), \frac{1}{4}\, {q}^{-1}+1+53\, q+O\left({q}^{2}\right)\right], {y}^{3}-2\, {y}^{2}-\frac{1}{256}\, x\, y+\frac{1}{256}\, x\right] \]
Out[57]:
\[ \left[\left[0, 0, 0\right], \left[-1, 0, 1\right], \left[2, 2, 1\right], \left[2, 1, 1\right]\right] \]

4. Iteration¶

Now we consider $\lambda\cdot b_3$.

In [58]:
z4 := xl*b3
qetaGrades z4
Out[58]:
\[ \left[\left[\frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{261}{4}\, q+O\left({q}^{2}\right), \frac{1}{16}\, {q}^{-1}-\frac{5}{2}+\frac{389}{4}\, q+O\left({q}^{2}\right), -\frac{1}{64}\, {q}^{-2}+\frac{1}{16}\, {q}^{-1}-\frac{25}{8}+O\left({q}^{1}\right)\right], {y}^{4}-2\, {y}^{3}-\frac{1}{256}\, x\, {y}^{2}+\frac{1}{256}\, x\, y\right] \]
Out[58]:
\[ \left[1, 1, 2\right] \]

The element $z_4$ must be reduced in the third component. This can be done by subtracting a suitable multiple of $j b_0$.

In [59]:
[lc(z4,3), lc(xj*b0,3)]
Out[59]:
\[ \left[-\frac{1}{64}, 1\right] \]
In [60]:
z4a := z4 + 1/64*xj*b0
qetaGrades z4a
Out[60]:
\[ \left[\left[\frac{1}{64}\, {q}^{-2}+\frac{1}{16}\, {q}^{-1}+\frac{81}{8}+O\left({q}^{1}\right), \frac{1}{64}\, {q}^{-2}+\frac{1}{16}\, {q}^{-1}+\frac{73}{8}+O\left({q}^{1}\right), \frac{1}{16}\, {q}^{-1}+\frac{17}{2}+\frac{5}{4}\, q+O\left({q}^{2}\right)\right], {y}^{4}-2\, {y}^{3}-\frac{1}{256}\, x\, {y}^{2}+\frac{1}{256}\, x\, y+\frac{1}{64}\, x\right] \]
Out[60]:
\[ \left[2, 2, 1\right] \]

Clearly, the element can be reduced in the second component by $b_2$.

In [61]:
[lc(z4a,2), lc(b2,2)]
Out[61]:
\[ \left[\frac{1}{64}, -\frac{1}{256}\right] \]
In [62]:
z4b := z4a + 4*b2
qetaGrades z4b
Out[62]:
\[ \left[\left[\frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{261}{4}\, q+O\left({q}^{2}\right), \frac{1}{16}\, {q}^{-1}+\frac{3}{2}-\frac{123}{4}\, q+O\left({q}^{2}\right), -\frac{3}{16}\, {q}^{-1}-\frac{3}{2}-\frac{15}{4}\, q+O\left({q}^{2}\right)\right], {y}^{4}-2\, {y}^{3}+\left(-\frac{1}{256}\, x+4\right)\, {y}^{2}+\frac{1}{256}\, x\, y\right] \]
Out[62]:
\[ \left[1, 1, 1\right] \]

$z_{4b}$ would have to be reduced in the third component and it can be done by subtracting a constant multiple of $b_1=\lambda$.

In [63]:
[lc(z4b,3), lc(b1,3)]
Out[63]:
\[ \left[-\frac{3}{16}, -\frac{1}{16}\right] \]
In [64]:
z4c := z4b - 3*b1
qetaGrades z4c
Out[64]:
\[ \left[\left[\frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{69}{4}\, q+O\left({q}^{2}\right), \frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{69}{4}\, q+O\left({q}^{2}\right), -3-256\, {q}^{2}+O\left({q}^{3}\right)\right], {y}^{4}-2\, {y}^{3}+\left(-\frac{1}{256}\, x+4\right)\, {y}^{2}+\left(\frac{1}{256}\, x-3\right)\, y\right] \]
Out[64]:
\[ \left[1, 1, 0\right] \]

$z_{4c}$ would have to be reduced in the second component, but that can obviously not be done by any of the current basis elements. Therefore, $z_{4c}$ is added to the basis $B$ as $b_4$.

In [65]:
b4 := z4c
B := [b0,b1,b2,b3,b4]; [qetaGrades b for b in B]
Out[65]:
\[ \left[\left[\frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{69}{4}\, q+O\left({q}^{2}\right), \frac{1}{16}\, {q}^{-1}-\frac{3}{2}+\frac{69}{4}\, q+O\left({q}^{2}\right), -3-256\, {q}^{2}+O\left({q}^{3}\right)\right], {y}^{4}-2\, {y}^{3}+\left(-\frac{1}{256}\, x+4\right)\, {y}^{2}+\left(\frac{1}{256}\, x-3\right)\, y\right] \]
Out[65]:
\[ \left[\left[0, 0, 0\right], \left[-1, 0, 1\right], \left[2, 2, 1\right], \left[2, 1, 1\right], \left[1, 1, 0\right]\right] \]

5. Iteration¶

Now we consider $\lambda\cdot b_4$.

In [66]:
z5 := xl*b4
qetaGrades z5
Out[66]:
\[ \left[\left[1-32\, q+512\, {q}^{2}+O\left({q}^{3}\right), \frac{1}{16}\, {q}^{-1}-\frac{5}{2}+\frac{197}{4}\, q+O\left({q}^{2}\right), \frac{3}{16}\, {q}^{-1}-\frac{3}{2}+\frac{79}{4}\, q+O\left({q}^{2}\right)\right], {y}^{5}-2\, {y}^{4}+\left(-\frac{1}{256}\, x+4\right)\, {y}^{3}+\left(\frac{1}{256}\, x-3\right)\, {y}^{2}\right] \]
Out[66]:
\[ \left[0, 1, 1\right] \]

This element can be reduced (in the third component) by subtracting a constant multiple of $b_1$.

In [67]:
[lc(z5,3), lc(b1,3)]
Out[67]:
\[ \left[\frac{3}{16}, -\frac{1}{16}\right] \]
In [68]:
z5a := z5 + 3*b1
qetaGrades z5a
Out[68]:
\[ \left[\left[1+16\, q+128\, {q}^{2}+O\left({q}^{3}\right), \frac{1}{16}\, {q}^{-1}+\frac{1}{2}+\frac{5}{4}\, q+O\left({q}^{2}\right), 16\, q-128\, {q}^{2}+704\, {q}^{3}+O\left({q}^{4}\right)\right], {y}^{5}-2\, {y}^{4}+\left(-\frac{1}{256}\, x+4\right)\, {y}^{3}+\left(\frac{1}{256}\, x-3\right)\, {y}^{2}+3\, y\right] \]
Out[68]:
\[ \left[0, 1, -1\right] \]

The element $z_{5a}$ can be reduced in the second component by subtracting a constant multiple of $b_4$.

In [69]:
[lc(z5a,2), lc(b4,2)]
Out[69]:
\[ \left[\frac{1}{16}, \frac{1}{16}\right] \]
In [70]:
z5b := z5a - b4
qetaGrades z5b
Out[70]:
\[ \left[\left[-\frac{1}{16}\, {q}^{-1}+\frac{5}{2}-\frac{5}{4}\, q+O\left({q}^{2}\right), 2-16\, q-128\, {q}^{2}+O\left({q}^{3}\right), 3+16\, q+128\, {q}^{2}+O\left({q}^{3}\right)\right], {y}^{5}-3\, {y}^{4}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{3}+\left(\frac{1}{128}\, x-7\right)\, {y}^{2}+\left(-\frac{1}{256}\, x+6\right)\, y\right] \]
Out[70]:
\[ \left[1, 0, 0\right] \]

We obtain an element that obviously cannot be reduced in the first component by any existing basis element. It therefore enters the basis as $b_5$.

In [71]:
b5 := z5b
B := [b0,b1,b2,b3,b4,b5]; [qetaGrades b for b in B]
Out[71]:
\[ \left[\left[-\frac{1}{16}\, {q}^{-1}+\frac{5}{2}-\frac{5}{4}\, q+O\left({q}^{2}\right), 2-16\, q-128\, {q}^{2}+O\left({q}^{3}\right), 3+16\, q+128\, {q}^{2}+O\left({q}^{3}\right)\right], {y}^{5}-3\, {y}^{4}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{3}+\left(\frac{1}{128}\, x-7\right)\, {y}^{2}+\left(-\frac{1}{256}\, x+6\right)\, y\right] \]
Out[71]:
\[ \left[\left[0, 0, 0\right], \left[-1, 0, 1\right], \left[2, 2, 1\right], \left[2, 1, 1\right], \left[1, 1, 0\right], \left[1, 0, 0\right]\right] \]

If we look at the pole orders of all the basis elements, we see that relative to $j$ (with pole order 2 in each component), we can reduce any element. In other words, the basis $B$ is already complete and we expect a zero reduction in the next interation.

6. Iteration and Stop¶

Now we consider $\lambda\cdot b_5$.

In [72]:
z6 := xl*b5
qetaGrades z6
Out[72]:
\[ \left[\left[-1+48\, q-384\, {q}^{2}+O\left({q}^{3}\right), 2-48\, q+384\, {q}^{2}+O\left({q}^{3}\right), -\frac{3}{16}\, {q}^{-1}+\frac{1}{2}-\frac{15}{4}\, q+O\left({q}^{2}\right)\right], {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}\right] \]
Out[72]:
\[ \left[0, 0, 1\right] \]

This element can be reduced (in the third component) by subtracting a constant multiple of $b_1$.

In [73]:
[lc(z6,3), lc(b1,3)]
Out[73]:
\[ \left[-\frac{3}{16}, -\frac{1}{16}\right] \]
In [74]:
z6a := z6 - 3*b1
qetaGrades z6a
Out[74]:
\[ \left[\left[-1+O\left({q}^{3}\right), -1+O\left({q}^{3}\right), -1+O\left({q}^{3}\right)\right], {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}-3\, y\right] \]
Out[74]:
\[ \left[0, 0, 0\right] \]

Adding the vector for $b_0=1$ to $z_{6a}$ gives exactly zero in each of the first 3 components.

In [75]:
z := z6a + b0
assertTrue(zero? z)
Out[75]:
\[ \left[\left[O\left({q}^{5}\right), O\left({q}^{5}\right), O\left({q}^{5}\right)\right], {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}-3\, y+1\right] \]
Out[75]:
\[ \texttt{true} \]

The last component (where the representation of the element is stored) gives rise to the relation between $j$ and $\lambda$.

Indeed it is equal to the modular polynomial that we computed and checked already above.

In [76]:
xnPol(C, z)
assertEquals(xnPol(C, z), mp)
Out[76]:
\[ {y}^{6}-3\, {y}^{5}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{4}+\left(\frac{1}{128}\, x-7\right)\, {y}^{3}+\left(-\frac{1}{256}\, x+6\right)\, {y}^{2}-3\, y+1 \]
Out[76]:
\[ \texttt{true} \]

This is how the modular polynomial $p(x,y)$ is computed such that $p(j(\tau),\lambda(\tau))=0$ for every $\tau$ in the complex upper half plane.

In [77]:
-------------------------------------------------------------------
--endtest
-------------------------------------------------------------------