|
28 | 28 | sol_string = sprint((t, s) -> show(t, "text/plain", s), sol) |
29 | 29 |
|
30 | 30 | ## Analytical solution for the expectation value of a' * a |
31 | | - Ω_rabi = sqrt(g^2 + ((ωc - ωq)/2)^2) |
| 31 | + Ω_rabi = sqrt(g^2 + ((ωc - ωq) / 2)^2) |
32 | 32 | amp_rabi = g^2 / Ω_rabi^2 |
33 | 33 | ## |
34 | 34 |
|
|
171 | 171 |
|
172 | 172 | # Time-Dependent Hamiltonian |
173 | 173 | # ssesolve is slow to be run on CI. It is not removed from the test because it may be useful for testing in more powerful machines. |
174 | | - |
| 174 | + |
175 | 175 | ωd = 1.02 |
176 | 176 | F = 0.05 |
177 | | - |
| 177 | + |
178 | 178 | # Time Evolution in the drive frame |
179 | 179 |
|
180 | 180 | H_dr_fr = H - ωd * a' * a - ωd * σz / 2 + F * (a + a') |
181 | | - |
| 181 | + |
182 | 182 | rng = MersenneTwister(12) |
183 | 183 |
|
184 | 184 | tlist = range(0, 10 / γ, 1000) |
|
257 | 257 | allocs_tot = @allocations mesolve(L_td, ψ0, tlist, e_ops = e_ops, progress_bar = Val(false), params = p) |
258 | 258 | @test allocs_tot < 210 |
259 | 259 |
|
260 | | - allocs_tot = @allocations mesolve(L_td, ψ0, tlist, progress_bar = Val(false), saveat = [tlist[end]], params = p) # Warm-up |
261 | | - allocs_tot = @allocations mesolve(L_td, ψ0, tlist, progress_bar = Val(false), saveat = [tlist[end]], params = p) |
| 260 | + allocs_tot = |
| 261 | + @allocations mesolve(L_td, ψ0, tlist, progress_bar = Val(false), saveat = [tlist[end]], params = p) # Warm-up |
| 262 | + allocs_tot = |
| 263 | + @allocations mesolve(L_td, ψ0, tlist, progress_bar = Val(false), saveat = [tlist[end]], params = p) |
262 | 264 | @test allocs_tot < 120 |
263 | 265 | end |
264 | 266 |
|
265 | 267 | @testset "Memory Allocations (mcsolve)" begin |
266 | 268 | ntraj = 100 |
267 | | - allocs_tot = @allocations mcsolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj=ntraj, progress_bar = Val(false)) # Warm-up |
268 | | - allocs_tot = @allocations mcsolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj=ntraj, progress_bar = Val(false)) |
| 269 | + allocs_tot = |
| 270 | + @allocations mcsolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj = ntraj, progress_bar = Val(false)) # Warm-up |
| 271 | + allocs_tot = |
| 272 | + @allocations mcsolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj = ntraj, progress_bar = Val(false)) |
269 | 273 | @test allocs_tot < 160 * ntraj + 500 # 150 allocations per trajectory + 500 for initialization |
270 | 274 |
|
271 | | - allocs_tot = @allocations mcsolve(H, ψ0, tlist, c_ops, ntraj=ntraj, saveat = [tlist[end]], progress_bar = Val(false)) # Warm-up |
272 | | - allocs_tot = @allocations mcsolve(H, ψ0, tlist, c_ops, ntraj=ntraj, saveat = [tlist[end]], progress_bar = Val(false)) |
| 275 | + allocs_tot = @allocations mcsolve( |
| 276 | + H, |
| 277 | + ψ0, |
| 278 | + tlist, |
| 279 | + c_ops, |
| 280 | + ntraj = ntraj, |
| 281 | + saveat = [tlist[end]], |
| 282 | + progress_bar = Val(false), |
| 283 | + ) # Warm-up |
| 284 | + allocs_tot = @allocations mcsolve( |
| 285 | + H, |
| 286 | + ψ0, |
| 287 | + tlist, |
| 288 | + c_ops, |
| 289 | + ntraj = ntraj, |
| 290 | + saveat = [tlist[end]], |
| 291 | + progress_bar = Val(false), |
| 292 | + ) |
273 | 293 | @test allocs_tot < 160 * ntraj + 300 # 100 allocations per trajectory + 300 for initialization |
274 | 294 | end |
275 | 295 |
|
276 | 296 | @testset "Memory Allocations (ssesolve)" begin |
277 | | - allocs_tot = @allocations ssesolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj=100, progress_bar = Val(false)) # Warm-up |
278 | | - allocs_tot = @allocations ssesolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj=100, progress_bar = Val(false)) |
| 297 | + allocs_tot = |
| 298 | + @allocations ssesolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj = 100, progress_bar = Val(false)) # Warm-up |
| 299 | + allocs_tot = |
| 300 | + @allocations ssesolve(H, ψ0, tlist, c_ops, e_ops = e_ops, ntraj = 100, progress_bar = Val(false)) |
279 | 301 | @test allocs_tot < 1950000 # TODO: Fix this high number of allocations |
280 | 302 |
|
281 | | - allocs_tot = @allocations ssesolve(H, ψ0, tlist, c_ops, ntraj=100, saveat = [tlist[end]], progress_bar = Val(false)) # Warm-up |
282 | | - allocs_tot = @allocations ssesolve(H, ψ0, tlist, c_ops, ntraj=100, saveat = [tlist[end]], progress_bar = Val(false)) |
| 303 | + allocs_tot = @allocations ssesolve( |
| 304 | + H, |
| 305 | + ψ0, |
| 306 | + tlist, |
| 307 | + c_ops, |
| 308 | + ntraj = 100, |
| 309 | + saveat = [tlist[end]], |
| 310 | + progress_bar = Val(false), |
| 311 | + ) # Warm-up |
| 312 | + allocs_tot = @allocations ssesolve( |
| 313 | + H, |
| 314 | + ψ0, |
| 315 | + tlist, |
| 316 | + c_ops, |
| 317 | + ntraj = 100, |
| 318 | + saveat = [tlist[end]], |
| 319 | + progress_bar = Val(false), |
| 320 | + ) |
283 | 321 | @test allocs_tot < 570000 # TODO: Fix this high number of allocations |
284 | 322 | end |
285 | 323 |
|
|
0 commit comments