Skip to content

Commit

Permalink
azure rigetti example working
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhill1 committed Feb 2, 2024
1 parent 9f9a0ca commit bf2a183
Showing 1 changed file with 13 additions and 19 deletions.
32 changes: 13 additions & 19 deletions examples/rigetti_qvm_sim.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"source": [
"import cirq\n",
"\n",
"# create a test circuit\n",
"q0, q1 = cirq.LineQubit.range(2)\n",
"circuit = cirq.Circuit(cirq.H(q0), cirq.CNOT(q0, q1), cirq.measure(q0, q1))\n",
"\n",
Expand All @@ -60,24 +59,25 @@
"source": [
"from qbraid_qir.cirq import cirq_to_qir\n",
"\n",
"# convert to QIR\n",
"module = cirq_to_qir(circuit, name=\"bell\")"
"module = cirq_to_qir(circuit, name=\"bell\")\n",
"\n",
"print(str(module))"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Submit program to cloud"
"Submit program to Rigetti via Azure Quantum Cloud"
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"from azure.identity import AzureCliCredential"
"<div class=\"alert alert-block alert-info\">\n",
" <b>Note:</b> You will have to open a terminal and run <code>az login</code> to make sure your Azure credentials are stored.\n",
"</div>"
]
},
{
Expand All @@ -87,12 +87,13 @@
"outputs": [],
"source": [
"import azure.quantum\n",
"from azure.identity import AzureCliCredential\n",
"\n",
"workspace = azure.quantum.Workspace(\n",
" subscription_id=\"<subscription-id>\",\n",
" resource_group=\"AzureQuantum\",\n",
" name=\"<workspace-name>\",\n",
" location=\"eastus\",\n",
" name=\"qir-demo\",\n",
" location=\"westus\",\n",
" credential=AzureCliCredential(),\n",
")"
]
Expand All @@ -112,15 +113,8 @@
" output_data_format=\"microsoft.quantum-results.v1\",\n",
" input_data=module.bitcode,\n",
" input_params={\"shots\": 1, \"entryPoint\": \"main\", \"arguments\": []},\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
")\n",
"\n",
"info = job.details.as_dict()"
]
},
Expand Down

0 comments on commit bf2a183

Please sign in to comment.