Skip to content

Commit 72e7b79

Browse files
Fix steadystate
1 parent b1db66e commit 72e7b79

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/time_evolution/time_evolution.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ export TimeEvolutionSol, TimeEvolutionMCSol, TimeEvolutionStochasticSol
22

33
export liouvillian_floquet, liouvillian_generalized
44

5-
const DEFAULT_ODE_SOLVER_OPTIONS = (abstol = 1e-8, reltol = 1e-6, save_everystep = false)
6-
const DEFAULT_SDE_SOLVER_OPTIONS = (abstol = 1e-2, reltol = 1e-2, save_everystep = false)
5+
const DEFAULT_ODE_SOLVER_OPTIONS = (abstol = 1e-8, reltol = 1e-6, save_everystep = false, save_end = true)
6+
const DEFAULT_SDE_SOLVER_OPTIONS = (abstol = 1e-2, reltol = 1e-2, save_everystep = false, save_end = true)
77
const JUMP_TIMES_WHICH_INIT_SIZE = 200
88

99
@doc raw"""
@@ -237,7 +237,13 @@ function _merge_saveat(tlist, e_ops, default_options; kwargs...)
237237
saveat = is_empty_e_ops ? tlist : [tlist[end]]
238238
default_values = (default_options..., saveat = saveat)
239239
kwargs2 = merge(default_values, kwargs)
240-
save_end = tlist[end] in kwargs2.saveat # DifferentialEquations.jl has this weird setting
240+
241+
# DifferentialEquations.jl has this weird save_end setting
242+
# So we need to do this to make sure it's consistent
243+
haskey(kwargs, :save_end) && return kwargs2
244+
isempty(kwargs2.saveat) && return kwargs2
245+
246+
save_end = tlist[end] in kwargs2.saveat
241247
return merge(kwargs2, (save_end = save_end,))
242248
end
243249

0 commit comments

Comments
 (0)