Haiqu.distribution_loading(num_qubits: int, distribution_name: str, interval_start: Real, interval_end: Real, loc: Real = 0, scale: Real = 1, num_layers: int = 1, truncation_cutoff: Real = 1e-06, name: str | None = None, **shape) → DataLoadingJobModel
Generate a quantum circuit that prepares a probability distribution. Given the description of a probability distribution function (PDF), this method creates a Data Loading job that runs in the Haiqu cloud. The result of this job is a circuit which can be used to supply the PDF to a quantum algorithm for processing. The cost and time of this job can be estimated withdistribution_loading_estimates().
The complexity of the generated circuit can be controlled by the num_layers and truncation_cutoff parameters.
- Parameters:
- num_qubits (int) — The number of qubits in the generated circuit.
- distribution_name (str) — The name of the distribution. Can be any of the continuous distributions in
scipy.stats. - interval_start (Real) — The beginning of the interval.
- interval_end (Real) — The end of the interval.
- loc (Real) — The location to which to shift the distribution. Defaults to 0.
- scale (Real) — The scaling factor by which to stretch the distribution. Defaults to 1.
- num_layers (int) — The number of layers in the generated circuit. More layers can improve the quality of the output distribution at the cost of a deeper circuit. Defaults to 1.
- truncation_cutoff (Real) — The entanglement cutoff for later layers. Increasing this threshold may result in a smaller
(but more approximate) circuit. Defaults to
1e-6. - name (str | None) — The name for the job and the produced circuit. If
None(default), a name will be automatically generated. - **shape — Additional distribution parameters, required by some distributions. Refer to the distribution documentation
in
scipy.statsfor more details.
- Returns: The Data Loading job that will generate the circuit for the probability distribution.
- Return type: DataLoadingJobModel