Hi! I’ve been trying to create a qnode within a class but having a little trouble doing this.
Some pseudo code:
class Circuit(object):
def__init__(self):
self.dev_qubit=qml.device(‘default.qubit’,wires=total)
Then when I create the qnode I try referencing the dev_qubit in the wrapper like so:
@qml.qnode(self.dev_qubit)
def quantumcirc()…
But this raises an error because self cannot be passed this way in the decorator. If I use the following later on:
dev_qubit=qml.device(‘default.qubit’,wires=total)
quantumcirc=qml.Qnode(quantumcirc, dev_qubit)
This also doesn’t seem to run. I’m not sure how to work around this! This is probably more a python/wrapper issue not a PennyLane one, but just wanted to ask in case there is a quick/obvious solution I’m missing! Thank you!