Issue with qml.workflow.construct_tape in Pennylane Tutorial

Hi everyone,

I am currently following the Pennylane tutorial Quantum Natural SPSA Optimizer. However, I’ve encountered an issue with the function qml.workflow.construct_tape. When I try to use it with the latest version of Pennylane (v0.38), I get the following error:

AttributeError: module 'pennylane.workflow' has no attribute 'construct_tape'

Is there a solution to this issue that doesn’t require modifying the main code of the tutorial?

I would greatly appreciate any help or insights you could provide!

Hi @QuantumH ,

The latest version of PennyLane is actually version v0.40. This is why you’re seeing this issue. You can solve it by doing pip install pennylane --upgrade

I hope this helps!

Hi @CatalinaAlbornoz,

Thank you! This worked perfectly. I appreciate your help.

1 Like