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

Hi, I am a bit confused on how the conclusion that theta=0.208 is the optimal was made. Doesn’t the optimizer find a more optimal value of theta=0.2250?

Hi @quantumlover ,

You’re right, the demo should say that the optimal theta is 0.2250 instead of 0.208. It looks like we missed updating this when we updated the demo last year. Thanks for pointing it out and helping us improve!