SinterCompiledDecoder_BP.decode_shots_bit_packed: missing count= in np.unpackbits causes wrong corrections
In relay_bp/stim/sinter/decoders.py, line 46:
syndromes = np.unpackbits(
bit_packed_detection_event_data, bitorder="little", axis=1
).astype(np.uint8)
When num_detectors % 8 != 0, np.unpackbits pads to the nearest byte boundary, producing extra zero columns that participate in BP message passing and silently produce wrong corrections (inflated logical error rate, no exception raised).
Fix
num_detectors = self.check_matrices.check_matrix.shape[0]
syndromes = np.unpackbits(
bit_packed_detection_event_data, bitorder="little", axis=1, count=num_detectors
).astype(np.uint8)
SinterCompiledDecoder_BP.decode_shots_bit_packed: missingcount=innp.unpackbitscauses wrong correctionsIn
relay_bp/stim/sinter/decoders.py, line 46:When
num_detectors % 8 != 0,np.unpackbitspads to the nearest byte boundary, producing extra zero columns that participate in BP message passing and silently produce wrong corrections (inflated logical error rate, no exception raised).Fix