-
Notifications
You must be signed in to change notification settings - Fork 736
Add qml.to_openqasm transform
#7393
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
Conversation
|
Just thinking here: would it make sense it to live in the |
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
Ok thank you Christina! I move it to the |
@albi3ro I think this is a good idea! Since this is not really a 'transform' but more a new public function, it would probably be confusing to put it in the |
qml.to_openqasm transformqml.to_qasm function
qml.to_qasm functionqml.to_openqasm transform
|
I added some unit tests checking the OpenQASM 2.0 code for a few different circuits but actually most of the work done by the transform already has an extensive set of tests for the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7393 +/- ##
=======================================
Coverage 99.69% 99.69%
=======================================
Files 529 529
Lines 50698 50709 +11
=======================================
+ Hits 50543 50554 +11
Misses 155 155 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Astral Cai <[email protected]>
astralcai
left a comment
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. Congratulations on your first contribution to PennyLane! 🎸
isaacdevlugt
left a comment
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.
Nice @SimoneGasperini! I left some comments on the documentation :)
Co-authored-by: Isaac De Vlugt <[email protected]>
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
albi3ro
left a comment
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.
Potentially also include a test for precision?
|
There is already this test for the precision argument, but since we repeated/duplicated tests for |
Co-authored-by: Isaac De Vlugt <[email protected]>
This PR adds a transform to make the conversion of a quantum circuit into the corresponding OpenQASM 2.0 program easier and more user-friendly. The
qml.to_openqasmfunction is implemented in a newopenqasmmodule under theqml.transformssubpackage. Not sure this is the right location in the Pennylane repository.A quite extensive set of unit and integration tests for the
QuantumScript.to_openqasmmethod is already available in test_qasm.py. I will add a detailed description of what the transform is doing in the docstring, including a simple usage example.[sc-83360]