Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,47 @@
"$$\n",
"\n",
"\n",
"where $\\mu$ is an hyperparameter of our kernel and $JS$ is the Jensen-Shannon divergence.\n",
" "
"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."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "05964cf6-d96d-42ee-9b1e-707110d55917",
"metadata": {},
"outputs": [],
"source": [
"import qek.data.extractors as qek_extractors\n",
"import qek.data.graphs as qek_graphs\n",
"from qek.kernel import IntegratedQEK as QEK\n",
"from pathlib import Path\n",
"\n",
"# First, we need to intantiate the compiler for the type of data.\n",
"compiler = qek_graphs.PTCFMCompiler()\n",
"\n",
"# Then, instantiate the Qutip Extractor.\n",
"extractor = qek_extractors.QutipExtractor(\n",
" # Once computing is complete, data will be saved in this file.\n",
" path=Path(\"saved_data.json\"),\n",
" compiler=compiler\n",
")\n",
"\n",
"# Finally, initialize the Integrated Quantum Evolution Kernel with both the extractor and the parameter mu.\n",
"kernel = QEK(mu=0.5, extractor=extractor)"
]
},
{
"cell_type": "markdown",
"id": "fae79440-b962-40fa-8274-ebffa48ccfb1",
"metadata": {},
"source": [
" 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."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "55f264f6-18f5-4009-930a-12cce4a2cb87",
"id": "000780dc-cb6a-4d70-bfe4-c86bbf281278",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -629,7 +662,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.3"
"version": "3.12.7"
}
},
"nbformat": 4,
Expand Down
Loading