Skip to content

Commit 8355037

Browse files
authored
docs: fix cancellation example (#129)
1 parent 7e1fb30 commit 8355037

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

examples/basics/getting_started.ipynb

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,9 @@
429429
"cell_type": "markdown",
430430
"metadata": {},
431431
"source": [
432-
"## Cancel job"
432+
"## Cancel job\n",
433+
"\n",
434+
"Jobs submitted to quantum backends can be requested to be cancelled by Nexus, however please note that depending on the status of the job cancellation cannot be guaranteed. Please check the job status once the cancellation request has been made to make sure."
433435
]
434436
},
435437
{
@@ -438,6 +440,7 @@
438440
"metadata": {},
439441
"outputs": [],
440442
"source": [
443+
"# Lets start a job (please note this example assumes you have access to the H1-1E device)\n",
441444
"ref_execute_job1 = qnx.start_execute_job(\n",
442445
" circuits=[ref_compiled_circuit],\n",
443446
" n_shots=[100],\n",
@@ -461,7 +464,17 @@
461464
"metadata": {},
462465
"outputs": [],
463466
"source": [
464-
"config = qnx.QuantinuumConfig(device_name=\"H1-Emulator\", attempt_batching=True)"
467+
"qnx.jobs.cancel(ref_execute_job1)"
468+
]
469+
},
470+
{
471+
"cell_type": "code",
472+
"execution_count": null,
473+
"metadata": {},
474+
"outputs": [],
475+
"source": [
476+
"# Double check the job is cancelled (this might take some time).\n",
477+
"qnx.jobs.status(ref_execute_job1)"
465478
]
466479
},
467480
{

0 commit comments

Comments
 (0)