This repository contains the SageMath notebooks for constructing and verifying the MSD protocols in our paper. It contains (twisted) three-orthogonality checking, binarization and generalized triorthogonality testing on binary codes (e.g. binarized & gadgetized CS-to-CS protocols, CCZ-to-CCZ protocols concatenated with 8T-to-CCZ), random puncturing for qudit-CCZ protocols.
- SageMath (I use SageMath 10.9 kernel for running these notebooks on my MAC)
- NumPy, SciPy, Numba, and Cython
- A C++17 compiler for the qudit distance certifier
- GAP with the QDistRnd package for randomized distance estimates. Change
gap_rootinrun_qdistrnd_cssto where GAP is installed. - Optional:
tqdmfor exact distance certification progress bars (install withsage -pip install tqdm)
The three notebooks are ordinary Jupyter notebooks with a SageMath kernel. Launch Jupyter from the repository root with:
sage -n jupyter-
notebooks/Small_protocols_CS.ipynbcontains CS-to-CS factories constructed from codes over$\mathbb{F}_4$ , their concatenations, and their binarized & gadgetized version. -
notebooks/Small_protocols_CCZ.ipynbcontains CCZ-to-CCZ factories and their concatenations. -
notebooks/Qudit_CCZ.ipynbcontains qudit-CCZ factories constructed from puncturing one-point codes over $\mathbb{F}4\sim \mathbb{F}{64}$.
MSD_AG_QEC26.pptx- QEC26 talk slides.src_distill/- helpers for code construction, finite-field, distance, and transversal-gate utilitiesnotebooks/- SageMath notebooks containing protocol constructions and searches
The following distance determination procedures are assisted by Codex:
- Call to QDistRnd.
- Exact qudit distance verification via rank-testing. I use it when the distance upper bound QDistRnd returns does not match theory lower bound. The largest instance is puncturing
$k=8$ columns from the one-point$\mathbb{F}_{16}$ Hermitian code. - Error coefficient counting.
I checked (and learned from) the codes Codex wrote, and also cross-checked the results with my own Python implementation of MITM checking/counting for many instances. During the cleanup stage of this project, I also let Codex refactor my MITM and random_puncture functions.
The resource estimation of our protocols, which was conducted by Adam with the help of ChatGPT and Patrick with the help of Claude, is not contained in this repository.