This repo implements Rust code to simulate the experiments for the
Acknowledgements: Massive thanks to the author E. Takou for explaining their paper to me. This code is more of a learning exercise I did based on conversations with the author.
This is the primary code used to generate data files for the surface code. I also added some additional functionality for custom experiments that is not present in the Python code (see below). To set up:
- Install Rust and Cargo using
rustup - Within the directory, run
cargo run --release - The Rust source code is within the
/src/folder, with tests in/tests/.
This should generate the x_ancilla_probs.csv file.
The Python code for the surface code was translated from Rust to Python using Claude.
- Have a Python environment with
Numpyandpytestinstalled. - All Python code and tests are under
/python/folder.
Use the notebook in analysis notebooks/First step : building the DEM.ipynb as an entry point. This notebook I wrote reads the x_ancilla_probs.csv file, and builds the DEM by inferring the probabilities main.rs and .csv provided in this repo,
I also wrote a simulation for the dem_repetition.ipynb. In this notebook, I do an actual circuit simulation by building a cirq circuit with data and ancilla qubits and using the results to construct the DEM.
For some math and derivations I did on why, see Math Notes.md.