Skip to content

Commit b01ecb5

Browse files
Improve ensemble generation of ssesolve
1 parent d03eed5 commit b01ecb5

File tree

3 files changed

+135
-185
lines changed

3 files changed

+135
-185
lines changed

src/time_evolution/smesolve.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ _smesolve_ScalarOperator(op_vec) =
1717
c_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
1818
sc_ops::Union{Nothing,AbstractVector,Tuple} = nothing;
1919
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
20-
params::NullParameters = NullParameters(),
20+
params = NullParameters(),
2121
rng::AbstractRNG = default_rng(),
2222
progress_bar::Union{Val,Bool} = Val(true),
2323
kwargs...,
@@ -74,7 +74,7 @@ function smesolveProblem(
7474
c_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
7575
sc_ops::Union{Nothing,AbstractVector,Tuple} = nothing;
7676
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
77-
params::NullParameters = NullParameters(),
77+
params = NullParameters(),
7878
rng::AbstractRNG = default_rng(),
7979
progress_bar::Union{Val,Bool} = Val(true),
8080
kwargs...,
@@ -139,7 +139,7 @@ end
139139
c_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
140140
sc_ops::Union{Nothing,AbstractVector,Tuple} = nothing;
141141
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
142-
params::NullParameters = NullParameters(),
142+
params = NullParameters(),
143143
rng::AbstractRNG = default_rng(),
144144
ntraj::Int = 1,
145145
ensemble_method = EnsembleThreads(),
@@ -181,7 +181,7 @@ Above, ``\hat{C}_i`` represent the collapse operators related to pure dissipatio
181181
- `rng`: Random number generator for reproducibility.
182182
- `ntraj`: Number of trajectories to use.
183183
- `ensemble_method`: Ensemble method to use. Default to `EnsembleThreads()`.
184-
- `prob_func`: Function to use for generating the ODEProblem.
184+
- `prob_func`: Function to use for generating the SDEProblem.
185185
- `output_func`: a `Tuple` containing the `Function` to use for generating the output of a single trajectory, the (optional) `ProgressBar` object, and the (optional) `RemoteChannel` object.
186186
- `progress_bar`: Whether to show the progress bar. Using non-`Val` types might lead to type instabilities.
187187
- `kwargs`: The keyword arguments for the ODEProblem.
@@ -204,7 +204,7 @@ function smesolveEnsembleProblem(
204204
c_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
205205
sc_ops::Union{Nothing,AbstractVector,Tuple} = nothing;
206206
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
207-
params::NullParameters = NullParameters(),
207+
params = NullParameters(),
208208
rng::AbstractRNG = default_rng(),
209209
ntraj::Int = 1,
210210
ensemble_method = EnsembleThreads(),
@@ -252,7 +252,7 @@ end
252252
sc_ops::Union{Nothing,AbstractVector,Tuple} = nothing;
253253
alg::StochasticDiffEqAlgorithm = SRA1(),
254254
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
255-
params::NullParameters = NullParameters(),
255+
params = NullParameters(),
256256
rng::AbstractRNG = default_rng(),
257257
ntraj::Int = 1,
258258
ensemble_method = EnsembleThreads(),
@@ -295,7 +295,7 @@ Above, ``\hat{C}_i`` represent the collapse operators related to pure dissipatio
295295
- `rng`: Random number generator for reproducibility.
296296
- `ntraj`: Number of trajectories to use.
297297
- `ensemble_method`: Ensemble method to use. Default to `EnsembleThreads()`.
298-
- `prob_func`: Function to use for generating the ODEProblem.
298+
- `prob_func`: Function to use for generating the SDEProblem.
299299
- `output_func`: a `Tuple` containing the `Function` to use for generating the output of a single trajectory, the (optional) `ProgressBar` object, and the (optional) `RemoteChannel` object.
300300
- `progress_bar`: Whether to show the progress bar. Using non-`Val` types might lead to type instabilities.
301301
- `kwargs`: The keyword arguments for the ODEProblem.
@@ -319,7 +319,7 @@ function smesolve(
319319
sc_ops::Union{Nothing,AbstractVector,Tuple} = nothing;
320320
alg::StochasticDiffEqAlgorithm = SRA1(),
321321
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
322-
params::NullParameters = NullParameters(),
322+
params = NullParameters(),
323323
rng::AbstractRNG = default_rng(),
324324
ntraj::Int = 1,
325325
ensemble_method = EnsembleThreads(),
@@ -359,7 +359,6 @@ function smesolve(
359359
_sol_1 = sol[:, 1]
360360
_expvals_sol_1 = _se_me_sse_get_expvals(_sol_1)
361361

362-
normalize_states = Val(false)
363362
dims = ens_prob.dimensions
364363
_expvals_all = _expvals_sol_1 isa Nothing ? nothing : map(i -> _se_me_sse_get_expvals(sol[:, i]), eachindex(sol))
365364
expvals_all = _expvals_all isa Nothing ? nothing : stack(_expvals_all)

0 commit comments

Comments
 (0)