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:- Standard form (only site tensors):
- Vidal form (site and bond tensors):
synthesis_options.
Passing the MPS with high bond dimension may degrade the quality and synthesis time.
NOTE
Qubit / MPS site order. Site tensorA_i(0-based) in the input MPS corresponds to circuit qubitq_i. The resulting statevector uses standard Qiskit ordering (rightmost bit = qubit 0), the same convention asvector_loading()andstatevector_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,BlockwiseSynthesisOptionsorVariationalSynthesisOptions, 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 toNone, which this method unwraps intoAnalyticalSynthesisOptions(num_layers=2, layer_type="V", bond_dim_layer=2, entanglement_cutoff=1e-6, fine_tuning_iterations=20). - num_layers (int) — Deprecated. Pass
num_layersinsidesynthesis_options. - truncation_cutoff (Real) — Deprecated. Renamed to
entanglement_cutoffinsidesynthesis_options. - fine_tuning_iterations (int) — Deprecated. Pass
fine_tuning_iterationsinsidesynthesis_optionsinstead. - 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.verbosityis"high". - Return type: DataLoadingJobModel