Repetition codes and error recovery¶
oracq.algorithms.qec.error_correction
Coherent encoding and single-error recovery circuits of the three-bit repetition code.
- oracq.algorithms.qec.error_correction.repetition_encode(*, error='bit')[source]¶
Encode one logical bit into the three-bit repetition code.
- Parameters:
error –
bitfor a single X error,phasefor a single Z error.- Returns:
target is the one-bit logical input; syndrome is two bits and must be zero on input.
- Return type:
The three encoded physical bits are laid out as target, syndrome[0], syndrome[1].
- oracq.algorithms.qec.error_correction.repetition_recover(*, error='bit')[source]¶
Coherently recover a single error of the given kind in the three-bit repetition code.
- Parameters:
error –
bitorphase, matching the encoder.- Returns:
target restores the logical state; the error information stays in syndrome.
- Return type:
No measurement or reset is included; a nonzero syndrome must not be treated as already-clean work space.