Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions src/qobj/quantum_object_evo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -440,17 +440,8 @@ end

_promote_to_scimloperator(data::AbstractMatrix) = MatrixOperator(data)
_promote_to_scimloperator(data::AbstractSciMLOperator) = data
# TODO: The following special cases can be simplified after
# https://github.com/SciML/SciMLOperators.jl/pull/264 is merged
_promote_to_scimloperator::Number, data::AbstractMatrix) = MatrixOperator* data)
function _promote_to_scimloperator::Number, data::MatrixOperator)
isconstant(data) && return MatrixOperator* data.A)
return ScaledOperator(α, data) # Going back to the generic case
end
function _promote_to_scimloperator::Number, data::ScaledOperator)
isconstant(data.λ) && return ScaledOperator* data.λ, data.L)
return ScaledOperator(data.λ, _promote_to_scimloperator(α, data.L)) # Try to propagate the rule
end
# We still have to define this for AddedOperator, as it is not present in SciMLOperators.jl
function _promote_to_scimloperator::Number, data::AddedOperator)
return AddedOperator(_promote_to_scimloperator.(α, data.ops)) # Try to propagate the rule
end
Expand Down
7 changes: 1 addition & 6 deletions src/time_evolution/mesolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,7 @@ function mesolveProblem(

tspan = (tlist[1], tlist[end])

# TODO: Remove this when https://github.com/SciML/SciMLSensitivity.jl/issues/1181 is fixed
if haskey(kwargs3, :sensealg)
prob = ODEProblem{getVal(inplace)}(L, ρ0, tspan, params; kwargs3...)
else
prob = ODEProblem{getVal(inplace),FullSpecialize}(L, ρ0, tspan, params; kwargs3...)
end
prob = ODEProblem{getVal(inplace),FullSpecialize}(L, ρ0, tspan, params; kwargs3...)

return TimeEvolutionProblem(prob, tlist, L_evo.dimensions, (isoperket = Val(isoperket(ψ0)),))
end
Expand Down
7 changes: 1 addition & 6 deletions src/time_evolution/sesolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ function sesolveProblem(

tspan = (tlist[1], tlist[end])

# TODO: Remove this when https://github.com/SciML/SciMLSensitivity.jl/issues/1181 is fixed
if haskey(kwargs3, :sensealg)
prob = ODEProblem{getVal(inplace)}(U, ψ0, tspan, params; kwargs3...)
else
prob = ODEProblem{getVal(inplace),FullSpecialize}(U, ψ0, tspan, params; kwargs3...)
end
prob = ODEProblem{getVal(inplace),FullSpecialize}(U, ψ0, tspan, params; kwargs3...)

return TimeEvolutionProblem(prob, tlist, H_evo.dimensions)
end
Expand Down
Loading