Skip to content

Commit

Permalink
Upstream/docs/update/notebook cleanup (#985)
Browse files Browse the repository at this point in the history
* Update one notebook and remove OpenBLAS messages

* Clean up rest of notebooks and BLAS warnings
  • Loading branch information
caleb-johnson authored Sep 29, 2023
1 parent 1f5141a commit 8f08da6
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 103 deletions.
31 changes: 10 additions & 21 deletions docs/running/notebooks/01_arguments_and_results.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"metadata": {
"tags": []
},
"outputs": [],
"outputs": [
],
"source": [
"from quantum_serverless import Program\n",
"\n",
Expand All @@ -117,21 +118,6 @@
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
}
},
"outputs": [],
"source": [
"from quantum_serverless import QuantumServerless, Provider\n",
"import os"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -140,12 +126,15 @@
"<QuantumServerless | providers [gateway-provider]>"
]
},
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from quantum_serverless import QuantumServerless, Provider\n",
"import os\n",
"\n",
"provider = Provider(\n",
" username=os.environ.get(\"GATEWAY_USER\", \"user\"),\n",
" password=os.environ.get(\"GATEWAY_PASSWORD\", \"password123\"),\n",
Expand All @@ -166,7 +155,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -182,7 +171,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand All @@ -191,7 +180,7 @@
"'{\"quasi_dists\": {\"0\": 0.4999999999999999, \"3\": 0.4999999999999999}}'"
]
},
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -217,7 +206,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down
35 changes: 15 additions & 20 deletions docs/running/notebooks/02_dependencies.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
"metadata": {
"tags": []
},
"outputs": [],
"outputs": [
],
"source": [
"from quantum_serverless import Program\n",
"\n",
Expand All @@ -84,29 +85,22 @@
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"from quantum_serverless import QuantumServerless, Provider\n",
"import os"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<QuantumServerless | providers [gateway-provider]>"
]
},
"execution_count": 3,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from quantum_serverless import QuantumServerless, Provider\n",
"import os\n",
"\n",
"provider = Provider(\n",
" username=os.environ.get(\"GATEWAY_USER\", \"user\"),\n",
" password=os.environ.get(\"GATEWAY_PASSWORD\", \"password123\"),\n",
Expand All @@ -120,17 +114,18 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"from qiskit.circuit.random import random_circuit\n",
"\n",
"circuit = random_circuit(2, 2)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -139,7 +134,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand All @@ -148,7 +143,7 @@
"'QUEUED'"
]
},
"execution_count": 6,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -159,16 +154,16 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'{\"quasi_dists\": {\"0\": 0.2393348760987308, \"1\": 0.7606651239012692}}'"
"'{\"quasi_dists\": {\"0\": 0.6107159035567002, \"1\": 0.3892840964432998}}'"
]
},
"execution_count": 8,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -194,7 +189,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down
63 changes: 31 additions & 32 deletions docs/running/notebooks/03_distributed_workloads.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,24 @@
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {
"collapsed": false,
"jupyter": {
"outputs_hidden": false
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<QuantumServerless | providers [gateway-provider]>"
]
},
"execution_count": 1,
"metadata": {},
"output_type": "execute_result"
}
},
"outputs": [],
],
"source": [
"from quantum_serverless import QuantumServerless, Provider\n",
"import os"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"provider = Provider(\n",
" username=os.environ.get(\"GATEWAY_USER\", \"user\"),\n",
" password=os.environ.get(\"GATEWAY_PASSWORD\", \"password123\"),\n",
Expand All @@ -99,23 +98,23 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's create list of random circuit which we will be using as arguments"
"Let's create a list of random circuits which we will be passed as arguments to the program."
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[<qiskit.circuit.quantumcircuit.QuantumCircuit at 0x7f9380e69d30>,\n",
" <qiskit.circuit.quantumcircuit.QuantumCircuit at 0x7f9380e69940>,\n",
" <qiskit.circuit.quantumcircuit.QuantumCircuit at 0x7f9380e696d0>]"
"[<qiskit.circuit.quantumcircuit.QuantumCircuit at 0x7f08545bea30>,\n",
" <qiskit.circuit.quantumcircuit.QuantumCircuit at 0x7f08545e1c70>,\n",
" <qiskit.circuit.quantumcircuit.QuantumCircuit at 0x7f08545e1dc0>]"
]
},
"execution_count": 6,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -132,21 +131,21 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Run program as usual"
"Run program as usual, but pass the circuits in as a keyword argument, `circuits`."
]
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"<Job | 20deb9fc-1be2-4233-a8e0-14191aa26676>"
"<Job | 42b32fd1-b908-4d7d-8fca-58c8cee56cff>"
]
},
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -166,7 +165,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -175,7 +174,7 @@
"'QUEUED'"
]
},
"execution_count": 8,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -186,16 +185,16 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'{\"results\": [{\"0\": 0.1434935972712797, \"2\": 0.8565064027287204}, {\"0\": 0.4999999999999999, \"2\": 0.4999999999999999}, {\"0\": 0.0225288870630969, \"2\": 0.977471112936903}]}'"
"'{\"results\": [{\"2\": 0.4999999999999999, \"3\": 0.4999999999999999}, {\"0\": 0.410199670072165, \"1\": 0.410199670072165, \"2\": 0.0898003299278348, \"3\": 0.0898003299278349}, {\"0\": 0.4999999999999999, \"2\": 0.4999999999999999}]}'"
]
},
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -221,7 +220,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.13"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 8f08da6

Please sign in to comment.