Code repository for quantum circuit discovery for fault-tolerant logical state preparation with reinforcement learning.
This library can be used to train an RL agent for three different tasks:
- Logical State Preparation: Prepare a logical state from a given stabilizer QEC code.
- Verification Circuit Synthesis: Prepare a verification circuit from a given logical state preparation circuit based on flag-qubit protocols [1] to make the state preparation fault-tolerant.
- Integrated Fault-Tolerant Logical State Preparation: Integrates the two tasks above to prepare a logical state fault-tolerantly.
For all the tasks, the user can specify the Clifford gate set and qubit connectivity.
- Clone the repository
git clone https://github.com/remmyzen/rlftqc.git
cd rlftqc
- Install requirements
pip install -r requirements.txt
For logical state preparation, you only need to specify the target stabilizers of your logical state.
For example, the code below will train an RL agent to prepare
from rlftqc.logical_state_preparation import LogicalStatePreparation
target = ["+ZZZZZZZ", "+ZIZIZIZ", "+XIXIXIX", "+IZZIIZZ", "+IXXIIXX", "+IIIZZZZ", "+IIIXXXX"]
lsp = LogicalStatePreparation(target)
lsp.train() ## Train the agent
lsp.run() ## Run the agent to get the circuit
Refer to the notebook notebooks/01 - Logical State Preparation.ipynb
for more advanced examples (e.g. change the gate set and qubit connectivity).
The code in this repository is released under the MIT License.
@article{zen2024quantum,
title={Quantum Circuit Discovery for Fault-Tolerant Logical State Preparation with Reinforcement Learning},
author={},
journal={arXiv:2402.xxxx},
year={2024}
}
[1] Chamberland, Christopher, and Michael E. Beverland. "Flag fault-tolerant error correction with arbitrary distance codes." Quantum 2 (2018): 53.