最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

machine learning - Qiskit ImportError - Stack Overflow

programmeradmin5浏览0评论

I was trying to import QuantumKernals using the following:

from qiskit_machine_learning.kernels import QuantumKernel

but i am getting this error:

 from qiskit_machine_learning.kernels import QuantumKernel
ImportError: cannot import name 'QuantumKernel' from 'qiskit_machine_learning.kernels' 
(C:\Users\pshre\AppData\Local\Programs\Python\Python310\lib\site-packages\qiskit_machine_learning\kernels\__init__.py)

Qiskit version: 0.8.2

i have updated the module:

pip install --upgrade qiskit-machine-learning

I was trying to import QuantumKernals using the following:

from qiskit_machine_learning.kernels import QuantumKernel

but i am getting this error:

 from qiskit_machine_learning.kernels import QuantumKernel
ImportError: cannot import name 'QuantumKernel' from 'qiskit_machine_learning.kernels' 
(C:\Users\pshre\AppData\Local\Programs\Python\Python310\lib\site-packages\qiskit_machine_learning\kernels\__init__.py)

Qiskit version: 0.8.2

i have updated the module:

pip install --upgrade qiskit-machine-learning
Share Improve this question asked 2 days ago ShreyansuShreyansu 1 New contributor Shreyansu is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Add a comment  | 

1 Answer 1

Reset to default 0

There is no class named QuantumKernel, hence the error.

See the API ref https://qiskit-community.github.io/qiskit-machine-learning/apidocs/qiskit_machine_learning.kernels.html#module-qiskit_machine_learning.kernels for the classes that are there.

Also see the tutorials such as this one for quantum kernels https://qiskit-community.github.io/qiskit-machine-learning/tutorials/03_quantum_kernel.html

发布评论

评论列表(0)

  1. 暂无评论