Haiqu SDK supports loading named multidimensional probability density functions (PDFs) into quantum circuits with haiqu.multivariate_distribution_loading.
job = haiqu.multivariate_distribution_loading( distribution_name="bivariate_student_t", num_qubits=8, # 4 qubits for x and 4 qubits for y interval=((-4.0, 4.0), (-4.0, 4.0)), encoding="probability", distribution_params={ "mu": [0.0, 0.0], "sigma": [[1.0, 0.3], [0.3, 1.0]], "nu": 5.0, },)data_loading_gate = job.result() # a HaiquCircuitGate, encapsulating state preparation circuit
Circuit fidelity is stored in job.quality. This is the MPS-to-circuit compilation fidelity.
For a d-dimensional distribution with nj qubits allocated to dimension j, the qubit layout groups dimensions sequentially: dimension 1 occupies qubits q0(1),…,qn1−1(1), dimension 2 occupies q0(2),…,qn2−1(2), and so on up to dimension d, where q0(j) is the least-significant-bit qubit for dimension j. If num_qubits=(n_1, ..., n_d), the circuit uses nj qubits for dimension j.Each qubit group encodes a grid index in binary: for dimension j, the integer indexij=q0(j)⋅20+q1(j)⋅21+⋯+qnj−1(j)⋅2nj−1maps to the grid pointxij(j)=2nj−1highj−lowjij+lowj∈[lowj,highj].Qiskit uses the qubit-ordering convention ∣qN−1,…,q1,q0⟩ (most-significant qubit on the left), so the statevector index ordering is the reverse of the layout above: the full register reads ∣qnd−1(d),…,q0(d),…,qn1−1(1),…,q0(1)⟩ in Qiskit notation.
proportional to the square root of the density value
proportional to the density value
Probability distribution loading
For a d-dimensional grid point xi=(xi1(1),…,xid(d)) and density f, the two modes encode:ψiamplitude=∑kf(xk)2f(xi)ψiprobability=∑kf(xk)f(xi)
Use encoding="probability" when distribution_name refers to a PDF and measurement outcomes should sample from that PDF.
Name in SDK:bivariate_student_tA heavy-tail generalization of the bivariate Gaussian. It is useful when the joint distribution needs Gaussian-like correlation structure while retaining robustness to tail events and outliers.The density is the standard two-dimensional Student-t PDF with location vector mu, scale matrix sigma, and degrees of freedom nu.f(x,y)=Γ(ν/2)νπ∣Σ∣1/2Γ((ν+2)/2)(1+ν(z−μ)TΣ−1(z−μ))−(ν+2)/2where z=(x,y)T.
Name in SDK:bivariate_gammaKibble’s bivariate Gamma distribution with Gamma marginals and a positive dependence parameter. The implementation uses the scaled modified Bessel function for numerical stability.f(x,y)=Γ(ν)(1−ρ)ρ(ν−1)/2(xy)(ν−1)/2exp(−1−ρx+y)Iν−1(1−ρ2ρxy)where Iν−1 is the modified Bessel function of the first kind. For rho=0, the implementation returns the product of two independent Gamma densities.
Name in SDK:bivariate_von_misesA circular analogue of the bivariate Gaussian, defined on angular variables. The implementation uses the Sine model and computes the normalizing constant numerically.f(θ1,θ2)=exp(κ1cos(θ1−μ1)+κ2cos(θ2−μ2)+λsin(θ1−μ1)sin(θ2−μ2))
Parameter
Type
Constraints
Description
mu1
float
radians
Mean direction of the first angle
mu2
float
radians
Mean direction of the second angle
kappa1
float
at least 0
Concentration of the first angle
kappa2
float
at least 0
Concentration of the second angle
lam
float
real
Coupling parameter
n_norm
int
positive
Grid size per dimension for numerical normalization, default 100
Name in SDK:marshall_olkin_weibullA shock model with independent failure sources for each variable and a shared common shock. The implemented density is the absolutely continuous part; the singular mass on the diagonal x = y is not represented.For x < y, the density is:f(x,y)=λ1(λ2+λ3)k2(xy)k−1exp(−λ1xk−(λ2+λ3)yk)For x > y, the density is:f(x,y)=λ2(λ1+λ3)k2(xy)k−1exp(−(λ1+λ3)xk−λ2yk)On x = y, the absolutely continuous density returned by this function is 0.
Name in SDK:bivariate_poisson_normal_approxA continuous Gaussian approximation to a bivariate Poisson model constructed from X = Z_1 + Z_3 and Y = Z_2 + Z_3, where each Z_i is Poisson-distributed. The shared component Z_3 induces covariance.μ=[λ1+λ3,λ2+λ3]Σ11=λ1+λ3,Σ22=λ2+λ3,Σ12=Σ21=λ3
Copula loading builds a joint PDF from two scipy.stats marginals and a supported copula density using Sklar’s theorem.f(x,y)=c(FX(x),FY(y))fX(x)fY(y)Use a copula name in distribution_name, provide the copula parameters in copula_params, and provide exactly two marginal names and parameter dictionaries.
Copula name
Parameters
Dependence behavior
gaussian_copula
rho in (-1, 1)
Gaussian dependence structure
clayton_copula
theta at least 0
Lower-tail dependence
gumbel_copula
theta at least 1
Upper-tail dependence
frank_copula
non-zero theta
Symmetric dependence without tail concentration
The supported copula densities are:cGaussian(u,v)=1−ρ21exp(2(1−ρ2)ρ(2xy−ρ(x2+y2))),x=Φ−1(u),y=Φ−1(v)cClayton(u,v)=(1+θ)(uv)−(θ+1)(u−θ+v−θ−1)−1/θ−2cGumbel(u,v)=exp(−A1/θ)(st)θ−1A1/θ−2uvA1/θ+θ−1,s=−lnu,t=−lnv,A=sθ+tθcFrank(u,v)=(e−θ−1+(e−θu−1)(e−θv−1))2−θ(e−θ−1)e−θ(u+v)
distribution_params are only valid for direct 2D distributions. For copulas, use copula_params, marginal_distribution_names, and marginal_distribution_params.
Normal and lognormal marginals can be loaded via the copula interface using scipy.stats distribution names. Both examples below use a Gaussian copula, which preserves the familiar Gaussian dependence structure.
Use "lognorm" as both marginal names. In scipy.stats, lognorm is parameterized by shape s (the standard deviation of the underlying normal in log-space), loc (shift, usually 0), and scale (equal to exp(mu) where mu is the mean of the underlying normal).
The lognormal interval must exclude zero. Use a small positive lower bound such as 0.01 rather than 0.0 to avoid evaluating the density at the boundary.
⌘I
Assistant
Responses are generated using AI and may contain mistakes.