Haiqu.vector_loading(data: Sequence[Number], num_qubits: int | None = None, num_layers: int = 2, truncation_cutoff: Real = 1e-06, fine_tuning_iterations: int = 20, name: str | None = None) → DataLoadingJobModel
Generate a quantum circuit that prepares an arbitrary real or complex vector. Given a vector of data, 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 vector to a quantum algorithm for processing. The cost and time of this job can be estimated withvector_loading_estimates().
The complexity and quality of the generated circuit can be controlled by the num_layers, truncation_cutoff, and
fine_tuning_iterations parameters.
If len(data) < 2**num_qubits, the vector will be padded with zeros.
- Parameters:
- data (Sequence *[*Number ]) — The vector with data to encode.
- num_qubits — (int | None): The number of qubits in the generated circuit. If
None(default), it is set automatically from the size of the data. - num_layers (int) — The number of layers in the generated circuit. More layers can improve the quality of the output vector at the cost of a deeper circuit. Defaults to 2.
- 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. - fine_tuning_iterations (int) — The maximum number of fine-tuning iterations to perform after each layer is added. Increasing this limit may improve the quality of the circuit by using more classical resources. Defaults to 20.
- name (str | None) — The name for the job and the produced circuit. If
None(default), a name will be automatically generated.
- Returns: The Data Loading job that will generate the circuit for the data vector.
- Return type: DataLoadingJobModel