qermit.spam¶
Produces a MitRes object for performing SPAM correction with subsets of fully correlated device nodes specified by correlations. Requires 2^n circuits to fully characterise, where n is the size of the largest sublist of correlated nodes.
- Parameters
backend (Backend) – Default Backend characterisation and experiment are executed on.
calibration_shots (int) – Number of shots required for each characterisation circuit
correlations (List[List[Node]]) – Each sublist of Node corresponds to some set of fully correlated nodes.
Produces a MitRes object for performing SPAM correction with no correlated nodes. Requires 2 circuits to characterise device.
- Parameters
backend (Backend) – Default Backend characterisation and experiment are executed on.
calibration_shots (int) – Number of shots required for each characterisation circuit
Produces a MitRes object for performing SPAM correction assuming with n-distance noise correlations.
- Parameters
backend (Backend) – Default Backend characterisation and experiment are executed on.
calibration_shots (int) – Number of shots required for each characterisation circuit
correlations_distance (int) – Distance over Backend Connectivity graph over which correlations in Qubit SPAM Noise is expected.
- full_spam_correction.gen_full_tomography_spam_circuits_task(shots: int, qubit_subsets: List[List[pytket._tket.circuit.Qubit]]) → qermit.taskgraph.mittask.MitTask¶
Generate MitTask for calibration circuits according to the specified correlation and given backend.
- Parameters
backend (Backend) – Backend on which the experiments are run.
qubit_subsets (List[List[Qubit]]) – A list of lists of correlated Nodes of a Device. Qubits within the same list are assumed to only have SPAM errors correlated with each other. Thus to allow SPAM errors between all qubits you should provide a single list. The qubits in qubit_subsets must be nodes in the backend’s associated Device.
shots – An int corresponding to the number of shots of each calibration circuit required.
- Returns
A MitTask object, requiring 1 List[CircuitShots] wire and returning (List[CircuitShots], List[StateInfo]) corresponding to Calibration Circuits and corresponding states.
- Return type
- full_spam_correction.gen_full_tomography_spam_characterisation_task(qubit_subsets: List[List[pytket._tket.circuit.Qubit]]) → qermit.taskgraph.mittask.MitTask¶
Uses results from device for characterisation circuits to characterise transition matrices for different qubit subsets and stores them in backend.
- Parameters
backend (Backend) – Backend for storing characterisations in.
qubit_subsets (List[List[Qubit]]) – Subsets of qubits in backend corresponding to different correlated subsets.
- full_spam_correction.gen_full_tomography_spam_correction_task(corr_method: qermit.spam.full_transition_tomography.CorrectionMethod) → qermit.taskgraph.mittask.MitTask¶
Uses characterisation result held in backend to correct for SPAM noise in passed BackendResult objects. Method used to invert SPAM characteriastion matrices and correct results given by CorrectionMethod enum.
- Parameters
backend (Backend) – Device Backend holding SPAM characterisation.
corr_method (CorrectionMethod) – Method used to invert matrices and correct results.
characterised (bool) – bool passed from characterisation task confirming characterisation is complete.
- full_spam_correction.gen_get_bit_maps_task() → qermit.taskgraph.mittask.MitTask¶
Returns a task that takes a list of circuits and returns the circuits, and a map betwen each circuit bit and the qubit it is measured on.
- partial_spam_correction.partial_spam_setup_task_gen(correlation_distance: int) → qermit.taskgraph.mittask.MitTask¶
Sets up required information for characterising and correcting SPAM noise. Includes check for whether SPAM Characterisation needs to be run.
- Parameters
backend (Backend) – Default Backend characterisation and experiment are executed on.
correlations_distance (int) – Distance over Backend Connectivity graph over which correlations in Qubit SPAM Noise is expected.
- Returns
A MitTask object that completes said task.
- Return type
For Given Backend, returns circuits characterisating SPAM noise for up to correlation_distance distance on the Backend connectivity graph.
- Parameters
backend (Backend) – Default Backend characterisation and experiment are executed on.
calibration_shots (int) – Number of shots required for each characterisation circuit
correlations_distance (int) – Distance over Backend Connectivity graph over which correlations in Qubit SPAM Noise is expected.
- Returns
A MitTask object that produces Characterisation circuits.
- Return type
Produces SPAM characterisation matrices for each correlation expected.
- Parameters
backend (Backend) – Backend which characterisation to be stored in
correlations_distance (int) – Correlation Distance which charactersation was produced for - only required for setting in backend.
- Returns
A MitTask object that assigns a PartialCorrelatedNoiseCharacterisation to backend.
- Return type
Produces and returns a MitTask object to apply SPAM correction to BackendResult objects. :param backend: Backend from which Spam Correction characterisation is retrieved. :type backend: Backend