We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Calling the inverse method of a conditional X gate returns an unconditional X gate.
inverse
I'd expect the inverse of a conditional gate to have the same condition.
That way, for instance, x.c_if(bit, 1) immediately followed by its inverse operation would produce the identity, as one would expect for an inverse.
x.c_if(bit, 1)
Assuming it's the desired behavior, could have inverse copy the condition from the original gate to the inverse gate before returning it.
The text was updated successfully, but these errors were encountered:
I'm just curious about when this situation comes up and why it might not just warn due to the presence of measurement?
Sorry, something went wrong.
Instruction.condition
IfElseOp
ewinston
Successfully merging a pull request may close this issue.
Information
What is the current behavior?
Calling the
inverse
method of a conditional X gate returns an unconditional X gate.Steps to reproduce the problem
What is the expected behavior?
I'd expect the inverse of a conditional gate to have the same condition.
That way, for instance,
x.c_if(bit, 1)
immediately followed by its inverse operation would produce the identity, as one would expect for an inverse.Suggested solutions
Assuming it's the desired behavior, could have
inverse
copy the condition from the original gate to the inverse gate before returning it.The text was updated successfully, but these errors were encountered: