|
2 | 2 |
|
3 | 3 | ```@setup mesolve |
4 | 4 | using QuantumToolbox |
| 5 | +
|
| 6 | +using CairoMakie |
| 7 | +CairoMakie.enable_only_mime!(MIME"image/svg+xml"()) |
5 | 8 | ``` |
6 | 9 |
|
7 | 10 | ## [Von Neumann equation](@id doc-TE:Von-Neumann-equation) |
@@ -123,13 +126,11 @@ sol = mesolve(H, ψ0, tlist, c_ops, e_ops = [sigmaz(), sigmay()]) |
123 | 126 | We can therefore plot the expectation values: |
124 | 127 |
|
125 | 128 | ```@example mesolve |
126 | | -using CairoMakie |
127 | | -CairoMakie.enable_only_mime!(MIME"image/svg+xml"()) |
128 | | -
|
129 | 129 | times = sol.times |
130 | 130 | expt_z = real(sol.expect[1,:]) |
131 | 131 | expt_y = real(sol.expect[2,:]) |
132 | 132 |
|
| 133 | +# plot by CairoMakie.jl |
133 | 134 | fig = Figure(size = (500, 350)) |
134 | 135 | ax = Axis(fig[1, 1], xlabel = "Time", ylabel = "Expectation values") |
135 | 136 | lines!(ax, times, expt_z, label = L"\langle\hat{\sigma}_z\rangle", linestyle = :solid) |
@@ -166,7 +167,7 @@ e_ops = [a' * a] |
166 | 167 | sol = mesolve(H, ψ0, tlist, c_ops, e_ops=e_ops) |
167 | 168 | Num = real(sol.expect[1, :]) |
168 | 169 |
|
169 | | -# plot the results |
| 170 | +# plot by CairoMakie.jl |
170 | 171 | fig = Figure(size = (500, 350)) |
171 | 172 | ax = Axis(fig[1, 1], |
172 | 173 | title = L"Decay of Fock state $|10\rangle$ in a thermal environment with $\langle n\rangle=2$", |
@@ -213,6 +214,7 @@ times = sol.times |
213 | 214 | N_atom = real(sol.expect[1,:]) |
214 | 215 | N_cavity = real(sol.expect[2,:]) |
215 | 216 |
|
| 217 | +# plot by CairoMakie.jl |
216 | 218 | fig = Figure(size = (500, 350)) |
217 | 219 | ax = Axis(fig[1, 1], xlabel = "Time", ylabel = "Expectation values") |
218 | 220 | lines!(ax, times, N_atom, label = "atom excitation probability", linestyle = :solid) |
|
0 commit comments