本文介绍了Colab使用DeviceError运行Pennylane的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Colab上运行Pennylane,所以我先安装了它.但是已安装的设备"为空,这是怎么回事?我已经重新启动并重建了好几次.这是我的代码.

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

推荐答案

在这里已回答:

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

有关详细信息,请参见网址.

See the url for detail.

这篇关于Colab使用DeviceError运行Pennylane的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 07:55