i tried to run this code:

import pennylane as qml

from pennylane.transforms import commute_controlled, cancel_inverses

pipeline = [commute_controlled, cancel_inverses]

@partial(qml.compile, pipeline=pipeline)

@qml.qnode(dev)

def qfunc(x, y, z):

qml.Hadamard(wires=0)

qml.Hadamard(wires=1)

qml.Hadamard(wires=2)

qml.RZ(z, wires=2)

qml.CNOT(wires=[2, 1])

qml.RX(z, wires=0)

qml.CNOT(wires=[1, 0])

qml.RX(x, wires=0)

qml.CNOT(wires=[1, 0])

qml.RZ(-z, wires=2)

qml.RX(y, wires=2)

qml.Y(wires=2)

qml.CZ(wires=[1, 2])

return qml.expval(qml.Z(wires=0)), which i copied from this link for circuit decomposition and circuit compiling: Compiling circuits — PennyLane 0.36.0 documentation. i got this error: ---------------------------------------------------------------------------

NameError Traceback (most recent call last)

Cell In[1], line 5

2 from pennylane.transforms import commute_controlled, cancel_inverses

3 pipeline = [commute_controlled, cancel_inverses]

----> 5 @partial(qml.compile, pipeline=pipeline)

6 @qml.qnode(dev)

7 def qfunc(x, y, z):

8 qml.Hadamard(wires=0)

9 qml.Hadamard(wires=1)

NameError: name ‘partial’ is not defined. I have the latest version of pennylane:

Version: 0.36.0