Add python scripts for DEM manipulation: generalize_dem.py and decomposer.py#187
Merged
noajshu merged 25 commits intoquantumlib:mainfrom Feb 18, 2026
Merged
Add python scripts for DEM manipulation: generalize_dem.py and decomposer.py#187noajshu merged 25 commits intoquantumlib:mainfrom
generalize_dem.py and decomposer.py#187noajshu merged 25 commits intoquantumlib:mainfrom
Conversation
…culation Fix Simplex cost_from_errors to use provided errors and const-qualify mask/cost helpers
…o fix the test failure caused by the previous fix to the cost from errors function in simplex
…into codex/add-index-translation-vectors-for-dem-errors
…rs-for-dem-errors Add index translation vectors for DEM errors
LalehB
approved these changes
Feb 17, 2026
Collaborator
LalehB
left a comment
There was a problem hiding this comment.
LGTM!
p.s. we will move them later for demutil
Refactor detector partitioning, add stim-surface-code mode, and enhance tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here we open source python versions of two DEM processing utilities.
DEM Generalization: When decoding the color code experiments, we found a large improvement in logical error rate (about 0.87x reduction factor) from calibrating a DEM on the rate that a most-likely-error decoder predicts that each error mechanism across a calibration dataset taken with the same set of qubits. To aggregate stats and generalize a DEM from, say, 10 rounds to 100 rounds, we use the detector coordinates of the DEM to identify a unique spatial key.
DEM Error Decomposition: Another DEM processing task important for matching decoders is decomposition. Stim's decomposition tactics are robust and general, at the cost of being suboptimal for the surface code.
As a next step, we could expose the functionality in Tesseract as follows: