Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 26 additions & 5 deletions docs/guides/q-ctrl-performance-management.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@
"source": [
"from qiskit_ibm_catalog import QiskitFunctionsCatalog\n",
"\n",
"catalog = QiskitFunctionsCatalog(\n",
" channel=\"ibm_quantum_platform\", instance=\"USER_CRN\", token=\"USER_API_KEY\"\n",
")\n",
"catalog = QiskitFunctionsCatalog()\n",
"\n",
"# Access Function\n",
"perf_mgmt = catalog.load(\"q-ctrl/performance-management\")"
Expand Down Expand Up @@ -229,7 +227,7 @@
"from qiskit_ibm_runtime import QiskitRuntimeService\n",
"\n",
"service = QiskitRuntimeService()\n",
"backend_name = service.least_busy().name"
"backend_name = \"ibm_torino\""
]
},
{
Expand Down Expand Up @@ -544,7 +542,8 @@
"pub_result = sampler_result[0]\n",
"counts = pub_result.data.c.get_counts()\n",
"\n",
"print(f\"Counts for the meas output register: {counts}\")"
"# Show a few items from the counts dictionary\n",
"list(counts.items())[:10]"
]
},
{
Expand All @@ -557,6 +556,28 @@
"Plot the bitstring with the highest counts to see if the hidden bitstring was the mode."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "799a7331-c029-4d50-8819-c7fe23627d27",
"metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": [
"remove-cell"
]
},
"outputs": [],
"source": [
"# This cell is hidden from the user. It checks the top result is the\n",
"# hidden bitstring. This can sometimes happen if the backend is having\n",
"# a bad day.\n",
"most_common_result = max(counts.items(), key=lambda x: x[1])[0][0]\n",
"assert most_common_result == hidden_bitstring"
]
},
{
"cell_type": "code",
"execution_count": 15,
Expand Down
Loading