-
Notifications
You must be signed in to change notification settings - Fork 31
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
Appropriate way to add on/off single controlled bloq? #883
Comments
sorry, I don't fully understand your code snippets. Where are you using the ctrl, q = bb.add(ZGate().controlled(), ctrl=ctrl, q=q) would be how I would do it |
I want an off-control. |
Whoops, should have been: ctrl_spec = CtrlSpec(cvs=[0])
(ctrl,), q = bb.add(ZGate().controlled(ctrl_spec), ctrl=(ctrl,), q=q) and ctrl_spec = CtrlSpec(QBit(), cvs=0b0)
ctrl, q = bb.add(ZGate().controlled(ctrl_spec), ctrl=ctrl, q=q) |
So you want a one-bit off-control. In the first one, you have to wrap your |
Right the second way seems a bit verbose. Very low priority though, just ran into it in #882 |
Does it not work if you do |
Is there a simpler way to add a singly-controlled bloq:
seems a little awkward.
Is
preferred?
The text was updated successfully, but these errors were encountered: