Skip to main content
Ctrl+K

XlCalcNet Documentation

  • Preface

Getting started

  • Setup and general usage
    • Setting up XlCalcNet
    • General and user interface functions
    • Calling Python from C#
    • Using XlCalcNet with spreadsheet formulas
    • Mathematical functions based on Mpmath, Gmpy2 and Python-Flint (only Python)
    • Mathematical functions in fixed precision
    • Mathematical functions based on XlCalcNet2
    • A quick look at Numpy
    • A quick look at Matplotlib and related libraries
    • A quick look at Pandas and Xlxswriter
    • A quick look at Scipy
    • A quick look at R, RStudio and Rpy2
  • Basic floating point functions
    • Operator overloading, general real functions
    • Machine constants, general
    • Properties of numbers
    • Integer related functions
    • Floating point functions for real numbers
    • Fraction and remainder related functions
    • Functions related to mantissa width and exponent range
    • Mathematical Constants
  • Elementary scalar functions (real and complex)
    • Complex components
    • Roots and quadratic, cubic, and quartic equations
    • Exponential and related functions
    • Logarithms and related functions
    • Power functions
    • Trigonometric functions, in radians
    • Trigonometric functions, in multiples of \(\pi\)
    • Hyperbolic functions
    • Inverse trigonometric functions, in radians
    • Inverse hyperbolic functions
    • Factorials, Gamma and related functions
    • Miscellaneous functions
  • Statistical Distributions
    • Introduction to random variables and distributions
    • Base class for univariate distributions
    • Base class for continuous univariate distributions
    • Base class for discrete univariate distributions
    • Closed form distributions, based on elementary functions
      • Boost: Arcsine Distribution
      • Boost: Cauchy distribution
      • Boost: Exponential distribution
      • Boost: Gumbel (Generalized Extreme Value distribution Type-I) distribution
      • Boost: Hyperexponential Distribution
      • !!!Boost: Kumaraswamy distribution
      • Boost: Laplace distribution
      • Boost: Logistic distribution
      • Boost: Pareto distribution
      • Boost: Rayleigh distribution
      • Boost: Triangular Distribution
      • Boost: Uniform distribution
      • Boost: Weibull (Minimum-Type-III) distribution
      • Dagum (Burr Type III) distribution
      • Fisk (log-logistic) distribution
      • Fréchet (Maximum/Minimum-Type-II or Inverse Weibull) distribution
      • Generalized Extreme Value (Maximum) or GEV distribution
      • Generalized Pareto distribution
      • Gompertz-Makeham distribution
      • Lomax distribution
      • Shifted Gompertz distribution
      • Singh-Maddala (Burr Type XII) distribution
    • Closed form distributions, based on the error function
      • !!!Boost: Lévy distribution
      • Boost: Lognormal (Johnson \(S_L\)) distribution
      • !!!Boost: Moyal Distribution
      • Boost: Normal (Johnson \(S_N\)) distribution
      • Boost: Skew normal Distribution
      • Boost: Wald (or Inverse Gaussian) distribution
      • Birnbaum-Saunders Distribution
      • Exponentially Modified Gaussian (EMG) distribution
      • Folded normal distribution
      • Half-normal distribution
      • Johnson \(S_B\) distribution
      • Johnson \(S_U\) distribution
      • Normal maximum distribution, \(\rho_{ij, i \ne j} = 0\)
      • Normal maximum modulus distribution, \(\rho_{ij, i \ne j} = 0\)
      • Sinh-arcsinh normal distribution
      • Truncated normal distribution
    • Closed form distributions, based on the incomplete gamma function
      • !!!Boost: Chi Distribution
      • Boost: Chi-Squared distribution
      • Boost: Gamma (Pearson Type III, Erlang) distribution
      • Boost: Inverse chisquared distribution
      • Boost: Inverse Gamma (Pearson Type V) distribution
      • !!!Boost: Maxwell Distribution
      • !!!Boost: Nakagami distribution
      • Amoroso distribution
      • Distribution of the logarithm of a \(\chi^2\) random variable
      • Hypoexponential (Generalized Erlang) Distribution
      • Lindley distribution (generalized)
      • Skew exponential power distribution
      • Stacy (generalized gamma) distribution
    • Closed form distributions, based on the incomplete beta function
      • Boost: Beta (Pearson Type I and II) distribution
      • Boost: Central Fisher F distribution
      • Boost: Student \(t\) (Pearson Type VII) distribution
      • Distribution of the negative logarithm of a beta variable
      • Beta-prime (Pearson Type VI) distribution
      • Generalized Beta (Type 1) distribution
      • Generalized Beta (Type 2) distribution
      • Generalized logistic distribution (JKB Types I - IV)
      • Generalized beta-exponential distribution
      • Feller-Pareto distribution
      • Fisher \(z\) distribution
      • Skew t-distribution (Jones)
      • Pearson’s rho distribution (under \(H_0\))
    • Noncentral distributions
      • Boost: Noncentral \(\chi^2\) distribution
      • Boost: Noncentral Student \(t\) distribution
      • Boost: Noncentral Fisher \(F\) distribution
      • Boost: Noncentral Beta Type I distribution
      • Noncentral Chi distribution
      • Rice (Nakagami-n) distribution
      • Noncentral distribution of the sample correlation coefficient
      • Distribution of the logarithm of a noncentral Beta Type II variable
      • Noncentral distribution (Type I) of Fisher’s \(R^2\)
      • Distribution of the logarithm of a noncentral Fisher \(1-R^2\) variable
      • Doubly non-central Student \(t\) distribution
      • Doubly non-central Fisher \(F\) distribution
    • Distributions related to multiple comparisons of means
      • Overview and literature
      • Normal maximum distribution, \(\rho_{ij, i \ne j} = \rho\)
      • Normal maximum modulus distribution, \(\rho_{ij, i \ne j} = \rho\)
      • Normal maximum distribution, \(\rho_{ij, i \ne j} = \lambda_i \lambda_j\)
      • Normal maximum modulus distribution, \(\rho_{ij, i \ne j} = \lambda_i \lambda_j\)
      • Normal range distribution
      • Studentized maximum distribution
      • Studentized maximum modulus distribution
      • Distribution of Dunnett’s \(t\), one-sided
      • Distribution of Dunnett’s \(t\), two-sided
      • Nair’s \(t\)-distribution
      • Halperin’s \(t\)-distribution
      • Nelson’s \(h\)-distribution
      • Studentized range distribution
    • Distributions related to multivariate statistical analysis
      • Distribution of the sum of the negative logarithms of independent beta variables
      • Distribution of the product of independent beta variables
      • Distribution of Wilks’ \(\Lambda\)
      • Distribution of Wilks’ \(L_{vc}\)
      • Distribution of Wilks’ \(L_{vcm}\)
      • Distribution of Wilks’ test of independence of \(p\) variates
      • Distribution of Wilks’ test of independence of \(k\) groups of variates
      • Distribution of Mauchly’s test of sphericity vs general structure
      • Distribution of Box’s test of equality of covariance matrices, equal sample sizes
      • Distribution of Box’s test of equality of k covariance matrices, unequal sample sizes
      • Distribution of Box’s test for same multivariate normal distributions, unequal sample sizes
      • Distribution of the modified likelihood ratio test (LRT) for a given covariance matrix
      • Distribution of the modified likelihood ratio test (LRT) for a given covariance matrix and mean vector
      • Central distribution of Roy’s largest root
      • Central distribution of Pillai’s \(V\)
      • Central distribution of Hotelling’s \(T^2\)
      • Noncentral Distribution of Wilks’ \(\Lambda\): MANOVA
      • Noncentral Distribution of Wilks’ \(\Lambda\): Canonical Correlation
    • Miscellaneous continuous distributions
      • Boost: Kolmogorov-Smirnov distribution (limiting form)
      • Boost: Landau Distribution
      • Boost: Holtsmark distribution
      • Boost: Map-Airy distribution
      • Boost: Saspoint5 distribution
      • Lévy alpha-stable distribution
      • Pearson Type IV distribution
      • Meixner distribution
      • Voigt Profile Distribution
      • Wrapped Cauchy distribution
      • Wrapped normal distribution
      • Von Mises distribution
      • Generalized inverse Gaussian distribution
      • Harmonic distribution
      • Halphen A distribution
      • Halphen B distribution
      • Halphen IB distribution
      • Generalized hyperbolic distribution
      • Hyperbolic distribution
      • Variance-gamma distribution
    • Elementary discrete (lattice) distributions
      • Boost: Bernoulli distribution
      • Boost: Geometric distribution
      • Boost: Poisson distribution
      • Boost: Binomial distribution
      • Boost: Negative binomial distribution
      • Boost: Classical hypergeometric distribution
      • Log-series distribution
      • Zeta distribution
      • Skellam distribution
      • Delaporte distribution
      • Beta-Poisson distribution (Quinkert)
      • Beta-binomial distribution
      • Beta-negative binomial distribution (Waring)
      • Negative hypergeometric distribution
      • Pólya-Eggenberger distribution
      • General hypergeometric distribution
      • Noncentral hypergeometric distribution, Fisher alternatives
    • Discrete (lattice) distributions related to (stratified) rank tests
      • Wilcoxon signed rank T distribution, continuous data
      • Noncentral Wilcoxon signed rank T distribution, Bennett alternatives
      • Mann-Whitney U distribution, continuous data
      • Noncentral Mann-Whitney U distribution, Lehmann alternatives
      • Noncentral Mann-Whitney U distribution, Milton alternatives
      • Kendall’s tau distribution, continuous data
      • Jonckheere-Terpsta \(T\) distribution, continuous data
      • Generalized Page \(L\) distribution, continuous data
      • Noncentral generalized Page \(L\) distribution, Milton alternatives
    • Discrete (non-lattice) distributions related to rank tests
      • Cochran-Friedman-Quade distribution
      • Kruskal-Wallis distribution
  • Numerical calculus
    • Introduction
    • DAMath: Numerical Rootfinding and Minimization
    • Boost/Math: Root Finding and Minimization Algorithms
    • Mpmath: Rootfinding and optimization
    • DAMath: Numerical Quadrature
    • Boost/Math: Numerical integration
    • Mpmath: Numerical integration
    • Mpmath: Numerical inverse Laplace transform
    • Boost/Odeint: Ordinary differential equations
    • Mpmath: Numerical differentiation
    • Mpmath: Asymptotic expansions
    • Mpmath: Function approximation
    • Mpmath: Sums, products, limits and extrapolation
    • Mpmath: Number identification
    • Mpmath: Polynomials
    • Eigen: Polynomials
    • Eigen/MinPack: non linear optimization
    • Eigen/CppOptLib: multidimensional optimization
    • Flint/Functions for polynomials
    • Flint/Power series and Taylor arithmetic
    • Flint/Verified numerical differentiation
    • Flint/Verified numerical integration
  • Eigen: Dense and Sparse Matrices
    • Creating scalars and matrices
    • Read-only properties: information about a matrix
    • Accessing and setting parts of a matrix
    • Changing the shape of a matrix and/or the order of coefficients
    • Basic arithmetic operations
    • Descriptive Statistics
    • Standard decompositions and linear solving
    • Singular Value and Eigen (selfadjoint) decompositions
    • Eigen decompositions of general square matrices
    • Eigen: Functions of matrix argument
    • Eigen: Fast Fourier Transform
  • Numpy: use with multiprecision data types
    • Numpy array creation from shape or value
    • Numpy array creation from existing data
    • Building special arrays for numerical work
    • Numpy indexing
    • Numpy basic array manipulation routines
    • Numpy array manipulation: Transpose-like operations
    • Numpy array manipulation: Changing number of dimensions
    • Numpy array manipulation: Joining arrays
    • Numpy array manipulation: Splitting and tiling arrays
    • Numpy array manipulation: Adding and removing elements
    • Numpy array manipulation: Rearranging elements
    • Numpy array manipulation: Sorting
    • Numpy array manipulation: Searching
    • Numpy mathematical functions: Sums, products, differences
    • Numpy mathematical functions: Extrema Finding
    • Numpy mathematical functions: Arithmetic operations, elementwise
    • Numpy mathematical functions: Averages and variances
    • Numpy mathematical functions: Matrix and vector products
    • Numpy logical functions: Truth value testing
    • Numpy mathematical functions: Integer and fractional
    • Numpy mathematical functions: Miscellaneous
    • Summary and examples: Numpy utility functions
    • Arithmetic operations with scalars and iterables
    • Numerical transformations and descriptive statistics
    • Standard decompositions and linear solving
    • Singular Value and Eigen decompositions
    • Analytic functions of a matrix
    • Discrete Fourier transform (DFT)
    • Flint/Functions for matrices

Special Functions

  • Elliptic functions and related
    • Carlson symmetric elliptic integrals
    • Legendre elliptic integrals (elliptic parameter \(m\))
    • Legendre elliptic integrals (elliptic modulus \(k\)), and related functions
    • Jacobi elliptic functions
    • Jacobi theta functions and related functions
    • Conversions of parameters of Weierstrass \(\wp\)
    • Weierstrass elliptic functions, in terms of elliptic period ratio \(\tau\)
    • Modular forms, in terms of half-period \(\omega_1\) and elliptic period ratio \(\tau\)
  • Lerch’s phi and related
    • Lerch’s transcendent and Lerch’s zeta
    • Polygamma and related functions
    • Polylogarithm and related functions
    • Hurwitz zeta and related functions
    • Riemann zeta function, and related functions
  • Hypergeometric function \(\,_0F_1\) and related
    • Hypergeometric Limit Function \(\,_0F_1\)
    • Bessel functions
    • Modified Bessel functions
    • Spherical Bessel functions
    • Modified spherical Bessel functions
    • Hankel functions
    • Airy functions
    • Kelvin functions
  • Hypergeometric function \(\,_1F_1\) and related
    • Hypergeometric Functions \(\,_1F_1\) (Kummer) and \(U\) (Tricomi)
    • Incomplete gamma functions
    • Coulomb, Whittaker and parabolic cylinder function
    • Error function and related functions
    • Exponential integrals, and related functions
  • Hypergeometric functions \(\,_2F_1\) and \(\,_1F_2\) (and related functions)
    • Gauss Hypergeometric Function \(\,_2F_1\)
    • Chebyshev, Gegenbauer and Jacobi polynomials
    • Legendre polynomials and related
    • Incomplete beta functions
    • Hypergeometric function \({}_1F_2\)
    • Scorer functions
    • Struve functions
    • Anger, Weber and Lommel functions

Supporting Functions

  • Algebra with random variables
    • Probability density function (pdf)
    • Probability mass function (pmf)
    • Cumulative distribution function (cdf)
    • Quantile function
    • Characteristic function
    • Moment generating function
    • Cumulant generating function
    • Probability generating function
    • Factorial Moments
    • Raw Moments
    • Central Moments
    • Cumulants
  • Series and integrals
    • Finite series algorithms for selected distributions
    • Infinite series algorithms for selected functions and distributions
    • Finite series for lattice distributions, based on factorial moments
    • Efficient integration of bell-shaped functions
    • Verified numerical integration
  • Pmf vectors
    • Basic discrete (lattice) distribution functions
    • Discrete (lattice) distribution functions related to (stratified) rank tests
    • Discrete (non-lattice) distribution functions related to rank tests
  • Fast approximations
    • Approximations based on the normal distribution
    • Approximations based on the chi-squared distribution
    • Approximations based on the central \(t\), \(F\) or beta distribution
    • Approximations based on the noncentral chi-squared distribution
    • Approximations based on the noncentral F or beta distribution
    • Approximations based on hypergeometric functions of scalar argument

Gallery of Plots

  • Visualisation of datasets
    • Bar Charts
    • Line and lollipop charts
    • Area Plots
    • Boxplot, Violinplot and Raincloud plot
    • Correlation and regression
    • Financial plots (requires mplfinance)
    • Geographic data (requires cartopy)
    • Geographic data (requires geopandas)
    • Parts of a whole
    • Arcplots, dendrograms, heatmaps and clustermaps
    • PlotTable
    • Flow and connections
    • Circular plots and flows
    • Network data (requires networkx)
  • Visualisation of functions and curves (2D)
    • Introduction to 2D functions and curves
    • Basic curves
    • Spirals
    • Decorative curves
    • General curve families
    • Field lines
    • Contours
    • Complex functions rendered as contours
    • Streams, barbs and quivers (some require cartopy)
  • Bitmaps
    • Fractals: introduction
    • Fractals related to the Mandelbrot set
    • Fractals related to the Julia set
    • Newton Fractals
    • Domain coloring options
    • Domain coloring: Examples part 1
  • Matplotlib 3D Graphics
    • Introduction
    • Matplotlib: 3D Graphics, part 2
    • S3dlib: Basic geometric figures
    • S3dlib: Real functions
    • S3dlib: Parametric Surfaces
    • S3dlib: Image mapping and clipping
    • S3dlib: Edge-to-edge surface coloring
    • S3dlib: Decorative parametric surfaces
    • S3dlib: Geometric and color datagrid mapping (requires scipy)
    • S3dlib: Implicit surfaces (requires scikit-image)
  • Plotly
    • General surface plots in 3D
    • Geographical plots
    • Sankey plots

Interactive 3D Wpf Plots

  • Wpf: Altitude surfaces in 3D, real and complex functions
    • Special techniques for height surfaces, real and complex functions
    • Scatterplots and building 3D scenes
    • Height plots of general bivariate real functions
  • Wpf: Parametric surfaces
    • Surfaces of translation
    • Surfaces of revolution: spheres and related
    • Generalisations of common surfaces
    • Minimal surfaces
    • Nonorientable (one-sided) Surfaces
    • Decorative parametric surfaces
  • Wpf: Path surfaces in 3D
    • Introduction to path surfaces
    • Functions with real input and complex results
    • Characteristic functions of statistical distributions
    • Helices and related curves traced on cylinders, cones and spheres
    • Coil springs
    • General knots
    • Torus knots
    • Lissajous knots
    • Polynomial knots
  • Wpf: Built-in 3D objects
    • Builtin solids with support for textures
    • Builtin solids without support for textures
    • Platonic solids, and related solids

User library: numerical

  • Additional Classes
    • User defined functions based on multiple precision arithmetic (Python)
    • User defined functions based on fixed precision arithmetic (C#)
    • User defined functions based on arbitrary precision arithmetic (C#)
    • Scalar functions
  • Distribution functions
    • Distributions related to multiple comparisons of means
    • Discrete (lattice) distribution functions related to (stratified) rank tests
    • Discrete (non-lattice) distribution functions related to rank tests
  • Inferential statistics
    • Basic classical statistical tests (stratified)
    • Basic classical statistical tests for 2 independent samples (stratified)
    • Basic classical statistical tests for 2 correlated samples (stratified)
    • Analysis of variance (ANOVA), orthogonal polynomials, and analysis of means (AOM)
    • Multiple comparisons of means
    • Nonparametric statistical tests, 1 or 2 samples
    • Nonparametric statistical tests, k samples
    • Multivariate statistical tests
  • Addditional elementary functions (real arguments, double precision)
    • Additional root, exponential, logarithmic and power functions
    • Additional Trigonometric functions (real arguments only)
    • Additional real error functions (real arguments only)
    • Additional real gamma functions (real arguments only)
    • Additional real incomplete gamma functions (real arguments only)
  • Addditional special functions (real arguments, double precision)
    • Conversions of parameters of elliptic functions
    • Additional elliptic integrals
    • Bulirsch elliptic integrals
    • Maple style elliptic integrals
    • Jacobi theta functions at \(x=0\) for \(0 \le q <1\)
    • Inverse Jacobi elliptic functions
    • Lemniscate functions
    • Neville theta functions
    • Polygamma, and related functions
    • Polylogarithm, and related functions
    • Riemann zeta, and related functions
    • Bessel functions of integer order
    • Modified Bessel functions of integer order
    • Integrals of zero-order Bessel functions
    • Kelvin functions of order 0
    • Synchrotron functions
    • Error function, and related functions
    • Exponential integrals, and related functions
    • Coulomb, Whittaker and parabolic cylinder function
    • Hypergeometric pFq, and related functions
    • Miscellaneous functions
  • Addditional special functions (complex arguments, double precision)
    • Conversions of parameters of Weierstrass \(\wp\)
    • Weierstrass elliptic functions, in terms of (real) lattice invariants \(g_2, g_3\)
    • Weierstrass elliptic functions, in terms of (real) lattice roots \(e_1, e_2\)
    • Weierstrass elliptic functions, in terms of lattice half-periods \(\omega_1\) and \(\omega_2\)
  • Addditional special functions (Mpmath)
    • Mpmath: Conversions of parameters of elliptic functions
    • Related to Lerch’s phi
    • Additional numbertheoretic functions
    • Generalized hypergeometric functions
    • Appell Functions
    • Q Functions
    • Further generalizations of gamma and hypergeometric functions

Back matter

  • License and History
    • Mozilla Public License Version 2.0
    • History

Indices

  • General Index
  • .rst

Jacobi theta functions and related functions

Contents

  • Jacobi theta function \(\theta_1(z, q)\)
    • ctx.jacobi_theta1()
  • Jacobi theta function \(\theta_2(z, q)\)
    • ctx.jacobi_theta2()
  • Jacobi theta function \(\theta_3(z, q)\)
    • ctx.jacobi_theta3()
  • Jacobi theta function \(\theta_4(z, q)\)
    • ctx.jacobi_theta4()

Jacobi theta functions and related functions#

The theta functions are functions of two variables:

  • \(z\) is the argument, an arbitrary real or complex number

  • \(q\) is the nome, which must be a real or complex number in the unit disk (i.e. \(|q| < 1\)). For \(|q| \ll 1\), the series converge very quickly, so the Jacobi theta functions can efficiently be evaluated to high precision.

The compact notations \(\theta_n(q) = \theta_n(0,q)\) and \(\theta_n = \theta_n(0,q)\) are also frequently encountered. Finally, Jacobi theta functions are frequently considered as functions of the half-period ratio \(\tau\) and then usually denoted by \(\theta_n(z|\tau)\).

Jacobi theta function \(\theta_1(z, q)\)#

ctx.jacobi_theta1(x, q)#

where ctx is math53, ctxboost or ctxflint.

Returns the Jacobi theta function \(\displaystyle \theta_1(z,q) = 2 q^{1/4} \sum_{n=0}^{\infty} (-1)^n q^{n^2+n\,} \sin((2n+1)z)\)

Note: the Amath version needs to be adapted.

JacobiTheta1

Left figure: real (“silver”) and imaginary (“gold”) part of the Jacobi theta function \(\theta_1(z, q)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.

See also Wikipedia [1424], MathWorld [1039], MathWorld [286], NIST [503], Ehrhardt [309] (3.2.13), Flint [818].

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.JacobiTheta(1, 0.8, 0.5)
xreal('5.2359877559829887307E-1')
>>> xreal.JacobiTheta(2, 0.8, '0.51')
xreal('5.3518479027559984754E-1')

An example with real input for \(\theta_1(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 40; x = '3.8'; q = '0.7'
>>> \mathrm{d}x = dec.jtheta(1, x, q); mx = mpm.jtheta(1, x, q); gx = gmp.jtheta(1, x, q)
>>> fx = fpm.jtheta(1, x, q); ax = apm.jtheta(1, x, q)
>>> mpm.show([\mathrm{d}x, mx, gx, fx, ax])
dec:  -2.876223175938890139154258006053690969477E-1
mpm:  -2.876223175938890139154258006053690969477e-1
gmp:  -2.876223175938890139154258006053690969477E-01
fpm:  -2.87622317593889E-01
apm:  -2.876223175938890139154258006053690969480e-1 (-2.326e-35%)

An example with complex input for \(\theta_1(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 20; z = '11.0 + 3.0j'; q = '0.7 + 0.1j'
>>> \mathrm{d}z = dec.jtheta(1, z, q); mz = mpm.jtheta(1, z, q); gz = gmp.jtheta(1, z, q)
>>> fz = fpm.jtheta(1, z, q); az = apm.jtheta(1, z, q)
>>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True)
dec: 1.3257637053506044723E+10              - 2.5508683032905869130E+9j
mpm: 1.3257637053506044723e+10              - 2.5508683032905869130e+9j
gmp: 1.3257637053506044723E+10              - 2.5508683032905869130E+09j
fpm: 1.32576370535060E+10                   - 2.55086830329060E+09j
apm: 1.3257637053506044630e+10 (4.315e-14%) - 2.5508683032905869160e+9 (-2.258e-13%)j

Jacobi theta function \(\theta_2(z, q)\)#

ctx.jacobi_theta2(x, q)#

where ctx is math53, ctxboost or ctxflint.

Returns the Jacobi theta function \(\displaystyle \theta_2(z,q) = 2 q^{1/4} \sum_{n=0}^{\infty} q^{n^{2\,} + n} \cos((2n+1)z)\)

Note: the Amath version needs to be adapted.

JacobiTheta2

Left figure: real (“silver”) and imaginary (“gold”) part of the Jacobi theta function \(\theta_2(z, q)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.

See also Wikipedia [1424], MathWorld [1039], MathWorld [286], NIST [503], Ehrhardt [309] (3.2.13), Flint [818].

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.JacobiTheta(1, 0.8, 0.5)
xreal('5.2359877559829887307E-1')
>>> xreal.JacobiTheta(2, 0.8, '0.51')
xreal('5.3518479027559984754E-1')

An example with real input for \(\theta_2(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 40; x = '3.8'; q = '0.7'
>>> \mathrm{d}x = dec.jtheta(2, x, q); mx = mpm.jtheta(2, x, q); gx = gmp.jtheta(2, x, q)
>>> fx = fpm.jtheta(2, x, q); ax = apm.jtheta(2, x, q)
>>> mpm.show([\mathrm{d}x, mx, gx, fx, ax])
dec:  -8.802379983271747955434299445752594240170E-1
mpm:  -8.802379983271747955434299445752594240170e-1
gmp:  -8.802379983271747955434299445752594240170E-01
fpm:  -8.80237998327175E-01
apm:  -8.802379983271747955434299445752594240180e-1 (-1.375e-35%)

An example with complex input for \(\theta_2(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 20; z = '11.0 + 3.0j'; q = '0.7 + 0.1j'
>>> \mathrm{d}z = dec.jtheta(2, z, q); mz = mpm.jtheta(2, z, q); gz = gmp.jtheta(2, z, q)
>>> fz = fpm.jtheta(2, z, q); az = apm.jtheta(2, z, q)
>>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True)
dec: 2.6679401530814916188E+11              - 3.0867614993820689042E+11j
mpm: 2.6679401530814916188e+11              - 3.0867614993820689042e+11j
gmp: 2.6679401530814916188E+11              - 3.0867614993820689042E+11j
fpm: 2.66794015308149E+11                   - 3.08676149938205E+11j
apm: 2.6679401530814916130e+11 (4.123e-14%) - 3.0867614993820688890e+11 (-3.758e-14%)j

Jacobi theta function \(\theta_3(z, q)\)#

ctx.jacobi_theta3(x, q)#

where ctx is math53, ctxboost or ctxflint.

Returns the Jacobi theta function \(\displaystyle \theta_3(z,q) = 1 + 2 \sum_{n=1}^{\infty} q^{n^2\,} \cos(2 n z)\)

Note: the Amath version needs to be adapted.

JacobiTheta3

Left figure: real (“silver”) and imaginary (“gold”) part of the Jacobi theta function \(\theta_3(z, q)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.

See also Wikipedia [1424], MathWorld [1039], MathWorld [286], NIST [503], Ehrhardt [309] (3.2.13), Flint [818].

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.JacobiTheta(1, 0.8, 0.5)
xreal('5.2359877559829887307E-1')
>>> xreal.JacobiTheta(2, 0.8, '0.51')
xreal('5.3518479027559984754E-1')

An example with real input for \(\theta_3(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 40; x = '3.8'; q = '0.7'
>>> \mathrm{d}x = dec.jtheta(3, x, q); mx = mpm.jtheta(3, x, q); gx = gmp.jtheta(3, x, q)
>>> fx = fpm.jtheta(3, x, q); ax = apm.jtheta(3, x, q)
>>> mpm.show([\mathrm{d}x, mx, gx, fx, ax])
dec:  8.802381825612654435491537366191521291923E-1
mpm:  8.802381825612654435491537366191521291923e-1
gmp:  8.802381825612654435491537366191521291923E-01
fpm:  8.80238182561266E-01
apm:  8.802381825612654435491537366191521291940e-1 (1.375e-35%)

An example with complex input for \(\theta_3(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 20; z = '11.0 + 3.0j'; q = '0.7 + 0.1j'
>>> \mathrm{d}z = dec.jtheta(3, z, q); mz = mpm.jtheta(3, z, q); gz = gmp.jtheta(3, z, q)
>>> fz = fpm.jtheta(3, z, q); az = apm.jtheta(3, z, q)
>>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True)
dec: -2.6679401441538351941E+11               + 3.0867614546580330581E+11j
mpm: -2.6679401441538351941e+11               + 3.0867614546580330581e+11j
gmp: -2.6679401441538351941E+11               + 3.0867614546580330581E+11j
fpm: -2.66794014415383E+11                    + 3.08676145465801E+11j
apm: -2.6679401441538351880e+11 (-4.086e-14%) + 3.0867614546580330430e+11 (3.758e-14%)j

Jacobi theta function \(\theta_4(z, q)\)#

ctx.jacobi_theta4(x, q)#

where ctx is math53, ctxboost or ctxflint.

Returns the Jacobi theta function \(\displaystyle \theta_4(z,q) = 1 + 2 \sum_{n=1}^{\infty} (-q)^{n^2\,} \cos(2 n z)\)

Note: the Amath version needs to be adapted.

JacobiTheta4

Left figure: real (“silver”) and imaginary (“gold”) part of the Jacobi theta function \(\theta_4(z, q)\). Camera angles are \(\theta=135^\circ\) and \(\phi = -12^\circ\), camera radius is -2.

See also Wikipedia [1424], MathWorld [1039], MathWorld [286], NIST [503], Ehrhardt [309] (3.2.13), Flint [818].

An example in Python

>>> from xlcalcnet import xreal
>>> xreal.JacobiTheta(1, 0.8, 0.5)
xreal('5.2359877559829887307E-1')
>>> xreal.JacobiTheta(2, 0.8, '0.51')
xreal('5.3518479027559984754E-1')

An example with real input for \(\theta_4(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 40; x = '3.8'; q = '0.7'
>>> \mathrm{d}x = dec.jtheta(4, x, q); mx = mpm.jtheta(4, x, q); gx = gmp.jtheta(4, x, q)
>>> fx = fpm.jtheta(4, x, q); ax = apm.jtheta(4, x, q)
>>> mpm.show([\mathrm{d}x, mx, gx, fx, ax])
dec:  2.876275982849924933190081281315277893390E-1
mpm:  2.876275982849924933190081281315277893390e-1
gmp:  2.876275982849924933190081281315277893390E-01
fpm:  2.87627598284992E-01
apm:  2.876275982849924933190081281315277893400e-1 (2.587e-35%)

An example with complex input for \(\theta_4(z,q)\):

>>> from xlcalcnet import dec, mpm, gmp, fpm, apm
>>> mpm.dps = 20; z = '11.0 + 3.0j'; q = '0.7 + 0.1j'
>>> \mathrm{d}z = dec.jtheta(4, z, q); mz = mpm.jtheta(4, z, q); gz = gmp.jtheta(4, z, q)
>>> fz = fpm.jtheta(4, z, q); az = apm.jtheta(4, z, q)
>>> mpm.show([\mathrm{d}z, mz, gz, fz, az], aligned=True)
dec: -1.3378357586306498825E+10               + 2.5798286002171674621E+9j
mpm: -1.3378357586306498825e+10               + 2.5798286002171674621e+9j
gmp: -1.3378357586306498825E+10               + 2.5798286002171674621E+09j
fpm: -1.33783575863064E+10                    + 2.57982860021718E+09j
apm: -1.3378357586306498730e+10 (-4.313e-14%) + 2.5798286002171674650e+9 (2.252e-13%)j

previous

Jacobi elliptic functions

next

Conversions of parameters of Weierstrass \(\wp\)

Contents
  • Jacobi theta function \(\theta_1(z, q)\)
    • ctx.jacobi_theta1()
  • Jacobi theta function \(\theta_2(z, q)\)
    • ctx.jacobi_theta2()
  • Jacobi theta function \(\theta_3(z, q)\)
    • ctx.jacobi_theta3()
  • Jacobi theta function \(\theta_4(z, q)\)
    • ctx.jacobi_theta4()

By Dietrich Hadler

© Copyright 2026, Dietrich Hadler. .

Last updated on Aug 19, 2026.