def plotShape(pulsef, name, end=14*pi/3): shape = plt.figure() pulse_time = np.linspace(0, end, 5000) plt.plot(pulse_time, [pulsef(t) for t in pulse_time], "b-", label=name) plt.legend(loc="best") plt.ylabel(r"Amplitude in $a_{max}$") plt.xlabel(r"t in $\hbar/a_{max}$") plt.ylim([-1.1,1.1]) plt.xlim([0.,end]) filename = base + name.replace(" ", "_") + "-shape.png" shape.savefig(filename)
pulseshape_data = [pulseshape(ti) for ti in tis] pshape = plt.figure() plt.plot(tis, pulseshape_data, 'b-') # plt.show() plt.ion() fig, ax = plt.subplots() fig.suptitle(wave + ":" + ptitle) p1, = plt.plot(p_t, sym1, 'b--', label="t=1") p3, = plt.plot(p_t, sym3, 'r-', label="t=3") p15, = plt.plot(p_t, sym12, 'g--', label="t=12") plt.xlabel(r"width in $\hbar / a_max$") plt.ylabel(r"$\phi(\rho_f, \rho_0)$") plt.legend(loc='best') plt.show() plt.pause(0.0001) def SCORPSEfac(partition): def a_SC(t): if t <= 0: return 0 if t < ((pi / 3) * hoa): return -a_max if t <= 2 * pi * hoa: return a_max if t < (partition): return -a_max return 0
# sym: mkInfo(sym_pi, tau) # } p_t = [] shapefig = plt.figure() chi_time = np.linspace(0 - 1, mytau + 1, 1000) if do_sym: plt.plot(chi_time, [sym_pi(t) for t in chi_time], "c-", label="Symmetric Pulse shape") if do_asym: plt.plot(chi_time, [asym_pi(t) for t in chi_time], "m-", label="Antisymmetric Pulse shape") plt.legend(loc="best") plt.ion() fig, ax = plt.subplots() pulse_plots = [] if do_pi: p_pi, = plt.plot(p_t, fids_pi, 'b--', label="pi pulse") pulse_plots.append(p_pi) if do_c: p_c, = plt.plot(p_t, fids_C, 'r-', label="CORPSE pulse") pulse_plots.append(p_c) if do_sc: p_sc, = plt.plot(p_t, fids_SC, 'r--', label="SCORPSE pulse") pulse_plots.append(p_sc) #r"$f(x) = x^2$; width $\pi$, 2 periods, range $-a_{max}$ to $a_{max}$"