`forest.wavefunction` DeviceError

Hey there, I’m getting an error trying to use the forest.wavefunction device:

import pennylane as qml

dev_wfun = qml.device('forest.wavefunction', wires=2)
---------------------------------------------------------------------------
DeviceError                               Traceback (most recent call last)
<ipython-input-1-40259941cb81> in <module>
      1 import pennylane as qml
      2 
----> 3 dev_wfun = qml.device('forest.wavefunction', wires=2)

~/opt/anaconda3/envs/qml/lib/python3.8/site-packages/pennylane/__init__.py in device(name, *args, **kwargs)
    253         return plugin_device_class(*args, **options)
    254 
--> 255     raise DeviceError("Device does not exist. Make sure the required plugin is installed.")
    256 
    257 

DeviceError: Device does not exist. Make sure the required plugin is installed.

However, my pennylane installation seems to be working fine. For example, running dev = qml.device('default.qubit', wires=2) raises no errors, and qml.about() gives

Name: PennyLane
Version: 0.15.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: None
Author-email: None
License: Apache License 2.0
Location: /Users/ryanhill/opt/anaconda3/envs/qml/lib/python3.8/site-packages
Requires: numpy, scipy, networkx, semantic-version, autograd, appdirs, toml
Required-by: PennyLane-qiskit, PennyLane-Cirq
Platform info:           macOS-10.16-x86_64-i386-64bit
Python version:          3.8.5
Numpy version:           1.18.5
Scipy version:           1.5.0
Installed devices:
— default.gaussian (PennyLane-0.15.0)
— default.mixed (PennyLane-0.15.0)
— default.qubit (PennyLane-0.15.0)
— default.qubit.autograd (PennyLane-0.15.0)
— default.qubit.jax (PennyLane-0.15.0)
— default.qubit.tf (PennyLane-0.15.0)
— default.tensor (PennyLane-0.15.0)
— default.tensor.tf (PennyLane-0.15.0)
— qiskit.aer (PennyLane-qiskit-0.16.0.dev0)
— qiskit.basicaer (PennyLane-qiskit-0.16.0.dev0)
— qiskit.ibmq (PennyLane-qiskit-0.16.0.dev0)
— cirq.mixedsimulator (PennyLane-Cirq-0.13.0)
— cirq.pasqal (PennyLane-Cirq-0.13.0)
— cirq.qsim (PennyLane-Cirq-0.13.0)
— cirq.qsimh (PennyLane-Cirq-0.13.0)
— cirq.simulator (PennyLane-Cirq-0.13.0)

I tried uninstalling and reinstalling pennylane with the same result. Any ideas as to why the forest.wavefunction device isn’t working here?

Hi @ryanhill1!

To have access to the forest.wavefunction device, you will need to install PennyLane-Forest:

pip install pennylane-forest

Furthermore, you will have to install the Forest QVM. This is quite tricky, and requires using Docker; see the instructions on the README for the QVM: https://github.com/rigetti/qvm/#running-the-qvm-with-docker

Can I ask what you’re using the forest.wavefunction device for?

Oh, ok great thanks. I was just looking at the docs for The Wavefunction Device. I was running the examples in the section on Usage but didn’t realize there were more imports necessary. Thank you!

No worries @ryanhill1, let us know if you have any other questions :slight_smile: