-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add support for ControlledQubitUnitary
#50
base: master
Are you sure you want to change the base?
Conversation
ControlledQubitUnitary
ControlledQubitUnitary
added a test |
Friendly nudge @isaacdevlugt 🙂 |
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.
Thanks a lot for this contribution, @Hosseinberg! And sorry for the delay. I think this is mostly good to merge. There are just a couple minor changes I suggested.
And if my understanding of the test is correct, I think we should add a test case for a non-trivial control-register state. Let me know what you think.
|
||
op = qml.ControlledQubitUnitary(mat, wires=list(range(len(control_wires), N+len(control_wires))), | ||
control_wires=control_wires) | ||
dev.apply([qml.QubitStateVector(state, wires=list(range(N + len(control_wires)))), op]) |
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.
I'm not sure I understand this correctly, but does this leave the control wires in the |0>
state? This would make the control operation trivial, no? Maybe it would be good to test this for the |+>
state in the control register. What do you think?
Co-authored-by: Frederik Wilde <[email protected]>
Co-authored-by: Frederik Wilde <[email protected]>
Co-authored-by: Frederik Wilde <[email protected]>
Co-authored-by: Frederik Wilde <[email protected]>
Hi @Hosseinberg, I just wanted to check in and hear what you think about this comment? I think if we have a test like this we can merge the PR. |
resolves issue #49. Tests need to be added though.