A little bit of context.
I am currently implementing quantum error-correction code (specifically, surface code and lattice-surgery operations) and I often find myself in the following situation: my implementation does not reach the distance I was expecting it to reach.
The question is then: is the theory incorrect, or is my implementation incorrect?
With the amount of tiny details required to get right in the implementation and the unforgivness of QEC in general to small implementation mistakes, the answer to the above question has always been (for the moment): "my implementation is incorrect and needs to be fixed".
Now about the question: what is the most efficient workflow to fix an implementation of a given quantum error-correction code in stim when it does not reach the expected distance (assuming that the theory is correct and the problem lies in the implementation)?
At the moment, my workflow starts by:
circuit: stim.Circuit = ... # your bugged generation method here with open("circuit.url", "w") as f: f.write(circuit.to_crumble_url()) errors = circuit.shortest_graphlike_error(canonicalize_circuit_errors=True) for error in errors: print("=" * 80) print(error) print("=" * 80) Then, I open the Crumble URL saved in circuit.url in my web-browser, manually add the errors that were printed, and try to understand how to fix the issue.
Most of the time, I try to categorize the error mechanism (i.e., the collection of $d < d_\text{expected}$ errors that flips one of the declared observable without triggering any detector) into one of the errors type I already encountered:
- One (or more) detector(s) is missing, and adding that detector would make the printed error mechanism detectable.
- The error mechanism contains "hook errors" that are not correctly aligned.
The problem is that this process is tedious (adding errors manually in Crumble), error-prone (adding errors manually in Crumble), and I find it hard to categorize an error mechanism.
Does anyone around here have a better process, or maybe improvement(s) to the above process?
EDIT: of course, I cannot compare my implementation to a reference known-to-be-correct implementation, there is no reference implementation that I am aware of.
