-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHEOM.py
38 lines (27 loc) · 1.08 KB
/
HEOM.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
import numpy as np
from qutip import sigmax, sigmay, sigmaz, basis, expect
from qutip.nonmarkov.heom import HSolverDL
import time
start_time = time.time()
eps = 1.0 # bias
Del = 1.0 # Delta
Hsys = eps * sigmaz() + Del*sigmax()
temperature = 1.0
Nk = 5 # this factor is represented as K in the chapter
Ncut = 50 # this factor is represented as L in the chapter
Q = sigmaz()
gam = 1.0 # wc - cutoff frequency
lam = 1.0 # lambda
hsolver = HSolverDL(Hsys, Q, lam, temperature, Ncut, Nk, gam, stats=True)
rho0 = basis(2,0) * basis(2,0).dag()
tlist = np.linspace(0,20, 401)
result = hsolver.run(rho0, tlist)
hsolver.stats.report()
P11p = basis(2,0) * basis(2,0).dag()
P22p = basis(2,1) * basis(2,1).dag()
P11exp = expect(result.states, P11p)
P22exp = expect(result.states, P22p)
data = np.column_stack((tlist, np.real(P11exp), np.real(P22exp), np.real(P11exp) - np.real(P22exp)))
filename = "P_wda-" + str(eps) + "_gda-" + str(Del) + "_lambda-" + str(lam) + "_wc-" + str(gam) + "_beta-" + str(beta) + ".dat"
np.savetxt(filename, data)
print("--- %s seconds ---" % (time.time() - start_time))