Track joint probabilities of correlated errors#127
Conversation
oscarhiggott
left a comment
There was a problem hiding this comment.
Looks great, added a comment about sorting edge detector indices
| double& p01 = joint_probabilites[{c0.node1, c0.node2}][{c1.node1, c1.node2}]; | ||
| double& p10 = joint_probabilites[{c1.node1, c1.node2}][{c0.node1, c0.node2}]; |
There was a problem hiding this comment.
This makes the assumption that the order of detectors in each edge (d1, d2) is fixed. i.e. that the detectors are always sorted (d1 < d2). This is typically the case in stim but we should not make this assumption in case a DEM is generated elsewhere.
We could ensure when parsing the DEM and storing in the UserGraph that detectors in each edge are always sorted.
There was a problem hiding this comment.
Maybe also worth adding a test with a simple DEM that doesn't have consistently sorted detectors in error mechanisms
| double& p = joint_probabilites[{e.node1, e.node2}][{e.node1, e.node2}]; | ||
| p = bernoulli_xor(p, error.probability); |
There was a problem hiding this comment.
Likewise best to ensure nodes are sorted here as well
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## correlated-matching #127 +/- ##
======================================================
Coverage ? 99.15%
======================================================
Files ? 3
Lines ? 353
Branches ? 0
======================================================
Hits ? 350
Misses ? 3
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
aa6982d to
60bf434
Compare
This PR extends
iter_dem_instructions_include_correlationsto track the joint probabilities between components that arise from the same error instruction.The core of this change is the introduction of a
joint_probabilities mapwhich is populated during the DEM iteration. This map stores the probability of any two error components occurring together.All existing tests have been updated to pass in the joint_probabilities map and verify its final state.
-- Performance before this PR --
-- Performance after this PR --