- class QuantumInstance(backend, shots=None, seed_simulator=None, basis_gates=None, coupling_map=None, initial_layout=None, pass_manager=None, bound_pass_manager=None, seed_transpiler=None, optimization_level=None, backend_options=None, noise_model=None, timeout=None, wait=5.0, skip_qobj_validation=True, measurement_error_mitigation_cls=None, cals_matrix_refresh_period=30, measurement_error_mitigation_shots=None, job_callback=None, mit_pattern=None, max_job_retries=50)[소스]¶
Deprecated: Quantum Backend including execution setting.
Quantum Instance holds a Qiskit Terra backend as well as configuration for circuit transpilation and execution. When provided to an Aqua algorithm the algorithm will execute the circuits it needs to run using the instance.
버전 0.24.0부터 폐지됨: The class
qiskit.utils.quantum_instance.QuantumInstanceis deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit https://qisk.it/qi_migration.
backend (Backend) – Instance of selected backend
shots (Optional[int]) – Number of repetitions of each circuit, for sampling. If None, the shots are extracted from the backend. If the backend has none set, the default is 1024.
seed_simulator (Optional[int]) – Random seed for simulators
basis_gates (Optional[List[str]]) – List of basis gate names supported by the target. Defaults to basis gates of the backend.
coupling_map (Optional[Union['CouplingMap', List[List]]]) – Coupling map (perhaps custom) to target in mapping
initial_layout (Optional[Union['Layout', Dict, List]]) – Initial layout of qubits in mapping
pass_manager (Optional['PassManager']) – Pass manager to handle how to compile the circuits. To run only this pass manager and not the
bound_pass_manager, call the
transpile()method with the argument
bound_pass_manager (Optional['PassManager']) – A second pass manager to apply on bound circuits only, that is, circuits without any free parameters. To only run this pass manager and not
transpile()method with the argument
pass_manager=quantum_instance.bound_pass_manager. manager should also be run.
seed_transpiler (Optional[int]) – The random seed for circuit mapper
optimization_level (Optional[int]) – How much optimization to perform on the circuits. Higher levels generate more optimized circuits, at the expense of longer transpilation time.
backend_options (Optional[Dict]) – All running options for backend, please refer to the provider of the backend for information as to what options it supports.
noise_model (Optional['NoiseModel']) – noise model for simulator
timeout (Optional[float]) – Seconds to wait for job. If None, wait indefinitely.
wait (float) – Seconds between queries for job result
skip_qobj_validation (bool) – Bypass Qobj validation to decrease circuit processing time during submission to backend.
measurement_error_mitigation_cls (Optional[Callable]) – The approach to mitigate measurement errors. The classes
qiskit.utils.mitigationmodule can be used here as exact values, not instances.
TensoredMeasFitterdoesn’t support the
cals_matrix_refresh_period (int) – How often to refresh the calibration matrix in measurement mitigation. in minutes
measurement_error_mitigation_shots (Optional[int]) – The number of shots number for building calibration matrix. If None, the main shots parameter value is used.
job_callback (Optional[Callable]) – Optional user supplied callback which can be used to monitor job progress as jobs are submitted for processing by an Aqua algorithm. The callback is provided the following arguments: job_id, job_status, queue_position, job
mit_pattern (Optional[List[List[int]]]) – Qubits on which to perform the TensoredMeasFitter measurement correction, divided to groups according to tensors. If None and qr is given then assumed to be performed over the entire qr as one group (default None).
max_job_retries (int) – positive non-zero number of trials for the job set (-1 for infinite trials) (default: 50)
- 예외 발생
QiskitError – the shots exceeds the maximum number of shots
QiskitError – set noise model but the backend does not support that
QiskitError – set backend_options but the backend does not support that
Get the stored calibration matrices and its timestamp.
A wrapper to interface with quantum backend.
Calculate the time difference from the query of last time.
Reset execution results
Set configurations for the quantum instance.
A wrapper to transpile circuits to allow algorithm access the transpiled circuits.
Return Backend backend object.
Getter of backend_config.
Return backend name.
Getter of backend_options.
Return the pass manager for designated for bound circuits.
The pass manager for bound circuits, if it has been set.
- 반환 형식
returns matrix refresh period
Getter of circuit summary.
Getter of compile_config.
Return True if backend is a local backend.
Return True if backend is a simulator.
Return True if backend is a statevector-type simulator.
Getter of max tries
returns measurement error mitigation cls
returns measurement error mitigation shots
Getter of noise_config.
Getter of qjob_config.
Getter of run_config.
checks if skip qobj validation
Accumulated time taken for execution.
Return the pass manager for designated for unbound circuits.
The pass manager for unbound circuits, if it has been set.
- 반환 형식