Skip to content

Commit 2ab6b39

Browse files
Merge pull request #313 from sQUlearn/develop
Release 0.8.1
2 parents 16712cf + 02bc1e5 commit 2ab6b39

30 files changed

Lines changed: 1267 additions & 97 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
sQUlearn is a user-friendly, NISQ-ready Python library for quantum machine learning (QML), designed for seamless integration with classical machine learning tools like scikit-learn. The library's dual-layer architecture serves both QML researchers and practitioners, enabling efficient prototyping, experimentation, and pipelining. sQUlearn provides a comprehensive tool set that includes both quantum kernel methods and quantum neural networks, along with features like customizable data encoding strategies, automated execution handling, and specialized kernel regularization techniques. By focusing on NISQ-compatibility and end-to-end automation, sQUlearn aims to bridge the gap between current quantum computing capabilities and practical machine learning applications.
66

7-
sQUlearn offers scikit-learn compatible high-level interfaces for various kernel methods and QNNs. They build on top of the low-level interfaces of the QNN engine and the quantum kernel engine. The executor is used to run experiments on simulated and real backends of the Qiskit or PennyLane frameworks.
7+
sQUlearn offers scikit-learn compatible high-level interfaces for various kernel methods, QNNs and quantum reservoir computing. They build on top of the low-level interfaces of the QNN engine and the quantum kernel engine. The executor is used to run experiments on simulated and real backends of the Qiskit or PennyLane frameworks.
88

99
<p align="center">
10-
<img width=500px alt="sQUlearn schematic" src="https://raw.githubusercontent.com/sQUlearn/squlearn/main/docs/_static/schematic.png" />
10+
<img width=600px alt="sQUlearn schematic" src="https://raw.githubusercontent.com/sQUlearn/squlearn/main/docs/_static/schematic.png" />
1111
</p>
1212

1313
---
49 KB
Loading
15.3 KB
Loading
208 KB
Loading
33.3 KB
Loading

docs/_static/schematic.png

8.13 KB
Loading
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"path": "../../examples/tutorials/qnn_ode_solver.ipynb",
3+
"extra-media": [
4+
"../../examples/tutorials/images"
5+
]
6+
}

docs/examples/examples_index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Examples
1010
example_kernel_digit_classification
1111
example_kernel_grid_search
1212
example_quantum_bayesian_optimization
13-
example_qnn_backend_mitigation
13+
example_qnn_backend_mitigation
14+
example_qnn_ode_solver

docs/user_guide/kernel_methods.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,21 @@ state [1]. In the quantum computational practice, the Hilbert-Schmidt inner prod
5050
measurements. Consequently, in quantum computing, access to the Hilbert space of quantum states is
5151
given by measurements.
5252

53+
.. _figure 1:
54+
.. figure:: ../_static/qkm/QKM_scheme_pic.jpg
55+
:alt: Quantum Kernel Methods
56+
:width: 500
57+
:align: center
58+
59+
**Figure 1** Schematic illustration of the function principle of quantum kernel methods, which can be formally embedded in the rich
60+
mathematical framework of conventional kernel theory. Data points :math:`\symbf{x}` are mapped to the quantum Hilbert space by
61+
encoding them into a quantum state :math:`\ket{\symbf{\psi}(\symbf{x})}`. Access to the quantum Hilbert space is granted by
62+
measurements. :math:`\symbf{Left:}` In quantum mechanics measurements are expressed through Hilbert-Schmidt inner products.
63+
Quantum kernels, which are defined using this fidelity-type metric are thus referred to as fidelity quantum kernels (FQKs).
64+
More on FQKs in sQUlearn will be discussed below. :math:`\symbf{Right:}` When projecting the quantum states to an approximate
65+
classical representation using, e.g., reduced physical observables this gives rise to a family of projected quantum kernels (PQKs).
66+
These will be also subject to discussion in the sQUlearn context below.
67+
5368

5469
.. currentmodule:: squlearn.kernel.ml
5570

docs/user_guide/quantum_neural_networks.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ minimized by a classical optimizer. The resultant QNN can then be employed to pr
1515
for new input data.
1616

1717
In many cases, QNNs adhere to a layered design, akin to classical neural networks, as illustrated
18-
in `figure 1`_. However, it is essential to note that they do not adhere to the concept of
18+
in `figure_qnn 1`_. However, it is essential to note that they do not adhere to the concept of
1919
neurons as seen in classical neural networks. Therefore, the term "Quantum Neural Network" may
2020
be somewhat misleading, as QNNs do not conform to the traditional neural network paradigm.
2121
Nevertheless, their application domain closely resembles that of classical neural networks,
2222
which explains the established nomenclature.
2323

24-
.. _figure 1:
24+
.. _figure_qnn 1:
2525
.. figure:: ../_static/qnn/qnn.svg
2626
:alt: Quantum Neural Network (QNN)
2727
:width: 600
@@ -57,7 +57,7 @@ It's worth noting that both the embedding layers :math:`U_i({x})` and the observ
5757

5858
To train Quantum Neural Networks (QNNs), a hybrid quantum-classical approach is employed.
5959
The training process consists of two phases: quantum circuit evaluation and classical optimization
60-
(as illustrated in `figure 1`_).
60+
(as illustrated in `figure_qnn 1`_).
6161

6262
In the quantum circuit evaluation phase, the QNN and its gradient with respect to the parameters
6363
are assessed using a quantum computer or simulator. The gradient can be obtained using the
@@ -292,13 +292,13 @@ The noise level of the model thus depends on its variance, which can be calculat
292292
\sigma_f^2 = \langle\Psi\lvert\hat{C}^2\rvert\Psi\rangle -
293293
\langle\Psi\lvert\hat{C}\rvert\Psi\rangle^2 \text{.}
294294
295-
`Figure 2`_ shows the output of a :class:`QNNRegressor` fit to a logarithm
295+
`Figure_qnn 3`_ shows the output of a :class:`QNNRegressor` fit to a logarithm
296296
with :class:`SquaredLoss <squlearn.qnn.loss.SquaredLoss>` evaluated on Qiskit's
297297
:class:`QasmSimulator <qiskit_aer.QasmSimulator>`.
298298
The model has been trained with a noise-free simulator, but evaluating it on a noisy simulator
299299
yields a high variance in the model output.
300300

301-
.. _figure 2:
301+
.. _figure_qnn 2:
302302
.. plot::
303303
:caption: **Figure 2** Logarithm and output of :class:`QNNRegressor` :math:`f(\theta, x)` evaluated on Qiskit's
304304
:class:`QasmSimulator <qiskit_aer.QasmSimulator>`. The QNN output has a high variance.
@@ -359,9 +359,9 @@ takes the keyword argument ``iteration`` to dynamically adjust the factor. Value
359359
:math:`10^{-2}` and :math:`10^{-4}` have shown to yield satisfying results. `[1]`_
360360

361361
Evaluation on Qiskit's :class:`QasmSimulator <qiskit_aer.QasmSimulator>` now yields less variance
362-
in the model, as depicted in `figure 3`_.
362+
in the model, as depicted in `figure_qnn 3`_.
363363

364-
.. _figure 3:
364+
.. _figure_qnn 3:
365365
.. plot::
366366
:caption: **Figure 3** Logarithm and output of :class:`QNNRegressor` :math:`f(\theta, x)`, trained with variance
367367
regularization, evaluated on Qiskit's :class:`QasmSimulator <qiskit_aer.QasmSimulator>`.

0 commit comments

Comments
 (0)