qldpc.decoders.common

Shared helpers for decoders.

Functions

with_erasure_bits(→ numpy.typing.NDArray[numpy.int_])

Append an erasure bit to each inferred error, in the dtype of that error.

Module Contents

qldpc.decoders.common.with_erasure_bits(errors: numpy.typing.NDArray[numpy.int_], erased: numpy.typing.NDArray[numpy.bool_] | bool) → numpy.typing.NDArray[numpy.int_][source]

Append an erasure bit to each inferred error, in the dtype of that error.

A decoder that signals erasure reports it in the last entry of every error it infers, set to 1 for a syndrome that the error does not reproduce. Accepts one error with one flag, or a batch of errors with one flag per error.