@@ -62,7 +62,7 @@ _sesolve_make_U_QobjEvo(H) = QobjEvo(H, -1im)
6262 ψ0::QuantumObject{DT2,KetQuantumObject},
6363 tlist::AbstractVector;
6464 e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
65- params::NamedTuple = NamedTuple(),
65+ params::Union{ NamedTuple, AbstractVector} = NamedTuple(),
6666 progress_bar::Union{Val,Bool} = Val(true),
6767 inplace::Union{Val,Bool} = Val(true),
6868 kwargs...,
@@ -80,7 +80,7 @@ Generate the ODEProblem for the Schrödinger time evolution of a quantum system:
8080- `ψ0`: Initial state of the system ``|\p si(0)\r angle``.
8181- `tlist`: List of times at which to save either the state or the expectation values of the system.
8282- `e_ops`: List of operators for which to calculate expectation values. It can be either a `Vector` or a `Tuple`.
83- - `params`: `NamedTuple` of parameters to pass to the solver.
83+ - `params`: `NamedTuple` or `AbstractVector` of parameters to pass to the solver.
8484- `progress_bar`: Whether to show the progress bar. Using non-`Val` types might lead to type instabilities.
8585- `inplace`: Whether to use the inplace version of the ODEProblem. The default is `Val(true)`.
8686- `kwargs`: The keyword arguments for the ODEProblem.
@@ -101,7 +101,7 @@ function sesolveProblem(
101101 ψ0:: QuantumObject{DT2,KetQuantumObject} ,
102102 tlist:: AbstractVector ;
103103 e_ops:: Union{Nothing,AbstractVector,Tuple} = nothing ,
104- params:: NamedTuple = NamedTuple (),
104+ params:: Union{ NamedTuple,AbstractVector} = NamedTuple (),
105105 progress_bar:: Union{Val,Bool} = Val (true ),
106106 inplace:: Union{Val,Bool} = Val (true ),
107107 kwargs... ,
148148 tlist::AbstractVector;
149149 alg::OrdinaryDiffEqAlgorithm = Tsit5(),
150150 e_ops::Union{Nothing,AbstractVector,Tuple} = nothing,
151- params::NamedTuple = NamedTuple(),
151+ params::Union{ NamedTuple, AbstractVector} = NamedTuple(),
152152 progress_bar::Union{Val,Bool} = Val(true),
153153 inplace::Union{Val,Bool} = Val(true),
154154 kwargs...,
@@ -167,7 +167,7 @@ Time evolution of a closed quantum system using the Schrödinger equation:
167167- `tlist`: List of times at which to save either the state or the expectation values of the system.
168168- `alg`: The algorithm for the ODE solver. The default is `Tsit5()`.
169169- `e_ops`: List of operators for which to calculate expectation values. It can be either a `Vector` or a `Tuple`.
170- - `params`: `NamedTuple` of parameters to pass to the solver.
170+ - `params`: `NamedTuple` or `AbstractVector` of parameters to pass to the solver.
171171- `progress_bar`: Whether to show the progress bar. Using non-`Val` types might lead to type instabilities.
172172- `inplace`: Whether to use the inplace version of the ODEProblem. The default is `Val(true)`.
173173- `kwargs`: The keyword arguments for the ODEProblem.
@@ -190,12 +190,21 @@ function sesolve(
190190 tlist:: AbstractVector ;
191191 alg:: OrdinaryDiffEqAlgorithm = Tsit5 (),
192192 e_ops:: Union{Nothing,AbstractVector,Tuple} = nothing ,
193- params:: NamedTuple = NamedTuple (),
193+ params:: Union{ NamedTuple,AbstractVector} = NamedTuple (),
194194 progress_bar:: Union{Val,Bool} = Val (true ),
195195 inplace:: Union{Val,Bool} = Val (true ),
196196 kwargs... ,
197197) where {DT1,DT2}
198- prob = sesolveProblem (H, ψ0, tlist; e_ops = e_ops, params = params, progress_bar = progress_bar, inplace = inplace, kwargs... )
198+ prob = sesolveProblem (
199+ H,
200+ ψ0,
201+ tlist;
202+ e_ops = e_ops,
203+ params = params,
204+ progress_bar = progress_bar,
205+ inplace = inplace,
206+ kwargs... ,
207+ )
199208
200209 return sesolve (prob, alg)
201210end
0 commit comments