|
137 | 137 | "$$\n", |
138 | 138 | "\n", |
139 | 139 | "\n", |
140 | | - "where $\\mu$ is an hyperparameter of our kernel and $JS$ is the Jensen-Shannon divergence.\n", |
141 | | - " " |
| 140 | + "where $\\mu$ is an hyperparameter of our kernel and $JS$ is the Jensen-Shannon divergence. For processing raw graph data, the IntegratedQEK is recommended; however, it requires an extractor to be provided as an argument." |
| 141 | + ] |
| 142 | + }, |
| 143 | + { |
| 144 | + "cell_type": "code", |
| 145 | + "execution_count": null, |
| 146 | + "id": "05964cf6-d96d-42ee-9b1e-707110d55917", |
| 147 | + "metadata": {}, |
| 148 | + "outputs": [], |
| 149 | + "source": [ |
| 150 | + "import qek.data.extractors as qek_extractors\n", |
| 151 | + "import qek.data.graphs as qek_graphs\n", |
| 152 | + "from qek.kernel import IntegratedQEK as QEK\n", |
| 153 | + "from pathlib import Path\n", |
| 154 | + "\n", |
| 155 | + "# First, we need to intantiate the compiler for the type of data.\n", |
| 156 | + "compiler = qek_graphs.PTCFMCompiler()\n", |
| 157 | + "\n", |
| 158 | + "# Then, instantiate the Qutip Extractor.\n", |
| 159 | + "extractor = qek_extractors.QutipExtractor(\n", |
| 160 | + " # Once computing is complete, data will be saved in this file.\n", |
| 161 | + " path=Path(\"saved_data.json\"),\n", |
| 162 | + " compiler=compiler\n", |
| 163 | + ")\n", |
| 164 | + "\n", |
| 165 | + "# Finally, initialize the Integrated Quantum Evolution Kernel with both the extractor and the parameter mu.\n", |
| 166 | + "kernel = QEK(mu=0.5, extractor=extractor)" |
| 167 | + ] |
| 168 | + }, |
| 169 | + { |
| 170 | + "cell_type": "markdown", |
| 171 | + "id": "fae79440-b962-40fa-8274-ebffa48ccfb1", |
| 172 | + "metadata": {}, |
| 173 | + "source": [ |
| 174 | + " In this case and since data has already been pre-processed, we will use the `FastQEK` kernel instead that speeds-up the computation and allows for computing matrix similarities." |
142 | 175 | ] |
143 | 176 | }, |
144 | 177 | { |
145 | 178 | "cell_type": "code", |
146 | 179 | "execution_count": null, |
147 | | - "id": "55f264f6-18f5-4009-930a-12cce4a2cb87", |
| 180 | + "id": "000780dc-cb6a-4d70-bfe4-c86bbf281278", |
148 | 181 | "metadata": {}, |
149 | 182 | "outputs": [], |
150 | 183 | "source": [ |
|
629 | 662 | "name": "python", |
630 | 663 | "nbconvert_exporter": "python", |
631 | 664 | "pygments_lexer": "ipython3", |
632 | | - "version": "3.12.3" |
| 665 | + "version": "3.12.7" |
633 | 666 | } |
634 | 667 | }, |
635 | 668 | "nbformat": 4, |
|
0 commit comments