Colab running Pennylane with DeviceError

大兔子大兔子 提交于 2021-01-29 14:56:13

问题


I tried to run Pennylane on Colab, so I install it first. But the "Installed devices" are null, what's going on? I have restart and rebuilt for several times. Here is my code.

!pip install pennylane pennylane-qiskit
import pennylane as qml
qml.about()

Here is the result (with nothing in "Installed devices"):

Successfully built qiskit python-constraint contextvars yfinance docplex dlx
Installing collected packages: semantic-version, appdirs, pennylane, sympy, fastjsonschema, retworkx, python-constraint, ply, immutables, contextvars, qiskit-terra, pybind11, qiskit-aer, websockets, cryptography, ntlm-auth, requests-ntlm, qiskit-ibmq-provider, qiskit-ignis, inflection, quandl, lxml, yfinance, docplex, dlx, qiskit-aqua, qiskit, pennylane-qiskit
  Found existing installation: sympy 1.1.1
    Uninstalling sympy-1.1.1:
      Successfully uninstalled sympy-1.1.1
  Found existing installation: lxml 4.2.6
    Uninstalling lxml-4.2.6:
      Successfully uninstalled lxml-4.2.6
Successfully installed appdirs-1.4.4 contextvars-2.4 cryptography-3.2.1 dlx-1.0.4 docplex-2.15.194 fastjsonschema-2.14.5 immutables-0.14 inflection-0.5.1 lxml-4.6.1 ntlm-auth-1.5.0 pennylane-0.12.0 pennylane-qiskit-0.12.0 ply-3.11 pybind11-2.6.0 python-constraint-1.4.0 qiskit-0.23.0 qiskit-aer-0.7.0 qiskit-aqua-0.8.0 qiskit-ibmq-provider-0.11.0 qiskit-ignis-0.5.0 qiskit-terra-0.16.0 quandl-3.5.3 requests-ntlm-1.1.0 retworkx-0.5.0 semantic-version-2.6.0 sympy-1.6.2 websockets-8.1 yfinance-0.1.55
Name: PennyLane
Version: 0.12.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: /usr/local/lib/python3.6/dist-packages
Requires: semantic-version, scipy, autograd, networkx, numpy, appdirs, toml
Required-by: PennyLane-qiskit
Platform info:           Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic
Python version:          3.6.9
Numpy version:           1.18.5
Scipy version:           1.4.1
Installed devices:

When I tried to use device, I got

raise DeviceError("Device does not exist. Make sure the required plugin is installed.")


回答1:


Had been answered here:

https://discuss.pennylane.ai/t/error-when-calling-device/259/35

See the url for detail.



来源:https://stackoverflow.com/questions/64701587/colab-running-pennylane-with-deviceerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!