Skip to content

Commit 8b04477

Browse files
authored
add test
1 parent c3a8dc5 commit 8b04477

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/interface/default_solver_tests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,11 @@ using StaticArrays
110110
cb = ContinuousCallback((u, t, integrator) -> t - 1, (integrator) -> nothing)
111111
SA_ode_problem = ODEProblem((u, p, t) -> zero(u), SA[0], 2)
112112
@test solve(SA_ode_problem; callback = cb).retcode == ReturnCode.Success
113+
114+
# test Complex numbers
115+
H(s) = (1-s) * complex([0 1; 1 0]) + s * complex([1 0; 0 -1])
116+
schrod_eq(state, time, s) = -im * time * H(s) * state
117+
118+
prob_complex = ODEProblem(schrod_eq, complex([1, -1]/sqrt(2)), (0,1), 100)
119+
complex_sol = solve(prob_complex)
120+
@test complex_sol.retcode == ReturnCode.Success

0 commit comments

Comments
 (0)