estimate_joint_confusion_in_set

forest.benchmarking.readout.estimate_joint_confusion_in_set(qc: pyquil.api._quantum_computer.QuantumComputer, qubits: Sequence[int] = None, num_shots: int = 1000, joint_group_size: int = 1, use_param_program: bool = True, use_active_reset=False, show_progress_bar: bool = False) → Dict[Tuple[int, ...], numpy.ndarray]

Measures the joint readout confusion matrix for all groups of size group_size among the qubits.

Simultaneous readout of multiple qubits may exhibit correlations in readout error. Measuring a single qubit confusion for each qubit of interest is therefore not sufficient to completely characterize readout error in general. This method estimates joint readout confusion matrices for groups of qubits, which involves preparing all 2^joint_group_size possible bitstrings on each of (len(qubits) choose joint_group_size) many groups. The joint_group_size specifies which order of correlation you wish to characterize, and a separate confusion matrix is estimated for every possible group of that size.

For example, a joint_group_size of one will simply estimate a single-qubit 2x2 confusion matrix for each of the provided qubits, similar to len(qubits) calls to estimate_confusion_matrix. Meanwhile, a joint_group_size of two will yield estimates of the (len(qubits) choose 2) many 4x4 confusion matrices for each possible pair of qubits. When the joint_group_size is the same as len(qubits) a single confusion matrix is estimated, which requires 2^len(qubits) number of state preparations. Note that the maximum number of measurements occurs when 1 << joint_group_size << len(qubits), and this maximum is quite large.

Because this method performs the measurement of exponentially many bitstrings on a particular group of qubits, use_param_program should result in an appreciable speed up for estimation of each matrix by looping over bitstrings at a lower level of the stack, rather than creating a new program for each bitstring. Use_active_reset should also speed up estimation, at the cost of introducing more error and potentially complicating interpretation of results.

Parameters:
  • qc – a quantum computer whose readout error you wish to characterize
  • qubits – a list of accessible qubits on the qc you wish to characterize. Defaults to all qubits in qc.
  • num_shots – number of shots in measurement of each bit string on each joint group of qubits.
  • joint_group_size – the size of each group; a joint confusion matrix with 2^joint_group_size number of rows/columns will be estimated for each group of qubits of the given size within the qubit set.
  • use_param_program – dictates whether to use a parameterized program to measure out each bitstring. If set to default of True, this routine should execute faster on a QPU. Note that the parameterized option does not execute a no-op when measuring 0.
  • use_active_reset – if true, all qubits in qc (not just provided qubits) will be actively reset to 0 state at the start of each bitstring measurement. This option is intended as a potential speed up, but may complicate interpretation of the estimated confusion matrices. The method estimate_joint_active_reset_confusion separately characterizes active reset.
  • show_progress_bar – displays a progress bar via tqdm if true.
Returns:

a dictionary whose keys are all possible joint_group_sized tuples that can be formed from the qubits. Each value is an estimated 2^group_size square confusion matrix for the corresponding tuple of qubits. Each key is listed in order of increasing qubit number. The corresponding matrix has rows and columns indexed in increasing bitstring order, with most significant (leftmost) bit labeling the smallest qubit number.