-
Notifications
You must be signed in to change notification settings - Fork 57
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
ControlledAddOrSubtract
Bloq
#1145
ControlledAddOrSubtract
Bloq
#1145
Conversation
c4876ad
to
f4ffb02
Compare
4830b4d
to
6f501e1
Compare
3625e6d
to
96ca306
Compare
ctrls, x = bb.add_t(bloq, ctrls=np.asarray(ctrl_soqs), **in_soqs) | ||
return np.asarray(ctrls).tolist(), (x,) |
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.
was this a bug? is there a test that would have caught it?
actually: what's going on here? the conditions above exclude any situation in where there is more than one SoquetT
being passed in. For this bloq, that one SoquetT
is an array of soquets
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 fails on test_tensor
:
for li in reg.all_idxs():
> idxed_soq = in_soq[li]
E IndexError: too many indices for array: array is 0-dimensional, but 1 were indexed
Some nits but LGTM, but I'll let @tanujkhattar take a final look |
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.
LGTM % nits
Has half the T-cost of a controlled addition gate. Useful to perform an Rz rotation via addition into phase gradient, at half the cost of a ZPow.