Skip to content

Commit

Permalink
Merge pull request #7 from AmitRotem/promote_TimeDependentSum_to_Dual
Browse files Browse the repository at this point in the history
promote TimeDependentSum in schroedinger_dynamics
  • Loading branch information
AmitRotem authored Dec 24, 2023
2 parents ec2e6b9 + 2349826 commit a3b376b
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 a3b376b

Please sign in to comment.