-
Notifications
You must be signed in to change notification settings - Fork 35
✨ Convenience features #226
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
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
…tion Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Signed-off-by: Lukas Burgholzer <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #226 +/- ##
=====================================
Coverage 84.6% 84.6%
=====================================
Files 51 51
Lines 8715 8761 +46
=====================================
+ Hits 7374 7419 +45
- Misses 1341 1342 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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! Avoiding the boilerplate for classically controlled operations is really nice.
This PR adds some convenience functions that allow easier creation of
QuantumComputation
s.Specifically, a
QuantumComputation
can now be easily converted to anOperation
. This allows one to create compound operations by first building a quantum circuit and, then, turning it into an operation.Furthermore, a convenience function for adding classically-controlled operations to circuits is provided. This avoids the verbose code of having to create the quantum operation, constructing the ClassicControlled operation out of that, and then emplacing the resulting operation in the circuit.
Furthermore, it adds a method to determine the circuit depth.
Most of the changes here are actually in the tests, which have been refactored to take advantage of the new convenience features and, imho, look much nicer and less verbose now.