Skip to content

Commit

Permalink
Update cutting tutorials to send ISA circuits to Qiskit Runtime (#500) (
Browse files Browse the repository at this point in the history
#512)

* Remove explicit `session.close()` calls inside context manager

These `close` calls are redundant since
Qiskit/qiskit-ibm-runtime#1139.

* Demonstrate transpiling circuits before sending to Runtime

... in cutting tutorials 1 and 3

* Update tutorial 2 (cutting for depth)

* Remove a comma

* black

* Rename `pm` -> `pass_manager` for clarity

(cherry picked from commit bf82d2d)

Co-authored-by: Jim Garrison <[email protected]>
  • Loading branch information
mergify[bot] and garrison authored Mar 25, 2024
1 parent 69088d8 commit 7f65f2b
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,21 +283,26 @@
"metadata": {},
"outputs": [],
"source": [
"# from qiskit_ibm_runtime import Session, Options, Sampler\n",
"# from qiskit_ibm_runtime import Session, Options, Sampler, QiskitRuntimeService\n",
"# from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager\n",
"#\n",
"# with Session(backend=\"ibmq_qasm_simulator\") as session:\n",
"# service = QiskitRuntimeService()\n",
"# backend = service.least_busy(operational=True, simulator=False)\n",
"#\n",
"# # Prepare transpiler for target backend\n",
"# pass_manager = generate_preset_pass_manager(optimization_level=1, backend=backend)\n",
"#\n",
"# with Session(backend=backend) as session:\n",
"# # Set up Qiskit Runtime Sampler primitives.\n",
"# samplers = {\n",
"# label: Sampler(Options(execution={\"shots\": 2**12})) for label in subexperiments.keys()\n",
"# }\n",
"#\n",
"# # Retrieve results from each subexperiment\n",
"# results = {\n",
"# label: sampler.run(subexperiments[label]).result()\n",
"# label: sampler.run(pass_manager.run(subexperiments[label])).result()\n",
"# for label, sampler in samplers.items()\n",
"# }\n",
"#\n",
"# session.close()"
"# }"
]
},
{
Expand Down
Loading

0 comments on commit 7f65f2b

Please sign in to comment.