From 197d27caca358056003559ba685b931080bef6ee Mon Sep 17 00:00:00 2001 From: SeanvdMeer <18538762+minisean@users.noreply.github.com> Date: Mon, 7 Jul 2025 13:44:20 +0200 Subject: [PATCH] Added additional if-statement checks for post-selection mask indices. If indices are not present in indexing kernel, ignore post-selection step. --- .../interface_definitions/intrf_error_identifier.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qce_interp/interface_definitions/intrf_error_identifier.py b/src/qce_interp/interface_definitions/intrf_error_identifier.py index 5237e8b..eef11ba 100644 --- a/src/qce_interp/interface_definitions/intrf_error_identifier.py +++ b/src/qce_interp/interface_definitions/intrf_error_identifier.py @@ -834,28 +834,28 @@ def get_post_selection_mask(self, cycle_stabilizer_count: int) -> NDArray[np.boo full_pass_mask: NDArray[np.bool_] = np.full(shape=(self._index_kernel.experiment_repetitions,), fill_value=True, dtype=np.bool_) result: NDArray[np.bool_] = full_pass_mask # (Optionally) add heralded post-selection - if self.include_heralded_post_selection: + if self.include_heralded_post_selection and self._index_kernel.include_heralded_initialization: heralded_selection_mask = self.get_heralded_post_selection_mask( cycle_stabilizer_count=cycle_stabilizer_count, post_selection_qubits=post_selection_qubits, ) result = np.logical_and(result, heralded_selection_mask) # (Optionally) add leakage (during data-qubit projection) post-selection - if self.include_projected_leakage_post_selection: + if self.include_projected_leakage_post_selection and self._index_kernel.include_qutrit_calibration_points: projected_leakage_selection_mask = self.get_projected_leakage_post_selection_mask( cycle_stabilizer_count=cycle_stabilizer_count, post_selection_qubits=post_selection_qubits, ) result = np.logical_and(result, projected_leakage_selection_mask) # (Optionally) add leakage (during data-qubit and ancilla-qubit projection) post-selection - if self.include_all_projected_leakage_post_selection: + if self.include_all_projected_leakage_post_selection and self._index_kernel.include_qutrit_calibration_points: all_projected_leakage_selection_mask = self.get_all_projected_leakage_post_selection_mask( cycle_stabilizer_count=cycle_stabilizer_count, post_selection_qubits=post_selection_qubits, ) result = np.logical_and(result, all_projected_leakage_selection_mask) # (Optionally) add leakage (during stabilizer-qubit cycle) post-selection - if self.include_stabilizer_leakage_post_selection: + if self.include_stabilizer_leakage_post_selection and self._index_kernel.include_qutrit_calibration_points: stabilizer_leakage_selection_mask = self.get_stabilizer_leakage_post_selection_mask( cycle_stabilizer_count=cycle_stabilizer_count, post_selection_qubits=post_selection_qubits,