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