A brief overview of VQE Demo

Use this topic for questions related to the VQE PennyLane Demo!

Is it possible to Draw the circuit of the VQE example?

Hi @gnusci , welcome to the Forum!

Absolutely!

You can use qml.draw_mpl() for getting nice drawings of your circuits, or qml.draw() if you need a text-based output (e.g. if you’re using a supercomputer).

For the VQE demo here’s an example of how you could draw the circuit as follows:

fig, ax = qml.draw_mpl(circuit)(param, wires)
fig.show()

You’ll need to specify the wires (e.g. wires=range(qubits)) and the parameter (e.g. param = 0.).

You can learn more about drawing circuits and the drawing styles available in the docs.

I hope this helps!

Thanks a lot! It works perfect :grinning_face:

1 Like