Skip to content

Commit 804ff20

Browse files
Change the default number of trajectories
1 parent 19c1e0c commit 804ff20

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/time_evolution/smesolve.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ end
157157
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
158158
params = NullParameters(),
159159
rng::AbstractRNG = default_rng(),
160-
ntraj::Int = 1,
160+
ntraj::Int = 500,
161161
ensemble_method = EnsembleThreads(),
162162
prob_func::Union{Function, Nothing} = nothing,
163163
output_func::Union{Tuple,Nothing} = nothing,
@@ -196,7 +196,7 @@ Above, ``\hat{C}_i`` represent the collapse operators related to pure dissipatio
196196
- `e_ops`: List of operators for which to calculate expectation values. It can be either a `Vector` or a `Tuple`.
197197
- `params`: `NullParameters` of parameters to pass to the solver.
198198
- `rng`: Random number generator for reproducibility.
199-
- `ntraj`: Number of trajectories to use.
199+
- `ntraj`: Number of trajectories to use. Default is `500`.
200200
- `ensemble_method`: Ensemble method to use. Default to `EnsembleThreads()`.
201201
- `prob_func`: Function to use for generating the SDEProblem.
202202
- `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.
@@ -224,7 +224,7 @@ function smesolveEnsembleProblem(
224224
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
225225
params = NullParameters(),
226226
rng::AbstractRNG = default_rng(),
227-
ntraj::Int = 1,
227+
ntraj::Int = 500,
228228
ensemble_method = EnsembleThreads(),
229229
prob_func::Union{Function,Nothing} = nothing,
230230
output_func::Union{Tuple,Nothing} = nothing,
@@ -281,7 +281,7 @@ end
281281
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
282282
params = NullParameters(),
283283
rng::AbstractRNG = default_rng(),
284-
ntraj::Int = 1,
284+
ntraj::Int = 500,
285285
ensemble_method = EnsembleThreads(),
286286
prob_func::Union{Function, Nothing} = nothing,
287287
output_func::Union{Tuple,Nothing} = nothing,
@@ -321,7 +321,7 @@ Above, ``\hat{C}_i`` represent the collapse operators related to pure dissipatio
321321
- `e_ops`: List of operators for which to calculate expectation values. It can be either a `Vector` or a `Tuple`.
322322
- `params`: `NullParameters` of parameters to pass to the solver.
323323
- `rng`: Random number generator for reproducibility.
324-
- `ntraj`: Number of trajectories to use.
324+
- `ntraj`: Number of trajectories to use. Default is `500`.
325325
- `ensemble_method`: Ensemble method to use. Default to `EnsembleThreads()`.
326326
- `prob_func`: Function to use for generating the SDEProblem.
327327
- `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.
@@ -350,7 +350,7 @@ function smesolve(
350350
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
351351
params = NullParameters(),
352352
rng::AbstractRNG = default_rng(),
353-
ntraj::Int = 1,
353+
ntraj::Int = 500,
354354
ensemble_method = EnsembleThreads(),
355355
prob_func::Union{Function,Nothing} = nothing,
356356
output_func::Union{Tuple,Nothing} = nothing,
@@ -382,7 +382,7 @@ end
382382
function smesolve(
383383
ens_prob::TimeEvolutionProblem,
384384
alg::StochasticDiffEqAlgorithm = SRA1(),
385-
ntraj::Int = 1,
385+
ntraj::Int = 500,
386386
ensemble_method = EnsembleThreads(),
387387
)
388388
sol = _ensemble_dispatch_solve(ens_prob, alg, ensemble_method, ntraj)

src/time_evolution/ssesolve.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ end
156156
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
157157
params = NullParameters(),
158158
rng::AbstractRNG = default_rng(),
159-
ntraj::Int = 1,
159+
ntraj::Int = 500,
160160
ensemble_method = EnsembleThreads(),
161161
prob_func::Union{Function, Nothing} = nothing,
162162
output_func::Union{Tuple,Nothing} = nothing,
@@ -195,7 +195,7 @@ Above, ``\hat{S}_n`` are the stochastic collapse operators and ``dW_n(t)`` is t
195195
- `e_ops`: List of operators for which to calculate expectation values. It can be either a `Vector` or a `Tuple`.
196196
- `params`: `NullParameters` of parameters to pass to the solver.
197197
- `rng`: Random number generator for reproducibility.
198-
- `ntraj`: Number of trajectories to use.
198+
- `ntraj`: Number of trajectories to use. Default is `500`.
199199
- `ensemble_method`: Ensemble method to use. Default to `EnsembleThreads()`.
200200
- `jump_callback`: The Jump Callback type: Discrete or Continuous. The default is `ContinuousLindbladJumpCallback()`, which is more precise.
201201
- `prob_func`: Function to use for generating the SDEProblem.
@@ -223,7 +223,7 @@ function ssesolveEnsembleProblem(
223223
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
224224
params = NullParameters(),
225225
rng::AbstractRNG = default_rng(),
226-
ntraj::Int = 1,
226+
ntraj::Int = 500,
227227
ensemble_method = EnsembleThreads(),
228228
prob_func::Union{Function,Nothing} = nothing,
229229
output_func::Union{Tuple,Nothing} = nothing,
@@ -278,7 +278,7 @@ end
278278
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
279279
params = NullParameters(),
280280
rng::AbstractRNG = default_rng(),
281-
ntraj::Int = 1,
281+
ntraj::Int = 500,
282282
ensemble_method = EnsembleThreads(),
283283
prob_func::Union{Function, Nothing} = nothing,
284284
output_func::Union{Tuple,Nothing} = nothing,
@@ -321,7 +321,7 @@ Above, ``\hat{S}_n`` are the stochastic collapse operators and ``dW_n(t)`` is th
321321
- `e_ops`: List of operators for which to calculate expectation values. It can be either a `Vector` or a `Tuple`.
322322
- `params`: `NullParameters` of parameters to pass to the solver.
323323
- `rng`: Random number generator for reproducibility.
324-
- `ntraj`: Number of trajectories to use.
324+
- `ntraj`: Number of trajectories to use. Default is `500`.
325325
- `ensemble_method`: Ensemble method to use. Default to `EnsembleThreads()`.
326326
- `prob_func`: Function to use for generating the SDEProblem.
327327
- `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.
@@ -350,7 +350,7 @@ function ssesolve(
350350
e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
351351
params = NullParameters(),
352352
rng::AbstractRNG = default_rng(),
353-
ntraj::Int = 1,
353+
ntraj::Int = 500,
354354
ensemble_method = EnsembleThreads(),
355355
prob_func::Union{Function,Nothing} = nothing,
356356
output_func::Union{Tuple,Nothing} = nothing,
@@ -381,7 +381,7 @@ end
381381
function ssesolve(
382382
ens_prob::TimeEvolutionProblem,
383383
alg::StochasticDiffEqAlgorithm = SRA1(),
384-
ntraj::Int = 1,
384+
ntraj::Int = 500,
385385
ensemble_method = EnsembleThreads(),
386386
)
387387
sol = _ensemble_dispatch_solve(ens_prob, alg, ensemble_method, ntraj)

test/core-test/time_evolution.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@
132132
progress_bar = Val(false),
133133
jump_callback = DiscreteLindbladJumpCallback(),
134134
)
135-
sol_sse = ssesolve(H, ψ0, tlist, c_ops, ntraj = 500, e_ops = e_ops, progress_bar = Val(false))
136-
sol_sme = smesolve(H, ψ0, tlist, c_ops_sme, sc_ops_sme, ntraj = 500, e_ops = e_ops, progress_bar = Val(false))
135+
sol_sse = ssesolve(H, ψ0, tlist, c_ops, e_ops = e_ops, progress_bar = Val(false))
136+
sol_sme = smesolve(H, ψ0, tlist, c_ops_sme, sc_ops_sme, e_ops = e_ops, progress_bar = Val(false))
137137

138138
ρt_mc = [ket2dm.(normalize.(states)) for states in sol_mc_states.states]
139139
expect_mc_states = mapreduce(states -> expect.(Ref(e_ops[1]), states), hcat, ρt_mc)

0 commit comments

Comments
 (0)