重复码与错误恢复¶
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')[源代码]¶
Encode one logical bit into the three-bit repetition code.
- 参数:
error --
bitfor a single X error,phasefor a single Z error.- 返回:
target is the one-bit logical input; syndrome is two bits and must be zero on input.
- 返回类型:
The three encoded physical bits are laid out as target, syndrome[0], syndrome[1].
- oracq.algorithms.qec.error_correction.repetition_recover(*, error='bit')[源代码]¶
Coherently recover a single error of the given kind in the three-bit repetition code.
- 参数:
error --
bitorphase, matching the encoder.- 返回:
target restores the logical state; the error information stays in syndrome.
- 返回类型:
No measurement or reset is included; a nonzero syndrome must not be treated as already-clean work space.