How to draw a circuit diagram with parameters

I want to draw a quantum circuit diagram with a parameter gamma, but running the code below shows that gamma is undefined, which can be represented in qikit by writing gamma=Parameter (“\ \ gamma ”). So how do I draw it in Pennylane?
Note: Gamma is a parameter to be optimized in a combinatorial optimization problem. It will be optimized using an optimizer in the future, and specific values cannot be provided in the process of writing code earlier

# Put code here
import pennylane as qml
import matplotlib.pyplot as plt

dev = qml.device("default.qubit", wires=5)

def circuit(gamma):
    qml.Hadamard(wires=0)
    qml.Hadamard(wires=1)
    qml.Hadamard(wires=2)
    qml.Hadamard(wires=3)
    qml.Hadamard(wires=4)
    qml.Hadamard(wires=5)

    qml.CNOT(wires=[0, 1])
    qml.RZ(47 * gamma, wires=1)
    qml.CNOT(wires=[0, 1])

    return qml.expval(qml.PauliZ(wires=0))



qnode = qml.QNode(circuit, dev)
qml.draw_mpl(qnode, decimals=1)(gamma)
plt.draw()



name 'gamma' is not defined

Thank you!

You can put any random value for gamma later it will take its optimal value.

Hey @ming! You need to assign a value to gamma first :slight_smile: