Skip to content

Commit

Permalink
check_const for stochastic
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashley Milsted committed Jul 29, 2023
1 parent e93946c commit 17b4aad
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/stochastic_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,15 @@ function integrate_stoch(tspan, df, dg, x0,
end
integrate_stoch(tspan, df, dg, x0, state, dstate, fout, n; kwargs...)
end

function _check_const(op)
if !QuantumOpticsBase.is_const(op)
throw(

Check warning on line 98 in src/stochastic_base.jl

View check run for this annotation

Codecov / codecov/patch

src/stochastic_base.jl#L98

Added line #L98 was not covered by tests
ArgumentError("You are attempting to use a time-dependent dynamics generator " *
"(a Hamiltonian or Lindbladian) with a solver that assumes constant " *
"dynamics. To avoid errors, please use the _dynamic solvers instead, " *
"e.g. schroedinger_dynamic instead of schroedinger")
)
end
nothing
end

0 comments on commit 17b4aad

Please sign in to comment.