Skip to content

Commit

Permalink
implemented requested changes and more
Browse files Browse the repository at this point in the history
  • Loading branch information
peterkomar-aws committed Sep 27, 2024
1 parent ed872de commit 631d8d7
Show file tree
Hide file tree
Showing 20 changed files with 250 additions and 183 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,11 @@ This folder contains examples that illustrate the use of Amazon Braket Hybrid Jo

## <a name="ahs">Analog Hamiltonian Simulation</a>

- [**Instruction to Analog Hamiltonian Simulation**](examples/analog_hamiltonian_simulation/00_Introduction_of_Analog_Hamiltonian_Simulation_with_Rydberg_Atoms.ipynb)
- [**Introduction to Analog Hamiltonian Simulation**](examples/analog_hamiltonian_simulation/00_Introduction_of_Analog_Hamiltonian_Simulation_with_Rydberg_Atoms.ipynb)

This tutorial provides an introduction to Analog Hamiltonian Simulation (AHS), a quantum computing paradigm different from gate-based computing. AHS uses a well-controlled quantum system and tunes its parameters to mimic the dynamics of another quantum system, the one we aim to study.

- [**Instruction to Aquila**](examples/analog_hamiltonian_simulation/01_Introduction_to_Aquila.ipynb)
- [**Introduction to Aquila**](examples/analog_hamiltonian_simulation/01_Introduction_to_Aquila.ipynb)

This tutorial illustrates how to run an AHS program on QuEra’s Aquila, a Rydberg based QPU, via Amazon Braket.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"\n",
"When you submit a circuit for execution on a QPU, Amazon Braket performs a series of compilation steps: it maps the _abstract qubits_ in your circuit to _physical qubits_ in the device; it synthesizes gates into the native gate set of the device; it optimizes the circuit to reduce the number of gates; and finally, it translates the gates into executable pulses.\n",
"\n",
"This section shows how the first step, called qubit allocation, works for the Rigetti Ankaa 2 device."
"This section shows how the first step, called qubit allocation, works for the Rigetti Ankaa-2 device."
]
},
{
Expand Down Expand Up @@ -57,7 +57,7 @@
"\n",
"The example that follows shows how to create a GHZ state on qubits that are not physically connected. After the quantum task is completed, you can obtain a list of the actual gates executed on the device, by viewing the result metadata.\n",
"\n",
"First, instantiate the Rigetti Ankaa 2 device and retrieve its connectivity graph, which shows the qubits that are directly connected on the chip."
"First, instantiate the Rigetti Ankaa-2 device and retrieve its connectivity graph, which shows the qubits that are directly connected on the chip."
]
},
{
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
" \n",
" aws braket create-quantum-task \\\n",
" --region \"us-west-1\" \\\n",
" --device-arn \"arn:aws:braket:us-west-1::device/qpu/rigetti/Ankaa 2\" \\\n",
" --device-arn \"arn:aws:braket:us-west-1::device/qpu/rigetti/Ankaa-2\" \\\n",
" --shots 100 \\\n",
" --action '{\n",
" \"braketSchemaHeader\": {\n",
Expand Down Expand Up @@ -1126,7 +1126,7 @@
"id": "3f01e6dc44e0e226",
"metadata": {},
"source": [
"We can run the above program on the Rigetti Ankaa 2 device,"
"We can run the above program on the Rigetti Ankaa-2 device,"
]
},
{
Expand Down Expand Up @@ -1171,7 +1171,7 @@
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\">\n",
" <b>Note:</b> This section and the next verbatim box section uses the Rigetti Ankaa 2 device. When you run this notebook, make sure the device is currently available. You can find QPU availability windows on the <a href=\"https://us-west-1.console.aws.amazon.com/braket/home?region=us-west-1#/devices\">Devices page</a> in the Amazon Braket Console\n",
" <b>Note:</b> This section and the next verbatim box section uses the Rigetti Ankaa-2 device. When you run this notebook, make sure the device is currently available. You can find QPU availability windows on the <a href=\"https://us-west-1.console.aws.amazon.com/braket/home?region=us-west-1#/devices\">Devices page</a> in the Amazon Braket Console\n",
"</div>"
]
},
Expand Down
36 changes: 20 additions & 16 deletions examples/braket_features/Noise_models/Noise_models_on_Rigetti.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"source": [
"# Noise models on Rigetti\n",
"\n",
"This notebook shows how to construct a noise model from device calibration data for Rigetti Ankaa 2. We compare the measurement outcomes of circuits run on a noisy simulator with the same circuits run on quantum processing units (QPUs), to show that simulating circuits with noise models more closely mimics QPUs.\n",
"This notebook shows how to construct a noise model from device calibration data for Rigetti Ankaa-2. We compare the measurement outcomes of circuits run on a noisy simulator with the same circuits run on quantum processing units (QPUs), to show that simulating circuits with noise models more closely mimics QPUs.\n",
"\n",
"**Before you begin**: We recommend being familiar with [Noise models on Amazon Braket.](https://github.com/amazon-braket/amazon-braket-examples/blob/main/examples/braket_features/Noise_models/Noise_models_on_Amazon_Braket.ipynb)\n",
"Additionally, users should be familiar with [Running quantum circuits on QPU devices](https://github.com/amazon-braket/amazon-braket-examples/blob/main/examples/getting_started/2_Running_quantum_circuits_on_QPU_devices/2_Running_quantum_circuits_on_QPU_devices.ipynb). \n",
Expand Down Expand Up @@ -45,7 +45,7 @@
"This can be used to construct noise models to approximate the behavior of the QPU when running circuits on a noisy simulator.\n",
"In this tutorial, we focus on local noise models with no crosstalk interactions. Real devices can have crosstalk and unexpected effects that can further degrade the results.\n",
"\n",
"The Ankaa 2 calibration data is available on the Braket devices page. Under qubit specs, the calibration data include the qubit index, with corresponding values for the $T_1$, $T_2$, fidelity from randomized benchmarking (fRB), fidelity from simultaneous randomized benchmarking (fsRB), readout fidelity (fRO), and active reset fidelity.\n",
"The Ankaa-2 calibration data is available on the Braket devices page. Under qubit specs, the calibration data include the qubit index, with corresponding values for the $T_1$, $T_2$, fidelity from randomized benchmarking (fRB), fidelity from simultaneous randomized benchmarking (fsRB), and readout fidelity (fRO).\n",
"Under \"edge specs\", the data includes the RB fidelity for two qubit gates for each connected edge in the device topology."
]
},
Expand All @@ -55,19 +55,19 @@
"metadata": {},
"source": [
"**One-qubit calibration data (Qubit specs)**\n",
"<div align=center><img src=\"Ankaam_qubit_specs.png\"/></div>\n",
"<div align=center><img src=\"ankaa2_qubit_specs.png\"/></div>\n",
"\n",
"\n",
"**Two-qubit calibration data (Edge specs)**\n",
"<div align=center><img src=\"Ankaam_edge_specs.png\"/></div>"
"<div align=center><img src=\"ankaa2_edge_specs.png\"/></div>"
]
},
{
"cell_type": "markdown",
"id": "276d680f-887d-4929-bcaa-e276a6303496",
"metadata": {},
"source": [
"We can programmatically access all the calibration data with the Braket SDK. First we load the AwsDevice using the ARN for Rigetti Ankaa 2."
"We can programmatically access all the calibration data with the Braket SDK. First we load the AwsDevice using the ARN for Rigetti Ankaa-2."
]
},
{
Expand Down Expand Up @@ -104,7 +104,7 @@
"id": "661cca17-01fa-40be-bd3e-741bacc74ce4",
"metadata": {},
"source": [
"For Ankaa 2,We can get all qubit indices with `one_qubit_data.keys()` or with `rigetti.topology_graph.nodes`.\n",
"For Ankaa-2,We can get all qubit indices with `one_qubit_data.keys()` or with `rigetti.topology_graph.nodes`.\n",
"\n",
"The keys of the two qubit dictionary are the connected qubit pairs separated by a hyphen. \n",
"For example, if qubit 0 and 1 are connected the key is \"0-1\".\n",
Expand Down Expand Up @@ -151,8 +151,6 @@
"\n",
"- **Fidelity (sRB)**: Single-qubit simultaneous randomized benchmarking fidelities. These are extracted by running single-qubit RB on all qubits simultaneously. Note that we expect the sRB fidelity to be lower than standard RB fidelity due to non-local crosstalk type noise on the device. \n",
"\n",
"- **Active reset fidelity**: Single-qubit active reset fidelities represents the accuracy to which qubits are reinitalized into the ground state |0⟩.\n",
"\n",
"- **Readout fidelity**: Single-qubit readout fidelities describes the probability of a bit flip error before readout in the computational basis. The readout fidelity is related to the probability of correctly measuring the ground state and excited states respectively, e.g. $f_{RO} =\\frac{p(0|0)+p(1|1)}{2}$"
]
},
Expand Down Expand Up @@ -228,7 +226,7 @@
"#### Two-qubit noise \n",
"Next we consider adding two-qubit noise to the model. \n",
"\n",
"Let's first look at the data provided in the Ankaa 2 device calibration data. On the first connect, \"0-1\", the properties are:"
"Let's first look at the data provided in the Ankaa-2 device calibration data. On the first connect, \"0-1\", the properties are:"
]
},
{
Expand Down Expand Up @@ -259,7 +257,7 @@
"source": [
"Here, we see the fidelity per gate (ISWAP or CZ) and the associated standard error. \n",
"\n",
"Next we loop over the entries in the `two_qubit_data` dictionary and add two-qubit depolarizing noise to the model. Notice that Ankaa 2 has symmetric connections (\"0-1\" and \"1-0\") so we need to add noise in both directions."
"Next we loop over the entries in the `two_qubit_data` dictionary and add two-qubit depolarizing noise to the model. Notice that Ankaa-2 has symmetric connections (\"0-1\" and \"1-0\") so we need to add noise in both directions."
]
},
{
Expand Down Expand Up @@ -409,7 +407,7 @@
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\">\n",
"<b>Note:</b> The below section runs tasks on the Rigetti Ankaa 2 device. When you run this notebook, make sure the device is currently available. You can find QPU availability windows on the <a href=\"https://us-west-1.console.aws.amazon.com/braket/home?region=us-west-1#/devices\">Devices page</a> in the Amazon Braket Console.\n",
"<b>Note:</b> The below section runs tasks on the Rigetti Ankaa-2 device. When you run this notebook, make sure the device is currently available. You can find QPU availability windows on the <a href=\"https://us-west-1.console.aws.amazon.com/braket/home?region=us-west-1#/devices\">Devices page</a> in the Amazon Braket Console.\n",
"</div>\n",
"\n",
"<div class=\"alert alert-block alert-info\">\n",
Expand Down Expand Up @@ -538,10 +536,10 @@
"noisy_sim = pd.DataFrame.from_dict(noisy_probs, orient=\"index\").rename(\n",
" columns={0: \"noisy_sim\"}\n",
")\n",
"Ankaam = pd.DataFrame.from_dict(rigetti_probs, orient=\"index\").rename(\n",
"Ankaa = pd.DataFrame.from_dict(rigetti_probs, orient=\"index\").rename(\n",
" columns={0: \"Ankaa-2\"}\n",
")\n",
"df = Ankaam.join(noisy_sim).join(free_sim)\n",
"df = Ankaa.join(noisy_sim).join(free_sim)\n",
"df"
]
},
Expand Down Expand Up @@ -627,7 +625,7 @@
"id": "aa8ffab8-e062-4c33-9c9d-4a312cd76b63",
"metadata": {},
"source": [
"We confirm that the simulator with a noise model is closer to the distribution produced by Ankaa 2."
"We confirm that the simulator with a noise model is closer to the distribution produced by Ankaa-2."
]
},
{
Expand All @@ -637,7 +635,7 @@
"source": [
"### Smaller, reduced noise models\n",
"\n",
"The full Rigetti Ankaa 2 noise model contains due to non-uniform qubit noise. We can obtain simpler, smaller noise models by coarse graining the model above.\n",
"The full Rigetti Ankaa-2 noise model contains due to non-uniform qubit noise. We can obtain simpler, smaller noise models by coarse graining the model above.\n",
"\n",
"Here, we consider taking the average over all qubits for the $T_1$, $T_2$, depolarizing, and readout depolarizing rates. This is a substantially smaller noise model, but may be less accurate. \n",
"\n",
Expand Down Expand Up @@ -952,9 +950,15 @@
"source": [
"## Summary\n",
"\n",
"In this notebook, we showed how to construct a noise model for Rigetti Ankaa 2 based only on the available calibration data.\n",
"In this notebook, we showed how to construct a noise model for Rigetti Ankaa-2 based only on the available calibration data.\n",
"We used a coarse assumption of gate-independent single-qubit depolarizing noise and gate-dependant two-qubit noise. Our qubit-dependent model could be improved in many ways. We could add gate-dependence noise, or change the depolarizing channel to Pauli channels. "
]
},
{
"cell_type": "markdown",
"id": "98989c13",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
13 changes: 2 additions & 11 deletions examples/braket_features/Verbatim_Compilation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,6 @@
"If we create a circuit with gates that are not part of that list, the gates will automatically be decomposed into a gate set that can be executed on the device."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"<div class=\"alert alert-block alert-info\">\n",
" <b>Note:</b> This notebook uses the Rigetti Ankaa-2 device. When you run this notebook, make sure the device is currently available. You can find QPU availability windows on the <a href=\"https://us-west-1.console.aws.amazon.com/braket/home?region=us-west-1#/devices\">Devices page</a> in the Amazon Braket Console\n",
"</div>"
]
},
{
"cell_type": "code",
"execution_count": 4,
Expand Down Expand Up @@ -363,7 +354,7 @@
"metadata": {},
"source": [
"As we have mentioned above, to build circuits with multi-qubit gates, you need to take into consideration the connectivity graph of the device. When a circuit contains a verbatim box, automatic qubit rewiring has to be disables, and you have manually allocate the qubits on the device that you want to use for your circuit.\n",
"You can access the connectivity graph on the [device detail page](https://console.aws.amazon.com/braket/home?region=us-west-1#/devices/arn:aws:braket:us-west-2::device/qpu/rigetti/Ankaa 2) in the Amazon Braket Console, or by using the code below."
"You can access the connectivity graph on the [device detail page](https://console.aws.amazon.com/braket/home?region=us-west-1#/devices/arn:aws:braket:us-west-1::device/qpu/rigetti/Ankaa-2) in the Amazon Braket Console, or by using the code below."
]
},
{
Expand Down Expand Up @@ -944,7 +935,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.10"
},
"vscode": {
"interpreter": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,9 @@
"queue depth with `AwsDevice(device_arn).queue_depth().jobs`. We can also check if the device is\n",
"currently available with `AwsDevice(device_arn).is_available()`.\n",
"\n",
"You can check the queue depth on the devices page of the [Amazon Braket Console](https://console.aws.amazon.com/braket/home). Below, we show the devices page for Rigetti Ankaa 2.\n",
"You can check the queue depth on the devices page of the [Amazon Braket Console](https://console.aws.amazon.com/braket/home). Below, we show the devices page for Rigetti Ankaa-2.\n",
"\n",
"![Rigetti Ankaa 2 showing the queue depths.](console_figures/queue_viz.png)\n"
"![Rigetti Ankaa-2 showing the queue depths.](console_figures/queue_viz.png)\n"
]
},
{
Expand Down Expand Up @@ -641,4 +641,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 631d8d7

Please sign in to comment.