Skip to content

Commit

Permalink
add bloqade to runtime demos (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhill1 authored Jun 25, 2024
1 parent 2b0aa49 commit 8374a08
Showing 1 changed file with 140 additions and 0 deletions.
140 changes: 140 additions & 0 deletions qbraid_sdk/qbraid_runtime_bloqade_aquila.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "9ebb8300-b55f-4a42-8ed9-017ea22616e3",
"metadata": {},
"source": [
"## qBraid Runtime: Bloqade task submission via BraketProvider"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f7670408-b707-451c-af4f-11db74703e69",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"import numpy as np\n",
"from bloqade import var\n",
"from bloqade.atom_arrangement import Square\n",
"\n",
"from qbraid.runtime.braket import BraketProvider"
]
},
{
"cell_type": "markdown",
"id": "7eb00c25-c035-4132-af97-598cf06f98f4",
"metadata": {},
"source": [
"Create adiabatic program batch using Bloqade"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ae66e887-94dc-4544-86ab-3362d62eecea",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"adiabatic_durations = [0.4, 3.2, 0.4]\n",
"\n",
"max_detuning = var(\"max_detuning\")\n",
"adiabatic_program = (\n",
" Square(3, lattice_spacing=\"lattice_spacing\")\n",
" .rydberg.rabi.amplitude.uniform.piecewise_linear(\n",
" durations=adiabatic_durations, values=[0.0, \"max_rabi\", \"max_rabi\", 0.0]\n",
" )\n",
" .detuning.uniform.piecewise_linear(\n",
" durations=adiabatic_durations,\n",
" values=[\n",
" -max_detuning, # scalar variables support direct arithmetic operations\n",
" -max_detuning,\n",
" max_detuning,\n",
" max_detuning,\n",
" ],\n",
" )\n",
" .assign(max_rabi=15.8, max_detuning=16.33)\n",
" .batch_assign(lattice_spacing=np.arange(4.0, 7.0, 1.0))\n",
")"
]
},
{
"cell_type": "markdown",
"id": "3c2e92e6-0987-472b-a0ae-822a8878936b",
"metadata": {},
"source": [
"Target QuEra Aquila device using BraketProvider"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "605fc035-124f-461c-9a33-dc92ebeda7ce",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"provider = BraketProvider()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "62423d51-73e8-46ab-a412-7fd04fa94777",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"device = provider.get_device(\"arn:aws:braket:us-east-1::device/qpu/quera/Aquila\")"
]
},
{
"cell_type": "markdown",
"id": "b1194bdb-4b70-4da3-bd96-44dee8d623e3",
"metadata": {},
"source": [
"Submit quantum task(s)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0e8a9021-4965-41b0-8eea-83779b21d995",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"job_batch = device.run(adiabatic_program, shots=50)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 [qBraid]",
"language": "python",
"name": "python3_qbraid_sdk_9j9sjy"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.14"
}
},
"nbformat": 4,
"nbformat_minor": 5
}

0 comments on commit 8374a08

Please sign in to comment.