File size: 2,561 Bytes
b7d9967
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This code is part of a Qiskit project.
#
# (C) Copyright IBM 2021, 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

r"""

Quantum kernels (:mod:`qiskit_machine_learning.kernels`)

========================================================



A set of extendable classes that can be used to evaluate kernel matrices.



The general task of machine learning is to find and study patterns in data. For many

algorithms, the datapoints are better understood in a higher dimensional feature space,

through the use of a kernel function:



.. math::



    K(x, y) = \langle f(x), f(y)\rangle.



Here :math:`K` is the kernel function, :math:`x`, :math:`y` are :math:`n` dimensional inputs.

:math:`f` is a map from :math:`n`-dimension to :math:`m`-dimension space. :math:`\langle x, y

\rangle` denotes the inner product. Usually :math:`m` is much larger than :math:`n`.



The quantum kernel algorithm calculates a kernel matrix, given datapoints :math:`x` and

:math:`y` and feature map :math:`f`, all of :math:`n` dimension. This kernel matrix can then be

used in classical machine learning algorithms such as support vector classification, spectral

clustering or ridge regression.



.. currentmodule:: qiskit_machine_learning.kernels



Quantum Kernels

---------------



.. autosummary::

   :toctree: ../stubs/

   :nosignatures:



   BaseKernel

   FidelityQuantumKernel

   FidelityStatevectorKernel

   TrainableKernel

   TrainableFidelityQuantumKernel

   TrainableFidelityStatevectorKernel



Submodules

----------



.. autosummary::

   :toctree:



   algorithms

"""

from .base_kernel import BaseKernel
from .fidelity_quantum_kernel import FidelityQuantumKernel
from .fidelity_statevector_kernel import FidelityStatevectorKernel
from .trainable_kernel import TrainableKernel
from .trainable_fidelity_quantum_kernel import TrainableFidelityQuantumKernel
from .trainable_fidelity_statevector_kernel import TrainableFidelityStatevectorKernel

__all__ = [
    "BaseKernel",
    "FidelityQuantumKernel",
    "FidelityStatevectorKernel",
    "TrainableKernel",
    "TrainableFidelityQuantumKernel",
    "TrainableFidelityStatevectorKernel",
]