Skip to content

Add strip_undecomposable_errors=False to decomposition#218

Merged
noajshu merged 4 commits intoquantumlib:mainfrom
noajshu:main
Mar 20, 2026
Merged

Add strip_undecomposable_errors=False to decomposition#218
noajshu merged 4 commits intoquantumlib:mainfrom
noajshu:main

Conversation

@noajshu
Copy link
Copy Markdown
Contributor

@noajshu noajshu commented Mar 18, 2026

The decomposer code written by Oscar is very nice because it is quite careful not to make any mistakes. For instance in a situation like this:

error D0 D1
error D0

if we label D0 as X and D1 as Z type, it will raise a ValueError due to D1 not appearing on its own in the error model. This prevents at least one possible issue, which is putting the logical flip (if present) onto the wrong component.

Anyways, sometimes we want to produce an error model anyways, and we don't care about these errors. In these situations we may as well strip such undecomposable errors entirely.

Alternative considered: we could also try harder to decompose them and workaround the lack of a single error with that component's worth of symptoms in the DEM. I tried this first but I feel it is somewhat higher risk since it could be silently failing and putting badly-decomposed errors into the DEM. So I think the best practice should be to strip them out entirely.

@noajshu noajshu requested a review from a team as a code owner March 18, 2026 22:23
@noajshu noajshu requested review from viathor and removed request for a team March 18, 2026 22:23
@noajshu noajshu requested a review from LalehB March 18, 2026 22:29
Copy link
Copy Markdown
Collaborator

@LalehB LalehB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Collaborator

@LalehB LalehB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wanted to say, you might want to add it to the readme as well to let other users know this is available

@noajshu
Copy link
Copy Markdown
Contributor Author

noajshu commented Mar 20, 2026

Good catch! I will update that now.

@noajshu noajshu merged commit 012770f into quantumlib:main Mar 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants