qermit.spam

qermit.spam.spam_mitres.gen_FullyCorrelated_SPAM_MitRes(backend, calibration_shots, correlations, **kwargs)[source]

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.

Return type:

MitRes

qermit.spam.spam_mitres.gen_UnCorrelated_SPAM_MitRes(backend, calibration_shots, **kwargs)[source]

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

Return type:

MitRes

qermit.spam.full_spam_correction.gen_full_tomography_spam_circuits_task(backend, shots, qubit_subsets)[source]

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[Node]]) – 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 (int) – An int corresponding to the number of shots of each calibration circuit required.

Return type:

MitTask

Returns:

A MitTask object, requiring 1 List[CircuitShots] wire and returning (List[CircuitShots], List[StateInfo]) corresponding to Calibration Circuits and corresponding states.

qermit.spam.full_spam_correction.gen_full_tomography_spam_characterisation_task(qubit_subsets)[source]

Uses results from device for characterisation circuits to characterise transition matrices for different qubit subsets and stores them in backend.

Parameters:

qubit_subsets (List[List[Node]]) – Subsets of qubits in backend corresponding to different correlated subsets.

Return type:

MitTask

qermit.spam.full_spam_correction.gen_full_tomography_spam_correction_task(corr_method)[source]

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:

corr_method (CorrectionMethod) – Method used to invert matrices and correct results.

Return type:

MitTask

qermit.spam.full_spam_correction.gen_get_bit_maps_task()[source]

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.

Return type:

MitTask