Skip to content

Commit 43386dc

Browse files
committed
minor update
1 parent 3c18fe2 commit 43386dc

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

src/time_evolution/sesolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ function sesolve_map(
210210
)
211211

212212
# generate and solve ensemble problem
213-
_output_func = _ensemble_dispatch_output_func(ensemblealg, progress_bar, ntraj) # setup global progress bar
213+
_output_func = _ensemble_dispatch_output_func(ensemblealg, progress_bar, ntraj, _dummy_output_func) # setup global progress bar
214214
ens_prob = TimeEvolutionProblem(
215215
EnsembleProblem(
216216
prob.prob,

src/time_evolution/smesolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function smesolveEnsembleProblem(
251251
) : prob_func
252252
_output_func =
253253
output_func isa Nothing ?
254-
_ensemble_dispatch_output_func(ensemblealg, progress_bar, ntraj, _stochastic_output_func) : output_func
254+
_ensemble_dispatch_output_func(ensemblealg, progress_bar, ntraj, _dummy_output_func) : output_func
255255

256256
prob_sme = smesolveProblem(
257257
H,

src/time_evolution/ssesolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ function ssesolveEnsembleProblem(
245245
) : prob_func
246246
_output_func =
247247
output_func isa Nothing ?
248-
_ensemble_dispatch_output_func(ensemblealg, progress_bar, ntraj, _stochastic_output_func) : output_func
248+
_ensemble_dispatch_output_func(ensemblealg, progress_bar, ntraj, _dummy_output_func) : output_func
249249

250250
prob_sme = ssesolveProblem(
251251
H,

src/time_evolution/time_evolution.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,16 @@ Helpers for handling output of ensemble problems.
357357
This is very useful especially for dispatching which method to use to update the progress bar.
358358
=#
359359

360+
# a dummy output function which does nothing
361+
_dummy_output_func(sol, i) = (sol, false)
362+
360363
# Output function with progress bar update
361-
_ensemble_output_func_progress(sol, i, progr, ::Nothing) = next!(progr)
362364
function _ensemble_output_func_progress(sol, i, progr, output_func)
363365
next!(progr)
364366
return output_func(sol, i)
365367
end
366368

367369
# Output function with distributed channel update for progress bar
368-
_ensemble_output_func_distributed(sol, i, channel, ::Nothing) = put!(channel, true)
369370
function _ensemble_output_func_distributed(sol, i, channel, output_func)
370371
put!(channel, true)
371372
return output_func(sol, i)
@@ -375,7 +376,7 @@ function _ensemble_dispatch_output_func(
375376
::ET,
376377
progress_bar,
377378
ntraj,
378-
output_func = nothing,
379+
output_func,
379380
) where {ET<:Union{EnsembleSerial,EnsembleThreads}}
380381
if getVal(progress_bar)
381382
progr = ProgressBar(ntraj, enable = getVal(progress_bar))
@@ -389,7 +390,7 @@ function _ensemble_dispatch_output_func(
389390
::ET,
390391
progress_bar,
391392
ntraj,
392-
output_func = nothing,
393+
output_func,
393394
) where {ET<:Union{EnsembleSplitThreads,EnsembleDistributed}}
394395
if getVal(progress_bar)
395396
progr = ProgressBar(ntraj, enable = getVal(progress_bar))
@@ -454,9 +455,6 @@ function _stochastic_prob_func(prob, i, repeat, rng, seeds, tlist; kwargs...)
454455
return remake(prob.prob, noise = noise, seed = seed)
455456
end
456457

457-
# Standard output function
458-
_stochastic_output_func(sol, i) = (sol, false)
459-
460458
#=
461459
Define diagonal or non-diagonal noise depending on the type of `sc_ops`.
462460
If `sc_ops` is a `AbstractQuantumObject`, we avoid using the non-diagonal noise.

0 commit comments

Comments
 (0)