admin管理员组文章数量:1241080
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.
1 Answer
Reset to default 0There 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
本文标签: machine learningQiskit ImportErrorStack Overflow
版权声明:本文标题:machine learning - Qiskit ImportError - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740070853a2223049.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论