-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
In QuTiP, the superoperators have different representations:
- general representation
- Choi representation
- Stinespring representation
- Chi representation
Note that Kraus and Stinespring representations are just a list of Operators
.
Maybe we can make a new abstract type AbstractSuperRepresentation
, and re-define the superoperator:
abstract type AbstractSuperRepresentation end
struct GeneralSuperRepresentation <: AbstractSuperRepresentation end
struct ChoiSuperRepresentation <: AbstractSuperRepresentation end
struct ChiSuperRepresentation <: AbstractSuperRepresentation end
struct SuperOperatorQuantumObject{T<:AbstractSuperRepresentation} <: QuantumObjectType
superrep::T
end
# default representation
SuperOperatorQuantumObject() = SuperOperatorQuantumObject(GeneralSuperRepresentation())
const SuperOperator = SuperOperatorQuantumObject()
const ChoiSuperOperator = SuperOperatorQuantumObject(ChoiSuperRepresentation())
const ChiSuperOperator = SuperOperatorQuantumObject(ChiSuperRepresentation())
When the users apply the basic operations (:+
, :-
, :*
) between GeneralSuperRepresentation
and other representation, it should work. However, if the users apply them on different representations, it should print a warning message just like qutip.
function Base.:(==)(::SuperOperatorQuantumObject{T1}, ::SuperOperatorQuantumObject{T2}) where {T1<:AbstractSuperRepresentation,T2<:AbstractSuperRepresentation}
(T1 != T2) && @warn "warning message"
return true
end
Also need to define some new functions same as qutip:
superrep(Q)
(returnsuperrep
ofQobj
)to_super(Q)
to_choi(Q)
to_kraus(Q)
to_stinespring(Q)
to_chi(Q)
iscp(Q)
istp(Q)
ishp(Q)
iscptp(Q)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers