Analog Hamiltonian Simulation (AHS) is a quantum computing paradigm fundamentally different from the gate-based circuit model, and this Amazon Braket notebook is its introduction. Instead of decomposing a computation into discrete quantum gates, AHS programs a well-controlled quantum system by continuously tuning its Hamiltonian parameters over time so that its natural dynamics directly mimic those of another quantum system one wants to study. The notebook explains the AHS model as realized on neutral-atom hardware, where individual atoms are trapped and arranged in space, and a time-dependent driving field plus the strong interactions between atoms excited to high-energy Rydberg states implement the simulated Hamiltonian. It introduces the key ingredients of a Braket AHS program: defining the register of atom positions, specifying the time-dependent drive (amplitude, detuning, and phase), and reading out the final atomic states. The example runs an AHS program on Braket's local neutral-atom simulator, showing how to set up, submit, and interpret an analog program. It is the essential starting point for the analog-simulation examples that follow, opening up a paradigm well suited to studying quantum magnetism, optimization, and many-body physics.
# --- Setup cell added by QCR (not part of the original tutorial) ---# Source: amazon-braket/amazon-braket-examples @ 0c0818f315479aab9deebed7e7ed7533ac581923, Apache License 2.0.# Installs the example's dependencies. If a later cell still reports a missing# package, restart the runtime/kernel and run again from the top.
%pip install -q amazon-braket-sdk==1.117.3
Introduction of analog Hamiltonian simulation
Analog Hamiltonian Simulation (AHS) is 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.
In the gate-based quantum computation, the program is a quantum circuit consisting of a series of quantum gates, each of which acts only a small subset of qubits. In contrast, an AHS program is a sequence of time-dependent Hamiltonians that govern the quantum dynamics of all qubits. The comparison can be seen in the following figure, where the left side shows a typical quantum circuit, and the right side illustrates that, during AHS, the effect of the evolution under a Hamiltonian can be understood as a unitary acting simultaneously on all qubits.
Digital quantum circuit
Analog Hamiltonian Simulation
("Digital quantum circuit" and "Analog Hamiltonian Simulation" figures by QuEra Computing Inc. are licensed under CC BY 4.0)
In this notebook, we focus on running Analog Hamiltonian Simulations with Rydberg atoms. Also, we will use matplotlib package and ahs_utils.py module in the current working directory for visualization purposes.
AHS with Rydberg atoms
An Analog Hamiltonian Simulation program is fully specified by its quantum register and (time-dependent) Hamiltonian.
In [1]:
from braket.ahs.analog_hamiltonian_simulation import AnalogHamiltonianSimulation
from braket.ahs.atom_arrangement import AtomArrangement
from braket.ahs.hamiltonian import Hamiltonian
register = AtomArrangement()
H = Hamiltonian()
ahs_program = AnalogHamiltonianSimulation(hamiltonian=H, register=register)
In order to run AHS program with Rydberg atoms, we will first have to understand what type of Hamiltonian can Rydberg atoms simulate.
Introduction to Rydberg Hamiltonian
Depending on the atomic states we use for the Rydberg system, its Hamiltonian could take different forms. Here we shall focus on the following type of Hamiltonian
where index the atoms (qubits) in the program register. We describe the nature and effect of each term in the Hamiltonian in the following sections, using a triangular array as an example.
Register
First, we need to define a quantum register, 2-dimensional layout of neutral atoms, on which this Hamiltonian will act.
In [2]:
import numpy as np
# e.g. three atoms in an equilateral triangle, with pairwise# separation equal to 5.5 micrometers
a = 5.5e-6# meters
register.add([0, 0])
register.add([a, 0.0])
register.add([0.5 * a, np.sqrt(3) / 2 * a]);
The atom arrangement can be visualized in the following way
In [3]:
from ahs_utils import show_register
show_register(register)
Driving field
The first term of the Hamiltonian represents the effect of a driving field that addresses the atoms simultaneously and uniformly
where , , and to denote the amplitude (Rabi frequency), laser phase, and the detuning of the driving laser field. Here is the number operator of atom ; the kets and denote the ground and Rydberg states, respectively. The part of the driving term is identical to a uniform (time-dependent) transverse magnetic field, whereas the part implements the effect of a longitudinal magnetic field, in a spin-model representation.
For the purpose of this example, we choose a constant Rabi frequency equal to rad/s, with the phase and global detuning set to zero. The duration of the program is set to , which will be explained in the next section.
In [4]:
from braket.ahs.driving_field import DrivingField
from braket.timings.time_series import TimeSeries
# e.g. trapzoid amplitude time series
Omega_max = 2.5e6# rad / seconds# e.g. the duration of the program
t_max = np.pi / (np.sqrt(2) * Omega_max) # seconds# e.g. constant Rabi frequency
Omega = TimeSeries()
Omega.put(0.0, Omega_max)
Omega.put(t_max, Omega_max)
# e.g. all-zero phase and detuning
phi = TimeSeries().put(0.0, 0.0).put(t_max, 0.0) # (time [s], value [rad])
Delta_global = TimeSeries().put(0.0, 0.0).put(t_max, 0.0) # (time [s], value [rad/s])
drive = DrivingField(amplitude=Omega, phase=phi, detuning=Delta_global)
H += drive
Local detuning field
The second term in represents the effect of a local detuning that detunes atoms according to a non-uniform pattern.
where is the time-dependent magnitude of the frequency shift, and is the atom-dependent pattern, which is a dimensionless number between 0 and 1. This local detuning is identical to a non-uniform (and time-dependent) longitudinal magnetic field in a spin-model representation.
For the purpose of this example, we choose a local detuning that strongly detunes the top atom in the triangular lattice.
In [5]:
from braket.ahs.field import Field
from braket.ahs.local_detuning import LocalDetuning
from braket.ahs.pattern import Pattern
# e.g. constant strong local detuning
Delta_local = TimeSeries()
Delta_local.put(0.0, -Omega_max * 20) # (time [s], value [rad/s])
Delta_local.put(t_max, -Omega_max * 20)
# e.g. the local detuning only acts on the third atom,# which is the top atom in the triangular array.
h = Pattern([0, 0, 0.5])
local_detuning = LocalDetuning(magnitude=Field(time_series=Delta_local, pattern=h))
H += local_detuning
The driving field and the local detuning can be inspected with the following utility function
In [6]:
from ahs_utils import show_drive_and_local_detuning
show_drive_and_local_detuning(drive, local_detuning)
Rydberg-Rydberg interaction
Finally, the third term in is the van der Waals interaction between all pairs of Rydberg atoms,
where is a fixed interaction coefficient, and is the distance between atoms and . This interaction shifts the frequency of the Rydberg level of all atoms that are close to an atom that is already in its Rydberg state. While the overall coefficient, is a fixed value (determined by the nature of the ground and Rydberg states), the strength of this interaction can be tuned by adjusting the pairwise distance between atoms.
In [7]:
# Note:# The van der Waals interaction term is implicitly assumed in the current version of the AHS module,# its strength (C6 / R_{j,k}^6) is calculated (if using the local simulator) from the atomic positions# of the register, hence there is no need to specify it explicitly.
Introduction to Rydberg blockade
For the interaction coefficient, the value of depends on the atom species, and the states used in the simulation. Here we shall take the value
for of the Rb atoms. For the typical scenario, where atoms are separated by meters, the van der Waals interaction strength is , which is much larger than the typical scale of the Rabi frequency (around ). As a result, when the separation of two atoms is within certain distance, it is nearly impossible to drive them to the Rydberg state simultaneously.
This is called the Rydberg blockade phenomena, illustrated in the figure below (Source: Browaeys and Lahaye), where is the separation between the atoms, and indicates the energies or frequencies of the different two-atom states as changes. The vertical arrows indicate the effect of a uniform driving field (with Rabi frequency ) that successfully transitions the atoms from the ground state to the 1-atom excited state (independent of ), but fails to get from there to the doubly-excited state , if is smaller than , the blockade radius.
Note: In the presence of both global Rabi frequency and detuning, it is more accurate to estimate the blockade radius with , see Pichler, et. al..
Full program
The fully-specified program can be inspected with the following command.
The AHS program defined above realizes the maximally entangled state for a pair of atoms, out of the three atoms in the triangular array. To see that, recall that we have subjected the top atom in the triangular array (labeled as atom 2) with a strong detuning where rad/s. Since is much bigger than any other energy scales in the system, including the Rabi frequency, it is energy unfavorable for atom 2 to be excited to the Rydberg state (note the minus sign in ). Hence atom 2 remains in the ground state throughout the evolution, and can be neglected in the following analysis.
Since the other two atoms are subjected with only the driving field with zero detuning and phase, the constant Hamiltonian reads
where are the indices for the two lower atoms in the triangular array. More concretely, in the basis of , the Hamiltonian takes the following matrix representation
Since the two atoms are separated by meters, the interaction strength between them reads
which is much greater than the Rabi frequency. Hence the two atoms are in the Rydberg blockade regime, and the state is very unlikely to be excited (assuming the initial state is ). Hence we can neglect the state, and the Hamiltonian is simplified to be
and the final state of the evolution can be solved to be
Hence if the system evolves for a duration , which is indeed the duration of the AHS program defined in the previous section, we will arrive at a maximally entangled state between the two atoms
Before submitting the AHS program to a QPU, it is useful to run the program on the local simulator to check if the simulation result meets one's expectation.
In [9]:
from braket.devices import LocalSimulator
device = LocalSimulator("braket_ahs")
We can run the AHS program just like running a quantum circuit on other Braket devices. Below we have explicitly specified the values of steps and shots, which are the number of time steps in the simulation and the number of sampling for the final stats, respectively. One could increase the accuracy of the result by increasing the values of these arguments, at the expense of longer runtime.
In [10]:
result = device.run(ahs_program, shots=1000, steps=100).result()
To confirm that we indeed arrive at a maximally entangled state, we first collect the measurement results, followed by counting the number of occurrence of and respectively.
In [11]:
defget_counters_from_result(result):
post_sequences = [list(measurement.post_sequence) for measurement in result.measurements]
post_sequences = [
"".join(["r"if site == 0else"g"for site in post_sequence])
for post_sequence in post_sequences
]
counters = {}
for post_sequence in post_sequences:
if post_sequence in counters:
counters[post_sequence] += 1else:
counters[post_sequence] = 1return counters
get_counters_from_result(result)
{'ggr': 1, 'grg': 484, 'rgg': 515}
The simulation outcome indeed confirms our expectations
It is very unlikely to excite the 3rd atom to the Rydberg state because of the strong local detuning.
Due to the Rydberg blockade, it is very unlikely to excite the 1st and 2nd atoms to the Rydberg states simultaneously.
By appropriately tuning the Rabi frequency and the duration of the AHS program, we can arrive at a maximally entangled state for the 1st and 2nd atoms. Since our simulation is noiseless, the discrepancy from ideal 50%-50% split is attributed to statistical sampling (aka "shot noise").
In summary, in this notebook, we have introduced Analog Hamiltonian Simulation (AHS), a different quantum computing paradigm, and showed how to run an AHS program with Rydberg atoms using Braket's local AHS simulator.
In [ ]:
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!