Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct noise channel approximate equality #6632

Merged
merged 8 commits into from
Jan 18, 2025

Conversation

richrines1
Copy link
Contributor

@richrines1 richrines1 commented Jun 3, 2024

This fixes two related bugs related to equality checks for noise channels:

  • approximate comparison between cirq noise channels and other gates raises an error
  • exact comparison ignores DepolarizingChannel.n_qubits

The first issue isfixed by just adding approximate=True to the @value_equality decorator for each class and removing their explicit implementations of approx_eq. The second issue just required the inclusion of n_qubits in DepolarizingChannel.value_equality_values

Fixes: #6631

@richrines1 richrines1 requested review from vtomole, cduck and a team as code owners June 3, 2024 18:08
@richrines1 richrines1 requested a review from maffoo June 3, 2024 18:08
@CirqBot CirqBot added the size: M 50< lines changed <250 label Jun 3, 2024
Copy link

codecov bot commented Jun 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.86%. Comparing base (06f12b9) to head (69d37dc).
Report is 55 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6632      +/-   ##
==========================================
- Coverage   97.86%   97.86%   -0.01%     
==========================================
  Files        1084     1084              
  Lines       94225    94218       -7     
==========================================
- Hits        92215    92208       -7     
  Misses       2010     2010              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot added the Stale label Jul 4, 2024
@github-actions github-actions bot removed the Stale label Jul 11, 2024
@github-actions github-actions bot added the Stale label Aug 30, 2024
@github-actions github-actions bot removed the Stale label Sep 11, 2024
@github-actions github-actions bot added the Stale label Oct 11, 2024
@github-actions github-actions bot closed this Nov 10, 2024
@mhucka mhucka added the status/stale This has been closed due to inactivity for an extended period of time. label Nov 18, 2024
@mhucka mhucka reopened this Dec 20, 2024
@github-actions github-actions bot removed the status/stale This has been closed due to inactivity for an extended period of time. label Dec 21, 2024
Copy link
Collaborator

@dstrain115 dstrain115 left a comment

Choose a reason for hiding this comment

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

This looks fine, but please add more information to the commit description when you commit (for instance, the context from the linked issue)

@dstrain115 dstrain115 added this pull request to the merge queue Jan 18, 2025
Merged via the queue into quantumlib:main with commit 0a955cc Jan 18, 2025
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

failing comparisons for noise channels
4 participants