Skip to content

Commit

Permalink
fix: Fallback to JAQCD for device properties (#104)
Browse files Browse the repository at this point in the history
* fix: Fallback to JAQCD for device properties

* fix: reformat
  • Loading branch information
kshitijc authored Jun 8, 2023
1 parent 5fef143 commit 2434a9a
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 79 deletions.
159 changes: 92 additions & 67 deletions docs/how_tos/0_how_to_access_AWS_Braket_devices.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"id": "5e768d55",
"metadata": {},
"outputs": [],
Expand All @@ -25,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"id": "200f52ee",
"metadata": {},
"outputs": [],
Expand All @@ -43,26 +43,29 @@
},
{
"cell_type": "code",
"execution_count": 52,
"execution_count": 3,
"id": "906ecc1a",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[BraketBackend[Aspen-10],\n",
"[BraketBackend[Aria 1],\n",
" BraketBackend[Aspen-10],\n",
" BraketBackend[Aspen-11],\n",
" BraketBackend[Aspen-8],\n",
" BraketBackend[Aspen-9],\n",
" BraketBackend[Aspen-M-1],\n",
" BraketBackend[IonQ Device],\n",
" BraketBackend[Aspen-M-2],\n",
" BraketBackend[Aspen-M-3],\n",
" BraketBackend[Harmony],\n",
" BraketBackend[Lucy],\n",
" BraketBackend[SV1],\n",
" BraketBackend[TN1],\n",
" BraketBackend[dm1]]"
]
},
"execution_count": 52,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -74,114 +77,144 @@
},
{
"cell_type": "code",
"execution_count": 40,
"execution_count": 4,
"id": "8c8672a6",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{'backend version': 2,\n",
" 'description': 'AWS Device: IonQ Aria 1.',\n",
" 'name': 'Aria 1',\n",
" 'number of qubits': 25,\n",
" 'online date': datetime.datetime(2023, 6, 7, 11, 12, 40, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='x', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='y', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='z', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='rx', num_qubits=1, num_clbits=0, params=[Parameter(theta)])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Rigetti Aspen-10.',\n",
" 'name': 'Aspen-10',\n",
" 'number of qubits': 38,\n",
" 'online date': datetime.datetime(2021, 12, 15, 19, 48, 30, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='id', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Rigetti Aspen-11.',\n",
" 'name': 'Aspen-11',\n",
" 'number of qubits': 48,\n",
" 'online date': datetime.datetime(2022, 3, 4, 20, 18, 30, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2022, 8, 17, 21, 25, 7, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='id', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Rigetti Aspen-8.',\n",
" 'name': 'Aspen-8',\n",
" 'number of qubits': 38,\n",
" 'online date': None,\n",
" 'operations': [Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='id', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Rigetti Aspen-9.',\n",
" 'name': 'Aspen-9',\n",
" 'number of qubits': 38,\n",
" 'online date': datetime.datetime(2021, 11, 18, 16, 13, 30, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='id', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Rigetti Aspen-M-1.',\n",
" 'name': 'Aspen-M-1',\n",
" 'number of qubits': 148,\n",
" 'online date': datetime.datetime(2022, 4, 18, 17, 3, 38, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2022, 6, 17, 20, 13, 38, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='id', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: IonQ IonQ Device.',\n",
" 'name': 'IonQ Device',\n",
" 'description': 'AWS Device: Rigetti Aspen-M-2.',\n",
" 'name': 'Aspen-M-2',\n",
" 'number of qubits': 148,\n",
" 'online date': datetime.datetime(2023, 1, 20, 19, 31, 9, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Rigetti Aspen-M-3.',\n",
" 'name': 'Aspen-M-3',\n",
" 'number of qubits': 148,\n",
" 'online date': datetime.datetime(2023, 6, 8, 17, 35, 32, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: IonQ Harmony.',\n",
" 'name': 'Harmony',\n",
" 'number of qubits': 11,\n",
" 'online date': datetime.datetime(2022, 4, 13, 18, 51, 48, 328000, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='x', num_qubits=1, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2023, 6, 8, 11, 0, 4, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='x', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='y', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='z', num_qubits=1, num_clbits=0, params=[]),\n",
" Instruction(name='rx', num_qubits=1, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='ry', num_qubits=1, num_clbits=0, params=[Parameter(theta)])]}\n",
" Instruction(name='rx', num_qubits=1, num_clbits=0, params=[Parameter(theta)])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Oxford Lucy.',\n",
" 'name': 'Lucy',\n",
" 'number of qubits': 8,\n",
" 'online date': datetime.datetime(2022, 4, 18, 17, 0, 8, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2023, 6, 8, 17, 0, 8, tzinfo=datetime.timezone.utc),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='cy', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Amazon Braket SV1.',\n",
" 'name': 'SV1',\n",
" 'number of qubits': 34,\n",
" 'online date': datetime.datetime(2022, 1, 28, 17, 18, 44, 525122),\n",
" 'operations': [Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2022, 6, 22, 10, 18),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='cy', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Amazon Braket TN1.',\n",
" 'name': 'TN1',\n",
" 'number of qubits': 50,\n",
" 'online date': datetime.datetime(2022, 1, 28, 17, 19, 33, 143757),\n",
" 'operations': [Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2022, 6, 22, 10, 18),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='cy', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[])]}\n",
"{'backend version': 2,\n",
" 'description': 'AWS Device: Amazon Braket dm1.',\n",
" 'name': 'dm1',\n",
" 'number of qubits': 17,\n",
" 'online date': datetime.datetime(2022, 3, 1, 22, 53, 1, 476669),\n",
" 'operations': [Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" 'online date': datetime.datetime(2022, 6, 22, 10, 18),\n",
" 'operations': [Instruction(name='measure', num_qubits=1, num_clbits=1, params=[]),\n",
" Instruction(name='cx', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cp', num_qubits=2, num_clbits=0, params=[Parameter(theta)]),\n",
" Instruction(name='cy', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[]),\n",
" Instruction(name='h', num_qubits=1, num_clbits=0, params=[])]}\n"
" Instruction(name='cz', num_qubits=2, num_clbits=0, params=[])]}\n"
]
}
],
Expand Down Expand Up @@ -209,7 +242,7 @@
},
{
"cell_type": "code",
"execution_count": 42,
"execution_count": 5,
"id": "c1e408c4",
"metadata": {},
"outputs": [
Expand All @@ -219,7 +252,7 @@
"BraketBackend[SV1]"
]
},
"execution_count": 42,
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -232,30 +265,30 @@
},
{
"cell_type": "code",
"execution_count": 45,
"execution_count": 6,
"id": "97112d3e",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"BraketBackend[IonQ Device]"
"BraketBackend[Harmony]"
]
},
"execution_count": 45,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# IonQ device\n",
"ionq_backend = provider.get_backend(\"IonQ Device\")\n",
"ionq_backend = provider.get_backend(\"Harmony\")\n",
"ionq_backend"
]
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 7,
"id": "32545fd3",
"metadata": {},
"outputs": [
Expand All @@ -265,7 +298,7 @@
"BraketBackend[Aspen-11]"
]
},
"execution_count": 46,
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -278,7 +311,7 @@
},
{
"cell_type": "code",
"execution_count": 47,
"execution_count": 8,
"id": "9c99034e",
"metadata": {},
"outputs": [
Expand All @@ -288,7 +321,7 @@
"BraketBackend[Lucy]"
]
},
"execution_count": 47,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -311,7 +344,7 @@
},
{
"cell_type": "code",
"execution_count": 51,
"execution_count": 9,
"id": "f29a72eb",
"metadata": {},
"outputs": [
Expand All @@ -321,7 +354,7 @@
"[BraketBackend[SV1], BraketBackend[TN1], BraketBackend[dm1]]"
]
},
"execution_count": 51,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -330,14 +363,6 @@
"online_simulators_backends = provider.backends(statuses=[\"ONLINE\"], types=[\"SIMULATOR\"])\n",
"online_simulators_backends"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "648a6638",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -356,7 +381,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
"version": "3.9.6"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 2434a9a

Please sign in to comment.