Skip to content

Commit f6ccbba

Browse files
authored
[Docs] fix typo in @example block (#246)
1 parent 88519ac commit f6ccbba

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

docs/src/users_guide/steadystate.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ using QuantumToolbox
7171
using CairoMakie
7272
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
7373
74-
7574
# Define parameters
7675
N = 20 # number of basis states to consider
7776
a = destroy(N)
@@ -81,8 +80,10 @@ H = a' * a
8180
n_th = 2 # temperature with average of 2 excitations
8281
8382
# collapse operators
84-
# c_op_list = [ emission ; absorption ]
85-
c_op_list = [ sqrt(κ * (1 + n_th)) * a ; sqrt(κ * n_th) * a' ]
83+
c_op_list = [
84+
sqrt(κ * (n_th + 1)) * a, # emission
85+
sqrt(κ * n_th ) * a' # absorption
86+
]
8687
8788
# find steady-state solution
8889
ρ_ss = steadystate(H, c_op_list)

docs/src/users_guide/time_evolution/solution.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,16 @@ using QuantumToolbox
2424
To understand how to access the data in solution, we will use an example as a guide, although we do not worry about the simulation details at this stage. The Schrödinger equation solver ([`sesolve`](@ref)) used in this example returns [`TimeEvolutionSol`](@ref):
2525

2626
```@example TE-solution
27-
H = 0.5 * sigmax()
27+
H = 0.5 * sigmay()
2828
ψ0 = basis(2, 0)
2929
e_ops = [
3030
proj(basis(2, 0)),
3131
proj(basis(2, 1)),
3232
basis(2, 0) * basis(2, 1)'
3333
]
3434
tlist = LinRange(0, 10, 100)
35-
sol = sesolve(H, ψ0, tlist, e_ops = e_ops, progress_bar = Val(false)); nothing # hide
35+
sol = sesolve(H, ψ0, tlist, e_ops = e_ops, progress_bar = Val(false))
36+
nothing # hide
3637
```
3738

3839
To see what is contained inside the solution, we can use the `print` function:
@@ -46,15 +47,17 @@ It tells us the number of expectation values are computed and the number of stat
4647
```@example TE-solution
4748
expt1 = real(sol.expect[1,:])
4849
expt2 = real(sol.expect[2,:])
49-
expt3 = real(sol.expect[3,:]); nothing # hide
50+
expt3 = real(sol.expect[3,:])
51+
nothing # hide
5052
```
5153

5254
Recall that `Julia` uses `Fortran`-style indexing that begins with one (i.e., `[1,:]` represents the 1-st observable, where `:` represents all values corresponding to `tlist`).
5355

5456
Together with the array of times at which these expectation values are calculated:
5557

5658
```@example TE-solution
57-
times = sol.times; nothing # hide
59+
times = sol.times
60+
nothing # hide
5861
```
5962

6063
we can plot the resulting expectation values:
@@ -64,10 +67,13 @@ using CairoMakie
6467
CairoMakie.enable_only_mime!(MIME"image/svg+xml"())
6568
6669
fig = Figure()
67-
ax = Axis(fig[1, 1])
68-
lines!(ax, times, expt1, label = L"P_00")
69-
lines!(ax, times, expt2, label = L"P_11")
70-
lines!(ax, times, expt3, label = L"P_01")
70+
ax = Axis(fig[1, 1], xlabel = L"t")
71+
lines!(ax, times, expt1, label = L"\langle 0 | \rho(t) | 0 \rangle")
72+
lines!(ax, times, expt2, label = L"\langle 1 | \rho(t) | 1 \rangle")
73+
lines!(ax, times, expt3, label = L"\langle 0 | \rho(t) | 1 \rangle")
74+
75+
ylims!(ax, (-0.5, 1.0))
76+
axislegend(ax, position = :lb)
7177
7278
fig
7379
```

0 commit comments

Comments
 (0)