You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -270,15 +270,149 @@ function _make_SciMLOperator(op::QuantumObject, α; f::Function = identity)
270
270
returnMatrixOperator(α *f(op.data))
271
271
end
272
272
273
-
function (QO::QuantumObjectEvolution)(p, t)
273
+
@docraw"""
274
+
(A::QuantumObjectEvolution)(ψout, ψin, p, t)
275
+
276
+
Apply the time-dependent [`QuantumObjectEvolution`](@ref) object `A` to the input state `ψin` at time `t` with parameters `p`. The output state is stored in `ψout`. This function mimics the behavior of a `AbstractSciMLOperator` object.
277
+
278
+
# Arguments
279
+
- `ψout::QuantumObject`: The output state. It must have the same type as `ψin`.
280
+
- `ψin::QuantumObject`: The input state. It must be either a [`KetQuantumObject`](@ref) or a [`OperatorKetQuantumObject`](@ref).
281
+
- `p`: The parameters of the time-dependent coefficients.
282
+
- `t`: The time at which the coefficients are evaluated.
) where {DT1,DT2,QobjType<:Union{KetQuantumObject,OperatorKetQuantumObject}}
356
+
check_dims(ψout, ψin)
357
+
check_dims(ψout, A)
358
+
359
+
ifisoper(A) &&isoperket(ψin)
360
+
throw(
361
+
ArgumentError(
362
+
"The input state must be a KetQuantumObject if the QuantumObjectEvolution object is an Operator.",
363
+
),
364
+
)
365
+
elseifissuper(A) &&isket(ψin)
366
+
throw(
367
+
ArgumentError(
368
+
"The input state must be an OperatorKetQuantumObject if the QuantumObjectEvolution object is a SuperOperator.",
369
+
),
370
+
)
371
+
end
372
+
373
+
A.data(ψout.data, ψin.data, p, t)
374
+
375
+
return ψout
376
+
end
377
+
378
+
@docraw"""
379
+
(A::QuantumObjectEvolution)(ψ, p, t)
380
+
381
+
Apply the time-dependent [`QuantumObjectEvolution`](@ref) object `A` to the input state `ψ` at time `t` with parameters `p`. Out-of-place version of [`(A::QuantumObjectEvolution)(ψout, ψin, p, t)`](@ref). The output state is stored in a new [`QuantumObject`](@ref) object. This function mimics the behavior of a `AbstractSciMLOperator` object.
382
+
"""
383
+
function (A::QuantumObjectEvolution)(
384
+
ψ::QuantumObject{DT,QobjType},
385
+
p,
386
+
t,
387
+
) where {DT,QobjType<:Union{KetQuantumObject,OperatorKetQuantumObject}}
0 commit comments