Skip to main content

Haiqu.entangled_manifold_embedding(data, density=2, num_qubits=None, real=True, periodicity=False, synthesis_options=None, num_layers=None, truncation_cutoff=None, fine_tuning_iterations=None, max_time=900, name=None, job_description=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 are controlled by synthesis_options.

NOTE

Feature order (not amplitude indexing). data[k] is the k-th classical input feature in list order. This loader performs entangled manifold embedding; it does not map list entries to computational-basis amplitudes like vector_loading().
  • Parameters:
    • data (Sequence *[*Real ]) — The real vector with data to encode. data[k] is the k-th input feature in list order (not a computational-basis amplitude index).
    • 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_qubits is set, in which case the minimal density that is compatible with the given number of qubits is chosen. Whichever way it is arrived at, it also sets the width of the synthesis layers unless synthesis_options gives them a width of their own. Defaults to 2.
    • 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 to None.
    • 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 manifold. Defaults to True.
    • periodicity (bool) — if True, then additional tangent transform is performed over data, adding periodicity properties to the encoding. With density==1 it matches angular encoding. Defaults to False.
    • synthesis_options (dict | DataLoadingSynthesisOptions) — How the circuit preparing the data is synthesized. Pass one of AnalyticalSynthesisOptions, BlockwiseSynthesisOptions or VariationalSynthesisOptions, or an equivalent dict whose "method" key names one of them. Those three classes document every option each method accepts, what it means and what it defaults to. Defaults to None, which this method unwraps into AnalyticalSynthesisOptions(num_layers=1, layer_type="V", bond_dim_layer=None, entanglement_cutoff=1e-6, fine_tuning_iterations=0). The bond_dim_layer=None above is the layer width equal to density, and 2 for a density below that. Options of your own replace that whole set, so keep bond_dim_layer at None in them to keep that width.
    • num_layers (int) — Deprecated. Pass num_layers inside synthesis_options.
    • truncation_cutoff (Real) — Deprecated. Renamed to entanglement_cutoff inside synthesis_options.
    • fine_tuning_iterations (int) — Deprecated. Pass fine_tuning_iterations inside synthesis_options instead.
    • max_time (int | float) — Soft time limit for the job (in seconds). The data loading job will first always produce the initial result and then limit the fine-tuning stage by the remaining time left. If time limit exceeds during the fine-tuning - the best current result will be returned. Defaults to 900 (15 min). Max allowed job time is 15 min. The job can take more wall clock time than user specified max_time due to latency, initialization overheads or if the initial result already takes more time.
    • name (str | None) — The name for the job and the produced circuit. If None (default), a name will be automatically generated.
    • job_description (str | None)
  • 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.quality is the achieved encoding fidelity vs. the ideal embedded state; job.info exposes loader metadata (fidelity). Run help(job.result) for the full description of result and info contents. In a notebook, a link to the job on the Dashboard is also displayed when haiqu.verbosity is "high".
  • Return type: DataLoadingJobModel

Examples