From e85b693cdea28a14e80088241a1771407b9b2ca9 Mon Sep 17 00:00:00 2001 From: Meltem Tolunay Date: Mon, 6 Apr 2026 15:52:22 -0700 Subject: [PATCH 1/8] update pqk tutorial --- .../tutorials/projected-quantum-kernels.ipynb | 28 +++++++++++++++++-- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 9a8ca77a0b7..f46fad46ef3 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -19,7 +19,18 @@ "id": "bee84331-1f3b-4a23-b691-4d3f7f51e76b", "metadata": {}, "source": [ - "# Enhance feature classification using projected quantum kernels\n", + "## Learning outcomes\n", + "\n", + "After going through this tutorial, users should understand:\n", + "- how projected quantum kernels (PQKs) work and when they offer a potential quantum advantage\n", + "- how to run a PQK on hardware using a real-world dataset\n", + "\n", + "## Prerequisites\n", + "\n", + "We suggest that users are familiar with the following topics before going through this tutorial:\n", + "- [quantum kernels](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/quantum-kernel-methods) from the quantum machine learning course on the IBM Quantum Learning Platform \n", + "\n", + "## Background\n", "\n", "*Usage estimate: 80 minutes on a Heron r3 processor (NOTE: This is an estimate only. Your runtime might vary.)*\n", "\n", @@ -1461,6 +1472,17 @@ "print(f\"Quantum model complexity is {s_q:.4f}\")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Next steps\n", + "\n", + "If you found this work interesting, you might be interested in the following material:\n", + "- In-depth [quantum machine learning course](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning) from IBM Quantum Learning Platform\n", + "- [Quantum kernel training](https://quantum.cloud.ibm.com/docs/en/tutorials/quantum-kernel-training) tutorial" + ] + }, { "cell_type": "markdown", "id": "f082899c-b763-4df0-a81c-5efb3ca43451", @@ -1476,7 +1498,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "pqk", "language": "python", "name": "python3" }, @@ -1490,7 +1512,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3" + "version": "3.12.11" }, "widgets": { "application/vnd.jupyter.widget-state+json": { From 049e675203a3843f39a0ec96876efdff00b19758 Mon Sep 17 00:00:00 2001 From: Meltem Tolunay Date: Mon, 6 Apr 2026 16:55:52 -0700 Subject: [PATCH 2/8] fix vocabulary lint error --- docs/tutorials/projected-quantum-kernels.ipynb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index f46fad46ef3..2563521a9f4 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -19,11 +19,15 @@ "id": "bee84331-1f3b-4a23-b691-4d3f7f51e76b", "metadata": {}, "source": [ + "# Enhance feature classification using projected quantum kernels\n", + "\n", + "*Usage estimate: 80 minutes on a Heron r3 processor (NOTE: This is an estimate only. Your runtime might vary.)*\n", + "\n", "## Learning outcomes\n", "\n", "After going through this tutorial, users should understand:\n", - "- how projected quantum kernels (PQKs) work and when they offer a potential quantum advantage\n", - "- how to run a PQK on hardware using a real-world dataset\n", + "- How projected quantum kernels (PQK) work and when they offer a potential quantum advantage.\n", + "- How to run a PQK on hardware using a real-world dataset.\n", "\n", "## Prerequisites\n", "\n", From d82972aee109f8a42d897f345139020b8dd8daf8 Mon Sep 17 00:00:00 2001 From: Meltem Tolunay Date: Mon, 6 Apr 2026 17:01:04 -0700 Subject: [PATCH 3/8] fix other lint errors --- docs/tutorials/projected-quantum-kernels.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 2563521a9f4..9123575580b 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -32,7 +32,7 @@ "## Prerequisites\n", "\n", "We suggest that users are familiar with the following topics before going through this tutorial:\n", - "- [quantum kernels](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/quantum-kernel-methods) from the quantum machine learning course on the IBM Quantum Learning Platform \n", + "- [quantum kernels](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/quantum-kernel-methods) from the quantum machine learning course on the IBM Quantum Learning Platform\n", "\n", "## Background\n", "\n", @@ -1478,6 +1478,7 @@ }, { "cell_type": "markdown", + "id": "32606150-5820-44f3-a669-920712792350", "metadata": {}, "source": [ "## Next steps\n", @@ -1502,7 +1503,7 @@ ], "metadata": { "kernelspec": { - "display_name": "pqk", + "display_name": "Python 3", "language": "python", "name": "python3" }, @@ -1516,7 +1517,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.11" + "version": "3" }, "widgets": { "application/vnd.jupyter.widget-state+json": { From f788433c0cdf805dd0a5f43ea22951182d137e3b Mon Sep 17 00:00:00 2001 From: Meltem Tolunay Date: Mon, 11 May 2026 14:18:20 -0700 Subject: [PATCH 4/8] update after review --- .../tutorials/projected-quantum-kernels.ipynb | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 9123575580b..4387af30ad5 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -32,7 +32,7 @@ "## Prerequisites\n", "\n", "We suggest that users are familiar with the following topics before going through this tutorial:\n", - "- [quantum kernels](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/quantum-kernel-methods) from the quantum machine learning course on the IBM Quantum Learning Platform\n", + "- [Quantum kernels](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/quantum-kernel-methods) from the [quantum machine learning course](/learning/courses/quantum-machine-learning) on the IBM Quantum Learning Platform\n", "\n", "## Background\n", "\n", @@ -42,7 +42,9 @@ "\n", "PQK is a method used in quantum machine learning (QML) to encode classical data into a quantum feature space and project them back into the classical domain, by using quantum computers to enhance feature selection. It involves encoding classical data into quantum states using a quantum circuit, typically through a process called feature mapping, where the data is transformed into a high-dimensional Hilbert space. The \"projected\" aspect refers to extracting classical information from the quantum states, by measuring specific observables, to construct a kernel matrix that can be used in classical kernel-based algorithms like support vector machines. This approach leverages the computational advantages of quantum systems to potentially achieve better performance on certain tasks compared to classical methods.\n", "\n", - "This tutorial also assumes general familiarity with QML methods. For further exploration of QML, refer to the [Quantum machine learning](/learning/courses/quantum-machine-learning) course in IBM Quantum Learning." + "The main building blocks of PQKs are reduced density matrices (RDMs), obtained through projective measurements of the quantum feature map. In particular, one typically computes the single qubit reduced density matrices (1 RDMs) for each qubit. These measured quantities are then used as inputs to a classical kernel function, such as an exponential kernel, to construct the final kernel matrix.\n", + "\n", + "PQKs offer potential advantages over standard [quantum kernels](https://quantum.cloud.ibm.com/docs/en/tutorials/quantum-kernel-training), particularly for near term quantum hardware. Standard quantum kernels typically rely on estimating global state overlaps, which become increasingly difficult to measure accurately as the number of qubits grows and are highly sensitive to noise. In contrast, PQKs use local observables such as single qubit reduced density matrices (1 RDMs), leading to lower sampling overhead, improved robustness to hardware noise, and better scalability. By projecting quantum states onto local measurement features before applying a classical kernel function, PQKs can retain useful quantum correlations while remaining more practical for near-term devices." ] }, { @@ -110,12 +112,29 @@ "warnings.filterwarnings(\"ignore\")" ] }, + { + "cell_type": "markdown", + "id": "bd92ba56-e9eb-4841-b751-7627f47d756c", + "metadata": {}, + "source": [ + "## Small-scale simulator example\n", + "We omit the small scale simulator example in this tutorial, as our primary goal is to demonstrate how projected quantum kernels can scale to larger systems and real hardware." + ] + }, + { + "cell_type": "markdown", + "id": "0fb8a2fa-64b4-434f-8848-e89a098ba73d", + "metadata": {}, + "source": [ + "## Large-scale hardware example" + ] + }, { "cell_type": "markdown", "id": "2f8775c8-81b5-4732-8325-3f12dc96b45d", "metadata": {}, "source": [ - "## Step 1: Map classical inputs to a quantum problem" + "### Step 1: Map classical inputs to a quantum problem" ] }, { @@ -429,7 +448,7 @@ "id": "0c828dc0-9bd1-44bc-b299-303766ae3d37", "metadata": {}, "source": [ - "## Step 2: Optimize problem for quantum hardware execution" + "### Step 2: Optimize problem for quantum hardware execution" ] }, { @@ -555,7 +574,7 @@ "id": "8b27a3f8-5ee9-41b5-a430-25247545cbb9", "metadata": {}, "source": [ - "## Step 3: Execute using Qiskit primitives" + "### Step 3: Execute using Qiskit primitives" ] }, { @@ -564,8 +583,7 @@ "metadata": {}, "source": [ "### Measure 1-RDMs\n", - "\n", - "The main building blocks of projected quantum kernels are the reduced density matrices (RDMs), which are obtained though projective measurements of the quantum feature map. In this step, we obtain all single-qubit reduced density matrices (1-RDMs), which will later be provided into the classical exponential kernel function." + "In this step, we obtain all single-qubit reduced density matrices (1-RDMs) through projective measurements of the quantum feature map, which will later be provided into the classical exponential kernel function." ] }, { @@ -1123,7 +1141,7 @@ "id": "b87be787-8751-4093-9547-57315fa13c88", "metadata": {}, "source": [ - "## Step 4: Post-process and return result in desired classical format" + "### Step 4: Post-process and return result in desired classical format" ] }, { From 8fcbb8725b6e7b971256962ead91129e4e086743 Mon Sep 17 00:00:00 2001 From: abbycross Date: Tue, 12 May 2026 13:32:35 -0400 Subject: [PATCH 5/8] Apply suggestions from code review --- docs/tutorials/projected-quantum-kernels.ipynb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 4387af30ad5..5aa95f921df 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -32,7 +32,7 @@ "## Prerequisites\n", "\n", "We suggest that users are familiar with the following topics before going through this tutorial:\n", - "- [Quantum kernels](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning/quantum-kernel-methods) from the [quantum machine learning course](/learning/courses/quantum-machine-learning) on the IBM Quantum Learning Platform\n", + "- [Quantum kernels](/learning/courses/quantum-machine-learning/quantum-kernel-methods) from the [quantum machine learning course](/learning/courses/quantum-machine-learning) in IBM Quantum® Learning\n", "\n", "## Background\n", "\n", @@ -42,9 +42,9 @@ "\n", "PQK is a method used in quantum machine learning (QML) to encode classical data into a quantum feature space and project them back into the classical domain, by using quantum computers to enhance feature selection. It involves encoding classical data into quantum states using a quantum circuit, typically through a process called feature mapping, where the data is transformed into a high-dimensional Hilbert space. The \"projected\" aspect refers to extracting classical information from the quantum states, by measuring specific observables, to construct a kernel matrix that can be used in classical kernel-based algorithms like support vector machines. This approach leverages the computational advantages of quantum systems to potentially achieve better performance on certain tasks compared to classical methods.\n", "\n", - "The main building blocks of PQKs are reduced density matrices (RDMs), obtained through projective measurements of the quantum feature map. In particular, one typically computes the single qubit reduced density matrices (1 RDMs) for each qubit. These measured quantities are then used as inputs to a classical kernel function, such as an exponential kernel, to construct the final kernel matrix.\n", + "The main building blocks of PQKs are reduced density matrices (RDMs), obtained through projective measurements of the quantum feature map. In particular, one typically computes the single-qubit reduced density matrices (1 RDMs) for each qubit. These measured quantities are then used as inputs to a classical kernel function, such as an exponential kernel, to construct the final kernel matrix.\n", "\n", - "PQKs offer potential advantages over standard [quantum kernels](https://quantum.cloud.ibm.com/docs/en/tutorials/quantum-kernel-training), particularly for near term quantum hardware. Standard quantum kernels typically rely on estimating global state overlaps, which become increasingly difficult to measure accurately as the number of qubits grows and are highly sensitive to noise. In contrast, PQKs use local observables such as single qubit reduced density matrices (1 RDMs), leading to lower sampling overhead, improved robustness to hardware noise, and better scalability. By projecting quantum states onto local measurement features before applying a classical kernel function, PQKs can retain useful quantum correlations while remaining more practical for near-term devices." + "PQKs offer potential advantages over standard [quantum kernels](/docs/tutorials/quantum-kernel-training), particularly for near-term quantum hardware. Standard quantum kernels typically rely on estimating global state overlaps, which become increasingly difficult to measure accurately as the number of qubits grows and are highly sensitive to noise. In contrast, PQKs use local observables such as single-qubit reduced density matrices (1 RDMs), leading to lower sampling overhead, improved robustness to hardware noise, and better scalability. By projecting quantum states onto local measurement features before applying a classical kernel function, PQKs can retain useful quantum correlations while remaining more practical for near-term devices." ] }, { @@ -118,7 +118,7 @@ "metadata": {}, "source": [ "## Small-scale simulator example\n", - "We omit the small scale simulator example in this tutorial, as our primary goal is to demonstrate how projected quantum kernels can scale to larger systems and real hardware." + "We omit the small-scale simulator example in this tutorial, as our primary goal is to demonstrate how projected quantum kernels can scale to larger systems and real hardware." ] }, { @@ -1501,9 +1501,11 @@ "source": [ "## Next steps\n", "\n", + "\n", "If you found this work interesting, you might be interested in the following material:\n", - "- In-depth [quantum machine learning course](https://quantum.cloud.ibm.com/learning/en/courses/quantum-machine-learning) from IBM Quantum Learning Platform\n", - "- [Quantum kernel training](https://quantum.cloud.ibm.com/docs/en/tutorials/quantum-kernel-training) tutorial" + "- In-depth [quantum machine learning course](/learning/courses/quantum-machine-learning) from IBM Quantum Learning\n", + "- [Quantum kernel training](/docs/tutorials/quantum-kernel-training) tutorial" + "\n", ] }, { From 05add6508d933d251e0cd2f7f4450b3217e0a420 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 12 May 2026 13:40:50 -0400 Subject: [PATCH 6/8] fix admonition box --- docs/tutorials/projected-quantum-kernels.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 5aa95f921df..9b260c64767 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -1496,7 +1496,7 @@ }, { "cell_type": "markdown", - "id": "32606150-5820-44f3-a669-920712792350", + "id": "e29581c7-ec49-4a03-837f-ee1fe9178846", "metadata": {}, "source": [ "## Next steps\n", @@ -1504,8 +1504,8 @@ "\n", "If you found this work interesting, you might be interested in the following material:\n", "- In-depth [quantum machine learning course](/learning/courses/quantum-machine-learning) from IBM Quantum Learning\n", - "- [Quantum kernel training](/docs/tutorials/quantum-kernel-training) tutorial" - "\n", + "- [Quantum kernel training](/docs/tutorials/quantum-kernel-training) tutorial\n", + "" ] }, { From 14c333235aec0e6286f991e5c3a42d2a71b9d54b Mon Sep 17 00:00:00 2001 From: Henry Zou Date: Mon, 18 May 2026 14:09:00 -0400 Subject: [PATCH 7/8] align tutorial structure with template - Remove duplicate usage estimate from Background section - Promote Requirements and Setup to h2 headings - Move "If you found this work interesting" lead-in outside the Next steps admonition --- docs/tutorials/projected-quantum-kernels.ipynb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 9b260c64767..0abdd0ec6e4 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -36,8 +36,6 @@ "\n", "## Background\n", "\n", - "*Usage estimate: 80 minutes on a Heron r3 processor (NOTE: This is an estimate only. Your runtime might vary.)*\n", - "\n", "In this tutorial, we demonstrate how to run a [projected quantum kernel](https://www.nature.com/articles/s41467-021-22539-9) (PQK) with Qiskit on a real-world biological dataset, based on the paper [Enhanced Prediction of CAR T-Cell Cytotoxicity with Quantum-Kernel Methods](https://arxiv.org/abs/2507.22710) [[1]](#references).\n", "\n", "PQK is a method used in quantum machine learning (QML) to encode classical data into a quantum feature space and project them back into the classical domain, by using quantum computers to enhance feature selection. It involves encoding classical data into quantum states using a quantum circuit, typically through a process called feature mapping, where the data is transformed into a high-dimensional Hilbert space. The \"projected\" aspect refers to extracting classical information from the quantum states, by measuring specific observables, to construct a kernel matrix that can be used in classical kernel-based algorithms like support vector machines. This approach leverages the computational advantages of quantum systems to potentially achieve better performance on certain tasks compared to classical methods.\n", @@ -52,7 +50,7 @@ "id": "542b8075-3b8c-476c-9513-c03de0f162b1", "metadata": {}, "source": [ - "### Requirements\n", + "## Requirements\n", "Before starting this tutorial, ensure that you have the following installed:\n", "\n", "- Qiskit SDK v2.0 or later, with [visualization](/docs/api/qiskit/visualization) support\n", @@ -69,7 +67,7 @@ "id": "2c676996-1361-4b3a-9c94-4784376097b0", "metadata": {}, "source": [ - "### Setup" + "## Setup" ] }, { @@ -1500,9 +1498,8 @@ "metadata": {}, "source": [ "## Next steps\n", - "\n", - "\n", "If you found this work interesting, you might be interested in the following material:\n", + "\n", "- In-depth [quantum machine learning course](/learning/courses/quantum-machine-learning) from IBM Quantum Learning\n", "- [Quantum kernel training](/docs/tutorials/quantum-kernel-training) tutorial\n", "" From 1deef0428f200d20a392c5526cccb85211ba09ec Mon Sep 17 00:00:00 2001 From: Henry Zou Date: Tue, 19 May 2026 11:19:35 -0400 Subject: [PATCH 8/8] Reverted change for Next step --- docs/tutorials/projected-quantum-kernels.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tutorials/projected-quantum-kernels.ipynb b/docs/tutorials/projected-quantum-kernels.ipynb index 0abdd0ec6e4..cbaa90f1f1f 100644 --- a/docs/tutorials/projected-quantum-kernels.ipynb +++ b/docs/tutorials/projected-quantum-kernels.ipynb @@ -1498,8 +1498,8 @@ "metadata": {}, "source": [ "## Next steps\n", - "If you found this work interesting, you might be interested in the following material:\n", "\n", + "If you found this work interesting, you might be interested in the following material:\n", "- In-depth [quantum machine learning course](/learning/courses/quantum-machine-learning) from IBM Quantum Learning\n", "- [Quantum kernel training](/docs/tutorials/quantum-kernel-training) tutorial\n", ""