-
Notifications
You must be signed in to change notification settings - Fork 603
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 a transform get_unitary_matrix to obtain matrix representations of circuits #1609
Conversation
…ion of Observable
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: antalszava <antalszava@gmail.com>
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.
Hi @ingstra, thanks for the update. You can follow Josh's advice on how to reduce the number of if
and else
, this should solve the last problem 💯
Why is Sphinx suddenly failing? The error message is not very forthcoming: [sphinx-action] Build failed with 0 warnings |
Co-authored-by: Josh Izaac <josh146@gmail.com>
…lane into get_unitary_matrix
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.
Hi @ingstra, it looks good on my side thank you again for the great work! 💯 I let @glassnotes give a final review.
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.
@ingstra this is awesome!! 💯 All but one of my suggestions here is just formatting. The only thing left to add is an interface test for JAX, which will look quite similar to the other interface tests. Once that's in, it's ready to merge 🚀
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
…o get_unitary_matrix
Co-authored-by: Olivia Di Matteo <2068515+glassnotes@users.noreply.github.com>
Thanks @glassnotes! I accepted your suggestions and added a test with JAX. |
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.
@ingstra changes looks great, this is ready to go! 🎉 It looks like there will be a few merge conflicts when updating the branch, let me know if you run into any trouble with those.
Context:
Create a new function to construct the unitary matrix corresponding to any quantum circuit.
Description of the Change:
The new transform
get_unitary_matrix
works similarly to_apply_unitary()
indevices/default_qubit.py.
Benefits:
Can process all operations, including controlled gates on non-adjacent wires or wires in reverse order.
Possible Drawbacks:
Related GitHub Issues:
#1462