Skip to content

Commit

Permalink
Use new qiskit init in samples
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyi-joffre committed Jan 10, 2024
1 parent 75a3dd9 commit 019764c
Show file tree
Hide file tree
Showing 5 changed files with 329 additions and 214 deletions.
10 changes: 7 additions & 3 deletions samples/hidden-shift/hidden-shift.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@
},
"outputs": [],
"source": [
"from azure.quantum import Workspace\n",
"from azure.quantum.qiskit import AzureQuantumProvider\n",
"provider = AzureQuantumProvider(\n",
"\n",
"workspace = Workspace(\n",
" resource_id = \"\",\n",
" location = \"\"\n",
")"
" location = \"\",\n",
")\n",
"\n",
"provider = AzureQuantumProvider(workspace)"
]
},
{
Expand Down
440 changes: 269 additions & 171 deletions samples/quantum-signal-processing/signal-processing.ipynb

Large diffs are not rendered by default.

73 changes: 39 additions & 34 deletions samples/resource-estimator/estimation-qiskit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,15 @@
"metadata": {},
"outputs": [],
"source": [
"provider = AzureQuantumProvider (\n",
"from azure.quantum import Workspace\n",
"from azure.quantum.qiskit import AzureQuantumProvider\n",
"\n",
"workspace = Workspace(\n",
" resource_id = \"\",\n",
" location = \"\"\n",
")"
" location = \"\",\n",
")\n",
"\n",
"provider = AzureQuantumProvider(workspace)"
]
},
{
Expand Down Expand Up @@ -169,45 +174,45 @@
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The distribution of physical qubits used for the execution of the algorithm instructions and the supporting T factories can provide us valuable information to guide us in applying space and time optimizations. We can visualize this distribution to better understand the estimated space requirements for our algorithm."
]
"cell_type": "markdown",
"metadata": {},
"source": [
"The distribution of physical qubits used for the execution of the algorithm instructions and the supporting T factories can provide us valuable information to guide us in applying space and time optimizations. We can visualize this distribution to better understand the estimated space requirements for our algorithm."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"result.diagram.space"
]
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"result.diagram.space"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also visualize the time required to execute the algorithm as it relates to each T factory invocation runtime and the number of T factory invocations."
]
"cell_type": "markdown",
"metadata": {},
"source": [
"We can also visualize the time required to execute the algorithm as it relates to each T factory invocation runtime and the number of T factory invocations."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
">\n",
"> *You cannot visualize the time and space diagrams in the same cell.*\n",
">"
]
"cell_type": "markdown",
"metadata": {},
"source": [
">\n",
"> *You cannot visualize the time and space diagrams in the same cell.*\n",
">"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"result.diagram.time"
]
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"result.diagram.time"
]
},
{
"cell_type": "markdown",
Expand Down
10 changes: 7 additions & 3 deletions samples/sessions/introduction-to-sessions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@
"# Connect to the Azure Quantum workspace\n",
"from qiskit import QuantumCircuit\n",
"from qiskit.tools.monitor import job_monitor\n",
"from azure.quantum import Workspace\n",
"from azure.quantum.qiskit import AzureQuantumProvider\n",
"\n",
"provider = AzureQuantumProvider (\n",
" resource_id = \"\",\n",
" location = \"\")\n",
"workspace = Workspace(\n",
" resource_id = \"\",\n",
" location = \"\",\n",
")\n",
"\n",
"provider = AzureQuantumProvider(workspace)\n",
"\n",
"ionq_sim = provider.get_backend('ionq.simulator')\n",
"quantinuum_sim = provider.get_backend('quantinuum.sim.h1-1e')\n",
Expand Down
10 changes: 7 additions & 3 deletions samples/vqe/VQE-qiskit-hydrogen-session.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,16 @@
},
"outputs": [],
"source": [
"from azure.quantum import Workspace\n",
"from azure.quantum.qiskit import AzureQuantumProvider\n",
"\n",
"workspace = Workspace(\n",
" resource_id = \"\",\n",
" location = \"\",\n",
")\n",
"\n",
"# Connect to the Azure Quantum workspace via a Qiskit provider\n",
"provider = AzureQuantumProvider(\n",
" resource_id = \"\",\n",
" location = \"\")"
"provider = AzureQuantumProvider(workspace)"
]
},
{
Expand Down

0 comments on commit 019764c

Please sign in to comment.