# §23.22 Methods of Computation

## §23.22(i) Function Values

Given $\omega_{1}$ and $\omega_{3}$, with $\Im\left(\omega_{3}/\omega_{1}\right)>0$, the nome $q$ is computed from $q=e^{i\pi\omega_{3}/\omega_{1}}$. For $\wp\left(z\right)$ we apply (23.6.2) and (23.6.5), generating all needed values of the theta functions by the methods described in §20.14.

The functions $\zeta\left(z\right)$ and $\sigma\left(z\right)$ are computed in a similar manner: the former by replacing $u$ and $z$ in (23.6.13) by $z$ and $\pi z/(2\omega_{1})$, respectively, and also referring to (23.6.8); the latter by applying (23.6.9).

The modular functions $\lambda\left(\tau\right)$, $J\left(\tau\right)$, and $\eta\left(\tau\right)$ are also obtainable in a similar manner from their definitions in §23.15(ii).

## §23.22(ii) Lattice Calculations

### Starting from Lattice

Suppose that the lattice $\mathbb{L}$ is given. Then a pair of generators $2\omega_{1}$ and $2\omega_{3}$ can be chosen in an almost canonical way as follows. For $2\omega_{1}$ choose a nonzero point of $\mathbb{L}$ of smallest absolute value. (There will be $2$, $4$, or $6$ possible choices.) For $2\omega_{3}$ choose a nonzero point that is not a multiple of $2\omega_{1}$ and is such that $\Im\tau>0$ and $|\tau|$ is as small as possible, where $\tau=\omega_{3}/\omega_{1}$. (There will be either $1$ or $2$ possible choices.) This yields a pair of generators that satisfy $\Im\tau>0$, $|\Re\tau|\leq\tfrac{1}{2}$, $|\tau|>1$. In consequence, $q=e^{i\pi\omega_{3}/\omega_{1}}$ satisfies $|q|\leq e^{-\pi\sqrt{3}/2}=0.0658\dots$. The corresponding values of $e_{1}$, $e_{2}$, $e_{3}$ are calculated from (23.6.2)–(23.6.4), then $g_{2}$ and $g_{3}$ are obtained from (23.3.6) and (23.3.7).

### Starting from Invariants

Suppose that the invariants $g_{2}=c$, $g_{3}=d$, are given, for example in the differential equation (23.3.10) or via coefficients of an elliptic curve (§23.20(ii)). The determination of suitable generators $2\omega_{1}$ and $2\omega_{3}$ is the classical inversion problem (Whittaker and Watson (1927, §21.73), McKean and Moll (1999, §2.12); see also §20.9(i) and McKean and Moll (1999, §2.16)). This problem is solvable as follows:

1. (a)

In the general case, given by $cd\neq 0$, we compute the roots $\alpha$, $\beta$, $\gamma$, say, of the cubic equation $4t^{3}-ct-d=0$; see §1.11(iii). These roots are necessarily distinct and represent $e_{1}$, $e_{2}$, $e_{3}$ in some order.

If $c$ and $d$ are real, and the discriminant is positive, that is $c^{3}-27d^{2}>0$, then $e_{1}$, $e_{2}$, $e_{3}$ can be identified via (23.5.1), and $k^{2}$, ${k^{\prime}}^{2}$ obtained from (23.6.16).

If $c^{3}-27d^{2}<0$, or $c$ and $d$ are not both real, then we label $\alpha$, $\beta$, $\gamma$ so that the triangle with vertices $\alpha$, $\beta$, $\gamma$ is positively oriented and $[\alpha,\gamma]$ is its longest side (chosen arbitrarily if there is more than one). In particular, if $\alpha$, $\beta$, $\gamma$ are collinear, then we label them so that $\beta$ is on the line segment $(\alpha,\gamma)$. In consequence, $k^{2}=(\beta-\gamma)/(\alpha-\gamma)$, ${k^{\prime}}^{2}=(\alpha-\beta)/(\alpha-\gamma)$ satisfy $\Im k^{2}\geq 0\geq\Im{k^{\prime}}^{2}$ (with strict inequality unless $\alpha$, $\beta$, $\gamma$ are collinear); also $|k^{2}|$, $|{k^{\prime}}^{2}|\leq 1$.

Finally, on taking the principal square roots of $k^{2}$ and ${k^{\prime}}^{2}$ we obtain values for $k$ and $k^{\prime}$ that lie in the 1st and 4th quadrants, respectively, and $2\omega_{1}$, $2\omega_{3}$ are given by

 23.22.1 $2\omega_{1}M\left(1,k^{\prime}\right)=-2i\omega_{3}M\left(1,k\right)=\frac{\pi% }{3}\sqrt{\frac{c(2+k^{2}{k^{\prime}}^{2})({k^{\prime}}^{2}-k^{2})}{d(1-k^{2}{% k^{\prime}}^{2})}},$ ⓘ Symbols: $M\left(\NVar{a},\NVar{g}\right)$: arithmetic-geometric mean, $\pi$: the ratio of the circumference of a circle to its diameter, $\mathrm{i}$: imaginary unit, $\omega_{1}$, $\omega_{3}$, $\omega_{2}=-\omega_{1}-\omega_{3}$: lattice generators, $k$: modulus and $k^{\prime}$: complementary modulus Proof sketch: Combine (23.6.16), (23.6.17), (22.20.6), (23.3.5)–(23.3.7), and use analytical continuation. Referenced by: §23.22(ii) Permalink: http://dlmf.nist.gov/23.22.E1 Encodings: TeX, pMML, png See also: Annotations for §23.22(ii), §23.22(ii), §23.22 and Ch.23

where $M$ denotes the arithmetic-geometric mean (see §§19.8(i) and 22.20(ii)). This process yields 2 possible pairs ($2\omega_{1}$, $2\omega_{3}$), corresponding to the 2 possible choices of the square root.

2. (b)

If $d=0$, then

 23.22.2 $2\omega_{1}=-2i\omega_{3}=\frac{\left(\Gamma\left(\frac{1}{4}\right)\right)^{2% }}{2\sqrt{\pi}c^{1/4}}.$

There are 4 possible pairs ($2\omega_{1}$, $2\omega_{3}$), corresponding to the 4 rotations of a square lattice. The lemniscatic case occurs when $c>0$ and $\omega_{1}>0$.

3. (c)

If $c=0$, then

 23.22.3 $2\omega_{1}=2e^{-\pi i/3}\omega_{3}=\frac{\left(\Gamma\left(\frac{1}{3}\right)% \right)^{3}}{2\pi d^{1/6}}.$

There are 6 possible pairs ($2\omega_{1}$, $2\omega_{3}$), corresponding to the 6 rotations of a lattice of equilateral triangles. The equianharmonic case occurs when $d>0$ and $\omega_{1}>0$.

### Example

Assume $c=g_{2}=-4(3-2i)$ and $d=g_{3}=4(4-2i)$. Then $\alpha=-1-2i$, $\beta=1$, $\gamma=2i$; $k^{2}=\ifrac{(7+6i)}{17}$, and ${k^{\prime}}^{2}=\ifrac{(10-6i)}{17}$. Working to 6 decimal places we obtain

 23.22.4 $\displaystyle 2\omega_{1}$ $\displaystyle=0.867568+i1.466607,$ $\displaystyle 2\omega_{3}$ $\displaystyle=-1.223741+i1.328694,$ $\displaystyle\tau$ $\displaystyle=0.305480+i1.015109.$