Skip to content

Commit

Permalink
representation() -> represent()
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Gawron committed Aug 16, 2019
1 parent 937dcd8 commit 0596565
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/channels.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export AbstractQuantumOperation, KrausOperators, SuperOperator, DynamicalMatrix,
Stinespring, UnitaryChannel, IdentityChannel, POVMMeasurement,
PostSelectionMeasurement, ispovm, iseffect, iscptp, iscptni, applychannel,
compose, isidentity, ispositive, representation
compose, isidentity, ispositive, represent

################################################################################
# Channels definitions and constructors
Expand Down Expand Up @@ -279,19 +279,19 @@ for qop in (:KrausOperators, :SuperOperator, :DynamicalMatrix, :Stinespring,
end

################################################################################
# representation() function
# represent() function
################################################################################
for qop in (:KrausOperators, :POVMMeasurement)
@eval representation::$qop) = Φ.matrices
@eval represent::$qop) = Φ.matrices
end

for qop in (:SuperOperator, :DynamicalMatrix, :Stinespring,
:UnitaryChannel, :PostSelectionMeasurement)
@eval representation::$qop) = Φ.matrix
@eval represent::$qop) = Φ.matrix
end

representation::IdentityChannel{T}) where T<:Matrix{<:Number} = Matrix{T}(I, Φ.idim, Φ.idim)
representation::IdentityChannel) = representation(IdentityChannel{Matrix{ComplexF64}}())
represent::IdentityChannel{T}) where T<:Matrix{<:Number} = Matrix{T}(I, Φ.idim, Φ.idim)
represent::IdentityChannel) = represent(IdentityChannel{Matrix{ComplexF64}}())

################################################################################
# conversions functions
Expand Down
6 changes: 3 additions & 3 deletions test/channels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ end
end
end

@testset "representation" begin
@testset "represent" begin
for kraus_list in kraus_set
Φ = KrausOperators(kraus_list)
@test representation(Φ) == kraus_list
@test represent(Φ) == kraus_list
end

@test representation(DynamicalMatrix(J_random, 3, 3)) == J_random
@test represent(DynamicalMatrix(J_random, 3, 3)) == J_random
end

0 comments on commit 0596565

Please sign in to comment.