Skip to main content

Supported Characteristic Functions

Haiqu SDK supports loading probability density functions from characteristic functions (CFs) directly into quantum states. Many distributions — across finance, physics, queuing theory, and heavy-tail modelling — are most naturally specified through their CF ϕ(u)=E[eiuX]\phi(u) = \mathbb{E}[e^{iuX}] because their PDF has no closed form or is analytically intractable. Load the PDF of any supported distribution via its characteristic function using:
The functions are organized into three branches:

AJD Branch

The AJD (Affine Jump-Diffusion) branch models logST\log S_T as Heston stochastic volatility with optional independent jump sources. dps_cf is the most general model; all others are obtained by zeroing parameters.

Heston Model

Name in SDK: heston_cf  |  Citation: Heston (1993)  |  PDF support: (,)(-\infty,\, \infty) The industry-standard stochastic volatility model. Its mean-reverting variance process captures the volatility smile without jumps, is analytically tractable, and calibrates efficiently to vanilla option surfaces — making it the natural first choice for equity and foreign exchange derivatives. ϕ(u)=exp(iulogS0+C(u)+D(u)v0)\phi(u) = \exp\bigl(iu\log S_0 + C(u) + D(u)\,v_0\bigr) The Riccati coefficients CC and DD are solved in the numerically stable form of Albrecher et al. (2007). Define the intermediate quantities ξ=κρσiu,d=ξ2+σ2(u2+iu),g=ξdξ+d\xi = \kappa - \rho\sigma\, iu, \qquad d = \sqrt{\xi^2 + \sigma^2(u^2 + iu)}, \qquad g = \frac{\xi - d}{\xi + d} then C(u)=(rq)iuT  +  κθσ2[(ξd)T2ln1gedT1g]C(u) = (r-q)\,iu\,T \;+\; \frac{\kappa\theta}{\sigma^2}\left[(\xi - d)\,T - 2\ln\frac{1 - g\,e^{-dT}}{1 - g}\right] D(u)=ξdσ21edT1gedTD(u) = \frac{\xi - d}{\sigma^2}\cdot\frac{1 - e^{-dT}}{1 - g\,e^{-dT}} CC captures the cumulative drift and mean-reversion cost over [0,T][0,T]; DD is the sensitivity of the log-CF to the current variance v0v_0, decaying toward zero as the variance mean-reverts to θ\theta.
The Feller condition 2κθ>σ22\kappa\theta > \sigma^2 ensures the variance process vtv_t remains strictly positive. If violated, vtv_t can hit zero and the characteristic function may become numerically unreliable.

Bates Model

Name in SDK: bates_cf  |  Citation: Bates (1996)  |  PDF support: (,)(-\infty,\, \infty) Extends Heston with independent log-normal price jumps, capturing the steep short-maturity skew that pure diffusion cannot reproduce. The standard model for equity index options where crash risk matters. ϕBates(u)=ϕHeston(u)exp(λT(eiuμj12σj2u21iuμˉ))\phi_{\text{Bates}}(u) = \phi_{\text{Heston}}(u) \cdot \exp\Bigl(\lambda T\bigl(e^{iu\mu_j - \frac{1}{2}\sigma_j^2 u^2} - 1 - iu\bar\mu\bigr)\Bigr) where μˉ=eμj+12σj21\bar\mu = e^{\mu_j + \frac{1}{2}\sigma_j^2} - 1 is the martingale drift correction that keeps e(rq)TS0e^{(r-q)T}S_0 as the forward price. Additional parameters (inherits all Heston parameters):

SVJJ Model

Name in SDK: svjj_cf  |  Citation: Duffie, Pan & Singleton (2003), Eraker (2003)  |  PDF support: (,)(-\infty,\, \infty) Extends Bates with independent exponential variance jumps, allowing volatility to spike discretely alongside price crashes. Empirically important for fitting the joint dynamics of the spot and VIX surfaces around market stress events. ϕSVJJ(u)=ϕBates(u)exp(cvj)\phi_{\text{SVJJ}}(u) = \phi_{\text{Bates}}(u) \cdot \exp(c_{vj}) where D(u,s)D(u,s) is the Heston DD coefficient evaluated at remaining time ss rather than the full maturity TT: D(u,s)=ξdσ21eds1gedsD(u,s) = \frac{\xi - d}{\sigma^2}\cdot\frac{1 - e^{-ds}}{1 - g\,e^{-ds}} The variance-jump contribution integrates the moment-generating function of an exponential jump against this time-varying coefficient: cvj=λv0T[11μvD(u,s)1]dsc_{vj} = \lambda_v \int_0^T \left[\frac{1}{1 - \mu_v D(u,s)} - 1\right] ds The integrand is the CGF of one exponential(1/μv1/\mu_v) variance jump evaluated at D(u,s)D(u,s); the integral is evaluated in closed form. Additional parameters (inherits all Bates parameters):

DPS Model (most general AJD)

Name in SDK: dps_cf  |  Citation: Duffie, Pan & Singleton (2003)  |  PDF support: (,)(-\infty,\, \infty) Extends SVJJ with a third correlated jump source: simultaneous price and variance jumps whose sizes are statistically dependent. All narrower AJD models are special cases obtained by zeroing parameters. ϕDPS(u)=ϕSVJJ(u)exp(ccorr)\phi_{\text{DPS}}(u) = \phi_{\text{SVJJ}}(u) \cdot \exp(c_{\text{corr}}) where D(u,s)D(u,s) is defined as in the SVJJ section, and the correlated-jump contribution accounts for the joint distribution of a price jump JSJvN(μj+ρjJv,σj2)J_S \mid J_v \sim \mathcal{N}(\mu_j + \rho_j J_v,\, \sigma_j^2) and a variance jump JvExp(1/μv)J_v \sim \mathrm{Exp}(1/\mu_v): ccorr=λc0T[KcμvD(u,s)1iuμˉc]dsc_{\text{corr}} = \lambda_c \int_0^T \left[\frac{K}{c - \mu_v D(u,s)} - 1 - iu\bar\mu_c\right] ds with K=eiuμj12σj2u2K = e^{iu\mu_j - \frac{1}{2}\sigma_j^2 u^2}, c=1μviuρjc = 1 - \mu_v\, iu\,\rho_j, and μˉc=eμj+12σj2/(1ρjμv)1\bar\mu_c = e^{\mu_j + \frac{1}{2}\sigma_j^2}/(1 - \rho_j\mu_v) - 1. The integral is evaluated in closed form. Additional parameters (inherits all SVJJ parameters):

Lévy-OU Branch

BNS Model

Name in SDK: bns_cf  |  Citation: Barndorff-Nielsen & Shephard (2001)  |  PDF support: (,)(-\infty,\, \infty) Drives variance through a non-Gaussian Ornstein–Uhlenbeck process subordinated to a Lévy process (e.g. Gamma). This produces heavier tails than Heston and naturally accommodates the empirically observed non-Gaussian distribution of variance increments, making it particularly suited to energy and commodity markets. ϕ(u)=exp(iulogS0+iu(rq)T+A(u)+B(u)σ02)\phi(u) = \exp\bigl(iu\log S_0 + iu(r-q)T + A(u) + B(u)\,\sigma^2_0\bigr) Here uRu \in \mathbb{R} is the Fourier argument, i.e. ϕ(u)=E[eiulogST]\phi(u) = \mathbb{E}[e^{iu\log S_T}]. B(u,s)B(u,s) — sensitivity to the initial variance σ02\sigma^2_0, obtained by integrating the OU impulse-response function against the standard risk-neutral price–variance loading (β=12\beta = -\tfrac{1}{2} baked in). Here ss is the remaining time, so B(u,s)B(u,s) evaluated at s=Ts = T gives the full-horizon coefficient: B(u,s)=u2+iu2λ(1eλs)B(u,s) = -\frac{u^2 + iu}{2\lambda}\left(1 - e^{-\lambda s}\right) As ss \to \infty, B(u2+iu)/(2λ)B \to -(u^2+iu)/(2\lambda); the initial variance is “forgotten” at rate λ\lambda. A(u)A(u) — cumulative contribution from the subordinator’s Lévy measure, obtained by integrating the log-Laplace exponent ΨZ\Psi_Z of the subordinator along the shifted BB-curve: A(u)=0TΨZ(B(u,s)+iuρ)dsA(u) = \int_0^T \Psi_Z\bigl(B(u,s) + iu\rho\bigr)\, ds The additive iuρiu\rho inside ΨZ\Psi_Z is the direct jump leverage: it correlates price jumps with variance jumps instantaneously. Set ρ=0\rho = 0 to disable this channel. The Lévy time-change factor λ\lambda from the paper is absorbed into the subordinator parameters aa and bb rather than appearing explicitly outside the integral. For the Gamma subordinator with shape aa and rate bb: ΨZ(θ)=aln(1θb)\Psi_Z(\theta) = -a\ln\left(1 - \frac{\theta}{b}\right) This integral has no closed form in general and is evaluated by numerical quadrature (controlled by parameter n).
Only the 'gamma' subordinator is currently supported. Increase n for higher precision at longer maturities.

Pure Lévy Processes

CGMY / Tempered Stable

Name in SDK: cgmy_cf  |  Citation: Carr, Geman, Madan & Yor (2002)  |  PDF support: (,)(-\infty,\, \infty) A four-parameter pure-jump Lévy model that nests Variance Gamma (Y0Y \to 0) and approaches Brownian motion as Y2Y \to 2. The fine-structure index YY directly controls whether the process has finite or infinite variation, making CGMY the go-to model for studying jump activity in high-frequency return data. ϕ(u)=exp(CΓ(Y)[(Miu)YMY+(G+iu)YGY])\phi(u) = \exp\bigl(C\,\Gamma(-Y)\bigl[(M - iu)^Y - M^Y + (G + iu)^Y - G^Y\bigr]\bigr)
cgmy_cf raises ValueError if Y is outside (0,2)(0, 2) or is an integer (pole of Γ(Y)\Gamma(-Y)).

Variance Gamma

Name in SDK: variance_gamma_cf  |  Citation: Madan, Carr & Chang (1998)  |  PDF support: (,)(-\infty,\, \infty) Brownian motion with drift time-changed by a Gamma process. Produces semi-heavy tails and controllable skewness with only three parameters, making it both parsimonious and analytically convenient for calibration to vanilla options across strikes and maturities. ϕ(u)=(1iθνu+12σ2νu2)1/ν\phi(u) = \left(1 - i\theta\nu u + \tfrac{1}{2}\sigma^2\nu\, u^2\right)^{-1/\nu}

Meixner Process

Name in SDK: meixner_cf  |  Citation: Schoutens (2001)  |  PDF support: (,)(-\infty,\, \infty) An infinite-activity pure-jump Lévy process with a closed-form characteristic function built from hyperbolic cosines. Its four parameters independently control scale, skewness, tail heaviness, and location, giving excellent flexibility for fitting option smiles while remaining computationally efficient. ϕ(u)=eiμu(cos(β/2)cosh(αuiβ2))2δ\phi(u) = e^{i\mu u}\left(\frac{\cos(\beta/2)}{\cosh\left(\tfrac{\alpha u - i\beta}{2}\right)}\right)^{2\delta}
meixner_cf raises ValueError if beta is outside (π,π)(-\pi, \pi).

Holtsmark Distribution

Name in SDK: holtsmark_cf  |  Citation: Holtsmark (1919)  |  PDF support: (,)(-\infty,\, \infty) Special case S(3/2,0,γ,δ)S(3/2,\,0,\,\gamma,\,\delta). Originally derived to model the gravitational field of a random stellar ensemble; its infinite variance makes it a powerful model for extreme-event phenomena in plasma physics and anomalous diffusion. ϕ(u)=exp(iuδγ3/2u3/2)\phi(u) = \exp\bigl(iu\delta - \gamma^{3/2}|u|^{3/2}\bigr) Parameters (alpha=1.5, beta=0 fixed):

Landau Distribution

Name in SDK: landau_cf  |  Citation: Bulyak (2022)  |  PDF support: (,)(-\infty,\, \infty) Special case S(1,1,γ,δ)S(1,\,1,\,\gamma,\,\delta) — maximally right-skewed with a heavy right tail. Originally models ionisation energy loss of charged particles in thin matter layers; in data science it appears as a model for right-skewed count data and timing jitter. ϕ(u)=exp(iuδγu[1+i2πsgn(u)lnu])\phi(u) = \exp\Bigl(iu\delta - \gamma|u|\Bigl[1 + i\,\tfrac{2}{\pi}\,\text{sgn}(u)\ln|u|\Bigr]\Bigr) Parameters (alpha=1, beta=1 fixed):

Linnik / Geometric Stable

Name in SDK: linnik_cf  |  Citation: Klebanov (1985)  |  PDF support: (,)(-\infty,\, \infty) The law of a geometric sum of i.i.d. stable random variables. Heavier-tailed than the corresponding stable law, making it useful for modelling waiting times in queuing, anomalous diffusion, and financial durations. The symmetric case simplifies to ϕ(u)=(1+uα)1\phi(u) = (1 + |u|^\alpha)^{-1}. ϕ(u)=11Ψstable(u)\phi(u) = \frac{1}{1 - \Psi_{\text{stable}}(u)} where Ψstable(u)=lnϕstable(u)\Psi_{\text{stable}}(u) = \ln\phi_{\text{stable}}(u) is the Lévy exponent of the underlying stable distribution (not the stable CF itself).

Bilateral Gamma

Name in SDK: bilateral_gamma_cf  |  Citation: Küchler & Tappe (2019)  |  PDF support: (,)(-\infty,\, \infty) Decomposes log-returns into independent positive and negative Gamma jump components, each with its own shape and rate. This asymmetric structure naturally captures the empirical observation that upward and downward moves in asset prices have different statistical properties. ϕ(u)=(b+b+iu)a+(bb+iu)a\phi(u) = \left(\frac{b_+}{b_+ - iu}\right)^{a_+}\left(\frac{b_-}{b_- + iu}\right)^{a_-}

Compound Poisson Process

Name in SDK: compound_poisson_cf  |  Citation: Gao (2022)  |  PDF support: depends on jump type (see table below) A finite-activity pure-jump process — the simplest possible jump model. Ideal for modelling rare, large events such as sovereign defaults, catastrophe losses, or earnings announcements, where the assumption of a finite number of jumps per unit time is realistic. ϕ(u)=exp(λ(ϕX(u)1))\phi(u) = \exp\bigl(\lambda(\phi_X(u) - 1)\bigr)
  • Model selection: Start with heston_cf for equity derivatives; extend to bates_cf or dps_cf if short-maturity skew or volatility jumps are under-fitted.
  • Fidelity: circuit fidelity depends on num_qubits and the fraction of PDF mass within [interval_start, interval_end] — increase num_qubits or widen the interval to improve it.
  • SciPy distributions: For standard distributions (Normal, Beta, Gamma, …) use Distribution Loading instead.