Draw complex pennylane circuits

Hi there, I have started using pennylane recently. Its fabulous.
This is the circuit:

n_qubits = 4
def circuit1():

    H_layer(n_qubits)

    RY_layer([1,2,3,4])

    for k in range(q_depth):

        entangling_layers(n_qubits)

        RY_layer([1,2,3,4])

    return qml.expval(qml.PauliZ(1))

circuit = qml.QNode(circuit1(), dev)

print(circuit.draw())

While draw, its giving error:

TypeError: [expval(PauliZ(wires=[0])), expval(PauliZ(wires=[1])), expval(PauliZ(wires=[2])), expval(PauliZ(wires=[3]))] is not a callable object 

Can anyone help me out?

Hi @Jay_Timbadia, you will need to evaluate the QNode before drawing it!

Also, when you create the QNode, you pass the name of the quantum function (without the () ).

For example:

>>> circuit = qml.QNode(circuit1, dev)
>>> circuit() # evaluate the QNode
>>> print(circuit.draw())