From 0afca0287dcd45d1521328b470a10e48b2426692 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 14:01:25 -0400 Subject: [PATCH 01/16] Rearrange with Claude --- docs/guides/monitor-job.ipynb | 436 +++++++++++++++++++++++----------- 1 file changed, 293 insertions(+), 143 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 4b9f7ff0ca6..9e8181b164b 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -13,228 +13,377 @@ "\n", "# Monitor or cancel a job\n", "\n", - "View a list of your workloads on the [Workloads page](https://quantum.cloud.ibm.com/workloads).\n", - "\n", - "## View job status\n", - "\n", - "Go to your [Workloads table](https://quantum.cloud.ibm.com/workloads) and check under the Status column for whether a job has completed or failed.\n", - "\n", - "## View remaining usage\n", - "\n", - "Go to your [Instances table](https://quantum.cloud.ibm.com/instances) and select the tab associated with the plan you want to view remaining usage for. Total time used and total time remaining on your plan is displayed.\n", - "\n", - "## View metrics on number of jobs and workloads submitted\n", - "\n", - "Go to the [Analytics page](https://quantum.cloud.ibm.com/analytics) to see the total number of jobs submitted, as well as a count of batch workloads and session workloads. Note that you can only see the Analytics page for accounts that you own or manage.\n", - "\n", - "## Monitor a job\n", - "\n", - "Use the job instance to check the job status or retrieve the results by calling the appropriate command:\n", - "\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", - "\n", - "\n", - "## Retrieve job results at a later time\n", + "This guide explains how to monitor job status, view usage information, and cancel jobs. You can access this information both through IBM Quantum Platform and programmatically using Qiskit." + ] + }, + { + "cell_type": "markdown", + "id": "bb84ab8e-6db9-45d6-bb59-2f06f38d9965", + "metadata": {}, + "source": [ + "{/*\n", + " DO NOT EDIT THIS CELL!!!\n", + " This cell's content is generated automatically by a script. Anything you add\n", + " here will be removed next time the notebook is run. To add new content, create\n", + " a new cell before or after this one.\n", + "*/}\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", + "\n", + "\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", - "\n", + "The code on this page was developed using the following requirements.\n", + "We recommend using these versions or newer.\n", "\n", - "### Example\n", + "```\n", + "qiskit-ibm-runtime~=0.46.1\n", + "```\n", "\n", - "This example returns the 10 most recent runtime jobs that were run on `my_backend`:" + "\n", + "" ] }, { "cell_type": "markdown", - "id": "c67f78c5-a199-456a-a9e3-35c518b28f50", + "id": "view-status", + "metadata": {}, + "source": [ + "## View job status\n", + "\n", + "You can check the status of your submitted jobs to see whether they have completed, failed, or are still queued.\n", + "\n", + "\n", + " \n", + " To check job status programmatically, use the `job.status()` method. This returns a [`JobStatus`](/docs/api/qiskit-ibm-runtime/qiskit_ibm_runtime.job.JobStatus) enum indicating the current state of the job.\n", + "\n", + " \n", + " \n", + " \n", + " Navigate to the [Workloads page](https://quantum.cloud.ibm.com/workloads) and check the Status column. Your job status appears as one of the following:\n", + " - **Queued**: Job is waiting to run on a QPU\n", + " - **Running**: Job is currently executing\n", + " - **Completed**: Job finished successfully\n", + " - **Failed**: Job encountered an error\n", + " \n", + "" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ee0318b6-0bfd-4f0b-b980-4e233a2d5d7b", "metadata": { "tags": [ - "version-info" + "id-status" ] }, - "source": [] + "outputs": [], + "source": [ + "from qiskit_ibm_runtime import QiskitRuntimeService\n", + "\n", + "# Initialize the service\n", + "service = QiskitRuntimeService()\n", + "\n", + "# Retrieve a previously submitted job using its ID\n", + "job = service.job(\"\")\n", + "\n", + "# Check the job status\n", + "print(job.status())" + ] + }, + { + "cell_type": "markdown", + "id": "view-usage", + "metadata": {}, + "source": [ + "## View remaining usage\n", + "\n", + "Track how much of your plan's usage quota remains.\n", + "\n", + "\n", + " \n", + " Use the service's `remaining_sessions()` and `active_account()` methods to get information about your plan and usage.\n", + "\n", + " \n", + " \n", + " \n", + " Navigate to the [Instances page](https://quantum.cloud.ibm.com/instances) and select the tab associated with the plan you want to check. The total time used and total time remaining on your plan is displayed.\n", + " \n", + "" + ] }, { "cell_type": "code", "execution_count": null, - "id": "ee0318b6-0bfd-4f0b-b980-4e233a2d5d7b", + "id": "usage-code", "metadata": { "tags": [ - "remove-cell" + "id-usage" ] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "d305ck0ocacs73ajagvg\n" - ] - } - ], + "outputs": [], "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", + "from qiskit_ibm_runtime import QiskitRuntimeService\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", + "# Get account information\n", + "account = service.active_account()\n", + "print(f\"Account: {account['instance_id']}\")\n", "\n", + "# Check remaining sessions (older API)\n", + "# remaining = service.remaining_sessions()\n", + "# print(f\"Remaining sessions: {remaining}\")" + ] + }, + { + "cell_type": "markdown", + "id": "view-metrics", + "metadata": {}, + "source": [ + "## View job metrics\n", "\n", - "pm = generate_preset_pass_manager(optimization_level=1, backend=backend)\n", - "transpiled_circuit = pm.run(circuit)\n", + "Get an overview of your total job submissions, including batch and session workload metrics.\n", "\n", - "params = np.random.uniform(size=(2, 3)).T\n", + "\n", + " \n", + " Use the `service.jobs()` method with filters to retrieve information about your submitted jobs. This gives you programmatic access to count and analyze your workloads.\n", "\n", - "sampler_pub = (transpiled_circuit, params)\n", + " \n", + " \n", + " \n", + " Navigate to the [Analytics page](https://quantum.cloud.ibm.com/analytics) to see:\n", + " - Total number of jobs submitted\n", + " - Count of batch workloads\n", + " - Count of session workloads\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())" + " **Note**: You can only access the Analytics page for accounts that you own or manage.\n", + " \n", + "" ] }, { "cell_type": "code", - "execution_count": 2, - "id": "03946d0d-aeac-45d7-9e8e-6af38e40e758", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "ExecutionSpans([DoubleSliceSpan()])\n" - ] - } - ], + "execution_count": null, + "id": "metrics-code", + "metadata": { + "tags": [ + "id-metrics" + ] + }, + "outputs": [], "source": [ - "result = job.result()\n", + "from qiskit_ibm_runtime import QiskitRuntimeService\n", + "\n", + "service = QiskitRuntimeService()\n", + "\n", + "# Get your most recent jobs\n", + "jobs = service.jobs(limit=10) # Retrieve the 10 most recent jobs\n", "\n", + "# Count jobs by status\n", + "status_counts = {}\n", + "for job in jobs:\n", + " status = str(job.status())\n", + " status_counts[status] = status_counts.get(status, 0) + 1\n", "\n", - "spans = job.result().metadata[\"execution\"][\"execution_spans\"]\n", - "print(spans)" + "print(f\"Total jobs retrieved: {len(jobs)}\")\n", + "print(f\"Jobs by status: {status_counts}\")" ] }, { - "cell_type": "code", - "execution_count": 3, - "id": "897d35cb-140a-4587-a687-97982a01d846", + "cell_type": "markdown", + "id": "monitor-job", "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" + "## Monitor a running job\n", + "\n", + "Get detailed information about a job while it's running or after it completes.\n", + "\n", + "\n", + " \n", + " The job instance provides several methods for monitoring:\n", + "\n", + " | Method | Description |\n", + " | --- | --- |\n", + " | `job.status()` | Check the current job status |\n", + " | `job.job_id()` | Get the unique job identifier |\n", + " | `job.result()` | Retrieve job results (blocking call until complete) |\n", + " | `job.wait_for_final_state()` | Block until the job reaches a terminal state |\n", + "\n", + " \n", + " \n", + " \n", + " 1. Navigate to the [Workloads page](https://quantum.cloud.ibm.com/workloads)\n", + " 2. Find your job in the table\n", + " 3. Click on the job name or row to open the detailed view\n", + " 4. In the details panel, you can see:\n", + " - Job status and timestamps\n", + " - Execution details and hardware information\n", + " - Results and any error messages\n", + " - Job metadata and parameters\n", + " \n", + "" ] }, { "cell_type": "code", - "execution_count": 4, - "id": "38176ecc-64fe-4dbb-a9fa-bd0ca2942920", + "execution_count": null, + "id": "monitor-code", + "metadata": { + "tags": [ + "id-monitor" + ] + }, + "outputs": [], + "source": [ + "from qiskit_ibm_runtime import QiskitRuntimeService\n", + "\n", + "service = QiskitRuntimeService()\n", + "\n", + "# Retrieve a job by ID\n", + "job = service.job(\"\")\n", + "\n", + "# Get job ID (useful for saving for later retrieval)\n", + "print(f\"Job ID: {job.job_id()}\")\n", + "\n", + "# Check current status\n", + "print(f\"Status: {job.status()}\")\n", + "\n", + "# Wait for job to complete (blocking call)\n", + "# job.wait_for_final_state()\n", + "# print(\"Job completed\")\n", + "\n", + "# Get results\n", + "# results = job.result()\n", + "# print(results)" + ] + }, + { + "cell_type": "markdown", + "id": "retrieve-later", "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" + "## Retrieve job results at a later time\n", + "\n", + "Jobs are queued and executed asynchronously. You can save job IDs and retrieve results later, even after closing your session.\n", + "\n", + "\n", + " \n", + " If you saved the job ID when you submitted the job, use `service.job()` to retrieve it later. If you don't have the job ID, use `service.jobs()` with optional filters.\n", + "\n", + " See the [QiskitRuntimeService.jobs](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service#jobs) API documentation for available filters.\n", + "\n", + " \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", + " \n", + " \n", + " \n", + " 1. Go to the [Workloads page](https://quantum.cloud.ibm.com/workloads)\n", + " 2. Use the search or filter options to find your job by name, date, or status\n", + " 3. Click on the job to view its results and details\n", + " 4. Results remain available indefinitely in your workload history\n", + " \n", + "\n", + "\n", + "### Example: Retrieve recent jobs from a specific backend" ] }, { "cell_type": "code", "execution_count": null, - "id": "4415838a-04da-4a8e-8fed-4c062d186ec7", - "metadata": {}, + "id": "retrieve-code", + "metadata": { + "tags": [ + "id-retrieve" + ] + }, "outputs": [], "source": [ "from qiskit_ibm_runtime import QiskitRuntimeService\n", "\n", - "# Initialize the account first.\n", "service = QiskitRuntimeService()\n", + "\n", + "# Retrieve a specific job by ID\n", + "# job = service.job(\"\")\n", + "\n", + "# Or retrieve multiple jobs with filters\n", "# Use `limit` to retrieve a specific number of jobs. The default `limit` is 10.\n", - "service.jobs(backend_name=my_backend)" + "my_backend = \"ibm_torino\"\n", + "recent_jobs = service.jobs(backend_name=my_backend, limit=10)\n", + "\n", + "print(f\"Retrieved {len(recent_jobs)} recent jobs from {my_backend}\")\n", + "\n", + "# Get results from a specific job\n", + "if recent_jobs:\n", + " job = recent_jobs[0]\n", + " print(f\"Job ID: {job.job_id()}\")\n", + " print(f\"Status: {job.status()}\")" ] }, { "cell_type": "markdown", - "id": "59195a9f-8df8-46f7-9ea0-c3a9b8eb3cac", + "id": "cancel-job", "metadata": {}, "source": [ "## Cancel a job\n", "\n", - "You can cancel a job from the IBM Quantum Platform dashboard either on the Workloads page or the details page for a specific workload. On the Workloads page, click the overflow menu at the end of the row for that workload, and select Cancel. If you are on the details page for a specific workload, use the Actions dropdown at the top of the page, and select Cancel.\n", + "Cancel a job that is queued or running. Once a job is cancelled, it cannot be resumed.\n", + "\n", + "\n", + " \n", + " Use the `job.cancel()` method to cancel a job programmatically.\n", + "\n", + " \n", + " \n", + " \n", + " 1. **From the workloads table**: Click the overflow menu (three dots) at the end of the row for the workload you want to cancel, and select **Cancel**.\n", + " 2. **From the job details page**: Click on the workload to open its details page, use the **Actions** dropdown at the top, and select **Cancel**.\n", + " \n", + "" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cancel-code", + "metadata": { + "tags": [ + "id-cancel" + ] + }, + "outputs": [], + "source": [ + "from qiskit_ibm_runtime import QiskitRuntimeService\n", + "\n", + "service = QiskitRuntimeService()\n", + "\n", + "# Retrieve the job\n", + "job = service.job(\"\")\n", + "\n", + "# Cancel the job\n", + "job.cancel()\n", "\n", - "In Qiskit, use `job.cancel()` to cancel a job." + "print(f\"Job {job.job_id()} has been cancelled\")" ] }, { "cell_type": "markdown", - "id": "c2abeb3d-4e4a-4c90-be59-16ec0e1be783", + "id": "next-steps", "metadata": {}, "source": [ "## Next steps\n", "\n", "\n", - " - Try the [Grover's algorithm](/docs/tutorials/grovers-algorithm) tutorial.\n", - " - Learn more about [Sampler execution spans](/docs/guides/sampler-input-output#execution-spans)\n", + " - Learn about [Sampler execution spans](/docs/guides/sampler-input-output#execution-spans) to understand job execution details\n", + " - Review the [QiskitRuntimeService API](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service) for additional job management methods\n", + " - Explore [execution modes](/docs/guides/execution-modes) to understand batch and session workload types\n", "" ] } ], "metadata": { + "description": "How to monitor or cancel a job submitted to IBM Quantum Platform", "kernelspec": { "display_name": "Python 3", "language": "python", @@ -250,8 +399,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3" - } + "version": "3.8" + }, + "title": "Monitor or cancel a job" }, "nbformat": 4, "nbformat_minor": 4 From ca17fe705440a9c9cc1ae168264597f0a8ff8e56 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 14:24:14 -0400 Subject: [PATCH 02/16] add back example --- docs/guides/monitor-job.ipynb | 158 +++++++++++++++++++++++++++++++++- 1 file changed, 157 insertions(+), 1 deletion(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 9e8181b164b..933e5f93d58 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -289,6 +289,162 @@ "### Example: Retrieve recent jobs from a specific backend" ] }, + { + "cell_type": "markdown", + "id": "c67f78c5-a199-456a-a9e3-35c518b28f50", + "metadata": { + "tags": [ + "version-info" + ] + }, + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "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, + "id": "4415838a-04da-4a8e-8fed-4c062d186ec7", + "metadata": {}, + "outputs": [], + "source": [ + "from qiskit_ibm_runtime import QiskitRuntimeService\n", + "\n", + "# Initialize the account first.\n", + "service = QiskitRuntimeService()\n", + "# Use `limit` to retrieve a specific number of jobs. The default `limit` is 10.\n", + "service.jobs(backend_name=my_backend)" + ] + }, { "cell_type": "code", "execution_count": null, @@ -328,7 +484,7 @@ "source": [ "## Cancel a job\n", "\n", - "Cancel a job that is queued or running. Once a job is cancelled, it cannot be resumed.\n", + "Cancel a job that is queued or running. Once a job is canceled, it cannot be resumed.\n", "\n", "\n", " \n", From 9bdfc60af228a9f43f721dbff68435df757d866f Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 14:58:53 -0400 Subject: [PATCH 03/16] Claude got these wrong --- docs/guides/monitor-job.ipynb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 933e5f93d58..baddacefe58 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -53,16 +53,17 @@ "\n", "\n", " \n", - " To check job status programmatically, use the `job.status()` method. This returns a [`JobStatus`](/docs/api/qiskit-ibm-runtime/qiskit_ibm_runtime.job.JobStatus) enum indicating the current state of the job.\n", + " To check job status programmatically, use the `job.status()` method.\n", "\n", " \n", " \n", " \n", " Navigate to the [Workloads page](https://quantum.cloud.ibm.com/workloads) and check the Status column. Your job status appears as one of the following:\n", - " - **Queued**: Job is waiting to run on a QPU\n", - " - **Running**: Job is currently executing\n", + " - **Pending**: Job is waiting to run on a QPU\n", + " - **In progress**: Job is currently executing\n", " - **Completed**: Job finished successfully\n", " - **Failed**: Job encountered an error\n", + " - **Canceled**: User canceled the job\n", " \n", "" ] From f13be92a4a01e9f6dbbb6f3a9f93d00d47b14dd2 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 15:29:46 -0400 Subject: [PATCH 04/16] This code wasn't correct either --- docs/guides/monitor-job.ipynb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index baddacefe58..a809527ab95 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -102,12 +102,12 @@ "\n", "\n", " \n", - " Use the service's `remaining_sessions()` and `active_account()` methods to get information about your plan and usage.\n", + " Use the `service.usage()` method to get usage information for your current active instance.\n", "\n", " \n", " \n", " \n", - " Navigate to the [Instances page](https://quantum.cloud.ibm.com/instances) and select the tab associated with the plan you want to check. The total time used and total time remaining on your plan is displayed.\n", + " Navigate to the [Instances page](https://quantum.cloud.ibm.com/instances) and select the tab associated with the plan you want to check. The total time used and total time remaining on your plan is displayed under the *Usage remaining* column.\n", " \n", "" ] @@ -127,13 +127,9 @@ "\n", "service = QiskitRuntimeService()\n", "\n", - "# Get account information\n", - "account = service.active_account()\n", - "print(f\"Account: {account['instance_id']}\")\n", - "\n", - "# Check remaining sessions (older API)\n", - "# remaining = service.remaining_sessions()\n", - "# print(f\"Remaining sessions: {remaining}\")" + "# Get usage information for the current active instance\n", + "usage = service.usage()\n", + "print(usage)" ] }, { From 8336a85549656274b0b4608b8e69ea4c5dbb5ed3 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 16:03:59 -0400 Subject: [PATCH 05/16] give examples of analytics to output --- docs/guides/monitor-job.ipynb | 44 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index a809527ab95..08508d12a36 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -139,11 +139,11 @@ "source": [ "## View job metrics\n", "\n", - "Get an overview of your total job submissions, including batch and session workload metrics.\n", + "Get an overview of your job submissions, including batch and session workload metrics.\n", "\n", "\n", " \n", - " Use the `service.jobs()` method with filters to retrieve information about your submitted jobs. This gives you programmatic access to count and analyze your workloads.\n", + " Use the `service.jobs()` method with filters to retrieve information about your submitted jobs, such as how many have been submitted, whether they were batch or session workloads, which instance they are associated with, when they were created, and so on. The following example looks at the last 50 workloads in an instance and outputs how many were batch or session workloads. It then lists out job ID, status, tags, and date created for the last ten jobs.\n", "\n", " \n", " \n", @@ -173,17 +173,35 @@ "\n", "service = QiskitRuntimeService()\n", "\n", - "# Get your most recent jobs\n", - "jobs = service.jobs(limit=10) # Retrieve the 10 most recent jobs\n", - "\n", - "# Count jobs by status\n", - "status_counts = {}\n", - "for job in jobs:\n", - " status = str(job.status())\n", - " status_counts[status] = status_counts.get(status, 0) + 1\n", - "\n", - "print(f\"Total jobs retrieved: {len(jobs)}\")\n", - "print(f\"Jobs by status: {status_counts}\")" + "# Get last 50 jobs to calculate metrics\n", + "print(\"Job Metrics:\")\n", + "print(\"=\"*60)\n", + "all_jobs = service.jobs(limit=50, descending=True) # To retrieve all \n", + "#jobs, replace with `limit=None`\n", + "\n", + "total_jobs = len(all_jobs)\n", + "session_workloads = sum(1 for job in all_jobs if job.session_id is not None)\n", + "batch_jobs = sum(1 for job in all_jobs if job.session_id is None)\n", + "\n", + "print(f\"Total jobs submitted: {total_jobs}\")\n", + "print(f\"Batch workloads (session_id = None): {batch_jobs}\")\n", + "print(f\"Session workloads (session_id != None): {session_workloads}\")\n", + "print()\n", + "\n", + "# Retrieve the last 10 jobs\n", + "print(\"Last 10 Jobs:\")\n", + "print(\"=\"*60)\n", + "jobs = service.jobs(limit=10, descending=True)\n", + "\n", + "print(f\"Retrieved {len(jobs)} jobs\\n\")\n", + "\n", + "for i, job in enumerate(jobs, 1):\n", + " print(f\"Job {i}:\")\n", + " print(f\" ID: {job.job_id()}\")\n", + " print(f\" Status: {job.status()}\")\n", + " print(f\" Tags: {job.tags}\")\n", + " print(f\" Created: {job.creation_date}\")\n", + " print()" ] }, { From bb1e1bc90843b5c6becd45bab9107c898e0d08a8 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 16:15:13 -0400 Subject: [PATCH 06/16] wordsmithing --- docs/guides/monitor-job.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 08508d12a36..ff832a2686b 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -148,10 +148,10 @@ " \n", " \n", " \n", - " Navigate to the [Analytics page](https://quantum.cloud.ibm.com/analytics) to see:\n", - " - Total number of jobs submitted\n", - " - Count of batch workloads\n", - " - Count of session workloads\n", + " Navigate to the [Analytics page](https://quantum.cloud.ibm.com/analytics) to see and download data, such as the following:\n", + " - Total usage\n", + " - Usage filtered by instance, quantum computer, and user\n", + " - Count of job, batch, and session workloads\n", "\n", " **Note**: You can only access the Analytics page for accounts that you own or manage.\n", " \n", From c25a7f788b23c6591e1e9f0df1d708528f739540 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 16:29:02 -0400 Subject: [PATCH 07/16] Combine sections --- docs/guides/monitor-job.ipynb | 108 ++++++++++------------------------ 1 file changed, 32 insertions(+), 76 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index ff832a2686b..d9e7a728f6c 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -47,23 +47,37 @@ "id": "view-status", "metadata": {}, "source": [ - "## View job status\n", + "## Monitor a job\n", "\n", "You can check the status of your submitted jobs to see whether they have completed, failed, or are still queued.\n", "\n", "\n", - " \n", - " To check job status programmatically, use the `job.status()` method.\n", + " \n", + " The job instance provides several methods for monitoring:\n", + "\n", + " | Method | Description |\n", + " | --- | --- |\n", + " | `job.status()` | Check the current job status |\n", + " | `job.job_id()` | Get the unique job identifier |\n", + " | `job.result()` | Retrieve job results (blocking call until complete) |\n", + " | `job.wait_for_final_state()` | Block until the job reaches a terminal state |\n", "\n", " \n", " \n", - " \n", + " \n", " Navigate to the [Workloads page](https://quantum.cloud.ibm.com/workloads) and check the Status column. Your job status appears as one of the following:\n", " - **Pending**: Job is waiting to run on a QPU\n", " - **In progress**: Job is currently executing\n", " - **Completed**: Job finished successfully\n", " - **Failed**: Job encountered an error\n", " - **Canceled**: User canceled the job\n", + "\n", + " Click on the job name or row to open the detailed view. In the details panel, you can see:\n", + " - Job status and timestamps\n", + " - Execution details and hardware information\n", + " - Results and any error messages\n", + " - Job metadata and parameters\n", + "\n", " \n", "" ] @@ -81,14 +95,24 @@ "source": [ "from qiskit_ibm_runtime import QiskitRuntimeService\n", "\n", - "# Initialize the service\n", "service = QiskitRuntimeService()\n", "\n", - "# Retrieve a previously submitted job using its ID\n", + "# Retrieve a job by ID\n", "job = service.job(\"\")\n", "\n", - "# Check the job status\n", - "print(job.status())" + "# Get job ID (useful for saving for later retrieval)\n", + "print(f\"Job ID: {job.job_id()}\")\n", + "\n", + "# Check current status\n", + "print(f\"Status: {job.status()}\")\n", + "\n", + "# Wait for job to complete (blocking call)\n", + "job.wait_for_final_state()\n", + "print(\"Job completed\")\n", + "\n", + "# Get results\n", + "results = job.result()\n", + "print(results)" ] }, { @@ -204,74 +228,6 @@ " print()" ] }, - { - "cell_type": "markdown", - "id": "monitor-job", - "metadata": {}, - "source": [ - "## Monitor a running job\n", - "\n", - "Get detailed information about a job while it's running or after it completes.\n", - "\n", - "\n", - " \n", - " The job instance provides several methods for monitoring:\n", - "\n", - " | Method | Description |\n", - " | --- | --- |\n", - " | `job.status()` | Check the current job status |\n", - " | `job.job_id()` | Get the unique job identifier |\n", - " | `job.result()` | Retrieve job results (blocking call until complete) |\n", - " | `job.wait_for_final_state()` | Block until the job reaches a terminal state |\n", - "\n", - " \n", - " \n", - " \n", - " 1. Navigate to the [Workloads page](https://quantum.cloud.ibm.com/workloads)\n", - " 2. Find your job in the table\n", - " 3. Click on the job name or row to open the detailed view\n", - " 4. In the details panel, you can see:\n", - " - Job status and timestamps\n", - " - Execution details and hardware information\n", - " - Results and any error messages\n", - " - Job metadata and parameters\n", - " \n", - "" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "monitor-code", - "metadata": { - "tags": [ - "id-monitor" - ] - }, - "outputs": [], - "source": [ - "from qiskit_ibm_runtime import QiskitRuntimeService\n", - "\n", - "service = QiskitRuntimeService()\n", - "\n", - "# Retrieve a job by ID\n", - "job = service.job(\"\")\n", - "\n", - "# Get job ID (useful for saving for later retrieval)\n", - "print(f\"Job ID: {job.job_id()}\")\n", - "\n", - "# Check current status\n", - "print(f\"Status: {job.status()}\")\n", - "\n", - "# Wait for job to complete (blocking call)\n", - "# job.wait_for_final_state()\n", - "# print(\"Job completed\")\n", - "\n", - "# Get results\n", - "# results = job.result()\n", - "# print(results)" - ] - }, { "cell_type": "markdown", "id": "retrieve-later", From bcea849b2f2a6cb90c491d34533b8cc941632c52 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 16:36:14 -0400 Subject: [PATCH 08/16] Wordsmith --- 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 d9e7a728f6c..70c2821cf7e 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -49,7 +49,7 @@ "source": [ "## Monitor a job\n", "\n", - "You can check the status of your submitted jobs to see whether they have completed, failed, or are still queued.\n", + "Use these methods to check the status of your submitted jobs, retrieve results, and view details related to the job and its execution.\n", "\n", "\n", " \n", From 3c3ffbd98a2121ddbb88870eefbdd426700bb9d7 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:02:32 -0400 Subject: [PATCH 09/16] Update monitor-job.ipynb --- docs/guides/monitor-job.ipynb | 193 ++++------------------------------ 1 file changed, 23 insertions(+), 170 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 70c2821cf7e..fa4e6b6383e 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -235,14 +235,15 @@ "source": [ "## Retrieve job results at a later time\n", "\n", - "Jobs are queued and executed asynchronously. You can save job IDs and retrieve results later, even after closing your session.\n", + "You can save job IDs and retrieve results later, even after closing your session.\n", "\n", "\n", " \n", - " If you saved the job ID when you submitted the job, use `service.job()` to retrieve it later. If you don't have the job ID, use `service.jobs()` with optional filters.\n", + " If you saved the job ID when you submitted the job, use `service.job()` to retrieve it later. If you don't have the job ID, or if you want to retrieve multiple jobs at once (including jobs from retired QPUs), use `service.jobs()` instead, with optional filters.\n", "\n", - " See the [QiskitRuntimeService.jobs](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service#jobs) API documentation for available filters.\n", + " See the [`QiskitRuntimeService.jobs`](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service#jobs) API documentation for available filters.\n", "\n", + " This example demonstrates retrieving recent results run on a specific backend.\n", " \n", "\n", " \n", @@ -255,165 +256,7 @@ " 3. Click on the job to view its results and details\n", " 4. Results remain available indefinitely in your workload history\n", " \n", - "\n", - "\n", - "### Example: Retrieve recent jobs from a specific backend" - ] - }, - { - "cell_type": "markdown", - "id": "c67f78c5-a199-456a-a9e3-35c518b28f50", - "metadata": { - "tags": [ - "version-info" - ] - }, - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "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, - "id": "4415838a-04da-4a8e-8fed-4c062d186ec7", - "metadata": {}, - "outputs": [], - "source": [ - "from qiskit_ibm_runtime import QiskitRuntimeService\n", - "\n", - "# Initialize the account first.\n", - "service = QiskitRuntimeService()\n", - "# Use `limit` to retrieve a specific number of jobs. The default `limit` is 10.\n", - "service.jobs(backend_name=my_backend)" + "" ] }, { @@ -431,21 +274,31 @@ "\n", "service = QiskitRuntimeService()\n", "\n", - "# Retrieve a specific job by ID\n", + "# Uncomment the next line to retrieve a specific job by ID\n", "# job = service.job(\"\")\n", "\n", "# Or retrieve multiple jobs with filters\n", "# Use `limit` to retrieve a specific number of jobs. The default `limit` is 10.\n", - "my_backend = \"ibm_torino\"\n", + "my_backend = \"\"\n", "recent_jobs = service.jobs(backend_name=my_backend, limit=10)\n", "\n", - "print(f\"Retrieved {len(recent_jobs)} recent jobs from {my_backend}\")\n", + "print(f\"Retrieved {len(recent_jobs)} recent jobs from {my_backend}\\n\")\n", "\n", - "# Get results from a specific job\n", - "if recent_jobs:\n", - " job = recent_jobs[0]\n", + "# Get results from all jobs\n", + "for job in recent_jobs:\n", " print(f\"Job ID: {job.job_id()}\")\n", - " print(f\"Status: {job.status()}\")" + " print(f\"Status: {job.status()}\")\n", + " \n", + " # Retrieve results if the job is complete\n", + " if str(job.status()) == 'DONE':\n", + " try:\n", + " results = job.result()\n", + " print(f\"Results: {results}\")\n", + " except Exception as e:\n", + " print(f\"Error retrieving results: {e}\")\n", + " else:\n", + " print(\"Results: Not available (job still running or failed)\")\n", + " print()" ] }, { @@ -491,7 +344,7 @@ "# Cancel the job\n", "job.cancel()\n", "\n", - "print(f\"Job {job.job_id()} has been cancelled\")" + "print(f\"Job {job.job_id()} has been canceled\")" ] }, { From c739afc60de99bbed97b8582c8f9d5e14f272a6a Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:04:33 -0400 Subject: [PATCH 10/16] Clean up next steps --- docs/guides/monitor-job.ipynb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index fa4e6b6383e..04cdb0f964d 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -355,9 +355,8 @@ "## Next steps\n", "\n", "\n", - " - Learn about [Sampler execution spans](/docs/guides/sampler-input-output#execution-spans) to understand job execution details\n", - " - Review the [QiskitRuntimeService API](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service) for additional job management methods\n", - " - Explore [execution modes](/docs/guides/execution-modes) to understand batch and session workload types\n", + " - Review the [`QiskitRuntimeService` API reference](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service) for additional job management methods.\n", + " - Explore [execution modes](/docs/guides/execution-modes) to understand batch and session workload types.\n", "" ] } From 31fab002abcb2c5c8e86ac0d941250440c52f51f Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:14:26 -0400 Subject: [PATCH 11/16] wordsmith --- docs/guides/monitor-job.ipynb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 04cdb0f964d..cd6a7da65f6 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -13,7 +13,9 @@ "\n", "# Monitor or cancel a job\n", "\n", - "This guide explains how to monitor job status, view usage information, and cancel jobs. You can access this information both through IBM Quantum Platform and programmatically using Qiskit." + "This guide explains how to monitor job status, view usage information, and cancel jobs. You can access this information both through IBM Quantum Platform and programmatically using Qiskit.\n", + "\n", + "Note that you can use `job.properties()` to retrieve the backend properties, including error rates, at the time of the job execution." ] }, { @@ -49,7 +51,7 @@ "source": [ "## Monitor a job\n", "\n", - "Use these methods to check the status of your submitted jobs, retrieve results, and view details related to the job and its execution.\n", + "Use these methods to check the status of your submitted jobs, retrieve results, and view details related to the job and its execution. \n", "\n", "\n", " \n", From 8eec130f947deef11c106fa44e576546912969e9 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:28:12 -0400 Subject: [PATCH 12/16] add job.properties() info --- docs/guides/monitor-job.ipynb | 59 +++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index cd6a7da65f6..db5665f82dd 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -13,9 +13,7 @@ "\n", "# Monitor or cancel a job\n", "\n", - "This guide explains how to monitor job status, view usage information, and cancel jobs. You can access this information both through IBM Quantum Platform and programmatically using Qiskit.\n", - "\n", - "Note that you can use `job.properties()` to retrieve the backend properties, including error rates, at the time of the job execution." + "This guide explains how to monitor job status, view usage information, and cancel jobs. You can access this information both through IBM Quantum Platform and programmatically using Qiskit." ] }, { @@ -246,7 +244,14 @@ " See the [`QiskitRuntimeService.jobs`](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service#jobs) API documentation for available filters.\n", "\n", " This example demonstrates retrieving recent results run on a specific backend.\n", + "\n", " \n", + " \n", + " You can use `job.properties()` to retrieve backend properties, including error rates, at the time of the job execution.\n", + "\n", + " This example demonstrates backend properties that were current at the time a job was executed, including $T_1$/$T_2$ times and error rates for a specific qubit (0).\n", + "\n", + " \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", @@ -303,6 +308,54 @@ " print()" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "id-backend-properties" + ] + }, + "outputs": [], + "source": [ + "from qiskit_ibm_runtime import QiskitRuntimeService\n", + "\n", + "service = QiskitRuntimeService()\n", + "\n", + "# Retrieve a specific job by ID\n", + "job = service.job(\"\")\n", + "\n", + "print(f\"Job ID: {job.job_id()}\")\n", + "print(f\"Backend: {job.backend}\\n\")\n", + "\n", + "# Fetch backend properties at the time of job execution\n", + "properties = job.properties()\n", + "\n", + "if properties:\n", + " print(\"Backend Properties at Job Execution Time:\")\n", + " print(\"=\"*60)\n", + " \n", + " # Get T1 (relaxation time) for qubit 0\n", + " t1 = properties.t1(0)\n", + " print(f\"Qubit 0 T1 (relaxation time): {t1}\")\n", + " \n", + " # Get T2 (dephasing time) for qubit 0\n", + " t2 = properties.t2(0)\n", + " print(f\"Qubit 0 T2 (dephasing time): {t2}\")\n", + " \n", + " # Get readout error for qubit 0\n", + " readout_error = properties.readout_error(0)\n", + " print(f\"Qubit 0 readout error: {readout_error}\")\n", + " \n", + " # Get all properties for a specific qubit\n", + " print(f\"\\nAll properties for qubit 0:\")\n", + " qubit_props = properties.qubit_property(0)\n", + " for prop_name, prop_value in qubit_props.items():\n", + " print(f\" {prop_name}: {prop_value}\")\n", + "else:\n", + " print(\"No properties available for this job\")\n" + ] + }, { "cell_type": "markdown", "id": "cancel-job", From 86b44f75fe29435d7e1cc07eae1af847d14466d1 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:41:52 -0400 Subject: [PATCH 13/16] Update monitor-job.ipynb --- docs/guides/monitor-job.ipynb | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index db5665f82dd..b01455eeaae 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -49,7 +49,7 @@ "source": [ "## Monitor a job\n", "\n", - "Use these methods to check the status of your submitted jobs, retrieve results, and view details related to the job and its execution. \n", + "Use these methods to check the status of your submitted jobs, retrieve results, and view details related to the job and its execution.\n", "\n", "\n", " \n", @@ -199,9 +199,9 @@ "\n", "# Get last 50 jobs to calculate metrics\n", "print(\"Job Metrics:\")\n", - "print(\"=\"*60)\n", - "all_jobs = service.jobs(limit=50, descending=True) # To retrieve all \n", - "#jobs, replace with `limit=None`\n", + "print(\"=\" * 60)\n", + "all_jobs = service.jobs(limit=50, descending=True) # To retrieve all\n", + "# jobs, replace with `limit=None`\n", "\n", "total_jobs = len(all_jobs)\n", "session_workloads = sum(1 for job in all_jobs if job.session_id is not None)\n", @@ -214,7 +214,7 @@ "\n", "# Retrieve the last 10 jobs\n", "print(\"Last 10 Jobs:\")\n", - "print(\"=\"*60)\n", + "print(\"=\" * 60)\n", "jobs = service.jobs(limit=10, descending=True)\n", "\n", "print(f\"Retrieved {len(jobs)} jobs\\n\")\n", @@ -246,7 +246,7 @@ " This example demonstrates retrieving recent results run on a specific backend.\n", "\n", " \n", - " \n", + "\n", " You can use `job.properties()` to retrieve backend properties, including error rates, at the time of the job execution.\n", "\n", " This example demonstrates backend properties that were current at the time a job was executed, including $T_1$/$T_2$ times and error rates for a specific qubit (0).\n", @@ -295,9 +295,9 @@ "for job in recent_jobs:\n", " print(f\"Job ID: {job.job_id()}\")\n", " print(f\"Status: {job.status()}\")\n", - " \n", + "\n", " # Retrieve results if the job is complete\n", - " if str(job.status()) == 'DONE':\n", + " if str(job.status()) == \"DONE\":\n", " try:\n", " results = job.result()\n", " print(f\"Results: {results}\")\n", @@ -311,6 +311,7 @@ { "cell_type": "code", "execution_count": null, + "id": "55afa300-0af7-4f5e-8b32-c32b6ba39621", "metadata": { "tags": [ "id-backend-properties" @@ -333,27 +334,27 @@ "\n", "if properties:\n", " print(\"Backend Properties at Job Execution Time:\")\n", - " print(\"=\"*60)\n", - " \n", + " print(\"=\" * 60)\n", + "\n", " # Get T1 (relaxation time) for qubit 0\n", " t1 = properties.t1(0)\n", " print(f\"Qubit 0 T1 (relaxation time): {t1}\")\n", - " \n", + "\n", " # Get T2 (dephasing time) for qubit 0\n", " t2 = properties.t2(0)\n", " print(f\"Qubit 0 T2 (dephasing time): {t2}\")\n", - " \n", + "\n", " # Get readout error for qubit 0\n", " readout_error = properties.readout_error(0)\n", " print(f\"Qubit 0 readout error: {readout_error}\")\n", - " \n", + "\n", " # Get all properties for a specific qubit\n", - " print(f\"\\nAll properties for qubit 0:\")\n", + " print(\"All properties for qubit 0:\")\n", " qubit_props = properties.qubit_property(0)\n", " for prop_name, prop_value in qubit_props.items():\n", " print(f\" {prop_name}: {prop_value}\")\n", "else:\n", - " print(\"No properties available for this job\")\n" + " print(\"No properties available for this job\")" ] }, { @@ -433,7 +434,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8" + "version": "3" }, "title": "Monitor or cancel a job" }, From 8fff1c544125c9d65ed17d5fcf963ea5c3ed1467 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:43:53 -0400 Subject: [PATCH 14/16] Update monitor-job.ipynb --- docs/guides/monitor-job.ipynb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index b01455eeaae..f9f8aedc1ca 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -16,6 +16,17 @@ "This guide explains how to monitor job status, view usage information, and cancel jobs. You can access this information both through IBM Quantum Platform and programmatically using Qiskit." ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "tags": [ + "version-info" + ] + }, + "outputs": [], + "source": [] + }, { "cell_type": "markdown", "id": "bb84ab8e-6db9-45d6-bb59-2f06f38d9965", From 9cdb37d1b5637995581d22db870da86d1ff91504 Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Tue, 9 Jun 2026 17:45:14 -0400 Subject: [PATCH 15/16] Update monitor-job.ipynb --- docs/guides/monitor-job.ipynb | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index f9f8aedc1ca..7387f3ed42d 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -19,6 +19,7 @@ { "cell_type": "code", "execution_count": null, + "id": "866ed6ab-a597-402e-876a-8315ac5ed9e6", "metadata": { "tags": [ "version-info" From 5277a9c7e1051b1c6655df02babc7bd54372864b Mon Sep 17 00:00:00 2001 From: ABBY CROSS Date: Wed, 10 Jun 2026 11:47:55 -0400 Subject: [PATCH 16/16] Update monitor-job.ipynb --- docs/guides/monitor-job.ipynb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/guides/monitor-job.ipynb b/docs/guides/monitor-job.ipynb index 7387f3ed42d..04fb14a70ea 100644 --- a/docs/guides/monitor-job.ipynb +++ b/docs/guides/monitor-job.ipynb @@ -17,15 +17,13 @@ ] }, { - "cell_type": "code", - "execution_count": null, + "cell_type": "markdown", "id": "866ed6ab-a597-402e-876a-8315ac5ed9e6", "metadata": { "tags": [ "version-info" ] }, - "outputs": [], "source": [] }, {