Skip to main content

Haiqu.mps_loading(mps, shape=‘plr’, 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 prepares a quantum state from matrix product state (MPS). The MPS is normalized in the process, and expect physical index to be of size 2. Given a MPS, 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 state to a quantum algorithm for processing. Two MPS formats are supported:
  1. Standard form (only site tensors):
  2. Vidal form (site and bond tensors):
The complexity and quality of the generated circuit are controlled by synthesis_options. Passing the MPS with high bond dimension may degrade the quality and synthesis time.

NOTE

Qubit / MPS site order. Site tensor A_i (0-based) in the input MPS corresponds to circuit qubit q_i. The resulting statevector uses standard Qiskit ordering (rightmost bit = qubit 0), the same convention as vector_loading() and statevector_run().
  • Parameters:
    • mps (Sequence) — The MPS in either standard or Vidal form. Standard form expects a list of rank-3 site tensors (one per each qubit). Vidal form is a tuple of site and bond tensors, where bonds tensors are rank-1 or diagonal rank-2 tensors. The MPS type is determined automatically. Standard form includes left- and right-canonical forms, while Vidal form includes central canonical form. The maximal bond dimension we accept is 64.
    • shape (str) — shape of site tensors of the MPS. Site tensors are rank-3 tensors. Shape defines the order of axes in it. p - physical index, l - left index, r - right index. Defaults to “plr”, which is standard order in Qiskit.
    • 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=2, layer_type="V", bond_dim_layer=2, entanglement_cutoff=1e-6, fine_tuning_iterations=20).
    • 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 from the MPS. : In a notebook, a link to the job on the Dashboard is also displayed when haiqu.verbosity is "high".
  • Return type: DataLoadingJobModel

Examples

Loading Qiskit MPS:
Preparing a ground state of a Hamiltonian: