@@ -117,21 +117,17 @@ struct QuantumObjectEvolution{
117117 type:: ObjType
118118 dimensions:: DimType
119119
120- function QuantumObjectEvolution (
121- data:: DT ,
122- type:: Union{ObjType,Type{ObjType}} ,
123- dims,
124- ) where {DT<: AbstractSciMLOperator ,ObjType<: QuantumObjectType }
125- (ObjType == Operator || ObjType == SuperOperator) ||
126- throw (ArgumentError (" The type $ObjType is not supported for QuantumObjectEvolution." ))
120+ function QuantumObjectEvolution (data:: DT , type, dims) where {DT<: AbstractSciMLOperator }
121+ type = _get_type (type)
122+ (type isa Operator || type isa SuperOperator) ||
123+ throw (ArgumentError (" The type $type is not supported for QuantumObjectEvolution." ))
127124
128125 dimensions = _gen_dimensions (dims)
129- type = _get_type (type)
130126
131127 _size = _get_size (data)
132128 _check_QuantumObject (type, dimensions, _size[1 ], _size[2 ])
133129
134- return new {ObjType ,typeof(dimensions),DT} (data, type, dimensions)
130+ return new {typeof(type) ,typeof(dimensions),DT} (data, type, dimensions)
135131 end
136132end
137133
@@ -154,18 +150,14 @@ function Base.show(io::IO, QO::QuantumObjectEvolution)
154150end
155151
156152@doc raw """
157- QobjEvo(data::AbstractSciMLOperator; type::Union{ObjType, Type{ObjType}} = Operator, dims = nothing)
158- QuantumObjectEvolution(data::AbstractSciMLOperator; type::Union{ObjType, Type{ObjType}} = Operator, dims = nothing)
153+ QobjEvo(data::AbstractSciMLOperator; type = Operator, dims = nothing)
154+ QuantumObjectEvolution(data::AbstractSciMLOperator; type = Operator, dims = nothing)
159155
160156Generate a [`QuantumObjectEvolution`](@ref) object from a [`SciMLOperator`](https://github.com/SciML/SciMLOperators.jl), in the same way as [`QuantumObject`](@ref) for `AbstractArray` inputs.
161157
162158Note that `QobjEvo` is a synonym of `QuantumObjectEvolution`
163159"""
164- function QuantumObjectEvolution (
165- data:: AbstractSciMLOperator ;
166- type:: Union{ObjType,Type{ObjType}} = Operator,
167- dims = nothing ,
168- ) where {ObjType<: QuantumObjectType }
160+ function QuantumObjectEvolution (data:: AbstractSciMLOperator ; type = Operator, dims = nothing )
169161 _size = _get_size (data)
170162 type = _get_type (type)
171163
@@ -183,8 +175,8 @@ function QuantumObjectEvolution(
183175end
184176
185177@doc raw """
186- QobjEvo(op_func_list::Union{Tuple,AbstractQuantumObject}, α::Union{Nothing,Number}=nothing; type::Union{Nothing, ObjType, Type{ObjType}} =nothing)
187- QuantumObjectEvolution(op_func_list::Union{Tuple,AbstractQuantumObject}, α::Union{Nothing,Number}=nothing; type::Union{Nothing, ObjType, Type{ObjType}} =nothing)
178+ QobjEvo(op_func_list::Union{Tuple,AbstractQuantumObject}, α::Union{Nothing,Number}=nothing; type=nothing)
179+ QuantumObjectEvolution(op_func_list::Union{Tuple,AbstractQuantumObject}, α::Union{Nothing,Number}=nothing; type=nothing)
188180
189181Generate [`QuantumObjectEvolution`](@ref).
190182
@@ -275,11 +267,7 @@ Quantum Object: type=Operator dims=[10, 2] size=(20, 20) ishermitian=fal
275267⎣⠀⠀⠀⠀⠀⠀⠀⠀⠂⡑⎦
276268```
277269"""
278- function QuantumObjectEvolution (
279- op_func_list:: Tuple ,
280- α:: Union{Nothing,Number} = nothing ;
281- type:: Union{ObjType,Type{ObjType}} = nothing ,
282- ) where {ObjType<: QuantumObjectType }
270+ function QuantumObjectEvolution (op_func_list:: Tuple , α:: Union{Nothing,Number} = nothing ; type = nothing )
283271 op, data = _QobjEvo_generate_data (op_func_list, α)
284272 dims = op. dimensions
285273 type = _get_type (type)
@@ -296,15 +284,12 @@ function QuantumObjectEvolution(
296284end
297285
298286# this is a extra method if user accidentally specify `QuantumObjectEvolution( (op, func) )` or `QuantumObjectEvolution( ((op, func)) )`
299- QuantumObjectEvolution (
300- op_func:: Tuple{QuantumObject,Function} ,
301- α:: Union{Nothing,Number} = nothing ;
302- type:: Union{Nothing,ObjType,Type{ObjType}} = nothing ,
303- ) where {ObjType<: QuantumObjectType } = QuantumObjectEvolution ((op_func,), α; type = type)
287+ QuantumObjectEvolution (op_func:: Tuple{QuantumObject,Function} , α:: Union{Nothing,Number} = nothing ; type = nothing ) =
288+ QuantumObjectEvolution ((op_func,), α; type = type)
304289
305290@doc raw """
306- QuantumObjectEvolution(op::QuantumObject, f::Function, α::Union{Nothing,Number}=nothing; type::Union{Nothing, ObjType, Type{ObjType}} = nothing)
307- QobjEvo(op::QuantumObject, f::Function, α::Union{Nothing,Number}=nothing; type::Union{Nothing, ObjType, Type{ObjType}} = nothing)
291+ QuantumObjectEvolution(op::QuantumObject, f::Function, α::Union{Nothing,Number}=nothing; type = nothing)
292+ QobjEvo(op::QuantumObject, f::Function, α::Union{Nothing,Number}=nothing; type = nothing)
308293
309294Generate [`QuantumObjectEvolution`](@ref).
310295
@@ -333,30 +318,18 @@ Quantum Object Evo.: type=Operator dims=[10, 2] size=(20, 20) ishermitia
333318ScalarOperator(0.0 + 0.0im) * MatrixOperator(20 × 20)
334319```
335320"""
336- QuantumObjectEvolution (
337- op:: QuantumObject ,
338- f:: Function ,
339- α:: Union{Nothing,Number} = nothing ;
340- type:: Union{Nothing,ObjType,Type{ObjType}} = nothing ,
341- ) where {ObjType<: QuantumObjectType } = QuantumObjectEvolution (((op, f),), α; type = type)
342-
343- function QuantumObjectEvolution (
344- op:: QuantumObject ,
345- α:: Union{Nothing,Number} = nothing ;
346- type:: Union{Nothing,ObjType,Type{ObjType}} = nothing ,
347- ) where {ObjType<: QuantumObjectType }
321+ QuantumObjectEvolution (op:: QuantumObject , f:: Function , α:: Union{Nothing,Number} = nothing ; type = nothing ) =
322+ QuantumObjectEvolution (((op, f),), α; type = type)
323+
324+ function QuantumObjectEvolution (op:: QuantumObject , α:: Union{Nothing,Number} = nothing ; type = nothing )
348325 type = _get_type (type)
349326 if type isa Nothing
350327 type = op. type
351328 end
352329 return QuantumObjectEvolution (_make_SciMLOperator (op, α), type, op. dimensions)
353330end
354331
355- function QuantumObjectEvolution (
356- op:: QuantumObjectEvolution ,
357- α:: Union{Nothing,Number} = nothing ;
358- type:: Union{Nothing,ObjType,Type{ObjType}} = nothing ,
359- ) where {ObjType<: QuantumObjectType }
332+ function QuantumObjectEvolution (op:: QuantumObjectEvolution , α:: Union{Nothing,Number} = nothing ; type = nothing )
360333 type = _get_type (type)
361334 if type isa Nothing
362335 type = op. type
0 commit comments