Skip to content

Commit 849ffcb

Browse files
Add benchmarks for time-dependent evolutions (#556)
1 parent 894213b commit 849ffcb

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

benchmarks/timeevolution.jl

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,95 @@ function benchmark_timeevolution!(SUITE)
6363
ensemblealg = EnsembleThreads(),
6464
)
6565

66+
## Time-dependent evolutions ##
67+
68+
# Hamiltonian in the lab frame (without drive frame transformation)
69+
H_lab = ωc * a' * a + ωq / 2 * σz + g * (a' * σm + a * σm')
70+
71+
# Define time-dependent drive terms
72+
coef1(p, t) = p.F * exp(1im * p.ωd * t)
73+
coef2(p, t) = p.F * exp(-1im * p.ωd * t)
74+
p = (F = F, ωd = ωd)
75+
76+
# Time-dependent Hamiltonian as tuple (lab frame with drive)
77+
H_td = (H_lab, (a, coef1), (a', coef2))
78+
79+
# Time-dependent Hamiltonian as QobjEvo
80+
H_td2 = QobjEvo(H_td)
81+
82+
# Time-dependent Liouvillian
83+
L_td = liouvillian(H_td2)
84+
85+
tlist_td = range(0, 10 / γ, 100)
86+
87+
## sesolve (time-dependent) ##
88+
89+
SUITE["Time Evolution"]["time-dependent"]["sesolve"]["Tuple"] =
90+
@benchmarkable sesolve($H_td, $ψ0, $tlist_td, e_ops = $e_ops, progress_bar = Val(false), params = $p)
91+
92+
SUITE["Time Evolution"]["time-dependent"]["sesolve"]["QobjEvo"] =
93+
@benchmarkable sesolve($H_td2, $ψ0, $tlist_td, e_ops = $e_ops, progress_bar = Val(false), params = $p)
94+
95+
## mesolve (time-dependent) ##
96+
97+
SUITE["Time Evolution"]["time-dependent"]["mesolve"]["Tuple"] =
98+
@benchmarkable mesolve($H_td, $ψ0, $tlist_td, $c_ops, e_ops = $e_ops, progress_bar = Val(false), params = $p)
99+
100+
SUITE["Time Evolution"]["time-dependent"]["mesolve"]["QobjEvo"] =
101+
@benchmarkable mesolve($H_td2, $ψ0, $tlist_td, $c_ops, e_ops = $e_ops, progress_bar = Val(false), params = $p)
102+
103+
SUITE["Time Evolution"]["time-dependent"]["mesolve"]["Liouvillian"] =
104+
@benchmarkable mesolve($L_td, $ψ0, $tlist_td, $c_ops, e_ops = $e_ops, progress_bar = Val(false), params = $p)
105+
106+
## mcsolve (time-dependent) ##
107+
108+
SUITE["Time Evolution"]["time-dependent"]["mcsolve"]["Tuple"]["Serial"] = @benchmarkable mcsolve(
109+
$H_td,
110+
$ψ0,
111+
$tlist_td,
112+
$c_ops,
113+
ntraj = 100,
114+
e_ops = $e_ops,
115+
progress_bar = Val(false),
116+
params = $p,
117+
ensemblealg = EnsembleSerial(),
118+
)
119+
120+
SUITE["Time Evolution"]["time-dependent"]["mcsolve"]["Tuple"]["Multithreaded"] = @benchmarkable mcsolve(
121+
$H_td,
122+
$ψ0,
123+
$tlist_td,
124+
$c_ops,
125+
ntraj = 100,
126+
e_ops = $e_ops,
127+
progress_bar = Val(false),
128+
params = $p,
129+
ensemblealg = EnsembleThreads(),
130+
)
131+
132+
SUITE["Time Evolution"]["time-dependent"]["mcsolve"]["QobjEvo"]["Serial"] = @benchmarkable mcsolve(
133+
$H_td2,
134+
$ψ0,
135+
$tlist_td,
136+
$c_ops,
137+
ntraj = 100,
138+
e_ops = $e_ops,
139+
progress_bar = Val(false),
140+
params = $p,
141+
ensemblealg = EnsembleSerial(),
142+
)
143+
144+
SUITE["Time Evolution"]["time-dependent"]["mcsolve"]["QobjEvo"]["Multithreaded"] = @benchmarkable mcsolve(
145+
$H_td2,
146+
$ψ0,
147+
$tlist_td,
148+
$c_ops,
149+
ntraj = 100,
150+
e_ops = $e_ops,
151+
progress_bar = Val(false),
152+
params = $p,
153+
ensemblealg = EnsembleThreads(),
154+
)
155+
66156
return nothing
67157
end

0 commit comments

Comments
 (0)