@@ -5,7 +5,7 @@ Synonyms of the functions for QuantumObject
55export Qobj, QobjEvo, shape, isherm
66export trans, dag, matrix_element, unit
77export tensor, ⊗
8- export qeye
8+ export qeye, qeye_like, qzero_like
99export vector_to_operator, operator_to_vector
1010export sqrtm, logm, expm, sinm, cosm
1111
@@ -104,3 +104,21 @@ Matrix cosine of [`QuantumObject`](@ref), defined as
104104Note that this function is same as `cos(A)` and only supports for [`Operator`](@ref) and [`SuperOperator`](@ref).
105105"""
106106cosm (A:: QuantumObject{ObjType} ) where {ObjType<: Union{Operator,SuperOperator} } = cos (A)
107+
108+ @doc raw """
109+ qeye_like(A::AbstractQuantumObject)
110+
111+ Return a similar [`AbstractQuantumObject`](@ref) with `dims` and `type` are same as `A`, but `data` is an identity matrix.
112+
113+ Note that this function is same as `one(A)` and only supports for [`Operator`](@ref) and [`SuperOperator`](@ref).
114+ """
115+ qeye_like (A:: AbstractQuantumObject{OpType} ) where {OpType<: Union{Operator,SuperOperator} } = one (A)
116+
117+ @doc raw """
118+ qzero_like(A::AbstractQuantumObject)
119+
120+ Return a similar [`AbstractQuantumObject`](@ref) with `dims` and `type` are same as `A`, but `data` is a zero-array.
121+
122+ Note that this function is same as `zero(A)` and only supports for [`Operator`](@ref) and [`SuperOperator`](@ref).
123+ """
124+ qzero_like (A:: AbstractQuantumObject{OpType} ) where {OpType<: Union{Operator,SuperOperator} } = zero (A)
0 commit comments