Skip to content

Commit 5911791

Browse files
authored
[Doc] QobjEvo documentation page (#334)
* add `QobjEvo` documentation page * move some import of `CairoMakie.jl` to `@setup` block * fix typos
1 parent 1b68de4 commit 5911791

File tree

7 files changed

+370
-12
lines changed

7 files changed

+370
-12
lines changed

docs/src/users_guide/QuantumObject/QuantumObject.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ println(isoper(a)) # operator
174174
println(isoperket(a)) # operator-ket
175175
println(isoperbra(a)) # operator-bra
176176
println(issuper(a)) # super operator
177+
println(isconstant(a)) # time-independent or not
177178
println(ishermitian(a)) # Hermitian
178179
println(isherm(a)) # synonym of ishermitian(a)
179180
println(issymmetric(a)) # symmetric

docs/src/users_guide/steadystate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ exp_mc = real(sol_mc.expect[1, :])
104104
sol_me = mesolve(H, ψ0, tlist, c_ops, e_ops=e_ops, progress_bar=false)
105105
exp_me = real(sol_me.expect[1, :])
106106
107-
# plot the results
107+
# plot by CairoMakie.jl
108108
fig = Figure(size = (500, 350))
109109
ax = Axis(fig[1, 1],
110110
title = L"Decay of Fock state $|10\rangle$ in a thermal environment with $\langle n\rangle=2$",

docs/src/users_guide/time_evolution/intro.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
- [Monte-Carlo Solver](@ref doc-TE:Monte-Carlo-Solver)
2020
- [Stochastic Solver](@ref doc-TE:Stochastic-Solver)
2121
- [Solving Problems with Time-dependent Hamiltonians](@ref doc-TE:Solving-Problems-with-Time-dependent-Hamiltonians)
22+
- [Generate QobjEvo](@ref doc-TE:Generate-QobjEvo)
23+
- [QobjEvo fields (attributes)](@ref doc-TE:QobjEvo-fields-(attributes))
24+
- [Using parameters](@ref doc-TE:Using-parameters)
2225

2326
# [Introduction](@id doc-TE:Introduction)
2427

docs/src/users_guide/time_evolution/mesolve.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
```@setup mesolve
44
using QuantumToolbox
5+
6+
using CairoMakie
7+
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
58
```
69

710
## [Von Neumann equation](@id doc-TE:Von-Neumann-equation)
@@ -123,13 +126,11 @@ sol = mesolve(H, ψ0, tlist, c_ops, e_ops = [sigmaz(), sigmay()])
123126
We can therefore plot the expectation values:
124127

125128
```@example mesolve
126-
using CairoMakie
127-
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
128-
129129
times = sol.times
130130
expt_z = real(sol.expect[1,:])
131131
expt_y = real(sol.expect[2,:])
132132
133+
# plot by CairoMakie.jl
133134
fig = Figure(size = (500, 350))
134135
ax = Axis(fig[1, 1], xlabel = "Time", ylabel = "Expectation values")
135136
lines!(ax, times, expt_z, label = L"\langle\hat{\sigma}_z\rangle", linestyle = :solid)
@@ -166,7 +167,7 @@ e_ops = [a' * a]
166167
sol = mesolve(H, ψ0, tlist, c_ops, e_ops=e_ops)
167168
Num = real(sol.expect[1, :])
168169
169-
# plot the results
170+
# plot by CairoMakie.jl
170171
fig = Figure(size = (500, 350))
171172
ax = Axis(fig[1, 1],
172173
title = L"Decay of Fock state $|10\rangle$ in a thermal environment with $\langle n\rangle=2$",
@@ -213,6 +214,7 @@ times = sol.times
213214
N_atom = real(sol.expect[1,:])
214215
N_cavity = real(sol.expect[2,:])
215216
217+
# plot by CairoMakie.jl
216218
fig = Figure(size = (500, 350))
217219
ax = Axis(fig[1, 1], xlabel = "Time", ylabel = "Expectation values")
218220
lines!(ax, times, N_atom, label = "atom excitation probability", linestyle = :solid)

docs/src/users_guide/time_evolution/sesolve.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ The Schrödinger equation, which governs the time-evolution of closed quantum sy
2323

2424
```@setup sesolve
2525
using QuantumToolbox
26+
27+
using CairoMakie
28+
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
2629
```
2730

2831
For example, the time evolution of a quantum spin-``\frac{1}{2}`` system (initialized in spin-``\uparrow``) with tunneling rate ``0.1`` is calculated, and the expectation values of the Pauli-Z operator ``\hat{\sigma}_z`` is also evaluated, with the following code
@@ -68,12 +71,10 @@ print(size(expt))
6871
We can therefore plot the expectation values:
6972

7073
```@example sesolve
71-
using CairoMakie
72-
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
73-
7474
expt_z = real(expt[1,:])
7575
expt_y = real(expt[2,:])
7676
77+
# plot by CairoMakie.jl
7778
fig = Figure(size = (500, 350))
7879
ax = Axis(fig[1, 1], xlabel = "Time", ylabel = "Expectation values")
7980
lines!(ax, times, expt_z, label = L"\langle\hat{\sigma}_z\rangle", linestyle = :solid)

docs/src/users_guide/time_evolution/solution.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
```@setup TE-solution
44
using QuantumToolbox
5+
6+
using CairoMakie
7+
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
58
```
69

710
## [Solution](@id doc-TE:Solution)
@@ -61,9 +64,7 @@ nothing # hide
6164
we can plot the resulting expectation values:
6265

6366
```@example TE-solution
64-
using CairoMakie
65-
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
66-
67+
# plot by CairoMakie.jl
6768
fig = Figure(size = (500, 350))
6869
ax = Axis(fig[1, 1], xlabel = L"t")
6970
lines!(ax, times, expt1, label = L"\langle 0 | \rho(t) | 0 \rangle")

0 commit comments

Comments
 (0)