-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmodels.py
106 lines (73 loc) · 4.86 KB
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
def setup_counterlaser(lamb, gam_c, gam_d, num_threads = None, progress = False, parallel = False):
"""Generate Liouvillian for counter rotating interaction, lamb(a*sigmam + adag*sigmap)"""
from operators import tensor, qeye, destroy, create, sigmap, sigmam, sigmaz
from basis import nspins, ldim_s, ldim_p, setup_L
from numpy import sqrt
#note terms with just photon operators need to be divided by nspins
H = lamb * (tensor(create(ldim_p), sigmap()) + tensor(destroy(ldim_p), sigmam()))
c_ops=[]
c_ops.append(sqrt(gam_c/nspins)*tensor(destroy(ldim_p), qeye(ldim_s)))
c_ops.append(sqrt(gam_d)*tensor(qeye(ldim_p), sigmam()))
return setup_L(H, c_ops, num_threads, progress, parallel)
def setup_laser(g, Delta, kappa, gam_dn, gam_up, gam_phi, num_threads = None, progress = False, parallel = False):
"""Generate Liouvillian for laser problem
H = Delta*sigmaz + g(a*sigmap + adag*sigmam)
c_ops = kappa L[a] + gam_dn L[sigmam] + gam_up L[sigmap] + gam_phi L[sigmaz]"""
from operators import tensor, qeye, destroy, create, sigmap, sigmam, sigmaz
from basis import nspins, ldim_s, ldim_p, setup_L
from numpy import sqrt
H = g*(tensor(destroy(ldim_p), sigmap())+ tensor(create(ldim_p), sigmam())) + Delta*tensor(qeye(ldim_p), sigmaz())
c_ops = [sqrt(kappa/nspins)*tensor(destroy(ldim_p), qeye(ldim_s)), sqrt(gam_dn)*tensor(qeye(ldim_p), sigmam()), sqrt(gam_up)*tensor(qeye(ldim_p), sigmap())]
c_ops.append(sqrt(gam_phi)*tensor(qeye(ldim_p), sigmaz()))
return setup_L(H, c_ops, num_threads, progress, parallel)
def setup_3ls(nu, g, kappa, pump, num_threads = None, progress = False, parallel = False):
"""Generate Liouvillian for 3-level system
H = nu*adag*a + g(a*create(3) + h.c.)
c_ops = kappa L[a] + pump L[create(3)]
"""
from operators import tensor, qeye, destroy, create, sigmap, sigmam, sigmaz
from basis import nspins, ldim_s, ldim_p, setup_L
from numpy import sqrt
H = nu * tensor(create(ldim_p) * destroy(ldim_p), qeye(ldim_s)) / nspins\
+ g * tensor(create(ldim_p), destroy(ldim_s)) + g * tensor(destroy(ldim_p), create(ldim_s))
c_ops = [
sqrt(kappa/nspins)*tensor(destroy(ldim_p), qeye(ldim_s)),
sqrt(pump)*tensor(qeye(ldim_p), create(ldim_s)),
]
return setup_L(H, c_ops, num_threads, progress, parallel)
def setup_Dicke(omega, omega0, U, g, gp, kappa, gam_phi, gam_dn, num_threads = None, progress = False, parallel = False):
"""Generate Liouvillian for Dicke model
H = omega*adag*a + omega0*sz + g*(a*sp + adag*sm) + gp*(a*sm + adag*sp) + U *adag*a*sz
c_ops = kappa L[a] + gam_phi L[sigmaz] + gam_dn L[sigmam]"""
from operators import tensor, qeye, destroy, create, sigmap, sigmam, sigmaz
from basis import nspins, ldim_s, ldim_p, setup_L
from numpy import sqrt
num = create(ldim_p)*destroy(ldim_p)
#note terms with just photon operators need to be divided by nspins
H = omega*tensor(num, qeye(ldim_s))/nspins + omega0*tensor(qeye(ldim_p), sigmaz()) + U*tensor(num, sigmaz())
H = H + g*(tensor(create(ldim_p), sigmam()) + tensor(destroy(ldim_p), sigmap()))
H = H + gp*(tensor(create(ldim_p), sigmap()) + tensor(destroy(ldim_p), sigmam()))
c_ops=[]
c_ops.append(sqrt(kappa/nspins)*tensor(destroy(ldim_p), qeye(ldim_s)))
c_ops.append(sqrt(gam_phi)*tensor(qeye(ldim_p), sigmaz()))
c_ops.append(sqrt(gam_dn)*tensor(qeye(ldim_p), sigmam()))
return setup_L(H, c_ops, num_threads, progress, parallel)
def setup_pumped_Dicke(omega, omega0, U, g, gp, kappa, gam_phi, gam_dn, gam_up, num_threads = None,
progress = False, parallel = False):
"""Generate Liouvillian for Dicke model wih pumping
H = omega*adag*a + omega0*sz + g*(a*sp + adag*sm) + gp*(a*sm + adag*sp) + U *adag*a*sz
c_ops = kappa L[a] + gam_phi L[sigmaz] + gam_dn L[sigmam] + gam_up L[sigmap]"""
from operators import tensor, qeye, destroy, create, sigmap, sigmam, sigmaz
from basis import nspins, ldim_s, ldim_p, setup_L
from numpy import sqrt
num = create(ldim_p)*destroy(ldim_p)
#note terms with just photon operators need to be divided by nspins
H = omega*tensor(num, qeye(ldim_s))/nspins + omega0*tensor(qeye(ldim_p), sigmaz()) + U*tensor(num, sigmaz())
H = H + g*(tensor(create(ldim_p), sigmam()) + tensor(destroy(ldim_p), sigmap()))
H = H + gp*(tensor(create(ldim_p), sigmap()) + tensor(destroy(ldim_p), sigmam()))
c_ops=[]
c_ops.append(sqrt(kappa/nspins)*tensor(destroy(ldim_p), qeye(ldim_s)))
c_ops.append(sqrt(gam_phi)*tensor(qeye(ldim_p), sigmaz()))
c_ops.append(sqrt(gam_dn)*tensor(qeye(ldim_p), sigmam()))
c_ops.append(sqrt(gam_up)*tensor(qeye(ldim_p), sigmap()))
return setup_L(H, c_ops, num_threads, progress, parallel)