def timedomain(args): """ Input: mnames, det13, det23, gausstau, gausstheta, gausssigma, trep, npulse, upperlife, doplot pulsed laser: laser1 CW laser: laser2 """ mnames, v0, det13, det23, omega23, gausstau, gausstheta, gausssigma, trep, npulse, upperlife, doplot = args # mnames, split12, det13, tau, reptime, maxpow, npulse, upperlife, doplot = args for name in mnames: globals()[name] = ll_mat_from_mtx(name) # bloch_atomic, laser1_pow, laser1_det, laser2_pow, laser2_det, laser12_det = matrices # detunings d13real = det13 d23real = det23 d12real = d13real - d23real # Between pulses: CW laser is on pulseoff = bloch_atomic.copy() pulseoff.shift(omega23, laser2_pow) pulseoff.shift(d13real, laser1_det) pulseoff.shift(d23real, laser2_det) pulseoff.shift(d12real, laser12_det) pulseofftime = trep - gausstau # During pulse - base before adding pulsed power # with .shift(omega13(t), laser1_pow) pulsebase = pulseoff.copy() pulsestep = linspace(0, gausstau, 51)[0:-1] pulsedt = pulsestep[1] - pulsestep[0] pulsestep = (pulsestep + pulsedt / 2) - gausstau / 2 results = zeros((9, npulse+1)) vt = v0 for k in xrange(0, 9): results[k, 0] = vt[k] for i in xrange(npulse): # pulse on v3in = vt[2] for pt in pulsestep: omega13 = gausspulse(pt, gausstheta, gausssigma) pulseon = pulsebase.copy() pulseon.shift(omega13, laser1_pow) vt, e, hump = spexpv(pulsedt, pulseon, vt) vt = matrix(vt).T v3diff = vt[2] - v3in # pulse off vt, e, hump = spexpv(pulseofftime, pulseoff, vt) vt = matrix(vt).T for k in range(0, 9): results[k, i+1] = vt[k] return results
def pulsescalc(args): """ Calculate time evolution with pulses """ # mnames, split12, det13, tau, reptime, maxpow, npulse, upperlife, doplot = args mnames, v0, laser_det, delta, pulsefunc, pulseshape, pulsearea, pulsetotaltime, pulsepoints, trep, npulse = args for name in mnames: globals()[name] = ll_mat_from_mtx(name) # bloch_atomic, laser_pow = matrices print "Reptime: %f, detuning: %f" %(trep, delta) # Between pulses: CW laser is off pulseoff = bloch_atomic.copy() pulseoff.shift(1, laser_det(delta)) pulseofftime = trep - pulsetotaltime # During pulse - base before adding pulsed power pulsebase = pulseoff.copy() pulsestep = linspace(0, pulsetotaltime, pulsepoints)[0:-1] pulsedt = pulsestep[1] - pulsestep[0] pulsestep = (pulsestep + pulsedt / 2) - pulsetotaltime / 2 pulseblochs = [] omegas = [] for pt in pulsestep: omega = pulsefunc(pt, pulsearea, pulseshape) pulseon = pulsebase.copy() pulseon.shift(omega, laser_pow) pulseblochs += [pulseon] omegas += [omega] nelems = len(v0) results = zeros((nelems, npulse+1)) vt = v0 for k in xrange(0, nelems): results[k, 0] = vt[k] for i in xrange(npulse): # pulse on # v3in = vt[2] # for p in xrange(len(pulsestep)): for nextstep in pulseblochs: vt, e, hump = spexpv(pulsedt, nextstep, vt) vt = matrix(vt).T # pulse off vt, e, hump = spexpv(pulseofftime, pulseoff, vt) vt = matrix(vt).T for k in xrange(0, nelems): results[k, i+1] = vt[k] return results
def timedomain(args): """ Input: mnames, t, v0, det13, det23, omega13, omega23 """ mnames, t, v0, det13, det23, omega13, omega23 = args for name in mnames: globals()[name] = ll_mat_from_mtx(name) # detunings d13real = det13 d23real = det23 d12real = d13real - d23real # Between pulses: CW laser is on bloch = bloch_atomic.copy() bloch.shift(omega13, laser1_pow) bloch.shift(omega23, laser2_pow) bloch.shift(d13real, laser1_det) bloch.shift(d23real, laser2_det) bloch.shift(d12real, laser12_det) results = zeros((9, len(t))) vt = v0 for i in xrange(len(t)): vt, e, hump = spexpv(t[i], bloch, v0) vt = matrix(vt).T for k in range(0, 9): results[k, i] = vt[k] return results
def timedomain(args): # mnames, split12, det13, tau, reptime, maxpow, npulse, upperlife, doplot = args mnames, v, t, omega, laser_det, delta = args for name in mnames: globals()[name] = ll_mat_from_mtx(name) # bloch_atomic, laser_pow = matrices # v = matrix(zeros((36, 1))) # v[1] = 1 laseron = bloch_atomic.copy() laseron.shift(omega, laser_pow) laseron.shift(1, laser_det(delta)) # print laseron # print laseron t = np.linspace(0, t, 1001) results = zeros((len(v), len(t))) vt = v for k in xrange(0, 36): results[k, 0] = vt[k] for i in xrange(1, len(t)): vt, e, hump = spexpv(t[i]-t[i-1], laseron, vt) vt = matrix(vt).T for k in range(0, 36): results[k, i] = vt[k] return results
# [0, 0, 0, 0, 0, 0, d12, om23/2, om13/2], # [0, 0, 0, 0, -Gtot/2, 0, om23/2, d13, 0], # [0, 0, 0, 0, 0, -Gtot/2, -om13/2, 0, d23], # [0, 0, 0, -d12, -om23/2, om13/2, -Gtot/2, 0, 0], # [-om13/2, 0, om13/2, -om23/2, -d13, 0, 0, -Gtot/2, 0], # [0, -om23/2, om23/2, -om13/2, 0, -d23, 0, 0, -Gtot/2]]) nt = 151 t = linspace(0, 20, nt) p = array(zeros((nt, 9))) p2 = array(zeros((nt, 9))) v = matrix(zeros((9, 1))) v[start] = 1 # print v for i in xrange(nt): vt, e, hump = spexpv(t[i], out, v) p[i, 0:9] = vt[0:9] # p[i, 0:3] = vt[3:6] # v2 = dot(expm(obm*t[i]), v) # p2[i, 0:9] = v2[0:9].T # p = p2 for i in xrange(3): pl.plot(t, p[:, i], '-', label="(%d)"%(i+1)) # for i in xrange(3): # pl.plot(t, p2[:, i], 'x', label="X(%d)"%(i+1)) data = loadtxt('../matlab/compare.csv', delimiter=',') for i in xrange(3): pl.plot(t, data[:, i], 'o', label="M(%d)"%(i+1)) pl.legend(loc='best') pl.title('Populations')