-
Notifications
You must be signed in to change notification settings - Fork 595
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
Deprecate old QNode #440
Deprecate old QNode #440
Conversation
…bjects), correct test_vqe
Codecov Report
@@ Coverage Diff @@
## master #440 +/- ##
=========================================
- Coverage 99.33% 99.24% -0.1%
=========================================
Files 46 45 -1
Lines 3760 3303 -457
=========================================
- Hits 3735 3278 -457
Misses 25 25
Continue to review full report at Codecov.
|
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.
This is great Antal, thanks for helping finish this! I can't seem to compile the documentation locally, so I'm going to see if I can fix that quickly. Once done, this should be ready for merging.
Before I forget, let's remember to update the changelog as well 😆
Update: I have the docs correctly compiling, and viewable here |
…nto deprecate_old_qnode
Co-Authored-By: Josh Izaac <[email protected]>
…nylane into deprecate_old_qnode
That is really nice @josh146 , thanks! A really nasty caveat that I had to double-check (my latest commits include a correction to these cases) is plainly exchanging a def circuit(weights):
CVNeuralNetLayers(*weights, wires=range(4))
return qml.expval(qml.X(wires=0)) with qml.utils.OperationRecorder() as rec:
CVNeuralNetLayers(*weights, wires=range(4))
return qml.expval(qml.X(wires=0)) Extra care needs to be taken, as in the second case the test will simply pass (due to it reaching the This is the reason why the Just thought it's worth pointing this out just as a future use of the |
Context:
Currently, the refactored
QNode
is in thepennylane/beta
folder and users could potentially use it through referencing there. However, maintaining two types ofQNode
objects is not favorable in the long run. Therefore, deprecation of the old-styleQNode
is needed.Description of the Change:
Deprecates the old
QNode
such that only the new version is supported. Moves all related files from thebeta
folder.Benefits:
Only the new
QNode
version needs to be maintained.Possible Drawbacks:
New syntax to be used e.g. for the decorator, several changes need to be noted.
Related GitHub Issues:
Series of previous
QNode
PRs, such as #420, #425