2024-05-17 15:00:44 -04:00
|
|
|
from rabifun.system import *
|
|
|
|
from rabifun.plots import *
|
|
|
|
from rabifun.utilities import *
|
2024-05-17 20:14:25 -04:00
|
|
|
from plot_utils import wrap_plot
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
# %% interactive
|
2024-05-13 15:22:16 -04:00
|
|
|
|
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
def transient_rabi():
|
|
|
|
"""A transient rabi oscillation without noise."""
|
2024-05-17 15:00:44 -04:00
|
|
|
|
2024-05-24 17:32:14 -04:00
|
|
|
params = Params(
|
|
|
|
η=0.7,
|
2024-05-24 21:26:28 -04:00
|
|
|
Ω=13,
|
|
|
|
δ=1 / 4,
|
2024-05-27 14:21:59 -04:00
|
|
|
g_0=0.02,
|
2024-05-24 21:26:28 -04:00
|
|
|
laser_detuning=0,
|
2024-05-27 14:21:59 -04:00
|
|
|
ω_c=0,
|
2024-05-24 17:32:14 -04:00
|
|
|
N=3,
|
|
|
|
measurement_detuning=1,
|
|
|
|
rwa=False,
|
|
|
|
)
|
2024-05-24 21:26:28 -04:00
|
|
|
|
|
|
|
params.laser_off_time = params.lifetimes(15)
|
2024-05-24 17:32:14 -04:00
|
|
|
t = time_axis(params, 50, 0.1)
|
2024-05-17 15:00:44 -04:00
|
|
|
solution = solve(t, params)
|
2024-05-24 17:32:14 -04:00
|
|
|
signal = output_signal(t, solution.y, params)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-24 17:32:14 -04:00
|
|
|
f, (_, ax) = plot_simulation_result(
|
2024-05-24 21:26:28 -04:00
|
|
|
make_figure(), t, signal, params, window=(params.lifetimes(15), t[-1])
|
2024-05-24 17:32:14 -04:00
|
|
|
)
|
2024-05-27 14:21:59 -04:00
|
|
|
plot_rabi_sidebands(ax, params)
|
2024-05-17 15:00:44 -04:00
|
|
|
f.suptitle("Transient Rabi oscillation")
|
2024-05-13 15:22:16 -04:00
|
|
|
|
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
def steady_rabi():
|
|
|
|
"""A steady state rabi oscillation without noise."""
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-24 21:26:28 -04:00
|
|
|
params = Params(
|
|
|
|
η=0.7,
|
|
|
|
Ω=13,
|
|
|
|
δ=1 / 4,
|
2024-05-27 14:21:59 -04:00
|
|
|
g_0=0.02,
|
2024-05-24 21:26:28 -04:00
|
|
|
laser_detuning=0,
|
2024-05-27 14:21:59 -04:00
|
|
|
ω_c=0,
|
2024-05-24 21:26:28 -04:00
|
|
|
N=3,
|
|
|
|
measurement_detuning=1,
|
|
|
|
rwa=False,
|
|
|
|
)
|
|
|
|
t = time_axis(params, lifetimes=20, resolution=0.01)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
solution = solve(t, params)
|
2024-05-24 17:32:14 -04:00
|
|
|
signal = output_signal(t, solution.y, params)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
f, (_, ax) = plot_simulation_result(
|
2024-05-17 20:14:25 -04:00
|
|
|
make_figure(), t, signal, params, window=(params.lifetimes(8), t[-1])
|
2024-05-17 15:00:44 -04:00
|
|
|
)
|
2024-05-27 14:21:59 -04:00
|
|
|
plot_rabi_sidebands(ax, params)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
f.suptitle("Steady State Rabi oscillation. No Rabi Sidebands.")
|
2024-05-13 15:22:16 -04:00
|
|
|
|
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
def noisy_transient_rabi():
|
|
|
|
"""A transient rabi oscillation with noise."""
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-24 21:26:28 -04:00
|
|
|
params = Params(
|
|
|
|
η=0.7,
|
|
|
|
Ω=13,
|
|
|
|
δ=1 / 4,
|
2024-05-27 14:21:59 -04:00
|
|
|
g_0=0.02,
|
2024-05-24 21:26:28 -04:00
|
|
|
laser_detuning=0,
|
2024-05-27 14:21:59 -04:00
|
|
|
ω_c=0,
|
2024-05-24 21:26:28 -04:00
|
|
|
N=3,
|
|
|
|
measurement_detuning=1,
|
|
|
|
rwa=False,
|
|
|
|
)
|
|
|
|
|
|
|
|
t = time_axis(params, 20, 0.01)
|
|
|
|
|
|
|
|
params.laser_off_time = params.lifetimes(5)
|
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
solution = solve(t, params)
|
2024-05-24 17:32:14 -04:00
|
|
|
signal = output_signal(t, solution.y, params)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-24 21:26:28 -04:00
|
|
|
noise_strength = 5
|
2024-05-17 15:00:44 -04:00
|
|
|
signal = add_noise(signal, noise_strength)
|
2024-05-17 15:00:44 -04:00
|
|
|
|
2024-05-24 21:26:28 -04:00
|
|
|
f, (_, ax) = plot_simulation_result(
|
|
|
|
make_figure(), t, signal, params, window=(params.laser_off_time, t[-1])
|
|
|
|
)
|
2024-05-27 14:21:59 -04:00
|
|
|
plot_rabi_sidebands(ax, params)
|
2024-05-17 15:00:44 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
f.suptitle(f"Transient Rabi oscillation with noise strength {noise_strength}.")
|
2024-05-17 15:00:44 -04:00
|
|
|
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
def ringdown_after_rabi():
|
|
|
|
"""Demonstrates the nonstationary ringdown of the resonator after turning off the EOM and laser drive."""
|
2024-05-24 21:26:28 -04:00
|
|
|
off_lifetime = 5
|
2024-05-17 15:00:44 -04:00
|
|
|
laser_detuning = 0.1
|
2024-05-24 21:26:28 -04:00
|
|
|
|
|
|
|
params = Params(
|
|
|
|
η=0.7,
|
|
|
|
Ω=13,
|
|
|
|
δ=1 / 4,
|
2024-05-27 14:21:59 -04:00
|
|
|
g_0=0.02,
|
2024-05-24 21:26:28 -04:00
|
|
|
laser_detuning=laser_detuning,
|
2024-05-27 14:21:59 -04:00
|
|
|
ω_c=0,
|
2024-05-24 21:26:28 -04:00
|
|
|
N=3,
|
2024-05-27 14:21:59 -04:00
|
|
|
measurement_detuning=2,
|
2024-05-24 21:26:28 -04:00
|
|
|
rwa=False,
|
|
|
|
)
|
2024-05-17 20:14:25 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
params.laser_off_time = params.lifetimes(off_lifetime)
|
|
|
|
params.drive_off_time = params.lifetimes(off_lifetime)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-24 21:26:28 -04:00
|
|
|
t = time_axis(params, lifetimes=20, resolution=0.01)
|
2024-05-17 15:00:44 -04:00
|
|
|
solution = solve(t, params)
|
2024-05-24 17:32:14 -04:00
|
|
|
signal = output_signal(t, solution.y, params)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
# noise_strength = 0.1
|
|
|
|
# signal = add_noise(signal, noise_strength)
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
f, (_, fftax) = plot_simulation_result(
|
2024-05-17 20:14:25 -04:00
|
|
|
make_figure(), t, signal, params, window=(params.lifetimes(off_lifetime), t[-1])
|
2024-05-13 15:22:16 -04:00
|
|
|
)
|
|
|
|
|
2024-05-17 20:14:25 -04:00
|
|
|
fftax.axvline(params.Ω - params.δ - params.laser_detuning, color="black")
|
2024-05-17 15:00:44 -04:00
|
|
|
fftax.axvline(params.laser_detuning, color="black")
|
2024-05-13 15:22:16 -04:00
|
|
|
|
2024-05-17 15:00:44 -04:00
|
|
|
f.suptitle(f"Ringdown after rabi osci EOM after {off_lifetime} lifetimes.")
|
2024-05-24 17:32:14 -04:00
|
|
|
|
|
|
|
|
|
|
|
def sweep():
|
2024-05-24 21:26:28 -04:00
|
|
|
"""A sweep of the laser over the spectrum."""
|
2024-05-24 17:32:14 -04:00
|
|
|
|
2024-05-24 21:26:28 -04:00
|
|
|
params = Params(
|
|
|
|
η=1,
|
|
|
|
Ω=1,
|
|
|
|
δ=1 / 4,
|
2024-05-27 14:21:59 -04:00
|
|
|
g_0=0.0,
|
2024-05-24 21:26:28 -04:00
|
|
|
laser_detuning=-2,
|
2024-05-27 14:21:59 -04:00
|
|
|
ω_c=0,
|
2024-05-24 21:26:28 -04:00
|
|
|
N=3,
|
|
|
|
measurement_detuning=0,
|
|
|
|
rwa=False,
|
|
|
|
)
|
|
|
|
t = time_axis(params, params.lifetimes(2000), 0.1)
|
|
|
|
params.dynamic_detunting = (2 * params.δ + params.N) * params.Ω, t[-1]
|
2024-05-24 17:32:14 -04:00
|
|
|
solution = solve(t, params)
|
|
|
|
signal = output_signal(t, solution.y, params)
|
|
|
|
|
|
|
|
f, (_, ax) = plot_simulation_result(make_figure(), t, signal, params)
|
2024-05-27 14:21:59 -04:00
|
|
|
plot_rabi_sidebands(ax, params)
|
2024-05-24 17:32:14 -04:00
|
|
|
# ax.set_xlim(0.73, 0.77)
|
|
|
|
f.suptitle("Transient Rabi oscillation")
|