You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Introduce new methods of `sesolve_map` and `mesolve_map` for advanced usage. Users can now customize their own `iter`ator structure, `prob_func` and `output_func`. ([#565])
) where {HOpType<:Union{Operator,SuperOperator},StateOpType<:Union{Ket,Operator,OperatorKet}} =
349
+
mesolve_map(H, [ψ0], tlist, c_ops; kwargs...)
350
+
351
+
# this method is for advanced usage
352
+
# User can define their own iterator structure, prob_func and output_func
353
+
# - `prob_func`: Function to use for generating the ODEProblem.
354
+
# - `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.
355
+
#
356
+
# Return: An array of TimeEvolutionSol objects with the size same as the given iter.
357
+
functionmesolve_map(
358
+
prob::TimeEvolutionProblem{<:ODEProblem},
359
+
iter::AbstractArray,
360
+
alg::OrdinaryDiffEqAlgorithm=Tsit5(),
361
+
ensemblealg::EnsembleAlgorithm=EnsembleThreads();
362
+
prob_func::Union{Function,Nothing}=nothing,
363
+
output_func::Union{Tuple,Nothing}=nothing,
364
+
progress_bar::Union{Val,Bool}=Val(true),
365
+
)
366
+
# generate ensemble problem
367
+
ntraj =length(iter)
368
+
_prob_func =isnothing(prob_func) ? (prob, i, repeat) ->_se_me_map_prob_func(prob, i, repeat, iter) : prob_func
# User can define their own iterator structure, prob_func and output_func
262
+
# - `prob_func`: Function to use for generating the ODEProblem.
263
+
# - `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.
264
+
#
265
+
# Return: An array of TimeEvolutionSol objects with the size same as the given iter.
266
+
functionsesolve_map(
267
+
prob::TimeEvolutionProblem{<:ODEProblem},
268
+
iter::AbstractArray,
269
+
alg::OrdinaryDiffEqAlgorithm=Tsit5(),
270
+
ensemblealg::EnsembleAlgorithm=EnsembleThreads();
271
+
prob_func::Union{Function,Nothing}=nothing,
272
+
output_func::Union{Tuple,Nothing}=nothing,
273
+
progress_bar::Union{Val,Bool}=Val(true),
274
+
)
275
+
# generate ensemble problem
276
+
ntraj =length(iter)
277
+
_prob_func =isnothing(prob_func) ? (prob, i, repeat) ->_se_me_map_prob_func(prob, i, repeat, iter) : prob_func
0 commit comments