({{, (RefLink[EllipticTheta, paclet:ref/EllipticTheta])[a,u,q]
gives the theta function (Subscript[ϑ, a])(u,q)(a=1,…,4).}, {, (RefLink[EllipticTheta, paclet:ref/EllipticTheta])[a,q]
gives the theta constant (Subscript[θ, a])(q)==(Subscript[θ, a])(0,q).}})

OpenersNotesSection(Spacer1)Details

Mathematical function, suitable for both symbolic and numerical manipulation.

(Subscript[ϑ, 1])(u,q)=2(q^(1/4))(∑_(n=0)^∞)(((-1))^n)(q^(n(n+1)))sin((2 n+1)u).

(Subscript[ϑ, 2])(u,q)=2(q^(1/4))(∑_(n=0)^∞)(q^(n(n+1)))cos((2 n+1)u).

(Subscript[ϑ, 3])(u,q)=1+2(∑_(n=1)^∞)(q^(n^2))cos(2n u).

(Subscript[ϑ, 4])(u,q)=1+2(∑_(n=1)^∞)(((-1))^n)(q^(n^2))cos(2n u).

The (Subscript[ϑ, i]) are defined only inside the unit q disk; the disk forms a natural boundary of analyticity.

Inside the unit q disk, (Subscript[ϑ, 1]) and (Subscript[ϑ, 2]) have branch cuts from 0 to -1.

For certain special arguments, (RefLink[EllipticTheta, paclet:ref/EllipticTheta]) automatically evaluates to exact values.

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) can be evaluated to arbitrary numerical precision.

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) automatically threads over lists.

OpenersPrimaryExamplesSection(Spacer1)Examples  (29)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

EllipticTheta[1, 2.,1/3]

Plot[EllipticTheta[2, x,1/3],{x,-6,6}]

Series expansion:

Series[EllipticTheta[4,0,q],{q,0,100}]

OpenersExampleSection1(Spacer1)Scope  (13)

OpenersExampleSubsection0(Spacer1)Numerical Evaluation  (4)

Evaluate numerically:

EllipticTheta[2,5,.5]

EllipticTheta[3,.4,.5]

Evaluate to high precision:

N[EllipticTheta[3,1/4,1/3],25]

The precision of the output tracks the precision of the input:

EllipticTheta[3,4,.50005555555500055005]

Complex number inputs:

EllipticTheta[3,.4+I,.5I]

Evaluate efficiently at high precision:

EllipticTheta[2,5,.5`100]//Timing

EllipticTheta[2,5,.5`10000];//Timing

OpenersExampleSubsection1(Spacer1)Specific Values   (3)

Value at zero:

EllipticTheta[1,0,0]

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) evaluates symbolically for special arguments:

Table[EllipticTheta[j, z,0],{j,4}]

EllipticTheta[1, Pi,1/2]

Find the first positive minimum of (RefLink[EllipticTheta, paclet:ref/EllipticTheta])[3,x,1/2]:

xmin=x/.FindRoot[D[EllipticTheta[3,x,1/2]]==0,{x,2}]//Quiet

Plot[EllipticTheta[3,x,1/2],{x,-1,4},Epilog->{PointSize[Large],Red,Point[{xmin,EllipticTheta[3,xmin,1/2]}]}]

OpenersExampleSubsection2(Spacer1)Visualization  (2)

Plot the (RefLink[EllipticTheta, paclet:ref/EllipticTheta]) function for various parameters:

Plot[{EllipticTheta[1,x,1/2],EllipticTheta[2,x,1/2],EllipticTheta[3,x,1/2],EllipticTheta[4,x,1/2]},{x,-6,6}]

Plot the real part of (EllipticTheta[4, z, 1/3]):

ContourPlot[Re[EllipticTheta[4,x+ I y,1/3]],{x,-5,5},{y,-5,5},Contours->24]

Plot the imaginary part of (EllipticTheta[4, z, 1/3]):

ContourPlot[Im[EllipticTheta[4,x+ I y,1/3]],{x,-5,5},{y,-5,5},Contours->24]

OpenersExampleSubsection3(Spacer1)Function Properties  (4)

Real and complex domains of (RefLink[EllipticTheta, paclet:ref/EllipticTheta]):

Table[FunctionDomain[EllipticTheta[a,x,q],x],{a,4}]

Table[FunctionDomain[EllipticTheta[a,z,q],z,Complexes],{a,4}]

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) is a periodic function with respect to z:

Table[FunctionPeriod[EllipticTheta[a,z,q],z],{a,4}]

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) threads elementwise over lists:

EllipticTheta[{1,2,3,4},z,q]

EllipticTheta[2,{Pi/2,Pi},1/2]

(RefLink[TraditionalForm, paclet:ref/TraditionalForm]) formatting:

EllipticTheta[a,z,q] // TraditionalForm

EllipticTheta[a,q] // TraditionalForm

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (1)

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) can be applied to a power series:

EllipticTheta[2,z,q-((q^2)/2)+((q^3)/9)+((O[q])^4)]

OpenersExampleSection3(Spacer1)Applications  (7)

Plot near the unit circle in the complex q plane:

Plot[Re[EllipticTheta[1,0.5,0.9 Exp[I ϕ]]],{ϕ,-Pi,Pi}]

Plot[Re[EllipticTheta[1,0.5,0.97 Exp[I ϕ]]],{ϕ,-Pi,Pi}]

The number of representations of n as a sum of four squares:

Table[
SeriesCoefficient[Series[EllipticTheta[3,0,q]^4,{q,0,n}],n],{n,10}]

Conformal map from an ellipse to the unit disk:

w[z_,{a_,b_}]:=With[{q=(a-b)^2/(a+b)^2,e=Sqrt[a^2-b^2]},EllipticTheta[1,ArcSin[z/e],q]/EllipticTheta[4,ArcSin[z/e],q]]

Visualize the map:

ParametricPlot[{Re[w[ρ (2 Cos[φ] + I Sin[φ]),{2,1}]],Im[w[ρ (2 Cos[φ]+I Sin[φ]),{2,1}]]},{ρ,0,1},{φ,0,2Pi},Mesh->15]

Dirichlet Green's function for the 1D heat equation:

T[{x_,t_},x0_,L_]=1/(2L) (EllipticTheta[3,Pi/(2L) (x-x0),Exp[-Pi^2/L^2 t]]-EllipticTheta[3,Pi/(2L) (x+x0),Exp[-Pi^2/L^2 t]]);

Plot the time-dependent temperature distribution:

Plot3D[T[{x,t},0.6,1],{x,0,1},{t,0.01,1/2}]

Form Bloch functions of a one-dimensional crystal with Gaussian orbitals:

ψ[𝓀_,x_,ϕ_]:=(((E^(-(1/2) π ϕ (x^2))) EllipticTheta[3,π 𝓀-(1/2) π I ϕ x,(E^(-π/2 ϕ))])/(Sqrt[(2/ϕ) (E^(-((4 (𝓀^2) π)/ϕ)))EllipticTheta[3,-((4 I 𝓀 π)/ϕ),(E^(-((4 π)/ϕ)))]]))

Plot Bloch functions as a function of the quasi-wave vector:

Plot3D[Re[ψ[𝓀, x, 1]],{x,-12,12},{𝓀,0,1/2}]

Electrostatic potential in a NaCl-like crystal with point-like ions:

q[x_,t_]:=EllipticTheta[2,2 Pi x,Exp[-t^2]]

φ[{x_, y_, z_}]:=16/Pi NIntegrate[t q[x,t]q[y,t]q[z,t],{t,0,∞}]

Plot the potential in a plane through the crystal:

ListContourPlot[Table[φ[{x,y,0.3}],{x,-1,1,1/25},{y,-1,1,1/25}]]

A concise form of the Poisson summation formula:

(x^(1/4)) EllipticTheta[3,0,(E^(π x))]==(2UnitStep[Im[x]]-1)  I (x^(-1/4)) EllipticTheta[3,0,(E^(π/x))]

% /.x->- 2.

OpenersExampleSection4(Spacer1)Properties & Relations  (2)

Numerically find a root of a transcendental equation:

FindRoot[((EllipticTheta[1,z,1/3])^3)+EllipticTheta[3,z,1/3]+z==2,{z,2}]

(RefLink[Sum, paclet:ref/Sum]) can generate elliptic theta functions:

Sum[(-1)^n q^(n^2),{n,Infinity}]

OpenersExampleSection5(Spacer1)Possible Issues  (3)

Machine-precision input is insufficient to give a correct answer:

EllipticTheta[1,10.^30,1/2]

Use arbitrary-precision arithmetic to obtain the correct result:

N[EllipticTheta[1,10^30,1/2],20]

(RefLink[EllipticTheta, paclet:ref/EllipticTheta]) has the attribute (RefLink[NHoldFirst, paclet:ref/NHoldFirst]):

Attributes[EllipticTheta]

Different argument conventions exist:

{Plot[EllipticTheta[1,z,1/2],{z,0,2Pi}],
Plot[EllipticTheta[1,z/(2Pi),1/2],{z,0,2Pi}]}

{Plot[EllipticTheta[1,2,q],{q,0.1, 0.8}],
Plot[EllipticTheta[1,2,Exp[I Pi (I τ)]],{τ,0.1, 0.8}]}

OpenersExampleSection6(Spacer1)Neat Examples  (1)

Visualize a function with a boundary of analyticity:

Module[{f,r=0.995},
f[z_?NumberQ]:=If[Abs[z]>r,0,Sin[Arg[EllipticTheta[3, 1,z]]/2]^2];
ContourPlot[f[qx+I qy],{qx,-1,1},{qy,-1,1},PlotPoints -> 30,MaxRecursion->1,Contours->60,PlotRange -> All,Frame->False,ContourLines->False,RegionFunction->(Norm[{#1,#2}]<r&),ColorFunction->(Hue[2.72 #]&)]]

ParametricPlot3D[{qr Cos[qϕ],qr Sin[qϕ],Abs[EllipticTheta[2,2,qr Exp[I qϕ]]]},{qϕ,-Pi,Pi},{qr,0,0.99}, BoxRatios->{1,1,0.66}]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ModularLambda, paclet:ref/ModularLambda])  ▪  (RefLink[DedekindEta, paclet:ref/DedekindEta])  ▪  (RefLink[KleinInvariantJ, paclet:ref/KleinInvariantJ])  ▪  (RefLink[SiegelTheta, paclet:ref/SiegelTheta])  ▪  (RefLink[QPochhammer, paclet:ref/QPochhammer])  ▪  (RefLink[EllipticThetaPrime, paclet:ref/EllipticThetaPrime])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Elliptic Integrals and Elliptic Functions, paclet:tutorial/EllipticIntegralsAndEllipticFunctions])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Elliptic Functions, paclet:guide/EllipticFunctions])}, {▪(RefLinkPlain[Mathematical Functions, paclet:guide/MathematicalFunctions])}, {▪(RefLinkPlain[Special Functions, paclet:guide/SpecialFunctions])}, {▪(RefLinkPlain[Number Theoretic Functions, paclet:guide/NumberTheoreticFunctions])}, {▪(RefLinkPlain[q Functions, paclet:guide/QFunctions])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-NKS.png(Spacer1)NKS|Online, http://www.wolframscience.com/nksonline/index/search.cgi?SearchIndex=EllipticTheta]) ((WebLink[A New Kind of Science, http://www.wolframscience.com/nksonline/]))}})}})