From 31e8aeb96bdedd0d6326e7e9f61bbb380f5b867a Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Fri, 10 Apr 2026 16:21:14 -0400 Subject: [PATCH 1/3] rmv outdated language --- docs/guides/monitor-job.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index ae1341e081f..e42aa581f89 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -7,7 +7,7 @@ "source": [ "---\n", "title: Monitor or cancel a job\n", - "description: How to monitor or cancel a job submitted to IBM Quantum Platform or IBM Quantum on IBM Cloud\n", + "description: How to monitor or cancel a job submitted to IBM Quantum Platform\n", "---\n", "\n", "\n", From 46511eb7ff43e0e67568796a8b0da10c2c39b66e Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Fri, 10 Apr 2026 16:30:25 -0400 Subject: [PATCH 2/3] some initial cleanup, remove random code --- docs/guides/monitor-job.ipynb | 141 ++-------------------------------- 1 file changed, 5 insertions(+), 136 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index e42aa581f89..9741cc25a20 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -33,15 +33,15 @@ "\n", "| | |\n", "| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n", - "| job.result() | Review job results immediately after the job completes. Job results are available after the job completes. Therefore, job.result() is a blocking call until the job completes. |\n", - "| job.job\\_id() | Return the ID that uniquely identifies that job. Retrieving the job results at a later time requires the job ID. Therefore, it is recommended that you save the IDs of jobs you might want to retrieve later. |\n", - "| job.status() | Check the job status. |\n", - "| job = service.job(\\) | Retrieve a job you previously submitted. This call requires the job ID. |\n", + "| `job.result()` | Review job results immediately after the job completes. Job results are available after the job completes. Therefore, `job.result()` is a blocking call until the job completes. |\n", + "| `job.job_id()` | Return the ID that uniquely identifies that job. Retrieving the job results at a later time requires the job ID. Therefore, it is recommended that you save the IDs of jobs you might want to retrieve later. |\n", + "| `job.status()` | Check the job status. |\n", + "| `job = service.job(\\)` | Retrieve a job you previously submitted. This call requires the job ID. |\n", "\n", "\n", "## Retrieve job results at a later time\n", "\n", - "Call `service.job(\\)` to retrieve a job you previously submitted. If you don't have the job ID, or if you want to retrieve multiple jobs at once; including jobs from retired QPUs (quantum processing units), call `service.jobs()` with optional filters instead. See [QiskitRuntimeService.jobs](../api/qiskit-ibm-runtime/qiskit-runtime-service#jobs).\n", + "Call `service.job()` to retrieve a job you previously submitted. If you don't have the job ID, or if you want to retrieve multiple jobs at once; including jobs from retired QPUs (quantum processing units), call `service.jobs()` with optional filters instead. See [QiskitRuntimeService.jobs](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service#jobs).\n", "\n", "\n", " `service.jobs()` also returns jobs run from the deprecated `qiskit-ibm-provider` package. Jobs submitted by the older (also deprecated) `qiskit-ibmq-provider` package are no longer available.\n", @@ -62,137 +62,6 @@ }, "source": [] }, - { - "cell_type": "code", - "execution_count": 1, - "id": "ee0318b6-0bfd-4f0b-b980-4e233a2d5d7b", - "metadata": { - "tags": [ - "remove-cell" - ] - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "d305ck0ocacs73ajagvg\n" - ] - } - ], - "source": [ - "# This cell is hidden from users\n", - "from qiskit import QuantumCircuit\n", - "from qiskit.circuit import Parameter\n", - "from qiskit.transpiler import generate_preset_pass_manager\n", - "\n", - "from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2\n", - "import numpy as np\n", - "\n", - "\n", - "my_backend = \"ibm_torino\"\n", - "service = QiskitRuntimeService()\n", - "# backend = service.backend(my_backend)\n", - "backend = service.least_busy()\n", - "\n", - "# Define two circuits, each with one parameter with two parameters.\n", - "circuit = QuantumCircuit(2)\n", - "circuit.h(0)\n", - "circuit.cx(0, 1)\n", - "circuit.ry(Parameter(\"a\"), 0)\n", - "circuit.cx(0, 1)\n", - "circuit.h(0)\n", - "circuit.measure_all()\n", - "\n", - "\n", - "pm = generate_preset_pass_manager(optimization_level=1, backend=backend)\n", - "transpiled_circuit = pm.run(circuit)\n", - "\n", - "params = np.random.uniform(size=(2, 3)).T\n", - "\n", - "sampler_pub = (transpiled_circuit, params)\n", - "\n", - "# Instantiate the new estimator object, then run the transpiled circuit\n", - "# using the set of parameters and observables.\n", - "sampler = SamplerV2(mode=backend)\n", - "job = sampler.run([sampler_pub], shots=4)\n", - "print(job.job_id())" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "03946d0d-aeac-45d7-9e8e-6af38e40e758", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ExecutionSpans([DoubleSliceSpan()])\n" - ] - } - ], - "source": [ - "result = job.result()\n", - "\n", - "\n", - "spans = job.result().metadata[\"execution\"][\"execution_spans\"]\n", - "print(spans)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "897d35cb-140a-4587-a687-97982a01d846", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[0.2260416 , 0.8747859 , 0.44361995],\n", - " [0.94700856, 0.96826017, 0.98426562]])" - ] - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "params = np.random.uniform(size=(2, 3))\n", - "params" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "38176ecc-64fe-4dbb-a9fa-bd0ca2942920", - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "array([[[ True, True, True, True],\n", - " [ True, True, True, True]],\n", - "\n", - " [[ True, True, True, True],\n", - " [ True, True, True, True]],\n", - "\n", - " [[ True, True, True, True],\n", - " [ True, True, True, True]]])" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "mask = spans[0].mask(0)\n", - "mask" - ] - }, { "cell_type": "code", "execution_count": null, From 27f09a741d72500dc24810dd53c8a813b1d2a3f7 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Mon, 13 Apr 2026 11:05:55 -0400 Subject: [PATCH 3/3] rearrange cells --- docs/guides/monitor-job.ipynb | 129 ++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 9741cc25a20..db8fc865e42 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -62,6 +62,63 @@ }, "source": [] }, + { + "cell_type": "code", + "execution_count": 1, + "id": "ee0318b6-0bfd-4f0b-b980-4e233a2d5d7b", + "metadata": { + "tags": [ + "remove-cell" + ] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d305ck0ocacs73ajagvg\n" + ] + } + ], + "source": [ + "# This cell is hidden from users\n", + "from qiskit import QuantumCircuit\n", + "from qiskit.circuit import Parameter\n", + "from qiskit.transpiler import generate_preset_pass_manager\n", + "\n", + "from qiskit_ibm_runtime import QiskitRuntimeService, SamplerV2\n", + "import numpy as np\n", + "\n", + "\n", + "my_backend = \"ibm_torino\"\n", + "service = QiskitRuntimeService()\n", + "# backend = service.backend(my_backend)\n", + "backend = service.least_busy()\n", + "\n", + "# Define two circuits, each with one parameter with two parameters.\n", + "circuit = QuantumCircuit(2)\n", + "circuit.h(0)\n", + "circuit.cx(0, 1)\n", + "circuit.ry(Parameter(\"a\"), 0)\n", + "circuit.cx(0, 1)\n", + "circuit.h(0)\n", + "circuit.measure_all()\n", + "\n", + "\n", + "pm = generate_preset_pass_manager(optimization_level=1, backend=backend)\n", + "transpiled_circuit = pm.run(circuit)\n", + "\n", + "params = np.random.uniform(size=(2, 3)).T\n", + "\n", + "sampler_pub = (transpiled_circuit, params)\n", + "\n", + "# Instantiate the new estimator object, then run the transpiled circuit\n", + "# using the set of parameters and observables.\n", + "sampler = SamplerV2(mode=backend)\n", + "job = sampler.run([sampler_pub], shots=4)\n", + "print(job.job_id())" + ] + }, { "cell_type": "code", "execution_count": null, @@ -108,6 +165,78 @@ "To view execution span information, review the metadata of the result returned by `SamplerV2`, which comes in the form of an `ExecutionSpans` object. This object is a list-like container containing instances of subclasses of `ExecutionSpan`, such as `SliceSpan`:" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "0dd5600c-0071-4523-b76f-ff38adf6fdb1", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ExecutionSpans([DoubleSliceSpan()])\n" + ] + } + ], + "source": [ + "result = job.result()\n", + "\n", + "\n", + "spans = job.result().metadata[\"execution\"][\"execution_spans\"]\n", + "print(spans)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bf962103-3ef2-45ad-b088-5eaf6d5e2e05", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[0.2260416 , 0.8747859 , 0.44361995],\n", + " [0.94700856, 0.96826017, 0.98426562]])" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "params = np.random.uniform(size=(2, 3))\n", + "params" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "5f8b0e31-291b-4f08-b1ac-b9d8fd39ccd9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([[[ True, True, True, True],\n", + " [ True, True, True, True]],\n", + "\n", + " [[ True, True, True, True],\n", + " [ True, True, True, True]],\n", + "\n", + " [[ True, True, True, True],\n", + " [ True, True, True, True]]])" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "mask = spans[0].mask(0)\n", + "mask" + ] + }, { "cell_type": "code", "execution_count": 6,