2

I understand that PyMatching has a main c++ core with all sorts of python wrappers.

Is there an example that shows how to use it in a pure c++ environment. I think the python part integrates an interface to STIM (which also has a c/c++ version). What I'd like to do is simulate a code (surface code for starters) in a depolarizing channel (no circuit noise)...without STIM probably better (simpler) but using STIM if there's no other way. The main objective is to do everything in c/c++.

unknown
  • 2,623
  • 1
  • 9
  • 22

1 Answers1

2

PyMatching at its core is just a C++ MWPM decoder. There's a python API on top of that, but you don't have to use it. See the pymatching developer documentation from the pymatching github repo for instructions on building it or linking to it using cmake or bazel.

The C++ code does depend on stim's C++ library, but only for data formats (i.e. in order to parse detector error models and detection event data). You could write custom C++ code to produce the decoder data structures, and drive them with your own read/write loop, at which point it would be possible to delete the stim dependency.

Craig Gidney
  • 47,099
  • 1
  • 44
  • 119