Add an example notebook for decoding tqec circuits#445
Conversation
|
IIRC we also had issues with tqec returning non-matchable circuits in arXiv:2511.20947, for which we also needed to use BP-OSD at some point. I'll take a look at the error, and meanwhile also see whether we can reproduce our old tqec/matching issue with @jmusullivan . |
|
Yeah I also recall, but I don't remember what caused it and how we solved it. This issue might be different, as the default pymatching in sinter works fine. |
|
It's possible that the default pymatching in sinter simply ignores non-graphlike errors. That's what |
|
Interesting, I see. |
|
Yep, looks like the notebook runs fine (and shows reasonable results) if I run with custom_decoders = {
f"{d=}": decoders.SlidingWindowDecoder(
d,
d // 2,
with_MWPM=True,
ignore_non_graphlike_errors=True,
)
for d in distances
}I flagged this in tqec/tqec#913. |
|
Let's go ahead and set |
|
I do not understand the installation error in the failed check: The checks clearly worked for other recent PRs, which used the same github workflow files... |
Co-authored-by: Michael A. Perlin <michael.perlin@jpmchase.com>
Co-authored-by: Michael A. Perlin <michael.perlin@jpmchase.com>
…configs; include notebook outputs
This is due to the workflow trying to install Do you want to place an upper bound on stim for now? |
|
Yeah, I think it would be okay to bound or pin the version of Stim for now. |
|
Could we tackle #402 here? Maybe have one example with ordinary decoding and an identical example switching out the decodr, hopefully showing similar logical error rates. I'd be happy to punt it to a future PR if it's significantly more work than expected. |
It's easy to add, but the ordinary decoding doesn't need to simulate separately for each distance, so the code reuse/repetition won't be very elegant. |
|
What do you mean by
? Each distance corresponds to a different circuit, and in turn a different simulation+decoding problem, no? |
Ah, my phrasing was confusing. I meant that because tqec's simulation interface doesn't support assigning decoders by distance, sliding window decoding needs to call it for each distance, whereas ordinary decoding only needs to call it once for all distances. Anyway, you can take a look at my last commit. |
|
Looks like there was a bona-fide bug in the sliding window decoder, which was preventing it from working in this example. I pushed a fix, so the example now works! So this PR fixes #402 I'll leave I now just need to do some final review + cleanup (including a new unit test) before merging. |
|
@HaoTy thanks again for drafting the notebook! I took a detailed pass over it. I have just two outstanding questions regarding missing documentation in |
|
Alright, looks good to merge! @jviszlai I'll note that the sliding window decoder does not perform as well as one might hope on the CNOT experiment in the example notebook here. Any idea as to why that might be? One thought is that the sliding window decoder was written with a memory experiment in mind, so maybe it's not quite doing what one would like for a lattice surgery experiment involving multiple surface code patches. |
Addresses #402.
MWPM doesn't compile correctly. BP-OSD works, so I tend to think the issue is on the qLDPC side or due to an incompatibility between tqec and qLDPC. @perlinm could you take a look at the MWPM error?