from maxwellbloch import mb_solve
import numpy as np
N = 0.1
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N01.json') mb_solve_fwhm1_N01
= mb_solve_fwhm1_N01.mbsolve(recalc=False) time _
Loaded tuple object.
CPU times: user 10 ms, sys: 23.3 ms, total: 33.3 ms
Wall time: 48.1 ms
= np.abs(mb_solve_fwhm1_N01.Omegas_zt[0, 0])
profile_in_fwhm1_N01 = mb_solve_fwhm1_N01.tlist[np.argmax(profile_in_fwhm1_N01)]
peak_in_fwhm1_N01 print(peak_in_fwhm1_N01)
= np.abs(mb_solve_fwhm1_N01.Omegas_zt[0, -1])
profile_out_fwhm1_N01 = mb_solve_fwhm1_N01.tlist[np.argmax(profile_out_fwhm1_N01)]
peak_out_fwhm1_N01 print(peak_out_fwhm1_N01)
0.0
-0.016
= 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_N01.tlist, mb_solve_fwhm1_N01.zlist,
cf abs(mb_solve_fwhm1_N01.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm1_N01, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm1_N01, c-2, 2)
ax.set_xlim(; plt.colorbar(cf)
N = 0.5
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N05.json') mb_solve_fwhm1_N05
= mb_solve_fwhm1_N05.mbsolve(recalc=False) time _
Loaded tuple object.
CPU times: user 6.7 ms, sys: 18.7 ms, total: 25.4 ms
Wall time: 27.2 ms
= np.abs(mb_solve_fwhm1_N05.Omegas_zt[0, 0])
profile_in_fwhm1_N05 = mb_solve_fwhm1_N05.tlist[np.argmax(profile_in_fwhm1_N05)]
peak_in_fwhm1_N05 print(peak_in_fwhm1_N05)
= np.abs(mb_solve_fwhm1_N05.Omegas_zt[0, -1])
profile_out_fwhm1_N05 = mb_solve_fwhm1_N05.tlist[np.argmax(profile_out_fwhm1_N05)]
peak_out_fwhm1_N05 print(peak_out_fwhm1_N05)
0.0
-0.072
= 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_N05.tlist, mb_solve_fwhm1_N05.zlist,
cf abs(mb_solve_fwhm1_N05.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm1_N05, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm1_N05, c-2, 2)
ax.set_xlim(; plt.colorbar(cf)
N = 1
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N1.json') mb_solve_fwhm1_N1
= mb_solve_fwhm1_N1.mbsolve(recalc=False) time Omegas_zt, states_zt
Loaded tuple object.
CPU times: user 6.89 ms, sys: 17.8 ms, total: 24.7 ms
Wall time: 26.6 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.136
= 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.tlist, mb_solve_fwhm1_N1.zlist,
cf abs(mb_solve_fwhm1_N1.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm1_N1, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm1_N1, c-2, 2)
ax.set_xlim(; plt.colorbar(cf)
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax /np.max(profile_in_fwhm1_N1))
ax.plot(mb_solve_fwhm1_N1.tlist, profile_in_fwhm1_N1/np.max(profile_out_fwhm1_N1)) ax.plot(mb_solve_fwhm1_N1.tlist, profile_out_fwhm1_N1
N = 2
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N2.json') mb_solve_fwhm1_N2
%time Omegas_zt, states_zt = mb_solve_fwhm1_N2.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 6.1 ms, sys: 18.3 ms, total: 24.4 ms
Wall time: 25.5 ms
= np.real(mb_solve_fwhm1_N2.Omegas_zt[0, 0])
profile_in_fwhm1_N2 = mb_solve_fwhm1_N2.tlist[np.argmax(profile_in_fwhm1_N2)]
peak_in_fwhm1_N2 print(peak_in_fwhm1_N2)
= np.real(mb_solve_fwhm1_N2.Omegas_zt[0, -1])
profile_out_fwhm1_N2 = mb_solve_fwhm1_N2.tlist[np.argmax(profile_out_fwhm1_N2)]
peak_out_fwhm1_N2 print(peak_out_fwhm1_N2)
0.0
-0.252
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax = np.linspace(-1.0e-3, 1.0e-3, 20)
cmap_range = ax.contourf(mb_solve_fwhm1_N2.tlist, mb_solve_fwhm1_N2.zlist,
cf 0]/(2*np.pi)),
np.real(mb_solve_fwhm1_N2.Omegas_zt[=plt.cm.RdBu)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm1_N2, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm1_N2, c# ax.set_xlim(-2, 2)
; plt.colorbar(cf)
from maxwellbloch import fixed
= 0.5 # [L Γ]
speed_of_light
= fixed.t_list(mb_solve_fwhm1_N2, speed_of_light)
tlist_fixed_frame = fixed.rabi_freq(mb_solve_fwhm1_N2, 0, speed_of_light, part='real', interp_kind='cubic') field_fixed_frame
= plt.figure(2, figsize=(8, 3))
fig = fig.add_subplot(111)
ax = np.linspace(-1.0e-3, 1.0e-3, 20)
cmap_range = ax.contourf(tlist_fixed_frame, mb_solve_fwhm1_N2.zlist,
cf /(2*np.pi),
field_fixed_frame=plt.cm.RdBu)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Fixed Time $1/\Gamma$)')
ax.set_xlabel('Distance ($L$)') ax.set_ylabel(
<matplotlib.text.Text at 0x113a69978>
### N = 4
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N4.json') mb_solve_fwhm1_N4
%time _ = mb_solve_fwhm1_N4.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 5.93 ms, sys: 18.4 ms, total: 24.3 ms
Wall time: 24.6 ms
= np.real(mb_solve_fwhm1_N4.Omegas_zt[0, 0])
profile_in_fwhm1_N4 = mb_solve_fwhm1_N4.tlist[np.argmax(profile_in_fwhm1_N4)]
peak_in_fwhm1_N4 print(peak_in_fwhm1_N4)
= np.real(mb_solve_fwhm1_N4.Omegas_zt[0, -1])
profile_out_fwhm1_N4 = mb_solve_fwhm1_N4.tlist[np.argmax(profile_out_fwhm1_N4)]
peak_out_fwhm1_N4 print(peak_out_fwhm1_N4)
0.0
-0.448
= 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_N4.tlist, mb_solve_fwhm1_N4.zlist,
cf abs(mb_solve_fwhm1_N4.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm1_N4, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm1_N4, c# ax.set_xlim(-2, 2)
; plt.colorbar(cf)
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax /np.max(profile_in_fwhm1_N4))
ax.plot(mb_solve_fwhm1_N4.tlist, profile_in_fwhm1_N4/np.max(profile_out_fwhm1_N4)) ax.plot(mb_solve_fwhm1_N4.tlist, profile_out_fwhm1_N4
PLOT
= np.array([0.1, 0.5, 1.0, 2.0, 4.0])
N = -np.array([peak_out_fwhm1_N01, peak_out_fwhm1_N05, peak_out_fwhm1_N1, peak_out_fwhm1_N2, peak_out_fwhm1_N4]) peaks_out
= plt.figure(figsize=(8, 3))
fig ='o') plt.plot(N, peaks_out, marker
N = 4.5
= mb_solve.MBSolve().from_json('fast-light-fwhm1-N4.5.json') mb_solve_fwhm1_N4_5
%time _ = mb_solve_fwhm1_N4_5.mbsolve(recalc=False, pbar_chunk_size=2)
Loaded tuple object.
CPU times: user 60 ms, sys: 236 ms, total: 296 ms
Wall time: 322 ms
= np.abs(mb_solve_fwhm1_N4_5.Omegas_zt[0, 0])
profile_in_fwhm1_N4_5 = mb_solve_fwhm1_N4_5.tlist[np.argmax(profile_in_fwhm1_N4_5)]
peak_in_fwhm1_N4_5 print(peak_in_fwhm1_N4_5)
= np.abs(mb_solve_fwhm1_N4_5.Omegas_zt[0, -1])
profile_out_fwhm1_N4_5 = mb_solve_fwhm1_N4_5.tlist[np.argmax(profile_out_fwhm1_N4_5)]
peak_out_fwhm1_N4_5 print(peak_out_fwhm1_N4_5)
0.0
0.2504
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax = np.linspace(0.0, 1.0e-3, 101)
cmap_range = ax.contourf(mb_solve_fwhm1_N4_5.tlist, mb_solve_fwhm1_N4_5.zlist,
cf abs(mb_solve_fwhm1_N4_5.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm1_N4_5, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm1_N4_5, c-2, 2)
ax.set_xlim(; plt.colorbar(cf)
Wide Pulses
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N10.json') mb_solve_fwhm10_N10
%time _ = mb_solve_fwhm10_N10.mbsolve(recalc=False);
Loaded tuple object.
CPU times: user 6.22 ms, sys: 19.2 ms, total: 25.4 ms
Wall time: 25.8 ms
= np.abs(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.abs(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
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax = np.linspace(0.0, 1.0e-6, 101)
cmap_range = ax.contourf(mb_solve_fwhm10_N10.tlist, mb_solve_fwhm10_N10.zlist,
cf abs(mb_solve_fwhm10_N10.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm10_N10, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm10_N10, c-20, 20)
ax.set_xlim(; plt.colorbar(cf)
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N20.json') mb_solve_fwhm10_N20
%time _ = mb_solve_fwhm10_N20.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 49.1 ms, sys: 235 ms, total: 284 ms
Wall time: 314 ms
= np.abs(mb_solve_fwhm10_N20.Omegas_zt[0, 0])
profile_in_fwhm10_N20 = mb_solve_fwhm10_N20.tlist[np.argmax(profile_in_fwhm10_N20)]
peak_in_fwhm10_N20 print(peak_in_fwhm10_N20)
= np.abs(mb_solve_fwhm10_N20.Omegas_zt[0, -1])
profile_out_fwhm10_N20 = mb_solve_fwhm10_N20.tlist[np.argmax(profile_out_fwhm10_N20)]
peak_out_fwhm10_N20 print(peak_out_fwhm10_N20)
0.0
-5.68
= 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_fwhm10_N20.tlist, mb_solve_fwhm10_N20.zlist,
cf abs(mb_solve_fwhm10_N20.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c='red', lw=1.0, ls='dotted')
ax.axvline(peak_in_fwhm10_N20, c='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm10_N20, c-20, 20)
ax.set_xlim(; plt.colorbar(cf)
^ Try more t steps, this might work.
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N01.json') mb_solve_fwhm10_N01
%time _ = mb_solve_fwhm10_N01.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 9.18 ms, sys: 25.2 ms, total: 34.4 ms
Wall time: 37.3 ms
= np.abs(mb_solve_fwhm10_N01.Omegas_zt[0, -1])
profile_out_fwhm10_N01 = mb_solve_fwhm10_N01.tlist[np.argmax(profile_out_fwhm10_N01)]
peak_out_fwhm10_N01 print(peak_out_fwhm10_N01)
-0.04
= 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_fwhm10_N01.tlist, mb_solve_fwhm10_N01.zlist,
cf abs(mb_solve_fwhm10_N01.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c# ax.axvline(peak_in_fwhm10_N20, c='red', lw=1.0, ls='dotted')
='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm10_N01, c-20, 20)
ax.set_xlim(; plt.colorbar(cf)
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N05.json') mb_solve_fwhm10_N05
%time _ = mb_solve_fwhm10_N05.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 5.89 ms, sys: 20.3 ms, total: 26.2 ms
Wall time: 27.2 ms
= np.abs(mb_solve_fwhm10_N05.Omegas_zt[0, -1])
profile_out_fwhm10_N05 = mb_solve_fwhm10_N01.tlist[np.argmax(profile_out_fwhm10_N05)]
peak_out_fwhm10_N05 print(peak_out_fwhm10_N05)
-0.16
= 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_fwhm10_N05.tlist, mb_solve_fwhm10_N05.zlist,
cf abs(mb_solve_fwhm10_N05.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c# ax.axvline(peak_in_fwhm10_N20, c='red', lw=1.0, ls='dotted')
='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm10_N05, c-20, 20)
ax.set_xlim(; plt.colorbar(cf)
N = 1
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N1.json') mb_solve_fwhm10_N1
%time _ = mb_solve_fwhm10_N1.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 5.59 ms, sys: 18 ms, total: 23.6 ms
Wall time: 24.3 ms
= np.abs(mb_solve_fwhm10_N1.Omegas_zt[0, -1])
profile_out_fwhm10_N1 = mb_solve_fwhm10_N1.tlist[np.argmax(profile_out_fwhm10_N1)]
peak_out_fwhm10_N1 print(peak_out_fwhm10_N1)
-0.32
= 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_fwhm10_N1.tlist, mb_solve_fwhm10_N1.zlist,
cf abs(mb_solve_fwhm10_N1.Omegas_zt[0]/(2*np.pi)),
np.=plt.cm.Blues)
cmap_range, cmap'Rabi Frequency ($\Gamma / 2\pi $)')
ax.set_title('Time ($1/\Gamma$)')
ax.set_xlabel('Distance ($L$)')
ax.set_ylabel(for y in [0.0, 1.0]:
='grey', lw=1.0, ls='dotted')
ax.axhline(y, c# ax.axvline(peak_in_fwhm10_N1, c='red', lw=1.0, ls='dotted')
='green', lw=1.0, ls='dotted')
ax.axvline(peak_out_fwhm10_N1, c-20, 20)
ax.set_xlim(; plt.colorbar(cf)
N = 5
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N5.json') mb_solve_fwhm10_N5
%time _ = mb_solve_fwhm10_N5.mbsolve(recalc=False)
Loaded tuple object.
CPU times: user 6.04 ms, sys: 18.2 ms, total: 24.3 ms
Wall time: 25.3 ms
= np.real(mb_solve_fwhm10_N5.Omegas_zt[0, 0])
profile_in_fwhm10_N5 = mb_solve_fwhm10_N5.tlist[np.argmax(profile_in_fwhm10_N5)]
peak_in_fwhm10_N5 print(peak_in_fwhm10_N5)
= np.real(mb_solve_fwhm10_N5.Omegas_zt[0, -1])
profile_out_fwhm10_N5 = mb_solve_fwhm10_N5.tlist[np.argmax(profile_out_fwhm10_N5)]
peak_out_fwhm10_N5 print(np.max(profile_out_fwhm10_N5))
print(peak_out_fwhm10_N5)
0.0
4.37241125569e-05
-1.56
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax /np.max(profile_in_fwhm10_N5))
ax.plot(mb_solve_fwhm10_N5.tlist, profile_in_fwhm10_N5/np.max(profile_out_fwhm10_N5)) ax.plot(mb_solve_fwhm10_N5.tlist, profile_out_fwhm10_N5
N = 12
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N12.json') mb_solve_fwhm10_N12
%time _ = mb_solve_fwhm10_N12.mbsolve(recalc=False, pbar_chunk_size=2)
Loaded tuple object.
CPU times: user 51.9 ms, sys: 225 ms, total: 277 ms
Wall time: 300 ms
= np.abs(mb_solve_fwhm10_N12.Omegas_zt[0, -1])
profile_out_fwhm10_N12 = mb_solve_fwhm10_N12.tlist[np.argmax(profile_out_fwhm10_N12)]
peak_out_fwhm10_N12 print(peak_out_fwhm10_N12)
-3.75
N = 15
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N15.json') mb_solve_fwhm10_N15
%time _ = mb_solve_fwhm10_N15.mbsolve(recalc=False, pbar_chunk_size=2)
Loaded tuple object.
CPU times: user 77.1 ms, sys: 222 ms, total: 299 ms
Wall time: 376 ms
= 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
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax /np.max(profile_in_fwhm10_N15))
ax.plot(mb_solve_fwhm10_N15.tlist, profile_in_fwhm10_N15/np.max(profile_out_fwhm10_N15)) ax.plot(mb_solve_fwhm10_N15.tlist, profile_out_fwhm10_N15
N = 20
= mb_solve.MBSolve().from_json('fast-light-fwhm10-N20.json') mb_solve_fwhm10_N20
%time _ = mb_solve_fwhm10_N20.mbsolve(recalc=False, pbar_chunk_size=2)
Loaded tuple object.
CPU times: user 69.9 ms, sys: 196 ms, total: 266 ms
Wall time: 286 ms
= np.real(mb_solve_fwhm10_N20.Omegas_zt[0, 0])
profile_in_fwhm10_N20 = mb_solve_fwhm10_N20.tlist[np.argmax(profile_in_fwhm10_N20)]
peak_in_fwhm10_N20 print(peak_in_fwhm10_N20)
= np.real(mb_solve_fwhm10_N20.Omegas_zt[0, -1])
profile_out_fwhm10_N20 = mb_solve_fwhm10_N20.tlist[np.argmax(profile_out_fwhm10_N20)]
peak_out_fwhm10_N20 print(np.max(profile_out_fwhm10_N20))
print(peak_out_fwhm10_N20)
0.0
1.56090895713e-11
-5.68
= plt.figure(figsize=(8, 3))
fig = fig.add_subplot(111)
ax /np.max(profile_in_fwhm10_N20))
ax.plot(mb_solve_fwhm10_N20.tlist, profile_in_fwhm10_N20/np.max(profile_out_fwhm10_N20)) ax.plot(mb_solve_fwhm10_N20.tlist, profile_out_fwhm10_N20
PLOT
= np.array([0.1, 0.5, 1.0, 5.0, 10.0, 12.0, 15.0])
N10 = -np.array([peak_out_fwhm10_N01, peak_out_fwhm10_N05, peak_out_fwhm10_N1, peak_out_fwhm10_N5,
peaks_out_10
peak_out_fwhm10_N10, peak_out_fwhm10_N12, peak_out_fwhm10_N15])
='o') plt.plot(N10, peaks_out_10, marker
Plots together
= plt.figure(figsize=(8, 4))
fig = fig.add_subplot(111)
ax ='-', marker='o', label='Pulse', clip_on=False)
ax.plot(N, peaks_out, ls/10, ls='-', marker='o', label='Longer pulse', clip_on=False)
ax.plot(N10, peaks_out_10'Number density')
ax.set_xlabel('Pulse advancement in pulse widths')
ax.set_ylabel(=0)
ax.legend(loc
fig.tight_layout()'fast-light-fig-7.png'); fig.savefig(
Narrow pulses
Narrower pulses suffer too much pulse distortion. Tried. Not useful.