Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Gawron committed Aug 20, 2019
1 parent d936f6b commit 8fa5b3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/channels/constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ function KrausOperators{T1}(v::Vector{T2}, idim::Int, odim::Int) where {T1<:Abst
end

length::KrausOperators) = length.matrices)

function orthogonalize::KrausOperators{T}) where {T<:AbstractMatrix{<:Number}}
convert(KrausOperators{T}, convert(DynamicalMatrix{T}, Φ))
end

# TODO: create iterator over KrausOperators see: https://docs.julialang.org/en/v0.6.3/manual/interfaces/

"""
$(SIGNATURES)
- `T`: quantum channel map.
Expand Down
4 changes: 2 additions & 2 deletions src/channels/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ function Base.convert(::Type{KrausOperators{T1}}, Φ::POVMMeasurement{T2}) where
for (i, p) in enumerate.matrices)
sqrtp = sqrt(p)
k = ket(i, Φ.odim)*sum(bra(j, Φ.idim)*sqrtp for j in 1:Φ.idim)
push!(v, convert(T1,k))
push!(v, convert(T1, k))
end
KrausOperators{T1}(v, Φ.idim, Φ.odim)
end

function Base.convert(::Type{KrausOperators{T1}}, Φ::PostSelectionMeasurement{T2}) where {T1<:AbstractMatrix{<:Number}, T2<:AbstractMatrix{<:Number}}
m = Φ.matrix
v = T1[convert(T1,m)]
v = T1[convert(T1, m)]
KrausOperators{T1}(v, Φ.idim, Φ.odim)
end

Expand Down

0 comments on commit 8fa5b3b

Please sign in to comment.