Module qi_result
- class QIResult(backend_name, backend_version, qobj_id, job_id, success, results, date=None, status=None, header=None, **kwargs)[source]
Bases:
Result
- A result object returned by QIJob:
qi_backend = QI.get_backend(‘QX single-node simulator’) job = qi_backend.retrieve_job(job_id) qi_result = job.result()
Construct a new QIResult object. Not normally called directly, use a QIJob to get the QIResult. Based on Qiskit Result.
- Parameters:
backend_name (str) – backend name.
backend_version (str) – backend version, in the form X.Y.Z.
qobj_id (str) – user-generated Qobj id.
job_id (str) – unique execution id from the backend.
success (bool) – True if complete input qobj executed correctly. (Implies each experiment success)
results (List[ExperimentResult]) – corresponding results for array of experiments of the input qobj
date (Any) – date to be added to the result object
status (Any) – status to be added to the result object
header (Any) – header to be added to the result object
kwargs (Any) – other parameters (added as metadata to the result object)
- get_raw_result(field_name, experiment=None)[source]
Get the specific and unprocessed result data of an experiment. Can handle single and multi measurement results.
- Parameters:
field_name (str) – the specific result that is requested Can be one of ‘calibration’, ‘counts’, ‘memory’, ‘probabilities’ or the multi measurement results ‘counts_multiple_measurement’, ‘memory_multiple_measurement’, ‘probabilities_multiple_measurement’
experiment (Any | None) – the index of the experiment (str or QuantumCircuit or Schedule or int or None), as specified by
get_data()
.
- Returns:
A list with result structures which holds the specific unprocessed result for each experiment.
- Raises:
QiskitBackendError – raised if the results requested are not in the results for the experiment(s).
- Return type:
List[Dict[str, Any]] | List[List[List[str]]] | List[List[Dict[str, float]]]
- get_probabilities(experiment=None)[source]
Get the probability data of an experiment. The probability data is added as a separate result by Quantum Inspire backend.
- Parameters:
experiment (Any | None) – the index of the experiment (str or QuantumCircuit or Schedule or int or None), as specified by
get_data()
.- Returns:
A single or a list of dictionaries which holds the states and probabilities for respectively 1 or more experiment result.
- Raises:
QiskitBackendError – raised if there are no probabilities in a result for the experiment(s).
- Return type:
Dict[str, float] | List[Dict[str, float]]
- get_probabilities_multiple_measurement(experiment=None)[source]
Get the probability data of an experiment for all measurement blocks. The probability data is added as a separate result by Quantum Inspire backend.
- Parameters:
experiment (Any | None) – the index of the experiment (str or QuantumCircuit or Schedule or int or None), as specified by
get_data()
.- Returns:
One list or a list of list of dictionaries which holds the states and probabilities for each measurement block for respectively 1 or more experiment result.
- Raises:
QiskitBackendError – raised if there are no multi measurement probabilities in a result for the experiment(s).
- Return type:
List[Dict[str, float]] | List[List[Dict[str, float]]]
- get_calibration(experiment=None)[source]
Get the calibration data of an experiment. The calibration data is added as a separate result item by Quantum Inspire backend.
- Parameters:
experiment (Any | None) – the index of the experiment, as specified by
get_data()
. experiment can be: str or QuantumCircuit or Schedule or int or None- Returns:
Single or a list of dictionaries which holds the calibration data for respectively 1 or more experiment(s). Exact format depends on the backend. A simulator backend has no calibration data (None is returned)
- Raises:
QiskitBackendError – raised if there is no calibration data in a result for the experiment(s).
- Return type:
Dict[str, Any] | List[Dict[str, Any]]