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.
Haiqu.entangled_manifold_embedding(data, density=2, num_qubits=None, real=True, periodicity=False, num_layers=2, truncation_cutoff=1e-06, fine_tuning_iterations=20, name=None)
Generate a quantum circuit that produces entangled manifold embedding of the real data into a quantum state of a controllable entanglement. The size of the Hilbert space, where the embedding is produced, is controlled by the density parameter. Using larger density results in usage of more entangled states for the embedding, which allows to encode more features, but results in more complicated quantum circuits. 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 complexity and quality of the generated circuit can be controlled by thenum_layers, truncation_cutoff, and
fine_tuning_iterations parameters.
- Parameters:
- data (Sequence *[*Real ]) — The real vector with data to encode.
- density (int | None) — (int | None): Feature density of the encoding (from 1 to 8). Larger values result in more features
encoded per qubit but resulting quantum states are more entangled. Ignored if
num_qubitsis set, in which case the minimal density that is compatible with the given number of qubits is chosen. Defaults to2. - num_qubits (int | None) — (int | None): number of qubits for the embedding (from 1 to 1000 qubits). If
None, then it is set automatically from data size. Otherwise, it uses given number of qubits and automatically sets the minimal possible density. Data vector is extended with zero padding if necessary. The general scaling of the data size, which can be encoded, is O(num_qubits*density^2), up to small corrections. Defaults toNone. - real (bool) — if True, then a real quantum state is prepared, otherwise imaginary part is also used, doubling
the amount of features, which can be encoded in the same isometries. Defaults to
True. - periodicity (bool) — if True, then additional tangent transform is performed over data, adding periodicity
properties to the encoding. With
density==1it matches angular encoding. Defaults toFalse. - num_layers (int) — The number of layers in the generated circuit (from 1 to 15 layers). 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, maximum is 200.
- 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.
: Call
job.result()to retrieve a Qiskit-compatible gate (HaiquCircuitGate) that performs the entangled manifold embedding of the input vector.job.qualityis the achieved encoding fidelity vs. the ideal embedded state;job.infoexposes loader metadata (fidelity). Runhelp(job.result)for the full description of result andinfocontents. - Return type: DataLoadingJobModel