Skip to content

Commit f5b87fd

Browse files
authored
fix error message in mesolve (#273)
1 parent f19741e commit f5b87fd

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/time_evolution/mesolve.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,16 @@ function _mesolve_make_L_QobjEvo(H::Tuple, c_ops)
4646
c_ops isa Nothing && return QobjEvo(H)
4747
return QobjEvo((H..., mapreduce(op -> lindblad_dissipator(op), +, c_ops)); type = SuperOperator, f = liouvillian)
4848
end
49-
# TODO: Add support for Operator type QobEvo
50-
function _mesolve_make_L_QobjEvo(H::QuantumObjectEvolution, c_ops)
51-
issuper(H) || throw(ArgumentError("The time-dependent Hamiltonian must be a SuperOperator."))
49+
_mesolve_make_L_QobjEvo(H::QuantumObjectEvolution{DT,OperatorQuantumObject}, c_ops) where {DT<:AbstractSciMLOperator} =
50+
throw(
51+
ArgumentError(
52+
"This function does not support the data type of time-dependent Operator `H` currently. Try to provide `H` as a time-dependent SuperOperator or Tuple instead.",
53+
),
54+
)
55+
function _mesolve_make_L_QobjEvo(
56+
H::QuantumObjectEvolution{DT,SuperOperatorQuantumObject},
57+
c_ops,
58+
) where {DT<:AbstractSciMLOperator}
5259
c_ops isa Nothing && return H
5360
return H + QobjEvo((mapreduce(op -> lindblad_dissipator(op), +, c_ops)))
5461
end

0 commit comments

Comments
 (0)