Skip to content

Commit 28e42b3

Browse files
authored
Minor fix in quantum_neural_net.py (#1328)
**Title:** Minor fix in quantum_neural_net.py **Summary:** qml.quadX is not supported in pennylane≤0.29 and results in error. Change to qml.X **Relevant references:** **Possible Drawbacks:** **Related GitHub Issues:**
1 parent db3e422 commit 28e42b3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

demonstrations/quantum_neural_net.metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77
],
88
"dateOfPublication": "2019-10-11T00:00:00+00:00",
9-
"dateOfLastModification": "2024-10-07T00:00:00+00:00",
9+
"dateOfLastModification": "2025-03-20T00:00:00+00:00",
1010
"categories": [
1111
"Quantum Machine Learning"
1212
],

demonstrations/quantum_neural_net.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
pytorch_noise PyTorch and noisy devices
1818
tutorial_noisy_circuit_optimization Optimizing noisy circuits with Cirq
1919
20-
*Author: Maria Schuld — Posted: 11 October 2019. Last updated: 25 January 2021.*
20+
*Author: Maria Schuld — Posted: 11 October 2019. Last updated: 20 March 2025.*
2121
2222
.. warning::
2323
This demo is only compatible with PennyLane version ``0.29`` or below.
@@ -84,7 +84,7 @@ def quantum_neural_net(var, x):
8484
for v in var:
8585
layer(v)
8686

87-
return qml.expval(qml.QuadX(0))
87+
return qml.expval(qml.X(0))
8888

8989

9090
##############################################################################
@@ -741,4 +741,4 @@ def cost(var, features, labels):
741741
##############################################################################
742742
# About the author
743743
# ----------------
744-
#
744+
#

0 commit comments

Comments
 (0)