Skip to content

Commit 4425d34

Browse files
authored
Only use set_time! for tdop updates (#369)
1 parent 7474584 commit 4425d34

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/time_dependent_operators.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ _tuplify(o::AbstractOperator) = o
77
"""
88
schroedinger_dynamic_function(H::AbstractTimeDependentOperator)
99
10-
Creates a function `f(t, state) -> H(t)`. The `state` argument is ignored.
10+
Creates a function of the form `f(t, state) -> H(t)`. The `state` argument is ignored.
1111
1212
This is the function expected by [`timeevolution.schroedinger_dynamic()`](@ref).
1313
"""
1414
function schroedinger_dynamic_function(H::AbstractTimeDependentOperator)
15-
_getfunc(op) = (@inline _tdop_schroedinger_wrapper(t, _) = (op)(t))
15+
_getfunc(op) = (@inline _tdop_schroedinger_wrapper(t, _) = set_time!(op, t))
1616
Htup = _tuplify(H)
1717
return _getfunc(Htup)
1818
end
@@ -34,7 +34,7 @@ end
3434
"""
3535
master_h_dynamic_function(H::AbstractTimeDependentOperator, Js)
3636
37-
Returns a function `f(t, state) -> H(t), Js, dagger.(Js)`.
37+
Returns a function of the form `f(t, state) -> H(t), Js, dagger.(Js)`.
3838
The `state` argument is ignored.
3939
4040
This is the function expected by [`timeevolution.master_h_dynamic()`](@ref),
@@ -47,15 +47,15 @@ function master_h_dynamic_function(H::AbstractTimeDependentOperator, Js)
4747

4848
Jdags_tup = _tdopdagger.(Js_tup)
4949
function _getfunc(Hop, Jops, Jdops)
50-
return (@inline _tdop_master_wrapper_1(t, _) = ((Hop)(t), set_time!.(Jops, t), set_time!.(Jdops, t)))
50+
return (@inline _tdop_master_wrapper_1(t, _) = (set_time!(Hop, t), set_time!.(Jops, t), set_time!.(Jdops, t)))
5151
end
5252
return _getfunc(Htup, Js_tup, Jdags_tup)
5353
end
5454

5555
"""
5656
master_nh_dynamic_function(Hnh::AbstractTimeDependentOperator, Js)
5757
58-
Returns a function `f(t, state) -> Hnh(t), Hnh(t)', Js, dagger.(Js)`.
58+
Returns a function of the form `f(t, state) -> Hnh(t), Hnh(t)', Js, dagger.(Js)`.
5959
The `state` argument is currently ignored.
6060
6161
This is the function expected by [`timeevolution.master_nh_dynamic()`](@ref),
@@ -70,15 +70,15 @@ function master_nh_dynamic_function(Hnh::AbstractTimeDependentOperator, Js)
7070
Htdagup = _tdopdagger(Hnhtup)
7171

7272
function _getfunc(Hop, Hdop, Jops, Jdops)
73-
return (@inline _tdop_master_wrapper_2(t, _) = ((Hop)(t), (Hdop)(t), set_time!.(Jops, t), set_time!.(Jdops, t)))
73+
return (@inline _tdop_master_wrapper_2(t, _) = (set_time!(Hop, t), set_time!(Hdop, t), set_time!.(Jops, t), set_time!.(Jdops, t)))
7474
end
7575
return _getfunc(Hnhtup, Htdagup, Js_tup, Jdags_tup)
7676
end
7777

7878
"""
7979
mcfw_dynamic_function(H, Js)
8080
81-
Returns a function `f(t, state) -> H(t), Js, dagger.(Js)`.
81+
Returns a function of the form `f(t, state) -> H(t), Js, dagger.(Js)`.
8282
The `state` argument is currently ignored.
8383
8484
This is the function expected by [`timeevolution.mcwf_dynamic()`](@ref),
@@ -90,7 +90,7 @@ mcfw_dynamic_function(H, Js) = master_h_dynamic_function(H, Js)
9090
"""
9191
mcfw_nh_dynamic_function(Hnh, Js)
9292
93-
Returns a function `f(t, state) -> Hnh(t), Js, dagger.(Js)`.
93+
Returns a function of the form `f(t, state) -> Hnh(t), Js, dagger.(Js)`.
9494
The `state` argument is currently ignored.
9595
9696
This is the function expected by [`timeevolution.mcwf_dynamic()`](@ref),

0 commit comments

Comments
 (0)