0
$\begingroup$

In Stim, we can get a detector graph with the probability of each error mechanism occurring. Now I want to construct a path graph from the detector graph, which is usually done by Dijkstra's algorithm. What is the easiest way to implement Dijkstra's algorithm and get the path graph with each path having weight (=the sum of the corresponding edge weights (defined by -log p) in the detector graph) from detector_error_model?

$\endgroup$

1 Answer 1

1
$\begingroup$

The easiest way is to write glue code that iterates over the detector error model, converting error instructions into the edges of a networkx graph. Then use networkx for graph transformations like obtaining the path graph.

$\endgroup$
1
  • $\begingroup$ Thank you, but I have one more question. I know that pymatching.Matching.edges() gives edge weights of edges in the detector graph. However, I couldn't find a way to obtain the edge weights of edges in the path graph using networkx. Do you know how to do it? Thank you in advance. $\endgroup$ Commented Aug 28, 2024 at 14:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.