Skip to content

Commit af25029

Browse files
Make changelog, add example on docs and remove spell check errors
1 parent 40eb529 commit af25029

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1414
- Add more generic solver for `steadystate_floquet` to allow more linear solvers. ([#396])
1515
- Fix time evolution output when using `saveat` keyword argument. ([#398])
1616
- Improve ensemble generation of `ssesolve` and change parameters handling on stochastic processes. ([#403])
17+
- Introduce measurement on `ssesolve` and `smesolve`. ([#404])
1718

1819
## [v0.26.0]
1920
Release date: 2025-02-09
@@ -132,3 +133,4 @@ Release date: 2024-11-13
132133
[#398]: https://github.com/qutip/QuantumToolbox.jl/issues/398
133134
[#402]: https://github.com/qutip/QuantumToolbox.jl/issues/402
134135
[#403]: https://github.com/qutip/QuantumToolbox.jl/issues/403
136+
[#404]: https://github.com/qutip/QuantumToolbox.jl/issues/404

docs/src/users_guide/time_evolution/stochastic.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,16 @@ sse_sol = ssesolve(
105105
sc_ops,
106106
e_ops = [x],
107107
ntraj = ntraj,
108+
store_measurement = Val(true),
108109
)
109110
111+
measurement_avg = sum(sse_sol.measurement, dims=2) / size(sse_sol.measurement, 2)
112+
measurement_avg = dropdims(measurement_avg, dims=2)
113+
110114
# plot by CairoMakie.jl
111115
fig = Figure(size = (500, 350))
112116
ax = Axis(fig[1, 1], xlabel = "Time")
113-
#lines!(ax, tlist, real(sse_sol.xxxxxx), label = L"J_x", color = :red, linestyle = :solid) TODO: add this in the future
117+
lines!(ax, tlist[1:end-1], real(measurement_avg[1,:]), label = L"J_x", color = :red, linestyle = :solid)
114118
lines!(ax, tlist, real(sse_sol.expect[1,:]), label = L"\langle x \rangle", color = :black, linestyle = :solid)
115119
116120
axislegend(ax, position = :rt)
@@ -134,12 +138,16 @@ sme_sol = smesolve(
134138
sc_ops,
135139
e_ops = [x],
136140
ntraj = ntraj,
141+
store_measurement = Val(true),
137142
)
138143
144+
measurement_avg = sum(sme_sol.measurement, dims=2) / size(sme_sol.measurement, 2)
145+
measurement_avg = dropdims(measurement_avg, dims=2)
146+
139147
# plot by CairoMakie.jl
140148
fig = Figure(size = (500, 350))
141149
ax = Axis(fig[1, 1], xlabel = "Time")
142-
#lines!(ax, tlist, real(sme_sol.xxxxxx), label = L"J_x", color = :red, linestyle = :solid) TODO: add this in the future
150+
lines!(ax, tlist[1:end-1], real(measurement_avg[1,:]), label = L"J_x", color = :red, linestyle = :solid)
143151
lines!(ax, tlist, real(sme_sol.expect[1,:]), label = L"\langle x \rangle", color = :black, linestyle = :solid)
144152
145153
axislegend(ax, position = :rt)

src/time_evolution/callback_helpers/smesolve_callback_helpers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Helper functions for the smesolve callbacks. Almost equal to the mesolve case, b
55
struct SaveFuncSMESolve{
66
SM,
77
TE,
8-
TME,
8+
TE2,
99
PT<:Union{Nothing,ProgressBar},
1010
IT,
1111
TEXPV<:Union{Nothing,AbstractMatrix},
1212
TMEXPV<:Union{Nothing,AbstractMatrix},
1313
} <: AbstractSaveFunc
1414
store_measurement::Val{SM}
1515
e_ops::TE
16-
m_ops::TME
16+
m_ops::TE2
1717
progr::PT
1818
iter::IT
1919
expvals::TEXPV

src/time_evolution/callback_helpers/ssesolve_callback_helpers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ Helper functions for the ssesolve callbacks. Almost equal to the sesolve case, b
55
struct SaveFuncSSESolve{
66
SM,
77
TE,
8-
TME,
8+
TE2,
99
PT<:Union{Nothing,ProgressBar},
1010
IT,
1111
TEXPV<:Union{Nothing,AbstractMatrix},
1212
TMEXPV<:Union{Nothing,AbstractMatrix},
1313
} <: AbstractSaveFunc
1414
store_measurement::Val{SM}
1515
e_ops::TE
16-
m_ops::TME
16+
m_ops::TE2
1717
progr::PT
1818
iter::IT
1919
expvals::TEXPV

0 commit comments

Comments
 (0)