From 2349826f649b41ecd75154982ab80f9e853b7d8c Mon Sep 17 00:00:00 2001 From: Amit Rotem <66641519+AmitRotem@users.noreply.github.com> Date: Sun, 24 Dec 2023 09:27:19 +0200 Subject: [PATCH] promote TimeDependentSum in schroedinger_dynamics --- src/schroedinger.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/schroedinger.jl b/src/schroedinger.jl index ede39534..fffc12b1 100644 --- a/src/schroedinger.jl +++ b/src/schroedinger.jl @@ -56,7 +56,9 @@ end function schroedinger_dynamic(tspan, psi0::T, H::AbstractTimeDependentOperator; kwargs...) where {B,Bp,T<:Union{AbstractOperator{B,Bp},StateVector{B}}} - schroedinger_dynamic(tspan, psi0, schroedinger_dynamic_function(H); kwargs...) + tspan, psi0 = _promote_time_and_state(psi0, H, tspan) + Ht = TimeDependentSum(H.coefficients, H.static_op; init_time=zero(promote_type(eltype(tspan), typeof(current_time(H))))) + schroedinger_dynamic(tspan, psi0, schroedinger_dynamic_function(Ht); kwargs...) end """