Skip to content

Commit c217e8f

Browse files
Change expect property names
1 parent c4380df commit c217e8f

File tree

5 files changed

+19
-12
lines changed

5 files changed

+19
-12
lines changed

src/time_evolution/mcsolve.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ function mcsolve(
413413
ens_prob_mc.times,
414414
states,
415415
expvals,
416+
expvals, # This is average_expect
416417
expvals_all,
417418
col_times,
418419
col_which,

src/time_evolution/smesolve.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ function smesolve(
373373
ens_prob.times,
374374
states,
375375
expvals,
376+
expvals, # This is average_expect
376377
expvals_all,
377378
sol.converged,
378379
_sol_1.alg,

src/time_evolution/ssesolve.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ function ssesolve(
374374
ens_prob.times,
375375
states,
376376
expvals,
377+
expvals, # This is average_expect
377378
expvals_all,
378379
sol.converged,
379380
_sol_1.alg,

src/time_evolution/time_evolution.jl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ A structure storing the results and some information from solving quantum trajec
9999
- `times::AbstractVector`: The time list of the evolution.
100100
- `states::Vector{Vector{QuantumObject}}`: The list of result states in each trajectory.
101101
- `expect::Union{AbstractMatrix,Nothing}`: The expectation values (averaging all trajectories) corresponding to each time point in `times`.
102-
- `expect_all::Union{AbstractMatrix,Nothing}`: The expectation values corresponding to each trajectory and each time point in `times`
102+
- `average_expect::Union{AbstractMatrix,Nothing}`: The expectation values (averaging all trajectories) corresponding to each time point in `times`.
103+
- `runs_expect::Union{AbstractArray,Nothing}`: The expectation values corresponding to each trajectory and each time point in `times`
103104
- `col_times::Vector{Vector{Real}}`: The time records of every quantum jump occurred in each trajectory.
104105
- `col_which::Vector{Vector{Int}}`: The indices of which collapse operator was responsible for each quantum jump in `col_times`.
105106
- `converged::Bool`: Whether the solution is converged or not.
@@ -122,7 +123,8 @@ struct TimeEvolutionMCSol{
122123
times::TT
123124
states::TS
124125
expect::TE
125-
expect_all::TEA
126+
average_expect::TE # Currently just a synonym for `expect`
127+
runs_expect::TEA
126128
col_times::TJT
127129
col_which::TJW
128130
converged::Bool
@@ -140,7 +142,7 @@ function Base.show(io::IO, sol::TimeEvolutionMCSol)
140142
if sol.expect isa Nothing
141143
print(io, "num_expect = 0\n")
142144
else
143-
print(io, "num_expect = $(size(sol.expect, 1))\n")
145+
print(io, "num_expect = $(size(sol.average_expect, 1))\n")
144146
end
145147
print(io, "ODE alg.: $(sol.alg)\n")
146148
print(io, "abstol = $(sol.abstol)\n")
@@ -159,7 +161,8 @@ A structure storing the results and some information from solving trajectories o
159161
- `times::AbstractVector`: The time list of the evolution.
160162
- `states::Vector{Vector{QuantumObject}}`: The list of result states in each trajectory.
161163
- `expect::Union{AbstractMatrix,Nothing}`: The expectation values (averaging all trajectories) corresponding to each time point in `times`.
162-
- `expect_all::Union{AbstractArray,Nothing}`: The expectation values corresponding to each trajectory and each time point in `times`
164+
- `average_expect::Union{AbstractMatrix,Nothing}`: The expectation values (averaging all trajectories) corresponding to each time point in `times`.
165+
- `runs_expect::Union{AbstractArray,Nothing}`: The expectation values corresponding to each trajectory and each time point in `times`
163166
- `converged::Bool`: Whether the solution is converged or not.
164167
- `alg`: The algorithm which is used during the solving process.
165168
- `abstol::Real`: The absolute tolerance which is used during the solving process.
@@ -178,7 +181,8 @@ struct TimeEvolutionStochasticSol{
178181
times::TT
179182
states::TS
180183
expect::TE
181-
expect_all::TEA
184+
average_expect::TE # Currently just a synonym for `expect`
185+
runs_expect::TEA
182186
converged::Bool
183187
alg::AlgT
184188
abstol::AT
@@ -194,7 +198,7 @@ function Base.show(io::IO, sol::TimeEvolutionStochasticSol)
194198
if sol.expect isa Nothing
195199
print(io, "num_expect = 0\n")
196200
else
197-
print(io, "num_expect = $(size(sol.expect, 1))\n")
201+
print(io, "num_expect = $(size(sol.average_expect, 1))\n")
198202
end
199203
print(io, "SDE alg.: $(sol.alg)\n")
200204
print(io, "abstol = $(sol.abstol)\n")

test/core-test/time_evolution.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -660,21 +660,21 @@
660660
)
661661

662662
@test sol_mc1.expect sol_mc2.expect atol = 1e-10
663-
@test sol_mc1.expect_all sol_mc2.expect_all atol = 1e-10
663+
@test sol_mc1.runs_expect sol_mc2.runs_expect atol = 1e-10
664664
@test sol_mc1.col_times sol_mc2.col_times atol = 1e-10
665665
@test sol_mc1.col_which sol_mc2.col_which atol = 1e-10
666666

667-
@test sol_mc1.expect_all sol_mc3.expect_all[:, 1:500, :] atol = 1e-10
667+
@test sol_mc1.runs_expect sol_mc3.runs_expect[:, 1:500, :] atol = 1e-10
668668

669669
@test sol_sse1.expect sol_sse2.expect atol = 1e-10
670-
@test sol_sse1.expect_all sol_sse2.expect_all atol = 1e-10
670+
@test sol_sse1.runs_expect sol_sse2.runs_expect atol = 1e-10
671671

672-
@test sol_sse1.expect_all sol_sse3.expect_all[:, 1:50, :] atol = 1e-10
672+
@test sol_sse1.runs_expect sol_sse3.runs_expect[:, 1:50, :] atol = 1e-10
673673

674674
@test sol_sme1.expect sol_sme2.expect atol = 1e-10
675-
@test sol_sme1.expect_all sol_sme2.expect_all atol = 1e-10
675+
@test sol_sme1.runs_expect sol_sme2.runs_expect atol = 1e-10
676676

677-
@test sol_sme1.expect_all sol_sme3.expect_all[:, 1:50, :] atol = 1e-10
677+
@test sol_sme1.runs_expect sol_sme3.runs_expect[:, 1:50, :] atol = 1e-10
678678
end
679679
end
680680

0 commit comments

Comments
 (0)