|
6 | 6 | "source": [ |
7 | 7 | "# Tutorial 1: using a Quantum Device to extract machine-learning features\n", |
8 | 8 | "\n", |
9 | | - "This notebook reproduces the first part of the [QEK paper](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.107.042615) using the library's high-level API, dedicated to features extraction using a Quantum Device.\n", |
| 9 | + "The companion library is a machine-learning tool that uses a quantum device to predict similarities and properties of graphs. In this tutorial, we will reproduce first part of the [QEK paper](https://journals.aps.org/pra/abstract/10.1103/PhysRevA.107.042615) using the library's high-level API. The high-level goal of this tutorial is to predict toxicity properties of molecules, using quantum machine learning, but of course, the mechanisms involved are much more generic.\n", |
10 | 10 | "\n", |
11 | 11 | "By the end of this notebook, you will know how to:\n", |
12 | 12 | "\n", |
|
25 | 25 | "source": [ |
26 | 26 | "## Dataset preparation\n", |
27 | 27 | "\n", |
28 | | - "As in any machine learning task, we first need to load and prepare data. QEK can work with many types of graphs, including molecular graphs. For this tutorial, we will use the PTC-FM dataset, which contains such molecular graphs." |
| 28 | + "As in any machine learning task, we first need to load and prepare data. QEK can work with many types of graphs, including molecular graphs. For this tutorial, we will use the PTC-FM dataset, which contains such molecular graphs, labeled with their toxicity." |
29 | 29 | ] |
30 | 30 | }, |
31 | 31 | { |
|
87 | 87 | "metadata": {}, |
88 | 88 | "outputs": [], |
89 | 89 | "source": [ |
| 90 | + "from pathlib import Path\n", |
90 | 91 | "import qek.data.extractors as qek_extractors\n", |
91 | 92 | "\n", |
92 | 93 | "# Use the Qutip Extractor.\n", |
93 | 94 | "extractor = qek_extractors.QutipExtractor(\n", |
94 | 95 | " # Once computing is complete, data will be saved in this file.\n", |
95 | | - " path=\"saved_data.json\",\n", |
| 96 | + " path=Path(\"saved_data.json\"),\n", |
96 | 97 | " compiler=compiler\n", |
97 | 98 | ")\n", |
98 | 99 | "\n", |
|
309 | 310 | "dataset_example.draw_excitation()" |
310 | 311 | ] |
311 | 312 | }, |
| 313 | + { |
| 314 | + "cell_type": "markdown", |
| 315 | + "metadata": {}, |
| 316 | + "source": [ |
| 317 | + "Is this distribution of excitation connected to the toxicity of the molecule? To check this out, we'll need to perform some machine-learning engineering.\n", |
| 318 | + "\n", |
| 319 | + "**Note** Of course, you could derive features completely unrelated to distribution of excitation." |
| 320 | + ] |
| 321 | + }, |
312 | 322 | { |
313 | 323 | "cell_type": "markdown", |
314 | 324 | "metadata": {}, |
|
317 | 327 | "\n", |
318 | 328 | "What we have seen so far covers the use of a Quantum Device to extract machine-learning features.\n", |
319 | 329 | "\n", |
320 | | - "For the next step, we'll see [how to use these features for machine learning](./tutorial%202%20-%20Machine-Learning%20with%20the%20Quantum%20EvolutionKernel.ipynb)." |
| 330 | + "For the next step, we'll see [how to use these features for actual machine learning](./tutorial%202%20-%20Machine-Learning%20with%20the%20Quantum%20EvolutionKernel.ipynb)." |
321 | 331 | ] |
| 332 | + }, |
| 333 | + { |
| 334 | + "cell_type": "markdown", |
| 335 | + "metadata": {}, |
| 336 | + "source": [] |
322 | 337 | } |
323 | 338 | ], |
324 | 339 | "metadata": { |
|
0 commit comments