Repository navigation
Fix #636: ApplyNoise derives from BaseCommand - #639
Merged
Merged
Conversation
`ApplyNoise` now derives from `BaseCommand`, like other commands. It implements `reindex`, which maps both its nodes and its domain, and uses the concise `repr` from `DataclassReprMixin`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thierry-martinez
force-pushed
the
fix-636
branch
from
October 27, 2026 13:13
9088dc7 to
db3e53c
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #639 +/- ##
==========================================
+ Coverage 89.97% 89.98% +0.01%
==========================================
Files 49 49
Lines 8466 8447 -19
==========================================
- Hits 7617 7601 -16
+ Misses 849 846 -3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
matulni
reviewed
Nov 2, 2026
Following review: `DepolarisingNoise`, `TwoQubitDepolarisingNoise`, `AmplitudeDampingNoise` and `TwoQubitAmplitudeDampingNoise` are now frozen dataclasses using `DataclassReprMixin`, so that `repr(DepolarisingNoise(0.1)) == "DepolarisingNoise(0.1)"`, and they support value equality and hashing. The `Probability` descriptor does not combine with dataclasses: the descriptor itself is taken as the field default, and its `__set__` cannot assign the private field of a frozen instance. The probability is now checked in `__post_init__` with the new `graphix.utils.check_probability`. The tutorial, which used the descriptor in a dataclass and therefore failed, is updated accordingly. Since noise instances are immutable, `ApplyNoise.reindex` can share the noise with the original command; this is now documented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pranav97nair
approved these changes
Nov 9, 2026
pranav97nair
left a comment
Contributor
There was a problem hiding this comment.
Thanks for this change, LGTM!
matulni
approved these changes
Nov 9, 2026
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.
ApplyNoisenow derives fromBaseCommand, like other commands. It implementsreindex, which maps both its nodes and its domain, and uses the concisereprfromDataclassReprMixin.Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com