Skip to content

Commit

Permalink
add catalog back in
Browse files Browse the repository at this point in the history
  • Loading branch information
abbycross committed Nov 26, 2024
1 parent 1e59e09 commit 8374f06
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions docs/guides/functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,24 @@
" )\n",
" ```\n",
"\n",
" Close out of the REPL with `exit()`. From now on, whenever you need to authenticate to the service, you can load your credentials with `QiskitFunctionsCatalog()`.\n",
"\n",
" ```python\n",
" # Load saved credentials\n",
" service = QiskitFunctionsCatalog()\n",
" ```\n",
"\n",
"1. <span id=\"functions-untrusted\"></span>**Avoid executing code on an external cloud Python environment to minimize security risks.** If you must use an untrusted environment (on, for example, a public computer), change your API token after each use by rotating it on the [IBM Quantum Platform dashboard](https://quantum.ibm.com/) (click the refresh button in the API token field). To initialize the service in this situation, expand the following section to view code you can use:\n",
" Close out of the REPL with `exit()`. From now on, whenever you need to authenticate to the service, you can load your credentials with `QiskitFunctionsCatalog()`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Load saved credentials\n",
"catalog = QiskitFunctionsCatalog()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"3. <span id=\"functions-untrusted\"></span>**Avoid executing code on an external cloud Python environment to minimize security risks.** If you must use an untrusted environment (on, for example, a public computer), change your API token after each use by rotating it on the [IBM Quantum Platform dashboard](https://quantum.ibm.com/) (click the refresh button in the API token field). To initialize the service in this situation, expand the following section to view code you can use:\n",
"\n",
" <details>\n",
" <summary>Initialize the service in an untrusted environment</summary>\n",
Expand All @@ -88,10 +98,15 @@
" from qiskit-ibm-catalog import QiskitFunctionsCatalog\n",
"\n",
" # Refresh your API token on the dashboard after using the code as follows:\n",
" service = QiskitFunctionsCatalog(token=\"<MY_IBM_QUANTUM_TOKEN>\")\n",
" catalog = QiskitFunctionsCatalog(token=\"<MY_IBM_QUANTUM_TOKEN>\")\n",
" ```\n",
" </details>\n",
"\n",
" </details>\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
" <Admonition type=\"caution\">\n",
" When sharing code with others, ensure that your API token is not embedded directly within the Python script. Instead, share the script without the token and provide instructions for securely setting it up.\n",
" </Admonition>"
Expand All @@ -102,7 +117,7 @@
"id": "5154cbea-ccfa-42ea-a9ef-c31699c3b2c0",
"metadata": {},
"source": [
"Once you have authenticated, you can list the functions from the Qiskit Functions Catalog that you have access to:"
"4. Once you have authenticated, you can list the functions from the Qiskit Functions Catalog that you have access to:"
]
},
{
Expand Down

0 comments on commit 8374f06

Please sign in to comment.