Hello. I am new to PennyLane and Quantum Computing in general. I was using some sample code and am getting an error that I have not been able to find a solution to. I have put the code below as well as the error. Thanks in adance.
Code:
import pennylane as qml
from pennylane import numpy as np
from pennylane.templates.embeddings import BasisEmbedding
dev = qml.device(‘default.qubit’, wires=6)
@qml.qnode(dev)
def circuit(data):
for i in range(6):
qml.Hadamard(i)
for i in range(len(data)):
BasisEmbedding(features=data[i], wires=range(6),do_queue=True)
return qml.state()
data=[[1,0,1,1,1,0],
[1,0,0,0,0,1]]
circuit(data)
print(circuit.draw(show_all_wires=True))
Error:
AttributeError Traceback (most recent call last)
/tmp/ipykernel_50/2114460403.py in <cell line: 23>()
21 circuit(data)
22
—> 23 print(circuit.draw(show_all_wires=True))
24
AttributeError: ‘QNode’ object has no attribute ‘draw’