Skip to content

Commit 8040318

Browse files
Fix instability error on ODE solver
1 parent ae638b1 commit 8040318

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

benchmarks/dynamical_shifted_fock.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,41 @@ function benchmark_dsf!(SUITE)
3838
dsf_params == Δ, F = F, κ = κ, U = U, J = J)
3939

4040
SUITE["Time Evolution"]["Dynamical Shifted Fock"]["mesolve"] = @benchmarkable dsf_mesolve(
41-
H_dsf,
41+
$H_dsf,
4242
$ψ0,
4343
$tlist,
44-
c_ops_dsf,
44+
$c_ops_dsf,
4545
$op_list,
4646
$α0_l,
4747
$dsf_params,
48-
e_ops = e_ops_dsf,
48+
e_ops = $e_ops_dsf,
4949
progress_bar = Val(false),
5050
)
5151

5252
SUITE["Time Evolution"]["Dynamical Shifted Fock"]["mcsolve"]["Serial"] = @benchmarkable dsf_mcsolve(
53-
H_dsf,
53+
$H_dsf,
5454
$ψ0,
5555
$tlist,
56-
c_ops_dsf,
56+
$c_ops_dsf,
5757
$op_list,
5858
$α0_l,
5959
$dsf_params,
6060
ntraj = 100,
61-
e_ops = e_ops_dsf,
61+
e_ops = $e_ops_dsf,
6262
progress_bar = Val(false),
6363
ensemblealg = EnsembleSerial(),
6464
)
6565

6666
SUITE["Time Evolution"]["Dynamical Shifted Fock"]["mcsolve"]["Multithreaded"] = @benchmarkable dsf_mcsolve(
67-
H_dsf,
67+
$H_dsf,
6868
$ψ0,
6969
$tlist,
70-
c_ops_dsf,
70+
$c_ops_dsf,
7171
$op_list,
7272
$α0_l,
7373
$dsf_params,
7474
ntraj = 100,
75-
e_ops = e_ops_dsf,
75+
e_ops = $e_ops_dsf,
7676
progress_bar = Val(false),
7777
ensemblealg = EnsembleThreads(),
7878
)

src/steadystate.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ end
4747
alg = Tsit5(),
4848
ψ0 = nothing,
4949
tmax = Inf,
50-
terminate_reltol = 1e-5,
51-
terminate_abstol = 1e-7
50+
terminate_reltol = 1e-4,
51+
terminate_abstol = 1e-6
5252
)
5353
5454
An ordinary differential equation (ODE) solver for solving [`steadystate`](@ref). It solves the stationary state based on [`mesolve`](@ref) with a termination condition.
@@ -69,8 +69,8 @@ or
6969
- `alg::OrdinaryDiffEqAlgorithm=Tsit5()`: The algorithm to solve the ODE.
7070
- `ψ0::Union{Nothing,QuantumObject}=nothing`: The initial state of the system. If not specified, a random pure state will be generated.
7171
- `tmax::Real=Inf`: The final time step for the steady state problem.
72-
- `terminate_reltol` = The relative tolerance for stationary state terminate condition. Default to `1e-5`.
73-
- `terminate_abstol` = The absolute tolerance for stationary state terminate condition. Default to `1e-7`.
72+
- `terminate_reltol` = The relative tolerance for stationary state terminate condition. Default to `1e-4`.
73+
- `terminate_abstol` = The absolute tolerance for stationary state terminate condition. Default to `1e-6`.
7474
7575
!!! warning "Tolerances for terminate condition"
7676
The terminate condition tolerances `terminate_reltol` and `terminate_abstol` should be larger than `reltol` and `abstol` of [`mesolve`](@ref), respectively.
@@ -87,8 +87,8 @@ Base.@kwdef struct SteadyStateODESolver{
8787
alg::MT = Tsit5()
8888
ψ0::ST = nothing
8989
tmax::TT = Inf
90-
terminate_reltol::RT = 10 * DEFAULT_ODE_SOLVER_OPTIONS.reltol
91-
terminate_abstol::AT = 10 * DEFAULT_ODE_SOLVER_OPTIONS.abstol
90+
terminate_reltol::RT = 1e-4
91+
terminate_abstol::AT = 1e-6
9292
end
9393

9494
@doc raw"""

0 commit comments

Comments
 (0)