Skip to content

Commit

Permalink
Update test_ForwardDiff.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
AmitRotem authored Dec 24, 2023
1 parent d2e1875 commit a478010
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_ForwardDiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,18 @@ base=SpinBasis(1/2)
ψt = spindown(base)
function Ftdop(q)
H = TimeDependentSum([q, abs2sinpi], [sigmaz(base), sigmax(base)])
_, ψf = schroedinger_dynamic(range(0,1,2), ψi, H)
_, ψf = timeevolution.schroedinger_dynamic(range(0,1,2), ψi, H)
abs2(ψt'last(ψf))
end
Ftdop(1.0)
@test ForwardDiff.derivative(Ftdop, 1.0) isa Any

function Ftdop(q)
H = TimeDependentSum([1, abs2sinpi], [sigmaz(base), q*sigmax(base)])
_, ψf = schroedinger_dynamic(range(0,1,2), ψi, H)
_, ψf = timeevolution.schroedinger_dynamic(range(0,1,2), ψi, H)
abs2(ψt'last(ψf))
end
Ftdop(1.0)
@test ForwardDiff.derivative(Ftdop, 1.0) isa Any

end # testset

0 comments on commit a478010

Please sign in to comment.