Skip to content

Commit 8266cf4

Browse files
Merge pull request #72 from qmanning4/main
[Unitary Hack][quera] Z2 phase prep explanation and Rydberg density heat map plot
2 parents b89145c + be79d9a commit 8266cf4

File tree

1 file changed

+78
-8
lines changed

1 file changed

+78
-8
lines changed

docs/examples/example-3-time-sweep.py

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,55 @@
6262
# actually have their parameters swept.
6363

6464
# %%
65-
6665
# Define relevant parameters for the lattice geometry and pulse schedule
6766
n_atoms = 11
6867
lattice_spacing = 6.1
6968
min_time_step = 0.05
7069

71-
# Define Rabi amplitude and detuning values.
72-
# Note the addition of a "sweep_time" variable
73-
# for performing sweeps of time values.
70+
# %% [markdown]
71+
# We choose a maximum Rabi amplitude of 15.8 MHz.
72+
# Pushing the Rabi amplitude as high as we can minimizes the protocol duration,
73+
# but maintains the same pulse area, $\Omega t$. For this reason, in many cases,
74+
# maximizing the Rabi frequency is considered good practice for minimizing decoherence effects.
75+
76+
# %%
7477
rabi_amplitude_values = [0.0, 15.8, 15.8, 0.0]
78+
79+
# %% [markdown]
80+
# The lattice spacing and Rabi amplitudes give us a nearest neighbor interaction strength:
81+
# $$V_{{i},{i+1}} = \frac{C_6}{a^6} \approx 105.21 \, \text{MHz} \gg \Omega = 15.8 \, \text{MHz}$$
82+
# where $C_6 = 2\pi \times 862690 \, \text{MHz} \, \mu \text{m}^6$ is our van der Waals coefficient
83+
# for Aquila hardware and $a$ is the lattice spacing we defined earlier.
84+
# Our interaction strength for next-nearest neighbors is quite low comparatively:
85+
# $$V_{{i},{i+2}} = \frac{C_6}{(2a)^6} \approx 1.64 \, \text{MHz} \ll \Omega = 15.8 \, \text{MHz}$$
86+
# The Rydberg interaction term dominates for nearest neighbor spacing, while the Rabi coupling dominates
87+
# for next-nearest neighbors.
88+
# This increases the probability of realizing a Rydberg blockade for nearest neighbors,
89+
# but decreases the probability of Rydberg interaction between next-nearest neighbors.
90+
# So far, we're in a good position for creating a Z2 phase.
91+
92+
# Next, we define our detuning values.
93+
94+
# %%
7595
rabi_detuning_values = [-16.33, -16.33, 16.33, 16.33]
96+
97+
# %% [markdown]
98+
# We start at large negative detuning values where all atoms are in the ground state.
99+
# Then, we transition to large positive detuning values where the Rydberg state
100+
# becomes energetically favorable and inter-atomic interactions become more important.
101+
102+
# The maximum absolute detuning value of $16.33 \, \text{MHz}$ gives us a Rydberg blockade radius
103+
# $$R_b = \Bigl(\frac{C_6}{\sqrt{\Delta^2+\Omega^2}}\Bigr)^{1/6} \approx 7.88 \mu \text{m}$$
104+
# Typically, we define the lattice spacing such that $a < R_b < 2a$ for a good blockade approximation
105+
# and Z2 state probability.
106+
107+
# Lastly, we define a set of test durations over which to execute our pulses
108+
# and write the instructions for our program.
109+
110+
# %%
76111
durations = [0.8, "sweep_time", 0.8]
112+
# Note the addition of a "sweep_time" variable
113+
# for performing sweeps of time values.
77114

78115
time_sweep_z2_prog = (
79116
Chain(n_atoms, lattice_spacing=lattice_spacing)
@@ -117,7 +154,6 @@
117154
# </div>
118155

119156
# %%
120-
121157
emu_filename = os.path.join(os.path.abspath(""), "data", "time-sweep-emulation.json")
122158
if not os.path.isfile(emu_filename):
123159
emu_future = time_sweep_z2_job.bloqade.python().run(shots=10000)
@@ -135,8 +171,6 @@
135171
# parameter sweep. The counts are obtained from the `report`of the batch object.
136172

137173
# %%
138-
139-
140174
def get_z2_probabilities(report):
141175
z2_probabilities = []
142176

@@ -184,8 +218,44 @@ def get_z2_probabilities(report):
184218
plt.legend()
185219
plt.show()
186220

221+
# %% [markdown]
222+
223+
# We can also plot the emulated Z2 ordered phase for a specific sweep time.
224+
# Here, we extract data for a sweep time of $0.67\mu s$ or a total pulse duration of $2.27\mu s$.
225+
226+
# %%
227+
densities = emu_report.rydberg_densities()
228+
site_indices = densities.loc[0].index.values
229+
rydberg_densities_67_sweep = densities.loc[5,0:10].values
230+
231+
plt.bar(site_indices, rydberg_densities_67_sweep, color="#C8447C")
232+
plt.xticks(site_indices)
233+
plt.title("Z2 Phase Rydberg Densities for 2.27$\mu$s Total Pulse Duration")
234+
plt.xlabel("Atom Site Index")
235+
plt.ylabel("Rydberg Density")
236+
237+
plt.show()
238+
239+
# %% [markdown]
240+
241+
# Similarly, we can visualize the emulated Rydberg densities of each site index as
242+
# the sweep time increases and we approach adiabatic evolution.
243+
244+
# %%
245+
rydberg_densities = densities.values.transpose()
246+
247+
im = plt.imshow(rydberg_densities)
248+
plt.xticks(rotation=90)
249+
plt.xticks([x for x in range(len(emu_sweep_times))], [round(dur,2) for dur in emu_sweep_times])
250+
plt.yticks(site_indices)
251+
plt.xlabel("Sweep Time ($\mu$s)")
252+
plt.ylabel("Atom Site Index")
253+
plt.colorbar(im, shrink=0.6)
254+
255+
plt.show()
256+
187257
# %% [markdown]
188258
## Analysis
189259
# As expected, we see that if we allow the pulse schedule to run for a longer
190260
# and longer period of time (more "adiabatically") we have an increasing
191-
# probability of creating the Z2 phase.
261+
# probability of creating the Z2 phase.

0 commit comments

Comments
 (0)