Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
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
12 changes: 10 additions & 2 deletions docs/guides/access-groups.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ When you create this access group, include the following policies:
<Admonition type="note">
Users with the `viewer` platform management role on "all account management services" can also view services such as billing. If you want to prevent this extra view access, use the IBM Cloud CLI to give them access to just Resource groups:
```cli
ibmcloud iam access-group-policy-create <group name> --roles Viewer --resource-type resource-group
ibmcloud iam access-group-policy-create \
(<group name> --roles Viewer --resource-type resource-group)
--resource-type resource-group)
```
</Admonition>

Expand All @@ -57,7 +59,13 @@ ibmcloud iam access-group-create GROUP_NAME [-d, --description DESCRIPTION]
To create an access group _policy_ by using the CLI, use the [`ibmcloud iam access-group-policy-create`](https://cloud.ibm.com/docs/cli?topic=cli-ibmcloud_commands_iam#ibmcloud_iam_access_group_policy_create) command.

```cli
ibmcloud iam access-group-policy-create GROUP_NAME {-f, --file @JSON_FILE | --roles ROLE_NAME1,ROLE_NAME2... [--service-name SERVICE_NAME] [--service-instance SERVICE_INSTANCE] [--region REGION] [--resource-type RESOURCE_TYPE] [--resource RESOURCE] [--resource-group-name RESOURCE_GROUP_NAME] [--resource-group-id RESOURCE_GROUP_ID]}
ibmcloud iam access-group-policy-create GROUP_NAME \
{-f, --file @JSON_FILE | --roles ROLE_NAME1,ROLE_NAME2... \
[--service-name SERVICE_NAME] \
[--service-instance SERVICE_INSTANCE] [--region REGION] \
[--resource-type RESOURCE_TYPE] [--resource RESOURCE] \
[--resource-group-name RESOURCE_GROUP_NAME] \
[--resource-group-id RESOURCE_GROUP_ID]}
```

You can use the following JSON code to create policies for an Administrators access group:
Expand Down
3 changes: 2 additions & 1 deletion docs/guides/algorithmiq-tem.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
"pub = (qc, [observable])\n",
"options = {\"default_precision\": 0.02}\n",
"\n",
"# Define backend to use. TEM will choose the least-busy device reported by IBM if not specified\n",
"# Define backend to use. TEM will choose the least-busy device\n",
"# reported by IBM if not specified\n",
"backend_name = \"ibm_marrakesh\"\n",
"\n",
"# Run the TEM function (uses around three minutes of QPU time)\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/guides/cloud-account-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Performing actions often requires a combination of platform management and servi
<Admonition type="note">
Users with the `viewer` platform management role on All account management services can also view services such as billing. If you want to prevent this extra view access, use the IBM Cloud CLI to give them access to just Resource groups:
```cli
ibmcloud iam access-group-policy-create <group name> --roles Viewer --resource-type resource-group
ibmcloud iam access-group-policy-create <group name> \
--roles Viewer --resource-type resource-group
```
</Admonition>
- Running jobs requires the `writer` service access role and `viewer` platform management role access to the instance.
Expand Down
4 changes: 3 additions & 1 deletion docs/guides/cloud-setup-rest-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Choose the appropriate authentication method, depending on your working environm
1. To set the IQP_API_TOKEN environment variable in your system, you can add the following line to your shell profile (for example, .bashrc or .zshrc) or by setting it directly in your terminal:

```shell
export IQP_API_TOKEN=<your-API_KEY> # Use the 44-character API_KEY you created and saved from the IBM Quantum Platform Home dashboard
export IQP_API_TOKEN=<your-API_KEY>
# Use the 44-character API_KEY you created and saved
# from the IBM Quantum Platform Home dashboard
```
When you invoke the environment variable in your code, include `import os`, as in this example:

Expand Down
5 changes: 3 additions & 2 deletions docs/guides/custom-backend.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "b346f50b-b127-4074-99fc-7c53e3fbc022",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -147,7 +147,8 @@
" each chip will be a heavy hex graph of ``distance`` code distance.\n",
" \"\"\"\n",
" super().__init__(name=\"Fake LOCC backend\")\n",
" # Create a heavy-hex graph using the rustworkx library, then instantiate a new target\n",
" # Create a heavy-hex graph using the\n",
" # rustworkx library, then instantiate a new target\n",
" self._graph = rx.generators.directed_heavy_hex_graph(\n",
" distance, bidirectional=False\n",
" )\n",
Expand Down
35 changes: 21 additions & 14 deletions docs/guides/debug-qiskit-runtime-jobs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "a45a6d9e-de39-4586-8395-a7f580f0e0dc",
"metadata": {},
"outputs": [],
Expand All @@ -114,7 +114,9 @@
"backend = service.least_busy(operational=True, simulator=False)\n",
"\n",
"# Generate a preset pass manager\n",
"# This will be used to convert the abstract circuit to an equivalent Instruction Set Architecture (ISA) circuit.\n",
"# This will be used to convert the abstract circuit to an equivalent\n",
"# Instruction Set Architecture (ISA) circuit.\n",
"\n",
"pm = generate_preset_pass_manager(backend=backend, optimization_level=0)\n",
"\n",
"# Set the random seed\n",
Expand All @@ -136,7 +138,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "df19af55-897d-4b1f-baf8-fac2641ae87d",
"metadata": {},
"outputs": [
Expand All @@ -154,8 +156,8 @@
"source": [
"def generate_circuit(n_qubits, n_layers):\n",
" r\"\"\"\n",
" A function to generate a pseudo-random a circuit with ``n_qubits`` qubits and\n",
" ``2*n_layers`` entangling layers of the type used in this notebook.\n",
" A function to generate a pseudo-random a circuit with ``n_qubits`` qubits\n",
" and ``2*n_layers`` entangling layers of the type used in this notebook.\n",
" \"\"\"\n",
" # An array of random angles\n",
" angles = [\n",
Expand Down Expand Up @@ -212,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "830b1dcc-2669-46cc-bff8-01a96a05c6ab",
"metadata": {},
"outputs": [
Expand All @@ -232,7 +234,8 @@
"# Map the observables to the backend's layout\n",
"isa_obs = [SparsePauliOp(o).apply_layout(isa_qc.layout) for o in obs]\n",
"\n",
"# Initialize the PUBs, which consist of six-qubit circuits with `n_layers` 1, ..., 6\n",
"# Initialize the PUBs, which consist of six-qubit circuits\n",
"# with `n_layers` 1, ..., 6\n",
"all_n_layers = [1, 2, 3, 4, 5, 6]\n",
"\n",
"pubs = [(pm.run(generate_circuit(6, n)), isa_obs) for n in all_n_layers]"
Expand Down Expand Up @@ -377,7 +380,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "cd61e437-bd2f-4349-a667-7edab51c4a6e",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -425,7 +428,8 @@
" # Print the mean absolute difference for the observables\n",
" mean_vals = np.round(np.mean(vals), 2)\n",
" print(\n",
" f\"Mean absolute difference between ideal and noisy results for circuits with {all_n_layers[idx]} layers:\\n {mean_vals}%\\n\"\n",
" f\"Mean absolute difference between ideal and noisy results \"\n",
" f\"for circuits with {all_n_layers[idx]} layers:\\n {mean_vals}%\\n\"\n",
" )"
]
},
Expand Down Expand Up @@ -453,7 +457,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "0835c562-55c9-4dbe-879e-7271f8bed280",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -508,7 +512,8 @@
" # Print the mean absolute difference for the observables\n",
" mean_values = np.round(np.mean(values), 2)\n",
" print(\n",
" f\"Mean absolute difference between ideal and noisy results for circuits with {all_n_layers[idx]} layers:\\n {mean_values}%\\n\"\n",
" f\"Mean absolute difference between ideal and noisy results \"\n",
" f\"for circuits with {all_n_layers[idx]} layers:\\n {mean_values}%\\n\"\n",
" )"
]
},
Expand Down Expand Up @@ -599,7 +604,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"id": "7db531a1-c417-4d5b-bdc3-7a4ad3385fd4",
"metadata": {},
"outputs": [
Expand All @@ -626,11 +631,13 @@
}
],
"source": [
"# Look at the mean absolute difference to quickly tell the best choice for your options\n",
"# Look at the mean absolute difference to quickly determine\n",
"# the best choice for your options\n",
"for factors, res in zip(noise_factors, results):\n",
" d = rdiff(ideal_results[0], res[0])\n",
" print(\n",
" f\"Mean absolute difference for factors {factors}:\\n {np.round(np.mean(d), 2)}%\\n\"\n",
" f\"Mean absolute difference for factors \"\n",
" f\"{factors}:\\n {np.round(np.mean(d), 2)}%\\n\"\n",
" )"
]
},
Expand Down
16 changes: 10 additions & 6 deletions docs/guides/estimator-input-output.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "53a4d5ae-109b-452b-bbc5-2d7940c5182c",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -252,19 +252,23 @@
],
"source": [
"print(\n",
" f\"The result of the submitted job had {len(result)} PUBs and has a value:\\n {result}\\n\"\n",
" f\"The result of the submitted job had {len(result)} \"\n",
" f\"PUBs and has a value:\\n {result}\\n\"\n",
")\n",
"print(\n",
" f\"The associated PubResult of this job has the following data bins:\\n {result[0].data}\\n\"\n",
" \"The associated PubResult of this job has the following data bins:\\n \"\n",
" \"{result[0].data}\\n\"\n",
")\n",
"print(f\"And this DataBin has attributes: {result[0].data.keys()}\")\n",
"print(\n",
" \"Recall that this shape is due to our array of parameter binding sets having shape (100, 2) -- where 2 is the\\n\\\n",
" number of parameters in the circuit -- combined with our array of observables having shape (3, 1). \\n\"\n",
" \"Recall that this shape is due to our array of parameter binding sets\"\n",
" \"having shape (100, 2), where 2 is the number of parameters in the \"\n",
" \"circuit, combined with our array of observables having shape (3, 1). \\n\"\n",
")\n",
"with np.printoptions(threshold=200):\n",
" print(\n",
" f\"The expectation values measured from this PUB are: \\n{result[0].data.evs}\"\n",
" \"The expectation values measured from this PUB are: \\n\"\n",
" \"{result[0].data.evs}\\n\"\n",
" )"
]
},
Expand Down
5 changes: 3 additions & 2 deletions docs/guides/estimator-noise-management.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "89f1827d-92a1-40a4-bd71-6d67a18f0932",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -180,7 +180,8 @@
" f\">>> gate twirling is turned on: {estimator.options.twirling.enable_gates}\"\n",
")\n",
"print(\n",
" f\">>> measurement error mitigation is turned on: {estimator.options.resilience.measure_mitigation}\"\n",
" f\">>> measurement error mitigation is turned on: \"\n",
" f\"{estimator.options.twirling.enable_gates}\"\n",
")"
]
},
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/execute-dynamic-circuits.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "076db590-29db-4137-a043-45485c9f46df",
"metadata": {
"tags": [
Expand All @@ -91,7 +91,7 @@
},
"outputs": [],
"source": [
"# This cell is hidden from users. It hides all those \"...instance was not set...\" warnings.\n",
"# This cell is hidden from users. It hides all those \"...instance was not set...\" warnings.\n",
"import warnings\n",
"\n",
"warnings.filterwarnings(\"ignore\", message=\".*Instance was not set*\")"
Expand Down
18 changes: 12 additions & 6 deletions docs/guides/function-template-chemistry-workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,17 @@
"serverless = QiskitServerless(\n",
" channel=\"ibm_quantum_platform\",\n",
" instance=\"INSTANCE_CRN\",\n",
" token=\"YOUR_API_KEY\" # Use the 44-character API_KEY you created and saved from the IBM Quantum Platform Home dashboard\n",
" # For `token`, use the 44-character API_KEY you created\n",
" # and saved from the IBM Quantum Platform Home dashboard\n",
" token=\"YOUR_API_KEY\"\n",
")\n",
"```\n",
"\n",
"Optionally, use `save_account()` to save your credentials in a local environment (see the [Set up your IBM Cloud account](/docs/guides/cloud-setup#cloud-save) guide). Note that this writes your credentials to the same file as [`QiskitRuntimeService.save_account()`](/docs/api/qiskit-ibm-runtime/qiskit-runtime-service#save_account):\n",
"\n",
"```python\n",
"QiskitServerless.save_account(token=\"YOUR_API_KEY\", channel=\"ibm_quantum_platform\", instance=\"INSTANCE_CRN\")\n",
"QiskitServerless.save_account(token=\"YOUR_API_KEY\",\n",
" channel=\"ibm_quantum_platform\", instance=\"INSTANCE_CRN\")\n",
"```\n",
"\n",
"If the [account is saved](/docs/guides/save-credentials), there is no need to provide the token to authenticate:"
Expand Down Expand Up @@ -222,7 +225,8 @@
"template = QiskitFunction(\n",
" title=\"sqd_pcm_template\",\n",
" entrypoint=\"sqd_pcm_entrypoint.py\",\n",
" working_dir=\"./source_files/\", # all files in this directory will be uploaded\n",
" # all files in `working_dir` will be uploaded\n",
" working_dir=\"./source_files/\",\n",
" dependencies=[\n",
" \"ffsim==0.0.54\",\n",
" \"pyscf==2.9.0\",\n",
Expand Down Expand Up @@ -344,7 +348,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "a1719ab1",
"metadata": {},
"outputs": [],
Expand Down Expand Up @@ -373,7 +377,8 @@
"}\n",
"\n",
"solvent_options = {\n",
" \"method\": \"IEF-PCM\", # other available methods are COSMO, C-PCM, SS(V)PE, see https://manual.q-chem.com/5.4/topic_pcm-em.html\n",
" # See https://manual.q-chem.com/5.4/topic_pcm-em.html for all methods\n",
" \"method\": \"IEF-PCM\", # other available methods are COSMO, C-PCM, SS(V)PE\n",
" \"eps\": 78.3553, # value for water\n",
"}\n",
"\n",
Expand Down Expand Up @@ -1722,7 +1727,8 @@
},
"outputs": [],
"source": [
"# This cell is hidden from users. It verifies both source listings are identical then deletes the working folder we created\n",
"# This cell is hidden from users. It verifies both source listings are identical\n",
"# then deletes the working folder we created\n",
"import shutil\n",
"\n",
"with open(\"./source_files/sqd_pcm_entrypoint.py\") as f1:\n",
Expand Down
Loading
Loading