-
Notifications
You must be signed in to change notification settings - Fork 11
Simplified implementation of gate modifiers #64
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
Simplified implementation of gate modifiers #64
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question and one suggestion, but otherwise looks good.
qreg[6], | ||
"rz1", | ||
control=[qreg[2], qreg[4], qreg[5]], | ||
neg_control=[qreg[0], qreg[1], qreg[0]], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason to allow repetition here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a byproduct of using sets. I just want to test here that controlling twice on the same qubit outputs an OQ code with a single ctrl modifier. I prefer this behavior, which allows users to pass overlapping qubit lists like
prog.gate(0, control=[*[i for i in qubits if i %2], *[i for i in qubits if i % 3]])
and still get a nice-looking output.
OQPyGateModifier (#61) is problably unnecessary complex. This PR keeps only the argument method.
Adds 4 keyword arguments to
gate
: