-
Notifications
You must be signed in to change notification settings - Fork 182
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
Fix qnn module tutorial for TorchLayer #247
Conversation
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.
Hopefully, the bug gets fixed soon and glad it got caught :)
I suggested adding a comment, but that's not particularly critical. Approve.
@@ -86,7 +86,10 @@ | |||
@qml.qnode(dev) | |||
def qnode(inputs, weights): | |||
qml.templates.AngleEmbedding(inputs, wires=range(n_qubits)) | |||
qml.templates.BasicEntanglerLayers(weights, wires=range(n_qubits)) | |||
for weights_layer in weights: |
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.
for weights_layer in weights: | |
# explicit `qml.templates.BasicEngtnglerLayers` until a bug is fixed | |
for weights_layer in weights: |
Maybe just a comment here that there is usually a better way of doing this.
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 see your point, although wonder if it may confuse the reader - unless they also look at the Keras
tutorial they may not be expecting to see BasicEntanglerLayers
.
# Embedding | ||
qml.RX(inputs[0], wires=0) | ||
qml.RX(inputs[1], wires=1) |
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.
@albi3ro, sorry to rerequest your review! We additionally have to change this, as the bug is also present in AngleEmbedding
.
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 don't see anymore templates. Hopefully this time it's good to go :)
This reverts commit 1866e7e.
Currently the tutorial is failing due to the issue highlighted here: PennyLaneAI/pennylane#1210.
As a quick fix in this PR, we swap out
BasicEntanglerLayers
for its explicit decomposition.