I’m doing the serie of tutorials, to learn a bit about PennyLane.
So far everything was working just fine, but then I tried the PyTorch tutorial, which start by using a forest devices. I installed the forest software and the plugin, however when I run :
import pennylane as qml
import torch
from torch.autograd import Variable
dev = qml.device('forest.qvm', device='2q', noisy=True)
I get the following error:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-2-2cf089c8119a> in <module>
----> 1 dev = qml.device('forest.qvm', device='2q', noisy=True)
~\.conda\envs\penny\lib\site-packages\pennylane\__init__.py in device(name, *args, **kwargs)
210
211 # load plugin device
--> 212 return plugin_device_class(*args, **options)
213
214 raise DeviceError('Device does not exist. Make sure the required plugin is installed.')
~\.conda\envs\penny\lib\site-packages\pennylane_forest\qvm.py in __init__(self, device, shots, noisy, **kwargs)
91 "a valid QVM quantum computer, or a NetworkX graph object.")
92
---> 93 super().__init__(num_wires, shots, **kwargs)
94
95 # get the qc
~\.conda\envs\penny\lib\site-packages\pennylane_forest\device.py in __init__(self, wires, shots, **kwargs)
187 def __init__(self, wires, shots, **kwargs):
188 super().__init__(wires, shots)
--> 189 self.forest_url = kwargs.get('forest_url', pyquil_config.compiler_url)
190 self.qvm_url = kwargs.get('qvm_url', pyquil_config.qvm_url)
191 self.compiler_url = kwargs.get('compiler_url', pyquil_config.compiler_url)
AttributeError: 'PyquilConfig' object has no attribute 'compiler_url'
I have to admit that I have no idea how to solve it, so any help would be welcome.
There are breaking changes in the latest versions of Rigetti software, and it affects PennyLane. I’m not sure if this is the same issue (@josh knows this better – perhaps he can comment), but we are working with Rigetti to fix the plugin.
For this one, It was on the conda environnement I created for penny lane. Maybe there is a problem related the conda environment? Penny lane and the forest plugin are only installed on the envs…
I was able to reproduce the error using the version of PennyLane-Forest installed via pip.
This bug is currently fixed in the latest GitHub master branch of PennyLane-Forest. I will update the pip version so this bug is fixed for users that pip install pennylane-forest ASAP, thank you for letting us know!
In the meantime, you can switch to the GitHub development version as follows:
git clone https://github.com/rigetti/pennylane-forest
cd pennylane-forest && pip install -e .
After running those above two commands, the tutorial linked above should work without error.
Where did you write this?
I am getting errors while trying to run
pip install pennylane-forest & pip install pyquil
thus I can’t run the tutorials because I get DeviceError: Device does not exist. Make sure the required plugin is installed.
Hi @_risto. What errors are you getting when attempting to install pennylane-forest and pyquil? If you could perhaps start a new thread on the forum and post the outputs there, I could attempt to help you figure out what’s going wrong.
It seems that the issue you’re facing will be related to the immutables package as the wheels cannot be built for that one in particular.
This seems to be a problem related to installing PyQuil in specific, rather than PennyLane or the PennyLane-Forest plugin. Perhaps there’s a lead in the complete traceback, on what might be going wrong. Locally I have immutables==0.6 and pyquil==2.21.0 installed, perhaps it is worth an attempt to try installing those versions in specific.