Skip to content

Fix #854: change NoiseChannel.__str__ to use correct method#856

Merged
mhucka merged 7 commits intomasterfrom
mh-fix-854
Aug 15, 2025
Merged

Fix #854: change NoiseChannel.__str__ to use correct method#856
mhucka merged 7 commits intomasterfrom
mh-fix-854

Conversation

@mhucka
Copy link
Copy Markdown
Collaborator

@mhucka mhucka commented Aug 10, 2025

An inspection of the code of class NoiseChannel in qsimcirq_tests/qsimcirq_tests.py suggests that the call to the _ops method should be instead to _prob_op_pairs, like this:

def __str__(self):
    return f"NoiseChannel({self._prob_op_pairs})"

This works, and printing instances of the class do print something reasonable.

An inspection of the code of class `NoiseChannel` in
`qsimcirq_tests/qsimcirq_tests.py` suggests that the most likely cause
of error #854 is that the call to the `_ops` method should be instead to
`_prob_op_pairs`, like this:

```python
def __str__(self):
    return f"NoiseChannel({self._prob_op_pairs})"
```
@github-actions github-actions Bot added the size: XS <10 lines changed label Aug 10, 2025
@mhucka mhucka added the area/tests Involves test cases, test frameworks, and similar label Aug 10, 2025
@mhucka mhucka marked this pull request as ready for review August 14, 2025 02:55
@mhucka mhucka enabled auto-merge (squash) August 15, 2025 20:23
@mhucka mhucka merged commit 8289496 into master Aug 15, 2025
49 checks passed
@mhucka mhucka deleted the mh-fix-854 branch August 15, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tests Involves test cases, test frameworks, and similar size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants