Automatically find detectors in a topologically quantum error corrected computation
Maintained. Last release 5 months ago, commits in 9 of the last 26 weeks. Weaker on release cadence.
pip install tqecdREADME as published on PyPI with version 0.2.1.
tqecd
The tqecd package is a spin-off from the tqec package that allows the automatic search of detectors in structured quantum error correction circuits.
This package was initially part of tqec and has been outsourced to make it accessible to anyone wanting to use it outside of the tqec library.
Documentation
Documentation is available at https://tqec.github.io/tqecd/index.html.
Installation
Currently, tqecd needs to be installed from source using
python -m pip install git+https://github.com/tqec/tqecd.git
Basic usage
import stim
from tqecd import annotate_detectors_automatically
# Example circuit that contains a detector
XXXX = stim.Circuit("""\
QUBIT_COORDS(1, 1) 0
QUBIT_COORDS(0, 0) 1
QUBIT_COORDS(2, 0) 2
QUBIT_COORDS(0, 2) 3
QUBIT_COORDS(2, 2) 4
RX 0 1 2 3 4
TICK
CX 0 1
TICK
CX 0 2
TICK
CX 0 3
TICK
CX 0 4
TICK
MX 0
""")
assert XXXX.num_detectors == 0
annotated_circuit = annotate_detectors_automatically(XXXX)
print(annotated_circuit)
should output the following quantum circuit:
QUBIT_COORDS(1, 1) 0
QUBIT_COORDS(0, 0) 1
QUBIT_COORDS(2, 0) 2
QUBIT_COORDS(0, 2) 3
QUBIT_COORDS(2, 2) 4
RX 0 1 2 3 4
TICK
CX 0 1
TICK
CX 0 2
TICK
CX 0 3
TICK
CX 0 4
TICK
MX 0
DETECTOR(1, 1, 0) rec[-1]
Contributing
Pull requests and issues are more than welcomed!
See the contributing page for specific contributing instructions.