@@ -158,9 +158,8 @@ function QuantumObjectEvolution(
158158 op_func_list:: Tuple ,
159159 α:: Union{Nothing,Number} = nothing ;
160160 type:: Union{Nothing,QuantumObjectType} = nothing ,
161- f:: Function = identity,
162161)
163- op, data = _QobjEvo_generate_data (op_func_list, α; f = f )
162+ op, data = _QobjEvo_generate_data (op_func_list, α)
164163 dims = op. dims
165164 if type isa Nothing
166165 type = op. type
@@ -177,24 +176,21 @@ function QuantumObjectEvolution(
177176 op:: QuantumObject ,
178177 α:: Union{Nothing,Number} = nothing ;
179178 type:: Union{Nothing,QuantumObjectType} = nothing ,
180- f:: Function = identity,
181179)
182180 if type isa Nothing
183181 type = op. type
184182 end
185- return QuantumObjectEvolution (_make_SciMLOperator (op, α, f = f ), type, op. dims)
183+ return QuantumObjectEvolution (_make_SciMLOperator (op, α), type, op. dims)
186184end
187185
188186function QuantumObjectEvolution (
189187 op:: QuantumObjectEvolution ,
190188 α:: Union{Nothing,Number} = nothing ;
191189 type:: Union{Nothing,QuantumObjectType} = nothing ,
192- f:: Function = identity,
193190)
194- f != = identity && throw (ArgumentError (" The function `f` is not supported for QuantumObjectEvolution inputs." ))
195191 if type isa Nothing
196192 type = op. type
197- else
193+ elseif type != op . type
198194 throw (
199195 ArgumentError (
200196 " The type of the QuantumObjectEvolution object cannot be changed when using another QuantumObjectEvolution object as input." ,
@@ -217,7 +213,7 @@ Parse the `op_func_list` and generate the data for the `QuantumObjectEvolution`
217213- `α`: A scalar to pre-multiply the operators.
218214- `f::Function=identity`: A function to pre-apply to the operators.
219215=#
220- @generated function _QobjEvo_generate_data (op_func_list:: Tuple , α; f :: Function = identity )
216+ @generated function _QobjEvo_generate_data (op_func_list:: Tuple , α)
221217 op_func_list_types = op_func_list. parameters
222218 N = length (op_func_list_types)
223219
@@ -242,9 +238,9 @@ Parse the `op_func_list` and generate the data for the `QuantumObjectEvolution`
242238 data_type = op_type. parameters[1 ]
243239 dims_expr = (dims_expr... , :($ op. dims))
244240 if i == 1
245- first_op = :(f ( $ op) )
241+ first_op = :($ op)
246242 end
247- data_expr = :($ data_expr + _make_SciMLOperator (op_func_list[$ i], α, f = f ))
243+ data_expr = :($ data_expr + _make_SciMLOperator (op_func_list[$ i], α))
248244 else
249245 op_type = op_func_type
250246 (isoper (op_type) || issuper (op_type)) ||
@@ -255,7 +251,7 @@ Parse the `op_func_list` and generate the data for the `QuantumObjectEvolution`
255251 if i == 1
256252 first_op = :(op_func_list[$ i])
257253 end
258- qobj_expr_const = :($ qobj_expr_const + f ( op_func_list[$ i]) )
254+ qobj_expr_const = :($ qobj_expr_const + op_func_list[$ i])
259255 end
260256 end
261257
@@ -272,20 +268,20 @@ Parse the `op_func_list` and generate the data for the `QuantumObjectEvolution`
272268 end
273269end
274270
275- function _make_SciMLOperator (op_func:: Tuple , α; f :: Function = identity )
271+ function _make_SciMLOperator (op_func:: Tuple , α)
276272 T = eltype (op_func[1 ])
277273 update_func = (a, u, p, t) -> op_func[2 ](p, t)
278274 if α isa Nothing
279- return ScalarOperator (zero (T), update_func) * MatrixOperator (f ( op_func[1 ]) . data)
275+ return ScalarOperator (zero (T), update_func) * MatrixOperator (op_func[1 ]. data)
280276 end
281- return ScalarOperator (zero (T), update_func) * MatrixOperator (α * f ( op_func[1 ]) . data)
277+ return ScalarOperator (zero (T), update_func) * MatrixOperator (α * op_func[1 ]. data)
282278end
283279
284- function _make_SciMLOperator (op:: QuantumObject , α; f :: Function = identity )
280+ function _make_SciMLOperator (op:: QuantumObject , α)
285281 if α isa Nothing
286- return MatrixOperator (f (op) . data)
282+ return MatrixOperator (op . data)
287283 end
288- return MatrixOperator (α * f ( op. data) )
284+ return MatrixOperator (α * op. data)
289285end
290286
291287@doc raw """
@@ -375,15 +371,11 @@ function (A::QuantumObjectEvolution)(
375371 check_dims (ψout, A)
376372
377373 if isoper (A) && isoperket (ψin)
378- throw (
379- ArgumentError (
380- " The input state must be a KetQuantumObject if the QuantumObjectEvolution object is an Operator." ,
381- ),
382- )
374+ throw (ArgumentError (" The input state must be a Ket if the QuantumObjectEvolution object is an Operator." ))
383375 elseif issuper (A) && isket (ψin)
384376 throw (
385377 ArgumentError (
386- " The input state must be an OperatorKetQuantumObject if the QuantumObjectEvolution object is a SuperOperator." ,
378+ " The input state must be an OperatorKet if the QuantumObjectEvolution object is a SuperOperator." ,
387379 ),
388380 )
389381 end
0 commit comments