Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only use set_time! for tdop updates #369

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/time_dependent_operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ _tuplify(o::AbstractOperator) = o
"""
schroedinger_dynamic_function(H::AbstractTimeDependentOperator)

Creates a function `f(t, state) -> H(t)`. The `state` argument is ignored.
Creates a function of the form `f(t, state) -> H(t)`. The `state` argument is ignored.

This is the function expected by [`timeevolution.schroedinger_dynamic()`](@ref).
"""
function schroedinger_dynamic_function(H::AbstractTimeDependentOperator)
_getfunc(op) = (@inline _tdop_schroedinger_wrapper(t, _) = (op)(t))
_getfunc(op) = (@inline _tdop_schroedinger_wrapper(t, _) = set_time!(op, t))
Htup = _tuplify(H)
return _getfunc(Htup)
end
Expand All @@ -34,7 +34,7 @@ end
"""
master_h_dynamic_function(H::AbstractTimeDependentOperator, Js)

Returns a function `f(t, state) -> H(t), Js, dagger.(Js)`.
Returns a function of the form `f(t, state) -> H(t), Js, dagger.(Js)`.
The `state` argument is ignored.

This is the function expected by [`timeevolution.master_h_dynamic()`](@ref),
Expand All @@ -47,15 +47,15 @@ function master_h_dynamic_function(H::AbstractTimeDependentOperator, Js)

Jdags_tup = _tdopdagger.(Js_tup)
function _getfunc(Hop, Jops, Jdops)
return (@inline _tdop_master_wrapper_1(t, _) = ((Hop)(t), set_time!.(Jops, t), set_time!.(Jdops, t)))
return (@inline _tdop_master_wrapper_1(t, _) = (set_time!(Hop, t), set_time!.(Jops, t), set_time!.(Jdops, t)))
end
return _getfunc(Htup, Js_tup, Jdags_tup)
end

"""
master_nh_dynamic_function(Hnh::AbstractTimeDependentOperator, Js)

Returns a function `f(t, state) -> Hnh(t), Hnh(t)', Js, dagger.(Js)`.
Returns a function of the form `f(t, state) -> Hnh(t), Hnh(t)', Js, dagger.(Js)`.
The `state` argument is currently ignored.

This is the function expected by [`timeevolution.master_nh_dynamic()`](@ref),
Expand All @@ -70,15 +70,15 @@ function master_nh_dynamic_function(Hnh::AbstractTimeDependentOperator, Js)
Htdagup = _tdopdagger(Hnhtup)

function _getfunc(Hop, Hdop, Jops, Jdops)
return (@inline _tdop_master_wrapper_2(t, _) = ((Hop)(t), (Hdop)(t), set_time!.(Jops, t), set_time!.(Jdops, t)))
return (@inline _tdop_master_wrapper_2(t, _) = (set_time!(Hop, t), set_time!(Hdop, t), set_time!.(Jops, t), set_time!.(Jdops, t)))
end
return _getfunc(Hnhtup, Htdagup, Js_tup, Jdags_tup)
end

"""
mcfw_dynamic_function(H, Js)

Returns a function `f(t, state) -> H(t), Js, dagger.(Js)`.
Returns a function of the form `f(t, state) -> H(t), Js, dagger.(Js)`.
The `state` argument is currently ignored.

This is the function expected by [`timeevolution.mcwf_dynamic()`](@ref),
Expand All @@ -90,7 +90,7 @@ mcfw_dynamic_function(H, Js) = master_h_dynamic_function(H, Js)
"""
mcfw_nh_dynamic_function(Hnh, Js)

Returns a function `f(t, state) -> Hnh(t), Js, dagger.(Js)`.
Returns a function of the form `f(t, state) -> Hnh(t), Js, dagger.(Js)`.
The `state` argument is currently ignored.

This is the function expected by [`timeevolution.mcwf_dynamic()`](@ref),
Expand Down
Loading