from maxwellbloch import mb_solve, fixed
import numpy as np
Fast Light Plots
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
= sns.color_palette("deep", 10) pal
Fig 1: Pulse in Vacuum
Will be animation but this is the system (maybe longer time)
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N0-movie.json') mbs_fwhm1_N0
= mbs_fwhm1_N0.mbsolve(recalc=False) time Omegas_zt, states_zt
Loaded tuple object.
CPU times: user 2.48 ms, sys: 6 ms, total: 8.48 ms
Wall time: 10.9 ms
= 0.2 # [L Γ]
speed_of_light
= fixed.t_list(mbs_fwhm1_N0, speed_of_light)
tlist_fixed_frame = fixed.rabi_freq_abs(mbs_fwhm1_N0, 0, speed_of_light, interp_kind='cubic') field_fixed_frame
= plt.figure(2, figsize=(8, 4))
fig = fig.add_subplot(111)
ax = np.linspace(0.0, 1.0e-3, 11)
cmap_range = ax.contourf(tlist_fixed_frame, mbs_fwhm1_N0.zlist,
cf abs(field_fixed_frame/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Fixed Time $1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for x in [0.0, 1/speed_of_light]:
='red', lw=1.0, ls='dashed')
ax.axvline(x, cfor y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c-4, 8)
ax.set_xlim(
plt.colorbar(cf)
fig.tight_layout()
'fast-light-fig-1.png'); plt.savefig(
## Fig 2: Pulse resonant with atoms, fast light
N = 1, T_w = 1 Will be animation
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N1-movie.json') mb_solve_fwhm1_N1
= mb_solve_fwhm1_N1.mbsolve(recalc=False) time Omegas_zt, states_zt
Loaded tuple object.
CPU times: user 2.62 ms, sys: 3.09 ms, total: 5.7 ms
Wall time: 4.22 ms
= np.real(mb_solve_fwhm1_N1.Omegas_zt[0, 0])
profile_in_fwhm1_N1 = mb_solve_fwhm1_N1.tlist[np.argmax(profile_in_fwhm1_N1)]
peak_in_fwhm1_N1 print(peak_in_fwhm1_N1)
= np.real(mb_solve_fwhm1_N1.Omegas_zt[0, -1])
profile_out_fwhm1_N1 = mb_solve_fwhm1_N1.tlist[np.argmax(profile_out_fwhm1_N1)]
peak_out_fwhm1_N1 print(peak_out_fwhm1_N1)
0.0
-0.12
= 0.2 # [L Γ]
speed_of_light
= fixed.t_list(mb_solve_fwhm1_N1, speed_of_light)
tlist_fixed_frame = fixed.rabi_freq_abs(mb_solve_fwhm1_N1, 0, speed_of_light, interp_kind='cubic') field_fixed_frame
= plt.figure(2, figsize=(8, 4))
fig = fig.add_subplot(111)
ax = np.linspace(0.0, 1.0e-3, 11)
cmap_range = ax.contourf(tlist_fixed_frame, mb_solve_fwhm1_N1.zlist,
cf abs(field_fixed_frame/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Fixed Time $1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for x in [0.0, 1/speed_of_light]:
='red', lw=1.0, ls='dashed')
ax.axvline(x, cfor y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c-4, 8)
ax.set_xlim(
plt.colorbar(cf)
plt.tight_layout()
'fast-light-fig-2.png'); plt.savefig(
Fig 3: End Profiles of Fig 2
These should actually be fixed frame comparisons
= np.flipud(mb_solve_fwhm1_N1.tlist) # Reverse the time for pulse advancement
t = profile_in_fwhm1_N1/np.max(profile_in_fwhm1_N1)
y1 = profile_out_fwhm1_N1/np.max(profile_out_fwhm1_N1) y2
len(t)
101
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax ='No atoms', clip_on=False)
ax.plot(t, y1, label='With atoms', clip_on=False)
ax.plot(t, y2, label0., y1, alpha=0.5, color=pal[0], clip_on=False, interpolate=True)
ax.fill_between(t, 0., y2, alpha=0.5, color=pal[1], clip_on=False, interpolate=True)
ax.fill_between(t, 'Pulse Advancement ($1/\Gamma$)')
ax.set_xlabel('Profile (Normalised)')
ax.set_ylabel(-2, 2])
ax.set_xlim([0.0, 1.0])
ax.set_ylim([
ax.legend()
fig.tight_layout()
'fast-light-fig-3.png'); plt.savefig(
Fig 4: Refractive Index
from maxwellbloch import spectral
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N1-spectral.json') mb_solve_fwhm1_N1_spectral
= mb_solve_fwhm1_N1_spectral.mbsolve(recalc=False) Omegas_zt, states_zt
Loaded tuple object.
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax = np.linspace(0.0, 1.0e-3, 11)
cmap_range = ax.contourf(mb_solve_fwhm1_N1_spectral.tlist, mb_solve_fwhm1_N1_spectral.zlist,
cf abs(mb_solve_fwhm1_N1_spectral.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap-2, 2)
ax.set_xlim(; plt.colorbar(cf)
= spectral.freq_list(mb_solve_fwhm1_N1_spectral)
freq_list # n_imag = spectral.dispersion(mb_solve_fwhm1_N1_spectral, 0, -1)
= np.sqrt(1 + spectral.dispersion(mb_solve_fwhm1_N1_spectral, 0, -1))
n_real = np.sqrt(1 + spectral.absorption(mb_solve_fwhm1_N1_spectral, 0, -1)) n_imag
= plt.figure(figsize=(8, 4))
fig = fig.add_subplot(111)
ax =pal[2],
ax.plot(freq_list, n_real, color='n real')
label# ax.plot(freq_list, n_imag, color=pal[3],
# label='n imag')
0.5, 1.5)
ax.set_ylim(-2.0, 2.0)
ax.set_xlim('Refractive Index')
ax.set_ylabel('Frequency ($\Gamma / 2\pi $)')
ax.set_xlabel(
fig.tight_layout()
'fast-light-fig-4.png'); plt.savefig(
Fig 5: Absorption and Dispersion Profiles
For explanation of phase velocity, group velocity, refractive index
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N10-spectral.json')
mbsw %time _ = mbsw.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 58.7 ms, sys: 213 ms, total: 272 ms
Wall time: 337 ms
= spectral.freq_list(mbsw)
freq_list_w = np.sqrt(1 + spectral.dispersion(mbsw, 0, -1))
n_real_w = np.sqrt(1 + spectral.absorption(mbsw, 0, -1)) n_imag_w
= plt.figure(2, figsize=(8, 6))
fig = fig.add_subplot(211)
ax
= spectral.freq_list(mb_solve_fwhm1_N1_spectral)
freq_list = np.abs(spectral.rabi_freq(mb_solve_fwhm1_N1_spectral, 0))[0]
rabi_freq_abs_0
= spectral.freq_list(mbsw)
freq_list_w = np.abs(spectral.rabi_freq(mbsw, 0))[0]
rabi_freq_abs_0_w
# t_text = ax.text(0.02, 0.90, '(a)', transform=ax.transAxes)
=pal[2],
ax.plot(freq_list, n_real, color='Real')
label=pal[3],
ax.plot(freq_list, n_imag, color='Imag')
label
-2.0, 2.0)
ax.set_xlim(0.5, 1.5)
ax.set_ylim(='off')
ax.tick_params(labelbottom-0.5, 0.5, alpha=0.2, color=pal[2])
ax.axvspan(
'Refractive Index')
ax.set_ylabel(
ax.legend()
= fig.add_subplot(212)
ax2
= rabi_freq_abs_0/np.max(rabi_freq_abs_0)
y
ax2.plot(freq_list, =pal[0],
y, color='Pulse')
label0., y, alpha=0.5, color=pal[0], clip_on=True, interpolate=True)
ax2.fill_between(freq_list,
= rabi_freq_abs_0_w/np.max(rabi_freq_abs_0_w)
yw
ax2.plot(freq_list_w, =pal[1],
yw, color='Longer Pulse')
label0., yw, alpha=0.5, color=pal[1], clip_on=True, interpolate=True)
ax2.fill_between(freq_list_w,
-0.5, 0.5, alpha=0.2, color=pal[2])
ax2.axvspan(-2.0, 2.0)
ax2.set_xlim(0.0, 1.0)
ax2.set_ylim(
'Profile (Normalised)')
ax2.set_ylabel('Frequency ($\Gamma/ 2\pi$)')
ax2.set_xlabel(
ax2.legend()
fig.tight_layout()
'fast-light-fig-5.png'); plt.savefig(
Fig 6: Show that get better advancement with wide pulse
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N15.json') mb_solve_fwhm10_N15
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N10.json') mb_solve_fwhm10_N10
=False)
mb_solve_fwhm10_N15.mbsolve(recalc=False); mb_solve_fwhm10_N10.mbsolve(recalc
Loaded tuple object.
Loaded tuple object.
= np.real(mb_solve_fwhm10_N15.Omegas_zt[0, 0])
profile_in_fwhm10_N15 = mb_solve_fwhm10_N15.tlist[np.argmax(profile_in_fwhm10_N15)]
peak_in_fwhm10_N15 print(peak_in_fwhm10_N15)
= np.real(mb_solve_fwhm10_N15.Omegas_zt[0, -1])
profile_out_fwhm10_N15 = mb_solve_fwhm10_N15.tlist[np.argmax(profile_out_fwhm10_N15)]
peak_out_fwhm10_N15 print(peak_out_fwhm10_N15)
0.0
-4.68
= np.flipud(mb_solve_fwhm10_N15.tlist) # Reverse the time for pulse advancement
x = profile_in_fwhm10_N15/np.max(profile_in_fwhm10_N15)
y1 = profile_out_fwhm10_N15/np.max(profile_out_fwhm10_N15) y2
= np.real(mb_solve_fwhm10_N10.Omegas_zt[0, 0])
profile_in_fwhm10_N10 = mb_solve_fwhm10_N10.tlist[np.argmax(profile_in_fwhm10_N10)]
peak_in_fwhm10_N10 print(peak_in_fwhm10_N10)
= np.real(mb_solve_fwhm10_N10.Omegas_zt[0, -1])
profile_out_fwhm10_N10 = mb_solve_fwhm10_N10.tlist[np.argmax(profile_out_fwhm10_N10)]
peak_out_fwhm10_N10 print(peak_out_fwhm10_N10)
0.0
-3.08
= np.flipud(mb_solve_fwhm10_N10.tlist) # Reverse the time for pulse advancement
x = profile_in_fwhm10_N10/np.max(profile_in_fwhm10_N10)
y1 = profile_out_fwhm10_N10/np.max(profile_out_fwhm10_N10) y2
= plt.figure(figsize=(8, 4))
fig = fig.add_subplot(111)
ax ='No atoms', clip_on=False)
ax.plot(x, y1, label0., y1, alpha=0.5, color=pal[0], interpolate=True)
ax.fill_between(x, ='Atoms', clip_on=False)
ax.plot(x, y2, label0., y2, alpha=0.5, color=pal[1], interpolate=True)
ax.fill_between(x, 'Pulse Advancement ($1/\Gamma$)')
ax.set_xlabel('Profile (Normalised)')
ax.set_ylabel(-20, 20])
ax.set_xlim([0.0, 1.0])
ax.set_ylim([
ax.legend()
fig.tight_layout()
'fast-light-fig-6.png'); fig.savefig(
Fig 7: Pulse Advancements vs Num Density
For pulses and wide pulses
See fast-light-fig-7.ipynb