Skip to content

Commit

Permalink
promote TimeDependentSum in schroedinger_dynamics
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitRotem authored Dec 24, 2023
1 parent 8012aa8 commit 2349826
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/schroedinger.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

"""
Expand Down

0 comments on commit 2349826

Please sign in to comment.