A key challenge in quantum computing applications — such as quantum machine learning, finance, and optimization — is efficiently encoding classical data into quantum states. In this tutorial, we’ll load a classical probability distribution (like the normal distribution) into a quantum state, which is a core primitive for various financial and simulation applications. Haiqu SDK offers a simple function to load over 100 distributions supported by scipy.stats library. For example, loading a Normal distribution into the quantum state can be done by running the following function that initializes a data loading job:Documentation Index
Fetch the complete documentation index at: https://docs.haiqu.ai/llms.txt
Use this file to discover all available pages before exploring further.
job.result()the job result:
fidelity quantifies the overlap between a wavefunction generated by the synthesized circuit and the exact discretized input distribution, computed as quantum state fidelity.
The quality of the obtained data loading circuit can be visually verified using e.g. statevector simulation. For the Normal distribution example using num_qubits=8 we obtain the following result:

distribution_loading method are:
distribution_name:name of the statistical distribution fromscipy.stats.interval_startandinterval_end: the boundaries of the interval over which the distribution will be discretized before loading into the quantum state.num_qubits: the number of qubits used, which sets the discretization resolution.
loc(default: 00) → The location/mean of the distribution.scale(default: 11) → Scale or spread, often linked to variance.shapeparameters → Distribution-specific extra parameters. Check SciPy docs for details.
num_layers(default: 11) → Number layer in the data loading circuit. More layers = better approximation of data or distribution, but more gates.truncation_cutoff(default:1e-6) → A threshold for cutting off low-entanglement gates. Set toNoneor0for no truncation (full entanglement retained).
Distribution Loading Specifications
| Parameter | Details |
|---|---|
| Number of qubits | Up to 1000 qubits |
| Number of distributions | 107 different classes of distributions are supported. Check SciPy docs for details. |
| Runtime | 1–15 seconds |
| Runtime scaling | Linear scaling with number of qubits |
| Circuit size (gates count) | O(n), n = number of qubits |
| Circuit depth | O(n/2), n = number of qubits |
| Circuit connectivity | Linear |
| Other circuit properties | - No mid-circuit measurements - Only CNOT and single-qubit rotation gates - No ancillary qubits - No post-selection required in state preparation |
| Returned metrics | Quantum state fidelity is returned for the ideal state prepared by the circuit |