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 1 commit 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
Contributor

daxfohl commented Dec 27, 2024

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

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