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

Modify IdentityGate to reject input when num_qubits is 0 #6884

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ayshiff
Copy link

@ayshiff ayshiff commented Dec 27, 2024

  • Updated IdentityGate to reject input with a message instead of raising an error when num_qubits is set to 0.
  • Added corresponding test case in identity_test.py to verify the new behavior.

Fixes #6768

- Updated IdentityGate to reject input with a message instead of raising an error when num_qubits is set to 0.
- Added corresponding test case in identity_test.py to verify the new behavior.
@ayshiff ayshiff requested review from vtomole and a team as code owners December 27, 2024 12:32
@ayshiff ayshiff requested a review from dabacon December 27, 2024 12:32
@CirqBot CirqBot added the size: S 10< lines changed <50 label Dec 27, 2024
@daxfohl
Copy link
Collaborator

daxfohl commented Dec 27, 2024

This could adversely affect some decompositions. Like I think PauliSumExponential(I(q)) decomposes to an I on zero qubits.

Copy link

codecov bot commented Jan 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.86%. Comparing base (06f12b9) to head (a9fb6e0).
Report is 5 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6884   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files        1084     1084           
  Lines       94225    94294   +69     
=======================================
+ Hits        92215    92284   +69     
  Misses       2010     2010           

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

@ayshiff ayshiff force-pushed the fix/identitygate-reject-zero-qubits branch from a9fb6e0 to d6ce731 Compare January 2, 2025 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IdentityGate Visualization
3 participants