From b4224a7301943b602004099f2161f3325ff74333 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Tue, 23 Jul 2024 15:41:29 +0000 Subject: [PATCH] build based on 69b9e85 --- dev/.documenter-siteinfo.json | 2 +- dev/api/index.html | 3 ++- dev/index.html | 2 +- dev/objects.inv | Bin 691 -> 732 bytes dev/search_index.js | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index e88db5d..2c7c82a 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-22T09:52:35","documenter_version":"1.5.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-23T15:41:26","documenter_version":"1.5.0"}} \ No newline at end of file diff --git a/dev/api/index.html b/dev/api/index.html index ee944ac..69b9ca0 100644 --- a/dev/api/index.html +++ b/dev/api/index.html @@ -1,2 +1,3 @@ -List of functions · Ket.jl

List of functions

Basic

Ket.ketFunction
ket([T=ComplexF64,] i::Integer, d::Integer = 2)

Produces a ket of dimension d with nonzero element i.

source
Ket.ketbraFunction
ketbra(v::AbstractVector)

Produces a ketbra of vector v.

source
Ket.projFunction
proj([T=ComplexF64,] i::Integer, d::Integer = 2)

Produces a projector onto the basis state i in dimension d.

source
Ket.pauliFunction
pauli([T=ComplexF64,], ind::Vector{<:Integer})

Constructs the Pauli matrices: 0 or "I" for the identity, 1 or "X" for the Pauli X operation, 2 or "Y" for the Pauli Y operator, and 3 or "Z" for the Pauli Z operator. Vectors of integers between 0 and 3 or strings of I, X, Y, Z automatically generate Kronecker products of the corresponding operators.

source
Ket.gell_mann!Function
gell_mann!(res::AbstractMatrix{T}, i::Integer, j::Integer, d::Integer = 3)

In-place version of gell_mann.

source
Ket.partial_traceFunction
partial_trace(X::AbstractMatrix, remove::Vector, dims::Vector)

Takes the partial trace of matrix X with subsystem dimensions dims over the subsystems in remove.

source
partial_trace(X::AbstractMatrix, remove::Integer, dims::Vector)

Takes the partial trace of matrix X with subsystem dimensions dims over the subsystem remove.

source
partial_trace(X::AbstractMatrix, remove::Integer)

Takes the partial trace of matrix X over the subsystems remove assuming two equally-sized subsystems.

source
Ket.partial_transposeFunction
partial_transpose(X::AbstractMatrix, transp::Vector, dims::Vector)

Takes the partial transpose of matrix X with subsystem dimensions dims on the subsystems in transp.

source
partial_transpose(X::AbstractMatrix, transp::Integer, dims::Vector)

Takes the partial transpose of matrix X with subsystem dimensions dims on the subsystem transp.

source
partial_transpose(X::AbstractMatrix, transp)

Takes the partial transpose of matrix X on the subsystems in transp assuming two equally-sized subsystems.

source
Ket.permute_systems!Function
permute_systems!(X::AbstractVector, perm::Vector, dims::Vector)

Permutes the order of the subsystems of vector X with subsystem dimensions dims in-place according to the permutation perm.

source
permute_systems!(X::AbstractVector, perm::Vector)

Permutes the order of the subsystems of vector X, which is composed by two subsystems of equal dimensions, in-place according to the permutation perm.

source
Ket.permute_systemsFunction
permute_systems(X::AbstractMatrix, perm::Vector, dims::Vector)

Permutes the order of the subsystems of the square matrix X, which is composed by square subsystems of dimensions dims, according to the permutation perm.

source
permute_systems(X::AbstractMatrix, perm::Vector)

Permutes the order of the subsystems of the square matrix X, which is composed by two square subsystems of equal dimensions, according to the permutation perm.

source
permute_systems(X::AbstractMatrix, perm::Vector, dims::Matrix)

Permutes the order of the subsystems of the matrix X, which is composed by subsystems of dimensions dims, according to the permutation perm. dims should be a n x 2 matrix where dims[i, 1] is the number of rows of subsystem i, and dims[i,2] is its number of columns.

source
Ket.cleanup!Function
cleanup!(M::AbstractArray{T}; tol = Base.rtoldefault(real(T)))

Zeroes out real or imaginary parts of M that are smaller than tol.

source

Entropy

Ket.entropyFunction
entropy([base=2,] ρ::AbstractMatrix)

Computes the von Neumann entropy -tr(ρ log ρ) of a positive semidefinite operator ρ using a base base logarithm.

Reference: von Neumann entropy.

source
entropy([base=2,] p::AbstractVector)

Computes the Shannon entropy -Σᵢpᵢlog(pᵢ) of a non-negative vector p using a base base logarithm.

Reference: Entropy (information theory).

source
Ket.relative_entropyFunction
relative_entropy([base=2,] ρ::AbstractMatrix, σ::AbstractMatrix)

Computes the (quantum) relative entropy tr(ρ (log ρ - log σ)) between positive semidefinite matrices ρ and σ using a base base logarithm. Note that the support of ρ must be contained in the support of σ but for efficiency this is not checked.

Reference: Quantum relative entropy.

source
relative_entropy([base=2,] p::AbstractVector, q::AbstractVector)

Computes the relative entropy D(p||q) = Σᵢpᵢlog(pᵢ/qᵢ) between two non-negative vectors p and q using a base base logarithm. Note that the support of p must be contained in the support of q but for efficiency this is not checked.

Reference: Relative entropy.

source
Ket.binary_relative_entropyFunction
binary_relative_entropy([base=2,] p::Real, q::Real)

Computes the binary relative entropy D(p||q) = p log(p/q) + (1-p) log((1-p)/(1-q)) between two probabilities p and q using a base base logarithm.

Reference: Relative entropy.

source
Ket.conditional_entropyFunction
conditional_entropy([base=2,] pAB::AbstractMatrix)

Computes the conditional Shannon entropy H(A|B) of the joint probability distribution pAB using a base base logarithm.

Reference: Conditional entropy.

source
conditional_entropy([base=2,], rho::AbstractMatrix, csys::AbstractVector, dims::AbstractVector)

Computes the conditional von Neumann entropy of rho with subsystem dimensions dims and conditioning systems csys, using a base base logarithm.

Reference: Conditional quantum entropy.

source

Entanglement

Ket.schmidt_decompositionFunction
schmidt_decomposition(ψ::AbstractVector, dims::AbstractVector{<:Integer})

Produces the Schmidt decomposition of ψ with subsystem dimensions dims. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.

Reference: Schmidt decomposition.

source
schmidt_decomposition(ψ::AbstractVector)

Produces the Schmidt decomposition of ψ assuming equally-sized subsystems. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.

Reference: Schmidt decomposition.

source
Ket.entanglement_entropyFunction
entanglement_entropy(ψ::AbstractVector, dims::AbstractVector{<:Integer})

Computes the relative entropy of entanglement of a bipartite pure state ψ with subsystem dimensions dims.

source
entanglement_entropy(ψ::AbstractVector)

Computes the relative entropy of entanglement of a bipartite pure state ψ assuming equally-sized subsystems.

source
entanglement_entropy(ρ::AbstractMatrix, dims::AbstractVector)

Lower bounds the relative entropy of entanglement of a bipartite state ρ with subsystem dimensions dims.

source
entanglement_entropy(ρ::AbstractMatrix)

Lower bounds the relative entropy of entanglement of a bipartite state ρ assuming equally-sized subsystems.

source

Measurements

Ket.sic_povmFunction
sic_povm([T=ComplexF64,] d::Integer)

Constructs a vector of vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d. This construction is based on the Weyl-Heisenberg fiducial.

Reference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813

source
Ket.test_sicFunction
test_sic(vecs)

Tests whether vecs is a vector of vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d.

source
Ket.test_povmFunction
test_povm(A::Vector{<:AbstractMatrix{T}})

Checks if the measurement defined by A is valid (hermitian, semi-definite positive, and normalized).

source
Ket.dilate_povmFunction
dilate_povm(vecs::Vector{Vector{T}})

Does the Naimark dilation of a rank-1 POVM given as a vector of vectors. This is the minimal dilation.

source
dilate_povm(E::Vector{<:AbstractMatrix})

Does the Naimark dilation of a POVM given as a vector of matrices. This always works, but is wasteful if the POVM elements are not full rank.

source
Ket.povmFunction
povm(B::Vector{<:AbstractMatrix{T}})

Creates a set of (projective) measurements from a set of bases given as unitary matrices.

source
povm(A::Array{T, 4}, n::Vector{Int64})

Converts a set of measurements in the common tensor format into a matrix of matrices. The second argument is fixed by the size of A but can also contain custom number of outcomes.

source
Ket.mubFunction
mub([T=ComplexF64,] d::Integer)

Construction of the standard complete set of MUBs. The output contains 1+minᵢ pᵢ^rᵢ bases, where d = ∏ᵢ pᵢ^rᵢ.

Reference: Durt, Englert, Bengtsson, Życzkowski, arXiv:1004.3348.

source

Nonlocality

Ket.chshFunction
chsh([T=Float64,] d::Integer = 2)

CHSH-d nonlocal game in full probability notation. If T is an integer type the game is unnormalized.

Reference: Buhrman and Massar, arXiv:quant-ph/0409066.

source
Ket.local_boundFunction
local_bound(G::Array{T,4})

Computes the local bound of a bipartite Bell functional G, written in full probability notation as a 4-dimensional array.

Reference: Araújo, Hirsch, and Quintino, arXiv:2005.13418.

source
Ket.tsirelson_boundFunction
tsirelson_bound(CG::Matrix, scenario::Vector, level::Integer)

Upper bounds the Tsirelson bound of a bipartite Bell funcional game CG, written in Collins-Gisin notation. scenario is vector detailing the number of inputs and outputs, in the order [oa, ob, ia, ib]. level is an integer determining the level of the NPA hierarchy.

This function requires Moment. It is only available if you first do "import MATLAB" or "using MATLAB".

source
Ket.correlation_tensorFunction
correlation_tensor(p::AbstractArray{T, N2}; marg::Bool = true)

Applies N sets of measurements onto a state rho to form a probability array. Convert a 2x...x2xmx...xm probability array into

  • a mx...xm correlation array (no marginals)
  • a (m+1)x...x(m+1) correlation array (marginals).
source
Ket.probability_tensorFunction
probability_tensor(rho::LA.Hermitian, all_Aax::Vector{Measurement}...)

Applies N sets of measurements onto a state rho to form a probability array.

source
Ket.fp2cgFunction
fp2cg(V::Array{T,4}) where {T <: Real}

Takes a bipartite Bell functional V in full probability notation and transforms it to Collins-Gisin notation.

source

Norms

Ket.kyfan_normFunction
kyfan_norm(X::AbstractMatrix, k::Integer, p::Real = 2)

Computes Ky-Fan (k,p) norm of matrix X.

source
Ket.diamond_normFunction
diamond_norm(J::AbstractMatrix, dims::AbstractVector)

Computes the diamond norm of the supermap J given in the Choi-Jamiołkowski representation, with subsystem dimensions dims.

Reference: Diamond norm

source
diamond_norm(K::Vector{<:AbstractMatrix})

Computes the diamond norm of the CP map given by the Kraus operators K.

source

Random

Ket.random_stateFunction
random_state([T=ComplexF64,] d::Integer, k::Integer = d)

Produces a uniformly distributed random quantum state in dimension d with rank k.

Reference: Życzkowski and Sommers, arXiv:quant-ph/0012101.

source
Ket.random_unitaryFunction
random_unitary([T=ComplexF64,] d::Integer)

Produces a Haar-random unitary matrix in dimension d. If T is a real type the output is instead a Haar-random (real) orthogonal matrix.

Reference: Stewart, doi:10.1137/0717034.

source
Ket.random_povmFunction
random_povm([T=ComplexF64,] d::Integer, n::Integer, r::Integer)

Produces a random POVM of dimension d with n outcomes and rank min(k, d).

Reference: Heinosaari et al., arXiv:1902.04751.

source

States

Ket.state_phiplus_ketFunction
state_phiplus_ket([T=ComplexF64,] d::Integer = 2)

Produces the vector of the maximally entangled state Φ⁺ of local dimension d.

source
Ket.state_phiplusFunction
state_phiplus([T=ComplexF64,] d::Integer = 2; v::Real = 1)

Produces the maximally entangled state Φ⁺ of local dimension d with visibility v.

source
Ket.isotropicFunction
isotropic(v::Real, d::Integer = 2)

Produces the isotropic state of local dimension d with visibility v.

source
Ket.state_psiminus_ketFunction
state_psiminus_ket([T=ComplexF64,] d::Integer = 2)

Produces the vector of the maximally entangled state ψ⁻ of local dimension d.

source
Ket.state_psiminusFunction
state_psiminus([T=ComplexF64,] d::Integer = 2; v::Real = 1)

Produces the maximally entangled state ψ⁻ of local dimension d with visibility v.

source
Ket.state_ghz_ketFunction
state_ghz_ket([T=ComplexF64,] d::Integer = 2, N::Integer = 3; coeff = 1/√d)

Produces the vector of the GHZ state local dimension d.

source
Ket.state_ghzFunction
state_ghz([T=ComplexF64,] d::Integer = 2, N::Integer = 3; v::Real = 1, coeff = 1/√d)

Produces the GHZ state of local dimension d with visibility v.

source
Ket.state_w_ketFunction
state_w_ket([T=ComplexF64,] N::Integer = 3; coeff = 1/√d)

Produces the vector of the N-partite W state.

source
Ket.state_wFunction
state_w([T=ComplexF64,] N::Integer = 3; v::Real = 1, coeff = 1/√d)

Produces the N-partite W state with visibility v.

source
Ket.white_noiseFunction
white_noise(rho::AbstractMatrix, v::Real)

Returns v * rho + (1 - v) * id, where id is the maximally mixed state.

source
Ket.white_noise!Function
white_noise!(rho::AbstractMatrix, v::Real)

Modifies rho in place to tranform in into v * rho + (1 - v) * id where id is the maximally mixed state.

source

Supermaps

Ket.choiFunction
choi(K::Vector{<:AbstractMatrix})

Constructs the Choi-Jamiołkowski representation of the CP map given by the Kraus operators K. The convention used is that choi(K) = ∑ᵢⱼ |i⟩⟨j|⊗K|i⟩⟨j|K'

source

Internal functions

Ket._partitionFunction
partition(n::Integer, k::Integer)

If n ≥ k partitions the set 1:n into k parts as equally sized as possible. Otherwise partitions it into n parts of size 1.

source
Ket._fiducial_WHFunction
_fiducial_WH([T=ComplexF64,] d::Integer)

Computes the fiducial Weyl-Heisenberg vector of dimension d.

Reference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813 http://www.gerhardzauner.at/sicfiducials.html

source
Ket._idxFunction
_idx(tidx::Vector, dims::Vector)

Converts a tensor index tidx = [i₁, i₂, ...] with subsystems dimensions dims to a standard index.

source
Ket._tidxFunction
_tidx(idx::Integer, dims::Vector)

Converts a standard index idx to a tensor index [i₁, i₂, ...] with subsystems dimensions dims.

source
Ket._idxpermFunction
_idxperm(perm::Vector, dims::Vector)

Computes the index permutation associated with permuting the subsystems of a vector with subsystem dimensions dims according to perm.

source
+List of functions · Ket.jl

List of functions

Basic

Ket.ketFunction
ket([T=ComplexF64,] i::Integer, d::Integer = 2)

Produces a ket of dimension d with nonzero element i.

source
Ket.ketbraFunction
ketbra(v::AbstractVector)

Produces a ketbra of vector v.

source
Ket.projFunction
proj([T=ComplexF64,] i::Integer, d::Integer = 2)

Produces a projector onto the basis state i in dimension d.

source
Ket.pauliFunction
pauli([T=ComplexF64,], ind::Vector{<:Integer})

Constructs the Pauli matrices: 0 or "I" for the identity, 1 or "X" for the Pauli X operation, 2 or "Y" for the Pauli Y operator, and 3 or "Z" for the Pauli Z operator. Vectors of integers between 0 and 3 or strings of I, X, Y, Z automatically generate Kronecker products of the corresponding operators.

source
Ket.gell_mann!Function
gell_mann!(res::AbstractMatrix{T}, i::Integer, j::Integer, d::Integer = 3)

In-place version of gell_mann.

source
Ket.partial_traceFunction
partial_trace(X::AbstractMatrix, remove::Vector, dims::Vector)

Takes the partial trace of matrix X with subsystem dimensions dims over the subsystems in remove.

source
partial_trace(X::AbstractMatrix, remove::Integer, dims::Vector)

Takes the partial trace of matrix X with subsystem dimensions dims over the subsystem remove.

source
partial_trace(X::AbstractMatrix, remove::Integer)

Takes the partial trace of matrix X over the subsystems remove assuming two equally-sized subsystems.

source
Ket.partial_transposeFunction
partial_transpose(X::AbstractMatrix, transp::Vector, dims::Vector)

Takes the partial transpose of matrix X with subsystem dimensions dims on the subsystems in transp.

source
partial_transpose(X::AbstractMatrix, transp::Integer, dims::Vector)

Takes the partial transpose of matrix X with subsystem dimensions dims on the subsystem transp.

source
partial_transpose(X::AbstractMatrix, transp)

Takes the partial transpose of matrix X on the subsystems in transp assuming two equally-sized subsystems.

source
Ket.permute_systems!Function
permute_systems!(X::AbstractVector, perm::Vector, dims::Vector)

Permutes the order of the subsystems of vector X with subsystem dimensions dims in-place according to the permutation perm.

source
permute_systems!(X::AbstractVector, perm::Vector)

Permutes the order of the subsystems of vector X, which is composed by two subsystems of equal dimensions, in-place according to the permutation perm.

source
Ket.permute_systemsFunction
permute_systems(X::AbstractMatrix, perm::Vector, dims::Vector)

Permutes the order of the subsystems of the square matrix X, which is composed by square subsystems of dimensions dims, according to the permutation perm.

source
permute_systems(X::AbstractMatrix, perm::Vector)

Permutes the order of the subsystems of the square matrix X, which is composed by two square subsystems of equal dimensions, according to the permutation perm.

source
permute_systems(X::AbstractMatrix, perm::Vector, dims::Matrix)

Permutes the order of the subsystems of the matrix X, which is composed by subsystems of dimensions dims, according to the permutation perm. dims should be a n x 2 matrix where dims[i, 1] is the number of rows of subsystem i, and dims[i,2] is its number of columns.

source
Ket.cleanup!Function
cleanup!(M::AbstractArray{T}; tol = Base.rtoldefault(real(T)))

Zeroes out real or imaginary parts of M that are smaller than tol.

source
Ket.symmetric_projectionFunction
symmetric_projection(dim::Integer, n::Integer; partial::Bool=true)

Orthogonal projection onto the symmetric subspace of n copies of a dim-dimensional space. By default (partial=true) it returns amatrix (say, P) with columns forming an orthogonal basis for the symmetric subspace. If partial=false, then it returns the actual projection P * P'.

Reference: Watrous' book, Sec. 7.1.1

source
Ket.orthonormal_rangeFunction
orthonormal_range(A::AbstractMatrix{T}; mode::Integer=nothing, tol::T=nothing, sp::Bool=true) where {T<:Number}

Orthonormal basis for the range of A. When A is sparse (or mode = 0), uses a QR factorization and returns a sparse result, otherwise uses an SVD and returns a dense matrix (mode = 1). Input A will be overwritten during the factorization. Tolerance tol is used to compute the rank and is automatically set if not provided.

source
Ket.permutation_matrixFunction
permutation_matrix(dims::Union{Integer,Vector{<:Integer}}, perm::Vector{<:Integer})

Unitary that permutes subsystems of dimension dims according to the permutation perm. If dims is an Integer, assumes there are length(perm) subsystems of equal dimensions dims.

source

Entropy

Ket.entropyFunction
entropy([base=2,] ρ::AbstractMatrix)

Computes the von Neumann entropy -tr(ρ log ρ) of a positive semidefinite operator ρ using a base base logarithm.

Reference: von Neumann entropy.

source
entropy([base=2,] p::AbstractVector)

Computes the Shannon entropy -Σᵢpᵢlog(pᵢ) of a non-negative vector p using a base base logarithm.

Reference: Entropy (information theory).

source
Ket.relative_entropyFunction
relative_entropy([base=2,] ρ::AbstractMatrix, σ::AbstractMatrix)

Computes the (quantum) relative entropy tr(ρ (log ρ - log σ)) between positive semidefinite matrices ρ and σ using a base base logarithm. Note that the support of ρ must be contained in the support of σ but for efficiency this is not checked.

Reference: Quantum relative entropy.

source
relative_entropy([base=2,] p::AbstractVector, q::AbstractVector)

Computes the relative entropy D(p||q) = Σᵢpᵢlog(pᵢ/qᵢ) between two non-negative vectors p and q using a base base logarithm. Note that the support of p must be contained in the support of q but for efficiency this is not checked.

Reference: Relative entropy.

source
Ket.binary_relative_entropyFunction
binary_relative_entropy([base=2,] p::Real, q::Real)

Computes the binary relative entropy D(p||q) = p log(p/q) + (1-p) log((1-p)/(1-q)) between two probabilities p and q using a base base logarithm.

Reference: Relative entropy.

source
Ket.conditional_entropyFunction
conditional_entropy([base=2,] pAB::AbstractMatrix)

Computes the conditional Shannon entropy H(A|B) of the joint probability distribution pAB using a base base logarithm.

Reference: Conditional entropy.

source
conditional_entropy([base=2,], rho::AbstractMatrix, csys::AbstractVector, dims::AbstractVector)

Computes the conditional von Neumann entropy of rho with subsystem dimensions dims and conditioning systems csys, using a base base logarithm.

Reference: Conditional quantum entropy.

source

Entanglement

Ket.schmidt_decompositionFunction
schmidt_decomposition(ψ::AbstractVector, dims::AbstractVector{<:Integer})

Produces the Schmidt decomposition of ψ with subsystem dimensions dims. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.

Reference: Schmidt decomposition.

source
schmidt_decomposition(ψ::AbstractVector)

Produces the Schmidt decomposition of ψ assuming equally-sized subsystems. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.

Reference: Schmidt decomposition.

source
Ket.entanglement_entropyFunction
entanglement_entropy(ψ::AbstractVector, dims::AbstractVector{<:Integer})

Computes the relative entropy of entanglement of a bipartite pure state ψ with subsystem dimensions dims.

source
entanglement_entropy(ψ::AbstractVector)

Computes the relative entropy of entanglement of a bipartite pure state ψ assuming equally-sized subsystems.

source
entanglement_entropy(ρ::AbstractMatrix, dims::AbstractVector)

Lower bounds the relative entropy of entanglement of a bipartite state ρ with subsystem dimensions dims.

source
entanglement_entropy(ρ::AbstractMatrix)

Lower bounds the relative entropy of entanglement of a bipartite state ρ assuming equally-sized subsystems.

source
Ket.entanglement_dpsFunction
entanglement_dps(ρ::AbstractMatrix{T}, n::Integer = 2, d1::Union{Integer,Nothing} = nothing; sn::Integer = 1, ppt::Bool = true, verbose::Bool = false,
+solver = Hypatia.Optimizer{_solver_type(T)}, witness::Bool = true, noise::Union{AbstractMatrix,Nothing} = nothing) where {T<:Number}

Test whether ρ has a symmetric extension with n copies of the second subsystem. If yes, returns true and the extension found. Otherwise, returns false and a witness W such that tr(W * ρ) = -1 and tr(W * σ) is nonnegative in any symmetrically-extendable σ.

When witness = false, it returns the maximum visibility of ρ such that it has a symmetric extension when mixed with noise (default is white noise). If this visibility is < 1, then the state is entangled, otherwise the test is inconclusive. No witness is returned in this case.

For sn > 1, it tests whether the state has a Schmidt number greater than sn. For example, if sn = 1 (default) and the state does not have an extension, then it has Schmidt number > 1 (is entangled). Likewise, if sn = 2 and it does not have an extension, then ρ has Schidt number at least 3. The witness parameter works as above. No witness is returned in this case.

References: Doherty, Parrilo, Spedalieri arXiv:quant-ph/0308032 Hulpke, Bruss, Lewenstein, Sanpera arXiv:quant-ph/0401118 Weilenmann, Dive, Trillo, Aguilar, Navascués arXiv:1912.10056

source

Measurements

Ket.sic_povmFunction
sic_povm([T=ComplexF64,] d::Integer)

Constructs a vector of vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d. This construction is based on the Weyl-Heisenberg fiducial.

Reference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813

source
Ket.test_sicFunction
test_sic(vecs)

Tests whether vecs is a vector of vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d.

source
Ket.test_povmFunction
test_povm(A::Vector{<:AbstractMatrix{T}})

Checks if the measurement defined by A is valid (hermitian, semi-definite positive, and normalized).

source
Ket.dilate_povmFunction
dilate_povm(vecs::Vector{Vector{T}})

Does the Naimark dilation of a rank-1 POVM given as a vector of vectors. This is the minimal dilation.

source
dilate_povm(E::Vector{<:AbstractMatrix})

Does the Naimark dilation of a POVM given as a vector of matrices. This always works, but is wasteful if the POVM elements are not full rank.

source
Ket.povmFunction
povm(B::Vector{<:AbstractMatrix{T}})

Creates a set of (projective) measurements from a set of bases given as unitary matrices.

source
povm(A::Array{T, 4}, n::Vector{Int64})

Converts a set of measurements in the common tensor format into a matrix of matrices. The second argument is fixed by the size of A but can also contain custom number of outcomes.

source
Ket.mubFunction
mub([T=ComplexF64,] d::Integer)

Construction of the standard complete set of MUBs. The output contains 1+minᵢ pᵢ^rᵢ bases, where d = ∏ᵢ pᵢ^rᵢ.

Reference: Durt, Englert, Bengtsson, Życzkowski, arXiv:1004.3348.

source

Nonlocality

Ket.chshFunction
chsh([T=Float64,] d::Integer = 2)

CHSH-d nonlocal game in full probability notation. If T is an integer type the game is unnormalized.

Reference: Buhrman and Massar, arXiv:quant-ph/0409066.

source
Ket.local_boundFunction
local_bound(G::Array{T,4})

Computes the local bound of a bipartite Bell functional G, written in full probability notation as a 4-dimensional array.

Reference: Araújo, Hirsch, and Quintino, arXiv:2005.13418.

source
Ket.tsirelson_boundFunction
tsirelson_bound(CG::Matrix, scenario::Vector, level::Integer)

Upper bounds the Tsirelson bound of a bipartite Bell funcional game CG, written in Collins-Gisin notation. scenario is vector detailing the number of inputs and outputs, in the order [oa, ob, ia, ib]. level is an integer determining the level of the NPA hierarchy.

This function requires Moment. It is only available if you first do "import MATLAB" or "using MATLAB".

source
Ket.correlation_tensorFunction
correlation_tensor(p::AbstractArray{T, N2}; marg::Bool = true)

Applies N sets of measurements onto a state rho to form a probability array. Convert a 2x...x2xmx...xm probability array into

  • a mx...xm correlation array (no marginals)
  • a (m+1)x...x(m+1) correlation array (marginals).
source
Ket.probability_tensorFunction
probability_tensor(rho::LA.Hermitian, all_Aax::Vector{Measurement}...)

Applies N sets of measurements onto a state rho to form a probability array.

source
Ket.fp2cgFunction
fp2cg(V::Array{T,4}) where {T <: Real}

Takes a bipartite Bell functional V in full probability notation and transforms it to Collins-Gisin notation.

source

Norms

Ket.kyfan_normFunction
kyfan_norm(X::AbstractMatrix, k::Integer, p::Real = 2)

Computes Ky-Fan (k,p) norm of matrix X.

source
Ket.diamond_normFunction
diamond_norm(J::AbstractMatrix, dims::AbstractVector)

Computes the diamond norm of the supermap J given in the Choi-Jamiołkowski representation, with subsystem dimensions dims.

Reference: Diamond norm

source
diamond_norm(K::Vector{<:AbstractMatrix})

Computes the diamond norm of the CP map given by the Kraus operators K.

source

Random

Ket.random_stateFunction
random_state([T=ComplexF64,] d::Integer, k::Integer = d)

Produces a uniformly distributed random quantum state in dimension d with rank k.

Reference: Życzkowski and Sommers, arXiv:quant-ph/0012101.

source
Ket.random_unitaryFunction
random_unitary([T=ComplexF64,] d::Integer)

Produces a Haar-random unitary matrix in dimension d. If T is a real type the output is instead a Haar-random (real) orthogonal matrix.

Reference: Stewart, doi:10.1137/0717034.

source
Ket.random_povmFunction
random_povm([T=ComplexF64,] d::Integer, n::Integer, r::Integer)

Produces a random POVM of dimension d with n outcomes and rank min(k, d).

Reference: Heinosaari et al., arXiv:1902.04751.

source

States

Ket.state_phiplus_ketFunction
state_phiplus_ket([T=ComplexF64,] d::Integer = 2)

Produces the vector of the maximally entangled state Φ⁺ of local dimension d.

source
Ket.state_phiplusFunction
state_phiplus([T=ComplexF64,] d::Integer = 2; v::Real = 1)

Produces the maximally entangled state Φ⁺ of local dimension d with visibility v.

source
Ket.isotropicFunction
isotropic(v::Real, d::Integer = 2)

Produces the isotropic state of local dimension d with visibility v.

source
Ket.state_psiminus_ketFunction
state_psiminus_ket([T=ComplexF64,] d::Integer = 2)

Produces the vector of the maximally entangled state ψ⁻ of local dimension d.

source
Ket.state_psiminusFunction
state_psiminus([T=ComplexF64,] d::Integer = 2; v::Real = 1)

Produces the maximally entangled state ψ⁻ of local dimension d with visibility v.

source
Ket.state_ghz_ketFunction
state_ghz_ket([T=ComplexF64,] d::Integer = 2, N::Integer = 3; coeff = 1/√d)

Produces the vector of the GHZ state local dimension d.

source
Ket.state_ghzFunction
state_ghz([T=ComplexF64,] d::Integer = 2, N::Integer = 3; v::Real = 1, coeff = 1/√d)

Produces the GHZ state of local dimension d with visibility v.

source
Ket.state_w_ketFunction
state_w_ket([T=ComplexF64,] N::Integer = 3; coeff = 1/√d)

Produces the vector of the N-partite W state.

source
Ket.state_wFunction
state_w([T=ComplexF64,] N::Integer = 3; v::Real = 1, coeff = 1/√d)

Produces the N-partite W state with visibility v.

source
Ket.white_noiseFunction
white_noise(rho::AbstractMatrix, v::Real)

Returns v * rho + (1 - v) * id, where id is the maximally mixed state.

source
Ket.white_noise!Function
white_noise!(rho::AbstractMatrix, v::Real)

Modifies rho in place to tranform in into v * rho + (1 - v) * id where id is the maximally mixed state.

source

Supermaps

Ket.choiFunction
choi(K::Vector{<:AbstractMatrix})

Constructs the Choi-Jamiołkowski representation of the CP map given by the Kraus operators K. The convention used is that choi(K) = ∑ᵢⱼ |i⟩⟨j|⊗K|i⟩⟨j|K'

source

Internal functions

Ket._partitionFunction
partition(n::Integer, k::Integer)

If n ≥ k partitions the set 1:n into k parts as equally sized as possible. Otherwise partitions it into n parts of size 1.

source
Ket._fiducial_WHFunction
_fiducial_WH([T=ComplexF64,] d::Integer)

Computes the fiducial Weyl-Heisenberg vector of dimension d.

Reference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813 http://www.gerhardzauner.at/sicfiducials.html

source
Ket._idxFunction
_idx(tidx::Vector, dims::Vector)

Converts a tensor index tidx = [i₁, i₂, ...] with subsystems dimensions dims to a standard index.

source
Ket._tidxFunction
_tidx(idx::Integer, dims::Vector)

Converts a standard index idx to a tensor index [i₁, i₂, ...] with subsystems dimensions dims.

source
Ket._idxpermFunction
_idxperm(perm::Vector, dims::Vector)

Computes the index permutation associated with permuting the subsystems of a vector with subsystem dimensions dims according to perm.

source
diff --git a/dev/index.html b/dev/index.html index acfc1ae..234b1c7 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -Home · Ket.jl

Ket.jl

Dev

Toolbox for quantum information, nonlocality, and entanglement.

Highlights are the functions mub and sic_povm, that produce respectively MUBs and SIC-POVMs with arbitrary precision, local_bound that uses a parallelized algorithm to compute the local bound of a Bell inequality, and partial_trace and partial_transpose, that compute the partial trace and partial transpose in a way that can be used for optimization with JuMP. Also worth mentioning are the functions to produce uniformly-distributed random states, unitaries, and POVMs: random_state, random_unitary, random_povm. And the eponymous ket, of course.

For the full list of functions see the documentation.

+Home · Ket.jl

Ket.jl

Dev

Toolbox for quantum information, nonlocality, and entanglement.

Highlights are the functions mub and sic_povm, that produce respectively MUBs and SIC-POVMs with arbitrary precision, local_bound that uses a parallelized algorithm to compute the local bound of a Bell inequality, and partial_trace and partial_transpose, that compute the partial trace and partial transpose in a way that can be used for optimization with JuMP. Also worth mentioning are the functions to produce uniformly-distributed random states, unitaries, and POVMs: random_state, random_unitary, random_povm. And the eponymous ket, of course.

For the full list of functions see the documentation.

diff --git a/dev/objects.inv b/dev/objects.inv index ef2591b96c10825fc6f91dd586372572e99d0b03..440520c7a1629f83e71442ac08e3d152dd1ac5e1 100644 GIT binary patch delta 621 zcmV-z0+Ri+1>6OYdVf~QZrm^oz0X&;XnUL%$uY+Q1rl^Qw1*xAS)y&uXoHp{)32}O z%;KbDN=KW|6v_7}_g%`a}G)vp63#~l1=y$&m}AHYNMpuxm7$bawTz-#W-;-$>39k%B( zuj2l1<_ixfR!cU@3a&67RuErJA5sT$ zACW5-Jr`tU5`Ve2M&=g0rf@+_JVr28AO>6b$buk1B5Pt#*6(f4dn~eH`P5)Ng@%QM z7##ILHB-*rUlwnwpt#AnVH3iOktYlD1hW zRdR*(9uzO323lt0v)(2nDcA@~G0hDv=q!6G&MHPdGJhFRqe+3*CUBG7sz;CUg*S^U zE8|`G(FAAdZ6Q(3#a42jRZNO~usTzZ_1&EmHuO2qkW})hw5t>TVrR|s^+H-`e;9au|BHN^ z%q?cMH)d##&CaNeBnHev4!O+sZL(_MGvZ=lF@>r59;gGKD2VlOvSo^SK$*#rr0|%p zW{@22J#W=aEnC^8MH-b8Nfk_%l#F<* H%2@g}NYgoh delta 580 zcmV-K0=xa(1+xW^dViM5Zrd;rhVOm~6>X1hksNa@P#{H@Lwo3vph(IZn~OjWlekY` zlJKIY=8#8gK9jTj|43k^dKm)B2kFGHy&Hx{XViu-uzr|+ejL6*z`;$!6sSKvYw<+6k@!j}_vxMQ(SxWL`@gIjUOL>Hpp>wbQ>?RNivkDC&&88WBT~ zFT-9xoF5OXqciY411e@61Vv%F?=gYl7*Lt;<`#Q{dw+j-K7e}!t{HkR$eSc^%=J5n6MrbD`lnPDRHN>)I&xF>RKMJUbT3g^AjJcl~QQjE+- z7p{&93VtJRP*cHJFhwJk?v+cfGdOrUpN+MEU? zGO2_!Y4lJaQY%qIN1dgIq>^{qEEI4!PQ1O*MS4G!q?3L-RK$wbTSa1kB+ZcaNdJDQ zTJl0%O+6{*Fn4eEHu&6uv{anJqvySYZJm}EUN&swMsl#TBXzd=SgE#t#ax@uCXi9& SefRsZ<0aR-qy7R#e!9mXEgBsF diff --git a/dev/search_index.js b/dev/search_index.js index 3e7090a..3fd46bb 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"api/#List-of-functions","page":"List of functions","title":"List of functions","text":"","category":"section"},{"location":"api/#Basic","page":"List of functions","title":"Basic","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"ket\nketbra\nproj\nshift\nclock\npauli\ngell_mann\ngell_mann!\npartial_trace\npartial_transpose\npermute_systems!\npermute_systems\ncleanup!","category":"page"},{"location":"api/#Ket.ket","page":"List of functions","title":"Ket.ket","text":"ket([T=ComplexF64,] i::Integer, d::Integer = 2)\n\nProduces a ket of dimension d with nonzero element i.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.ketbra","page":"List of functions","title":"Ket.ketbra","text":"ketbra(v::AbstractVector)\n\nProduces a ketbra of vector v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.proj","page":"List of functions","title":"Ket.proj","text":"proj([T=ComplexF64,] i::Integer, d::Integer = 2)\n\nProduces a projector onto the basis state i in dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.shift","page":"List of functions","title":"Ket.shift","text":"shift([T=ComplexF64,] d::Integer, p::Integer = 1)\n\nConstructs the shift operator X of dimension d to the power p.\n\nReference: Generalized Clifford algebra\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.clock","page":"List of functions","title":"Ket.clock","text":"clock([T=ComplexF64,] d::Integer, p::Integer = 1)\n\nConstructs the clock operator Z of dimension d to the power p.\n\nReference: Generalized Clifford algebra\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.pauli","page":"List of functions","title":"Ket.pauli","text":"pauli([T=ComplexF64,], ind::Vector{<:Integer})\n\nConstructs the Pauli matrices: 0 or \"I\" for the identity, 1 or \"X\" for the Pauli X operation, 2 or \"Y\" for the Pauli Y operator, and 3 or \"Z\" for the Pauli Z operator. Vectors of integers between 0 and 3 or strings of I, X, Y, Z automatically generate Kronecker products of the corresponding operators.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.gell_mann","page":"List of functions","title":"Ket.gell_mann","text":"gell_mann([T=ComplexF64,], d::Integer = 3)\n\nConstructs the set G of generalized Gell-Mann matrices in dimension d such that G[1] = I and G[i]*G[j] = 2 δ_ij.\n\nReference: Generalizations of Pauli matrices\n\n\n\n\n\ngell_mann([T=ComplexF64,], i::Integer, j::Integer, d::Integer = 3)\n\nConstructs the set i,jth Gell-Mann matrix of dimension d.\n\nReference: Generalizations of Pauli matrices\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.gell_mann!","page":"List of functions","title":"Ket.gell_mann!","text":"gell_mann!(res::AbstractMatrix{T}, i::Integer, j::Integer, d::Integer = 3)\n\nIn-place version of gell_mann.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.partial_trace","page":"List of functions","title":"Ket.partial_trace","text":"partial_trace(X::AbstractMatrix, remove::Vector, dims::Vector)\n\nTakes the partial trace of matrix X with subsystem dimensions dims over the subsystems in remove.\n\n\n\n\n\npartial_trace(X::AbstractMatrix, remove::Integer, dims::Vector)\n\nTakes the partial trace of matrix X with subsystem dimensions dims over the subsystem remove.\n\n\n\n\n\npartial_trace(X::AbstractMatrix, remove::Integer)\n\nTakes the partial trace of matrix X over the subsystems remove assuming two equally-sized subsystems.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.partial_transpose","page":"List of functions","title":"Ket.partial_transpose","text":"partial_transpose(X::AbstractMatrix, transp::Vector, dims::Vector)\n\nTakes the partial transpose of matrix X with subsystem dimensions dims on the subsystems in transp.\n\n\n\n\n\npartial_transpose(X::AbstractMatrix, transp::Integer, dims::Vector)\n\nTakes the partial transpose of matrix X with subsystem dimensions dims on the subsystem transp.\n\n\n\n\n\npartial_transpose(X::AbstractMatrix, transp)\n\nTakes the partial transpose of matrix X on the subsystems in transp assuming two equally-sized subsystems.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.permute_systems!","page":"List of functions","title":"Ket.permute_systems!","text":"permute_systems!(X::AbstractVector, perm::Vector, dims::Vector)\n\nPermutes the order of the subsystems of vector X with subsystem dimensions dims in-place according to the permutation perm.\n\n\n\n\n\npermute_systems!(X::AbstractVector, perm::Vector)\n\nPermutes the order of the subsystems of vector X, which is composed by two subsystems of equal dimensions, in-place according to the permutation perm.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.permute_systems","page":"List of functions","title":"Ket.permute_systems","text":"permute_systems(X::AbstractMatrix, perm::Vector, dims::Vector)\n\nPermutes the order of the subsystems of the square matrix X, which is composed by square subsystems of dimensions dims, according to the permutation perm.\n\n\n\n\n\npermute_systems(X::AbstractMatrix, perm::Vector)\n\nPermutes the order of the subsystems of the square matrix X, which is composed by two square subsystems of equal dimensions, according to the permutation perm.\n\n\n\n\n\npermute_systems(X::AbstractMatrix, perm::Vector, dims::Matrix)\n\nPermutes the order of the subsystems of the matrix X, which is composed by subsystems of dimensions dims, according to the permutation perm. dims should be a n x 2 matrix where dims[i, 1] is the number of rows of subsystem i, and dims[i,2] is its number of columns. \n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.cleanup!","page":"List of functions","title":"Ket.cleanup!","text":"cleanup!(M::AbstractArray{T}; tol = Base.rtoldefault(real(T)))\n\nZeroes out real or imaginary parts of M that are smaller than tol.\n\n\n\n\n\n","category":"function"},{"location":"api/#Entropy","page":"List of functions","title":"Entropy","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"entropy\nbinary_entropy\nrelative_entropy\nbinary_relative_entropy\nconditional_entropy","category":"page"},{"location":"api/#Ket.entropy","page":"List of functions","title":"Ket.entropy","text":"entropy([base=2,] ρ::AbstractMatrix)\n\nComputes the von Neumann entropy -tr(ρ log ρ) of a positive semidefinite operator ρ using a base base logarithm.\n\nReference: von Neumann entropy.\n\n\n\n\n\nentropy([base=2,] p::AbstractVector)\n\nComputes the Shannon entropy -Σᵢpᵢlog(pᵢ) of a non-negative vector p using a base base logarithm.\n\nReference: Entropy (information theory).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.binary_entropy","page":"List of functions","title":"Ket.binary_entropy","text":"binary_entropy([base=2,] p::Real)\n\nComputes the Shannon entropy -p log(p) - (1-p)log(1-p) of a probability p using a base base logarithm.\n\nReference: Entropy (information theory).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.relative_entropy","page":"List of functions","title":"Ket.relative_entropy","text":"relative_entropy([base=2,] ρ::AbstractMatrix, σ::AbstractMatrix)\n\nComputes the (quantum) relative entropy tr(ρ (log ρ - log σ)) between positive semidefinite matrices ρ and σ using a base base logarithm. Note that the support of ρ must be contained in the support of σ but for efficiency this is not checked.\n\nReference: Quantum relative entropy.\n\n\n\n\n\nrelative_entropy([base=2,] p::AbstractVector, q::AbstractVector)\n\nComputes the relative entropy D(p||q) = Σᵢpᵢlog(pᵢ/qᵢ) between two non-negative vectors p and q using a base base logarithm. Note that the support of p must be contained in the support of q but for efficiency this is not checked.\n\nReference: Relative entropy.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.binary_relative_entropy","page":"List of functions","title":"Ket.binary_relative_entropy","text":"binary_relative_entropy([base=2,] p::Real, q::Real)\n\nComputes the binary relative entropy D(p||q) = p log(p/q) + (1-p) log((1-p)/(1-q)) between two probabilities p and q using a base base logarithm.\n\nReference: Relative entropy.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.conditional_entropy","page":"List of functions","title":"Ket.conditional_entropy","text":"conditional_entropy([base=2,] pAB::AbstractMatrix)\n\nComputes the conditional Shannon entropy H(A|B) of the joint probability distribution pAB using a base base logarithm.\n\nReference: Conditional entropy.\n\n\n\n\n\nconditional_entropy([base=2,], rho::AbstractMatrix, csys::AbstractVector, dims::AbstractVector)\n\nComputes the conditional von Neumann entropy of rho with subsystem dimensions dims and conditioning systems csys, using a base base logarithm.\n\nReference: Conditional quantum entropy.\n\n\n\n\n\n","category":"function"},{"location":"api/#Entanglement","page":"List of functions","title":"Entanglement","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"schmidt_decomposition\nentanglement_entropy","category":"page"},{"location":"api/#Ket.schmidt_decomposition","page":"List of functions","title":"Ket.schmidt_decomposition","text":"schmidt_decomposition(ψ::AbstractVector, dims::AbstractVector{<:Integer})\n\nProduces the Schmidt decomposition of ψ with subsystem dimensions dims. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.\n\nReference: Schmidt decomposition.\n\n\n\n\n\nschmidt_decomposition(ψ::AbstractVector)\n\nProduces the Schmidt decomposition of ψ assuming equally-sized subsystems. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.\n\nReference: Schmidt decomposition.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.entanglement_entropy","page":"List of functions","title":"Ket.entanglement_entropy","text":"entanglement_entropy(ψ::AbstractVector, dims::AbstractVector{<:Integer})\n\nComputes the relative entropy of entanglement of a bipartite pure state ψ with subsystem dimensions dims.\n\n\n\n\n\nentanglement_entropy(ψ::AbstractVector)\n\nComputes the relative entropy of entanglement of a bipartite pure state ψ assuming equally-sized subsystems.\n\n\n\n\n\nentanglement_entropy(ρ::AbstractMatrix, dims::AbstractVector)\n\nLower bounds the relative entropy of entanglement of a bipartite state ρ with subsystem dimensions dims.\n\n\n\n\n\nentanglement_entropy(ρ::AbstractMatrix)\n\nLower bounds the relative entropy of entanglement of a bipartite state ρ assuming equally-sized subsystems.\n\n\n\n\n\n","category":"function"},{"location":"api/#Measurements","page":"List of functions","title":"Measurements","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"sic_povm\ntest_sic\ntest_povm\ndilate_povm\npovm\nmub\ntest_mub","category":"page"},{"location":"api/#Ket.sic_povm","page":"List of functions","title":"Ket.sic_povm","text":"sic_povm([T=ComplexF64,] d::Integer)\n\nConstructs a vector of d² vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d. This construction is based on the Weyl-Heisenberg fiducial.\n\nReference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.test_sic","page":"List of functions","title":"Ket.test_sic","text":"test_sic(vecs)\n\nTests whether vecs is a vector of d² vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.test_povm","page":"List of functions","title":"Ket.test_povm","text":"test_povm(A::Vector{<:AbstractMatrix{T}})\n\nChecks if the measurement defined by A is valid (hermitian, semi-definite positive, and normalized).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.dilate_povm","page":"List of functions","title":"Ket.dilate_povm","text":"dilate_povm(vecs::Vector{Vector{T}})\n\nDoes the Naimark dilation of a rank-1 POVM given as a vector of vectors. This is the minimal dilation.\n\n\n\n\n\ndilate_povm(E::Vector{<:AbstractMatrix})\n\nDoes the Naimark dilation of a POVM given as a vector of matrices. This always works, but is wasteful if the POVM elements are not full rank.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.povm","page":"List of functions","title":"Ket.povm","text":"povm(B::Vector{<:AbstractMatrix{T}})\n\nCreates a set of (projective) measurements from a set of bases given as unitary matrices.\n\n\n\n\n\npovm(A::Array{T, 4}, n::Vector{Int64})\n\nConverts a set of measurements in the common tensor format into a matrix of matrices. The second argument is fixed by the size of A but can also contain custom number of outcomes.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.mub","page":"List of functions","title":"Ket.mub","text":"mub([T=ComplexF64,] d::Integer)\n\nConstruction of the standard complete set of MUBs. The output contains 1+minᵢ pᵢ^rᵢ bases, where d = ∏ᵢ pᵢ^rᵢ.\n\nReference: Durt, Englert, Bengtsson, Życzkowski, arXiv:1004.3348.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.test_mub","page":"List of functions","title":"Ket.test_mub","text":"Check whether the input is indeed mutually unbiased\n\n\n\n\n\n","category":"function"},{"location":"api/#Nonlocality","page":"List of functions","title":"Nonlocality","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"chsh\ncglmp\nlocal_bound\ntsirelson_bound\ncorrelation_tensor\nprobability_tensor\nfp2cg","category":"page"},{"location":"api/#Ket.chsh","page":"List of functions","title":"Ket.chsh","text":"chsh([T=Float64,] d::Integer = 2)\n\nCHSH-d nonlocal game in full probability notation. If T is an integer type the game is unnormalized.\n\nReference: Buhrman and Massar, arXiv:quant-ph/0409066.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.cglmp","page":"List of functions","title":"Ket.cglmp","text":"cglmp([T=Float64,] d::Integer)\n\nCGLMP nonlocal game in full probability notation. If T is an integer type the game is unnormalized.\n\nReferences: arXiv:quant-ph/0106024 for the original game, and arXiv:2005.13418 for the form presented here.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.local_bound","page":"List of functions","title":"Ket.local_bound","text":"local_bound(G::Array{T,4})\n\nComputes the local bound of a bipartite Bell functional G, written in full probability notation as a 4-dimensional array.\n\nReference: Araújo, Hirsch, and Quintino, arXiv:2005.13418.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.tsirelson_bound","page":"List of functions","title":"Ket.tsirelson_bound","text":"tsirelson_bound(CG::Matrix, scenario::Vector, level::Integer)\n\nUpper bounds the Tsirelson bound of a bipartite Bell funcional game CG, written in Collins-Gisin notation. scenario is vector detailing the number of inputs and outputs, in the order [oa, ob, ia, ib]. level is an integer determining the level of the NPA hierarchy.\n\nThis function requires Moment. It is only available if you first do \"import MATLAB\" or \"using MATLAB\".\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.correlation_tensor","page":"List of functions","title":"Ket.correlation_tensor","text":"correlation_tensor(p::AbstractArray{T, N2}; marg::Bool = true)\n\nApplies N sets of measurements onto a state rho to form a probability array. Convert a 2x...x2xmx...xm probability array into\n\na mx...xm correlation array (no marginals)\na (m+1)x...x(m+1) correlation array (marginals).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.probability_tensor","page":"List of functions","title":"Ket.probability_tensor","text":"probability_tensor(rho::LA.Hermitian, all_Aax::Vector{Measurement}...)\n\nApplies N sets of measurements onto a state rho to form a probability array.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.fp2cg","page":"List of functions","title":"Ket.fp2cg","text":"fp2cg(V::Array{T,4}) where {T <: Real}\n\nTakes a bipartite Bell functional V in full probability notation and transforms it to Collins-Gisin notation.\n\n\n\n\n\n","category":"function"},{"location":"api/#Norms","page":"List of functions","title":"Norms","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"trace_norm\nkyfan_norm\nschatten_norm\ndiamond_norm","category":"page"},{"location":"api/#Ket.trace_norm","page":"List of functions","title":"Ket.trace_norm","text":"trace_norm(X::AbstractMatrix)\n\nComputes trace norm of matrix X.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.kyfan_norm","page":"List of functions","title":"Ket.kyfan_norm","text":"kyfan_norm(X::AbstractMatrix, k::Integer, p::Real = 2)\n\nComputes Ky-Fan (k,p) norm of matrix X.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.schatten_norm","page":"List of functions","title":"Ket.schatten_norm","text":"schatten_norm(X::AbstractMatrix, p::Real)\n\nComputes Schatten p-norm of matrix X.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.diamond_norm","page":"List of functions","title":"Ket.diamond_norm","text":"diamond_norm(J::AbstractMatrix, dims::AbstractVector)\n\nComputes the diamond norm of the supermap J given in the Choi-Jamiołkowski representation, with subsystem dimensions dims.\n\nReference: Diamond norm\n\n\n\n\n\ndiamond_norm(K::Vector{<:AbstractMatrix})\n\nComputes the diamond norm of the CP map given by the Kraus operators K.\n\n\n\n\n\n","category":"function"},{"location":"api/#Random","page":"List of functions","title":"Random","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"random_state\nrandom_state_ket\nrandom_unitary\nrandom_povm\nrandom_probability","category":"page"},{"location":"api/#Ket.random_state","page":"List of functions","title":"Ket.random_state","text":"random_state([T=ComplexF64,] d::Integer, k::Integer = d)\n\nProduces a uniformly distributed random quantum state in dimension d with rank k.\n\nReference: Życzkowski and Sommers, arXiv:quant-ph/0012101.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_state_ket","page":"List of functions","title":"Ket.random_state_ket","text":"random_state_ket([T=ComplexF64,] d::Integer)\n\nProduces a Haar-random quantum state vector in dimension d.\n\nReference: Życzkowski and Sommers, arXiv:quant-ph/0012101.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_unitary","page":"List of functions","title":"Ket.random_unitary","text":"random_unitary([T=ComplexF64,] d::Integer)\n\nProduces a Haar-random unitary matrix in dimension d. If T is a real type the output is instead a Haar-random (real) orthogonal matrix.\n\nReference: Stewart, doi:10.1137/0717034.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_povm","page":"List of functions","title":"Ket.random_povm","text":"random_povm([T=ComplexF64,] d::Integer, n::Integer, r::Integer)\n\nProduces a random POVM of dimension d with n outcomes and rank min(k, d).\n\nReference: Heinosaari et al., arXiv:1902.04751.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_probability","page":"List of functions","title":"Ket.random_probability","text":"random_probability([T=Float64,] d::Integer)\n\nProduces a random probability vector of dimension d uniformly distributed on the simplex.\n\nReference: Dirichlet distribution\n\n\n\n\n\n","category":"function"},{"location":"api/#States","page":"List of functions","title":"States","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"state_phiplus_ket\nstate_phiplus\nisotropic\nstate_psiminus_ket\nstate_psiminus\nstate_ghz_ket\nstate_ghz\nstate_w_ket\nstate_w\nwhite_noise\nwhite_noise!","category":"page"},{"location":"api/#Ket.state_phiplus_ket","page":"List of functions","title":"Ket.state_phiplus_ket","text":"state_phiplus_ket([T=ComplexF64,] d::Integer = 2)\n\nProduces the vector of the maximally entangled state Φ⁺ of local dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_phiplus","page":"List of functions","title":"Ket.state_phiplus","text":"state_phiplus([T=ComplexF64,] d::Integer = 2; v::Real = 1)\n\nProduces the maximally entangled state Φ⁺ of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.isotropic","page":"List of functions","title":"Ket.isotropic","text":"isotropic(v::Real, d::Integer = 2)\n\nProduces the isotropic state of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_psiminus_ket","page":"List of functions","title":"Ket.state_psiminus_ket","text":"state_psiminus_ket([T=ComplexF64,] d::Integer = 2)\n\nProduces the vector of the maximally entangled state ψ⁻ of local dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_psiminus","page":"List of functions","title":"Ket.state_psiminus","text":"state_psiminus([T=ComplexF64,] d::Integer = 2; v::Real = 1)\n\nProduces the maximally entangled state ψ⁻ of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_ghz_ket","page":"List of functions","title":"Ket.state_ghz_ket","text":"state_ghz_ket([T=ComplexF64,] d::Integer = 2, N::Integer = 3; coeff = 1/√d)\n\nProduces the vector of the GHZ state local dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_ghz","page":"List of functions","title":"Ket.state_ghz","text":"state_ghz([T=ComplexF64,] d::Integer = 2, N::Integer = 3; v::Real = 1, coeff = 1/√d)\n\nProduces the GHZ state of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_w_ket","page":"List of functions","title":"Ket.state_w_ket","text":"state_w_ket([T=ComplexF64,] N::Integer = 3; coeff = 1/√d)\n\nProduces the vector of the N-partite W state.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_w","page":"List of functions","title":"Ket.state_w","text":"state_w([T=ComplexF64,] N::Integer = 3; v::Real = 1, coeff = 1/√d)\n\nProduces the N-partite W state with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.white_noise","page":"List of functions","title":"Ket.white_noise","text":"white_noise(rho::AbstractMatrix, v::Real)\n\nReturns v * rho + (1 - v) * id, where id is the maximally mixed state.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.white_noise!","page":"List of functions","title":"Ket.white_noise!","text":"white_noise!(rho::AbstractMatrix, v::Real)\n\nModifies rho in place to tranform in into v * rho + (1 - v) * id where id is the maximally mixed state.\n\n\n\n\n\n","category":"function"},{"location":"api/#Supermaps","page":"List of functions","title":"Supermaps","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"choi","category":"page"},{"location":"api/#Ket.choi","page":"List of functions","title":"Ket.choi","text":"choi(K::Vector{<:AbstractMatrix})\n\nConstructs the Choi-Jamiołkowski representation of the CP map given by the Kraus operators K. The convention used is that choi(K) = ∑ᵢⱼ |i⟩⟨j|⊗K|i⟩⟨j|K'\n\n\n\n\n\n","category":"function"},{"location":"api/#Internal-functions","page":"List of functions","title":"Internal functions","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"Ket._partition\nKet._fiducial_WH\nKet._idx\nKet._tidx\nKet._idxperm","category":"page"},{"location":"api/#Ket._partition","page":"List of functions","title":"Ket._partition","text":"partition(n::Integer, k::Integer)\n\nIf n ≥ k partitions the set 1:n into k parts as equally sized as possible. Otherwise partitions it into n parts of size 1.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._fiducial_WH","page":"List of functions","title":"Ket._fiducial_WH","text":"_fiducial_WH([T=ComplexF64,] d::Integer)\n\nComputes the fiducial Weyl-Heisenberg vector of dimension d.\n\nReference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813 http://www.gerhardzauner.at/sicfiducials.html\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._idx","page":"List of functions","title":"Ket._idx","text":"_idx(tidx::Vector, dims::Vector)\n\nConverts a tensor index tidx = [i₁, i₂, ...] with subsystems dimensions dims to a standard index.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._tidx","page":"List of functions","title":"Ket._tidx","text":"_tidx(idx::Integer, dims::Vector)\n\nConverts a standard index idx to a tensor index [i₁, i₂, ...] with subsystems dimensions dims.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._idxperm","page":"List of functions","title":"Ket._idxperm","text":"_idxperm(perm::Vector, dims::Vector)\n\nComputes the index permutation associated with permuting the subsystems of a vector with subsystem dimensions dims according to perm.\n\n\n\n\n\n","category":"function"},{"location":"","page":"Home","title":"Home","text":"EditURL = \"https://github.com/araujoms/Ket.jl/blob/master/README.md\"","category":"page"},{"location":"#Ket.jl","page":"Home","title":"Ket.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Dev)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Toolbox for quantum information, nonlocality, and entanglement.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Highlights are the functions mub and sic_povm, that produce respectively MUBs and SIC-POVMs with arbitrary precision, local_bound that uses a parallelized algorithm to compute the local bound of a Bell inequality, and partial_trace and partial_transpose, that compute the partial trace and partial transpose in a way that can be used for optimization with JuMP. Also worth mentioning are the functions to produce uniformly-distributed random states, unitaries, and POVMs: random_state, random_unitary, random_povm. And the eponymous ket, of course.","category":"page"},{"location":"","page":"Home","title":"Home","text":"For the full list of functions see the documentation.","category":"page"}] +[{"location":"api/#List-of-functions","page":"List of functions","title":"List of functions","text":"","category":"section"},{"location":"api/#Basic","page":"List of functions","title":"Basic","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"ket\nketbra\nproj\nshift\nclock\npauli\ngell_mann\ngell_mann!\npartial_trace\npartial_transpose\npermute_systems!\npermute_systems\ncleanup!\nsymmetric_projection\northonormal_range\npermutation_matrix","category":"page"},{"location":"api/#Ket.ket","page":"List of functions","title":"Ket.ket","text":"ket([T=ComplexF64,] i::Integer, d::Integer = 2)\n\nProduces a ket of dimension d with nonzero element i.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.ketbra","page":"List of functions","title":"Ket.ketbra","text":"ketbra(v::AbstractVector)\n\nProduces a ketbra of vector v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.proj","page":"List of functions","title":"Ket.proj","text":"proj([T=ComplexF64,] i::Integer, d::Integer = 2)\n\nProduces a projector onto the basis state i in dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.shift","page":"List of functions","title":"Ket.shift","text":"shift([T=ComplexF64,] d::Integer, p::Integer = 1)\n\nConstructs the shift operator X of dimension d to the power p.\n\nReference: Generalized Clifford algebra\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.clock","page":"List of functions","title":"Ket.clock","text":"clock([T=ComplexF64,] d::Integer, p::Integer = 1)\n\nConstructs the clock operator Z of dimension d to the power p.\n\nReference: Generalized Clifford algebra\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.pauli","page":"List of functions","title":"Ket.pauli","text":"pauli([T=ComplexF64,], ind::Vector{<:Integer})\n\nConstructs the Pauli matrices: 0 or \"I\" for the identity, 1 or \"X\" for the Pauli X operation, 2 or \"Y\" for the Pauli Y operator, and 3 or \"Z\" for the Pauli Z operator. Vectors of integers between 0 and 3 or strings of I, X, Y, Z automatically generate Kronecker products of the corresponding operators.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.gell_mann","page":"List of functions","title":"Ket.gell_mann","text":"gell_mann([T=ComplexF64,], d::Integer = 3)\n\nConstructs the set G of generalized Gell-Mann matrices in dimension d such that G[1] = I and G[i]*G[j] = 2 δ_ij.\n\nReference: Generalizations of Pauli matrices\n\n\n\n\n\ngell_mann([T=ComplexF64,], i::Integer, j::Integer, d::Integer = 3)\n\nConstructs the set i,jth Gell-Mann matrix of dimension d.\n\nReference: Generalizations of Pauli matrices\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.gell_mann!","page":"List of functions","title":"Ket.gell_mann!","text":"gell_mann!(res::AbstractMatrix{T}, i::Integer, j::Integer, d::Integer = 3)\n\nIn-place version of gell_mann.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.partial_trace","page":"List of functions","title":"Ket.partial_trace","text":"partial_trace(X::AbstractMatrix, remove::Vector, dims::Vector)\n\nTakes the partial trace of matrix X with subsystem dimensions dims over the subsystems in remove.\n\n\n\n\n\npartial_trace(X::AbstractMatrix, remove::Integer, dims::Vector)\n\nTakes the partial trace of matrix X with subsystem dimensions dims over the subsystem remove.\n\n\n\n\n\npartial_trace(X::AbstractMatrix, remove::Integer)\n\nTakes the partial trace of matrix X over the subsystems remove assuming two equally-sized subsystems.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.partial_transpose","page":"List of functions","title":"Ket.partial_transpose","text":"partial_transpose(X::AbstractMatrix, transp::Vector, dims::Vector)\n\nTakes the partial transpose of matrix X with subsystem dimensions dims on the subsystems in transp.\n\n\n\n\n\npartial_transpose(X::AbstractMatrix, transp::Integer, dims::Vector)\n\nTakes the partial transpose of matrix X with subsystem dimensions dims on the subsystem transp.\n\n\n\n\n\npartial_transpose(X::AbstractMatrix, transp)\n\nTakes the partial transpose of matrix X on the subsystems in transp assuming two equally-sized subsystems.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.permute_systems!","page":"List of functions","title":"Ket.permute_systems!","text":"permute_systems!(X::AbstractVector, perm::Vector, dims::Vector)\n\nPermutes the order of the subsystems of vector X with subsystem dimensions dims in-place according to the permutation perm.\n\n\n\n\n\npermute_systems!(X::AbstractVector, perm::Vector)\n\nPermutes the order of the subsystems of vector X, which is composed by two subsystems of equal dimensions, in-place according to the permutation perm.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.permute_systems","page":"List of functions","title":"Ket.permute_systems","text":"permute_systems(X::AbstractMatrix, perm::Vector, dims::Vector)\n\nPermutes the order of the subsystems of the square matrix X, which is composed by square subsystems of dimensions dims, according to the permutation perm.\n\n\n\n\n\npermute_systems(X::AbstractMatrix, perm::Vector)\n\nPermutes the order of the subsystems of the square matrix X, which is composed by two square subsystems of equal dimensions, according to the permutation perm.\n\n\n\n\n\npermute_systems(X::AbstractMatrix, perm::Vector, dims::Matrix)\n\nPermutes the order of the subsystems of the matrix X, which is composed by subsystems of dimensions dims, according to the permutation perm. dims should be a n x 2 matrix where dims[i, 1] is the number of rows of subsystem i, and dims[i,2] is its number of columns. \n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.cleanup!","page":"List of functions","title":"Ket.cleanup!","text":"cleanup!(M::AbstractArray{T}; tol = Base.rtoldefault(real(T)))\n\nZeroes out real or imaginary parts of M that are smaller than tol.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.symmetric_projection","page":"List of functions","title":"Ket.symmetric_projection","text":"symmetric_projection(dim::Integer, n::Integer; partial::Bool=true)\n\nOrthogonal projection onto the symmetric subspace of n copies of a dim-dimensional space. By default (partial=true) it returns amatrix (say, P) with columns forming an orthogonal basis for the symmetric subspace. If partial=false, then it returns the actual projection P * P'.\n\nReference: Watrous' book, Sec. 7.1.1\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.orthonormal_range","page":"List of functions","title":"Ket.orthonormal_range","text":"orthonormal_range(A::AbstractMatrix{T}; mode::Integer=nothing, tol::T=nothing, sp::Bool=true) where {T<:Number}\n\nOrthonormal basis for the range of A. When A is sparse (or mode = 0), uses a QR factorization and returns a sparse result, otherwise uses an SVD and returns a dense matrix (mode = 1). Input A will be overwritten during the factorization. Tolerance tol is used to compute the rank and is automatically set if not provided.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.permutation_matrix","page":"List of functions","title":"Ket.permutation_matrix","text":"permutation_matrix(dims::Union{Integer,Vector{<:Integer}}, perm::Vector{<:Integer})\n\nUnitary that permutes subsystems of dimension dims according to the permutation perm. If dims is an Integer, assumes there are length(perm) subsystems of equal dimensions dims.\n\n\n\n\n\n","category":"function"},{"location":"api/#Entropy","page":"List of functions","title":"Entropy","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"entropy\nbinary_entropy\nrelative_entropy\nbinary_relative_entropy\nconditional_entropy","category":"page"},{"location":"api/#Ket.entropy","page":"List of functions","title":"Ket.entropy","text":"entropy([base=2,] ρ::AbstractMatrix)\n\nComputes the von Neumann entropy -tr(ρ log ρ) of a positive semidefinite operator ρ using a base base logarithm.\n\nReference: von Neumann entropy.\n\n\n\n\n\nentropy([base=2,] p::AbstractVector)\n\nComputes the Shannon entropy -Σᵢpᵢlog(pᵢ) of a non-negative vector p using a base base logarithm.\n\nReference: Entropy (information theory).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.binary_entropy","page":"List of functions","title":"Ket.binary_entropy","text":"binary_entropy([base=2,] p::Real)\n\nComputes the Shannon entropy -p log(p) - (1-p)log(1-p) of a probability p using a base base logarithm.\n\nReference: Entropy (information theory).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.relative_entropy","page":"List of functions","title":"Ket.relative_entropy","text":"relative_entropy([base=2,] ρ::AbstractMatrix, σ::AbstractMatrix)\n\nComputes the (quantum) relative entropy tr(ρ (log ρ - log σ)) between positive semidefinite matrices ρ and σ using a base base logarithm. Note that the support of ρ must be contained in the support of σ but for efficiency this is not checked.\n\nReference: Quantum relative entropy.\n\n\n\n\n\nrelative_entropy([base=2,] p::AbstractVector, q::AbstractVector)\n\nComputes the relative entropy D(p||q) = Σᵢpᵢlog(pᵢ/qᵢ) between two non-negative vectors p and q using a base base logarithm. Note that the support of p must be contained in the support of q but for efficiency this is not checked.\n\nReference: Relative entropy.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.binary_relative_entropy","page":"List of functions","title":"Ket.binary_relative_entropy","text":"binary_relative_entropy([base=2,] p::Real, q::Real)\n\nComputes the binary relative entropy D(p||q) = p log(p/q) + (1-p) log((1-p)/(1-q)) between two probabilities p and q using a base base logarithm.\n\nReference: Relative entropy.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.conditional_entropy","page":"List of functions","title":"Ket.conditional_entropy","text":"conditional_entropy([base=2,] pAB::AbstractMatrix)\n\nComputes the conditional Shannon entropy H(A|B) of the joint probability distribution pAB using a base base logarithm.\n\nReference: Conditional entropy.\n\n\n\n\n\nconditional_entropy([base=2,], rho::AbstractMatrix, csys::AbstractVector, dims::AbstractVector)\n\nComputes the conditional von Neumann entropy of rho with subsystem dimensions dims and conditioning systems csys, using a base base logarithm.\n\nReference: Conditional quantum entropy.\n\n\n\n\n\n","category":"function"},{"location":"api/#Entanglement","page":"List of functions","title":"Entanglement","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"schmidt_decomposition\nentanglement_entropy\nentanglement_dps","category":"page"},{"location":"api/#Ket.schmidt_decomposition","page":"List of functions","title":"Ket.schmidt_decomposition","text":"schmidt_decomposition(ψ::AbstractVector, dims::AbstractVector{<:Integer})\n\nProduces the Schmidt decomposition of ψ with subsystem dimensions dims. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.\n\nReference: Schmidt decomposition.\n\n\n\n\n\nschmidt_decomposition(ψ::AbstractVector)\n\nProduces the Schmidt decomposition of ψ assuming equally-sized subsystems. Returns the (sorted) Schmidt coefficients λ and isometries U, V such that kron(U', V')*ψ is of Schmidt form.\n\nReference: Schmidt decomposition.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.entanglement_entropy","page":"List of functions","title":"Ket.entanglement_entropy","text":"entanglement_entropy(ψ::AbstractVector, dims::AbstractVector{<:Integer})\n\nComputes the relative entropy of entanglement of a bipartite pure state ψ with subsystem dimensions dims.\n\n\n\n\n\nentanglement_entropy(ψ::AbstractVector)\n\nComputes the relative entropy of entanglement of a bipartite pure state ψ assuming equally-sized subsystems.\n\n\n\n\n\nentanglement_entropy(ρ::AbstractMatrix, dims::AbstractVector)\n\nLower bounds the relative entropy of entanglement of a bipartite state ρ with subsystem dimensions dims.\n\n\n\n\n\nentanglement_entropy(ρ::AbstractMatrix)\n\nLower bounds the relative entropy of entanglement of a bipartite state ρ assuming equally-sized subsystems.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.entanglement_dps","page":"List of functions","title":"Ket.entanglement_dps","text":"entanglement_dps(ρ::AbstractMatrix{T}, n::Integer = 2, d1::Union{Integer,Nothing} = nothing; sn::Integer = 1, ppt::Bool = true, verbose::Bool = false,\nsolver = Hypatia.Optimizer{_solver_type(T)}, witness::Bool = true, noise::Union{AbstractMatrix,Nothing} = nothing) where {T<:Number}\n\nTest whether ρ has a symmetric extension with n copies of the second subsystem. If yes, returns true and the extension found. Otherwise, returns false and a witness W such that tr(W * ρ) = -1 and tr(W * σ) is nonnegative in any symmetrically-extendable σ.\n\nWhen witness = false, it returns the maximum visibility of ρ such that it has a symmetric extension when mixed with noise (default is white noise). If this visibility is < 1, then the state is entangled, otherwise the test is inconclusive. No witness is returned in this case.\n\nFor sn > 1, it tests whether the state has a Schmidt number greater than sn. For example, if sn = 1 (default) and the state does not have an extension, then it has Schmidt number > 1 (is entangled). Likewise, if sn = 2 and it does not have an extension, then ρ has Schidt number at least 3. The witness parameter works as above. No witness is returned in this case.\n\nReferences: Doherty, Parrilo, Spedalieri arXiv:quant-ph/0308032 Hulpke, Bruss, Lewenstein, Sanpera arXiv:quant-ph/0401118 Weilenmann, Dive, Trillo, Aguilar, Navascués arXiv:1912.10056\n\n\n\n\n\n","category":"function"},{"location":"api/#Measurements","page":"List of functions","title":"Measurements","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"sic_povm\ntest_sic\ntest_povm\ndilate_povm\npovm\nmub\ntest_mub","category":"page"},{"location":"api/#Ket.sic_povm","page":"List of functions","title":"Ket.sic_povm","text":"sic_povm([T=ComplexF64,] d::Integer)\n\nConstructs a vector of d² vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d. This construction is based on the Weyl-Heisenberg fiducial.\n\nReference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.test_sic","page":"List of functions","title":"Ket.test_sic","text":"test_sic(vecs)\n\nTests whether vecs is a vector of d² vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.test_povm","page":"List of functions","title":"Ket.test_povm","text":"test_povm(A::Vector{<:AbstractMatrix{T}})\n\nChecks if the measurement defined by A is valid (hermitian, semi-definite positive, and normalized).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.dilate_povm","page":"List of functions","title":"Ket.dilate_povm","text":"dilate_povm(vecs::Vector{Vector{T}})\n\nDoes the Naimark dilation of a rank-1 POVM given as a vector of vectors. This is the minimal dilation.\n\n\n\n\n\ndilate_povm(E::Vector{<:AbstractMatrix})\n\nDoes the Naimark dilation of a POVM given as a vector of matrices. This always works, but is wasteful if the POVM elements are not full rank.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.povm","page":"List of functions","title":"Ket.povm","text":"povm(B::Vector{<:AbstractMatrix{T}})\n\nCreates a set of (projective) measurements from a set of bases given as unitary matrices.\n\n\n\n\n\npovm(A::Array{T, 4}, n::Vector{Int64})\n\nConverts a set of measurements in the common tensor format into a matrix of matrices. The second argument is fixed by the size of A but can also contain custom number of outcomes.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.mub","page":"List of functions","title":"Ket.mub","text":"mub([T=ComplexF64,] d::Integer)\n\nConstruction of the standard complete set of MUBs. The output contains 1+minᵢ pᵢ^rᵢ bases, where d = ∏ᵢ pᵢ^rᵢ.\n\nReference: Durt, Englert, Bengtsson, Życzkowski, arXiv:1004.3348.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.test_mub","page":"List of functions","title":"Ket.test_mub","text":"Check whether the input is indeed mutually unbiased\n\n\n\n\n\n","category":"function"},{"location":"api/#Nonlocality","page":"List of functions","title":"Nonlocality","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"chsh\ncglmp\nlocal_bound\ntsirelson_bound\ncorrelation_tensor\nprobability_tensor\nfp2cg","category":"page"},{"location":"api/#Ket.chsh","page":"List of functions","title":"Ket.chsh","text":"chsh([T=Float64,] d::Integer = 2)\n\nCHSH-d nonlocal game in full probability notation. If T is an integer type the game is unnormalized.\n\nReference: Buhrman and Massar, arXiv:quant-ph/0409066.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.cglmp","page":"List of functions","title":"Ket.cglmp","text":"cglmp([T=Float64,] d::Integer)\n\nCGLMP nonlocal game in full probability notation. If T is an integer type the game is unnormalized.\n\nReferences: arXiv:quant-ph/0106024 for the original game, and arXiv:2005.13418 for the form presented here.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.local_bound","page":"List of functions","title":"Ket.local_bound","text":"local_bound(G::Array{T,4})\n\nComputes the local bound of a bipartite Bell functional G, written in full probability notation as a 4-dimensional array.\n\nReference: Araújo, Hirsch, and Quintino, arXiv:2005.13418.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.tsirelson_bound","page":"List of functions","title":"Ket.tsirelson_bound","text":"tsirelson_bound(CG::Matrix, scenario::Vector, level::Integer)\n\nUpper bounds the Tsirelson bound of a bipartite Bell funcional game CG, written in Collins-Gisin notation. scenario is vector detailing the number of inputs and outputs, in the order [oa, ob, ia, ib]. level is an integer determining the level of the NPA hierarchy.\n\nThis function requires Moment. It is only available if you first do \"import MATLAB\" or \"using MATLAB\".\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.correlation_tensor","page":"List of functions","title":"Ket.correlation_tensor","text":"correlation_tensor(p::AbstractArray{T, N2}; marg::Bool = true)\n\nApplies N sets of measurements onto a state rho to form a probability array. Convert a 2x...x2xmx...xm probability array into\n\na mx...xm correlation array (no marginals)\na (m+1)x...x(m+1) correlation array (marginals).\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.probability_tensor","page":"List of functions","title":"Ket.probability_tensor","text":"probability_tensor(rho::LA.Hermitian, all_Aax::Vector{Measurement}...)\n\nApplies N sets of measurements onto a state rho to form a probability array.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.fp2cg","page":"List of functions","title":"Ket.fp2cg","text":"fp2cg(V::Array{T,4}) where {T <: Real}\n\nTakes a bipartite Bell functional V in full probability notation and transforms it to Collins-Gisin notation.\n\n\n\n\n\n","category":"function"},{"location":"api/#Norms","page":"List of functions","title":"Norms","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"trace_norm\nkyfan_norm\nschatten_norm\ndiamond_norm","category":"page"},{"location":"api/#Ket.trace_norm","page":"List of functions","title":"Ket.trace_norm","text":"trace_norm(X::AbstractMatrix)\n\nComputes trace norm of matrix X.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.kyfan_norm","page":"List of functions","title":"Ket.kyfan_norm","text":"kyfan_norm(X::AbstractMatrix, k::Integer, p::Real = 2)\n\nComputes Ky-Fan (k,p) norm of matrix X.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.schatten_norm","page":"List of functions","title":"Ket.schatten_norm","text":"schatten_norm(X::AbstractMatrix, p::Real)\n\nComputes Schatten p-norm of matrix X.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.diamond_norm","page":"List of functions","title":"Ket.diamond_norm","text":"diamond_norm(J::AbstractMatrix, dims::AbstractVector)\n\nComputes the diamond norm of the supermap J given in the Choi-Jamiołkowski representation, with subsystem dimensions dims.\n\nReference: Diamond norm\n\n\n\n\n\ndiamond_norm(K::Vector{<:AbstractMatrix})\n\nComputes the diamond norm of the CP map given by the Kraus operators K.\n\n\n\n\n\n","category":"function"},{"location":"api/#Random","page":"List of functions","title":"Random","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"random_state\nrandom_state_ket\nrandom_unitary\nrandom_povm\nrandom_probability","category":"page"},{"location":"api/#Ket.random_state","page":"List of functions","title":"Ket.random_state","text":"random_state([T=ComplexF64,] d::Integer, k::Integer = d)\n\nProduces a uniformly distributed random quantum state in dimension d with rank k.\n\nReference: Życzkowski and Sommers, arXiv:quant-ph/0012101.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_state_ket","page":"List of functions","title":"Ket.random_state_ket","text":"random_state_ket([T=ComplexF64,] d::Integer)\n\nProduces a Haar-random quantum state vector in dimension d.\n\nReference: Życzkowski and Sommers, arXiv:quant-ph/0012101.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_unitary","page":"List of functions","title":"Ket.random_unitary","text":"random_unitary([T=ComplexF64,] d::Integer)\n\nProduces a Haar-random unitary matrix in dimension d. If T is a real type the output is instead a Haar-random (real) orthogonal matrix.\n\nReference: Stewart, doi:10.1137/0717034.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_povm","page":"List of functions","title":"Ket.random_povm","text":"random_povm([T=ComplexF64,] d::Integer, n::Integer, r::Integer)\n\nProduces a random POVM of dimension d with n outcomes and rank min(k, d).\n\nReference: Heinosaari et al., arXiv:1902.04751.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.random_probability","page":"List of functions","title":"Ket.random_probability","text":"random_probability([T=Float64,] d::Integer)\n\nProduces a random probability vector of dimension d uniformly distributed on the simplex.\n\nReference: Dirichlet distribution\n\n\n\n\n\n","category":"function"},{"location":"api/#States","page":"List of functions","title":"States","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"state_phiplus_ket\nstate_phiplus\nisotropic\nstate_psiminus_ket\nstate_psiminus\nstate_ghz_ket\nstate_ghz\nstate_w_ket\nstate_w\nwhite_noise\nwhite_noise!","category":"page"},{"location":"api/#Ket.state_phiplus_ket","page":"List of functions","title":"Ket.state_phiplus_ket","text":"state_phiplus_ket([T=ComplexF64,] d::Integer = 2)\n\nProduces the vector of the maximally entangled state Φ⁺ of local dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_phiplus","page":"List of functions","title":"Ket.state_phiplus","text":"state_phiplus([T=ComplexF64,] d::Integer = 2; v::Real = 1)\n\nProduces the maximally entangled state Φ⁺ of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.isotropic","page":"List of functions","title":"Ket.isotropic","text":"isotropic(v::Real, d::Integer = 2)\n\nProduces the isotropic state of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_psiminus_ket","page":"List of functions","title":"Ket.state_psiminus_ket","text":"state_psiminus_ket([T=ComplexF64,] d::Integer = 2)\n\nProduces the vector of the maximally entangled state ψ⁻ of local dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_psiminus","page":"List of functions","title":"Ket.state_psiminus","text":"state_psiminus([T=ComplexF64,] d::Integer = 2; v::Real = 1)\n\nProduces the maximally entangled state ψ⁻ of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_ghz_ket","page":"List of functions","title":"Ket.state_ghz_ket","text":"state_ghz_ket([T=ComplexF64,] d::Integer = 2, N::Integer = 3; coeff = 1/√d)\n\nProduces the vector of the GHZ state local dimension d.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_ghz","page":"List of functions","title":"Ket.state_ghz","text":"state_ghz([T=ComplexF64,] d::Integer = 2, N::Integer = 3; v::Real = 1, coeff = 1/√d)\n\nProduces the GHZ state of local dimension d with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_w_ket","page":"List of functions","title":"Ket.state_w_ket","text":"state_w_ket([T=ComplexF64,] N::Integer = 3; coeff = 1/√d)\n\nProduces the vector of the N-partite W state.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.state_w","page":"List of functions","title":"Ket.state_w","text":"state_w([T=ComplexF64,] N::Integer = 3; v::Real = 1, coeff = 1/√d)\n\nProduces the N-partite W state with visibility v.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.white_noise","page":"List of functions","title":"Ket.white_noise","text":"white_noise(rho::AbstractMatrix, v::Real)\n\nReturns v * rho + (1 - v) * id, where id is the maximally mixed state.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket.white_noise!","page":"List of functions","title":"Ket.white_noise!","text":"white_noise!(rho::AbstractMatrix, v::Real)\n\nModifies rho in place to tranform in into v * rho + (1 - v) * id where id is the maximally mixed state.\n\n\n\n\n\n","category":"function"},{"location":"api/#Supermaps","page":"List of functions","title":"Supermaps","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"choi","category":"page"},{"location":"api/#Ket.choi","page":"List of functions","title":"Ket.choi","text":"choi(K::Vector{<:AbstractMatrix})\n\nConstructs the Choi-Jamiołkowski representation of the CP map given by the Kraus operators K. The convention used is that choi(K) = ∑ᵢⱼ |i⟩⟨j|⊗K|i⟩⟨j|K'\n\n\n\n\n\n","category":"function"},{"location":"api/#Internal-functions","page":"List of functions","title":"Internal functions","text":"","category":"section"},{"location":"api/","page":"List of functions","title":"List of functions","text":"Ket._partition\nKet._fiducial_WH\nKet._idx\nKet._tidx\nKet._idxperm","category":"page"},{"location":"api/#Ket._partition","page":"List of functions","title":"Ket._partition","text":"partition(n::Integer, k::Integer)\n\nIf n ≥ k partitions the set 1:n into k parts as equally sized as possible. Otherwise partitions it into n parts of size 1.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._fiducial_WH","page":"List of functions","title":"Ket._fiducial_WH","text":"_fiducial_WH([T=ComplexF64,] d::Integer)\n\nComputes the fiducial Weyl-Heisenberg vector of dimension d.\n\nReference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813 http://www.gerhardzauner.at/sicfiducials.html\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._idx","page":"List of functions","title":"Ket._idx","text":"_idx(tidx::Vector, dims::Vector)\n\nConverts a tensor index tidx = [i₁, i₂, ...] with subsystems dimensions dims to a standard index.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._tidx","page":"List of functions","title":"Ket._tidx","text":"_tidx(idx::Integer, dims::Vector)\n\nConverts a standard index idx to a tensor index [i₁, i₂, ...] with subsystems dimensions dims.\n\n\n\n\n\n","category":"function"},{"location":"api/#Ket._idxperm","page":"List of functions","title":"Ket._idxperm","text":"_idxperm(perm::Vector, dims::Vector)\n\nComputes the index permutation associated with permuting the subsystems of a vector with subsystem dimensions dims according to perm.\n\n\n\n\n\n","category":"function"},{"location":"","page":"Home","title":"Home","text":"EditURL = \"https://github.com/araujoms/Ket.jl/blob/master/README.md\"","category":"page"},{"location":"#Ket.jl","page":"Home","title":"Ket.jl","text":"","category":"section"},{"location":"","page":"Home","title":"Home","text":"(Image: Dev)","category":"page"},{"location":"","page":"Home","title":"Home","text":"Toolbox for quantum information, nonlocality, and entanglement.","category":"page"},{"location":"","page":"Home","title":"Home","text":"Highlights are the functions mub and sic_povm, that produce respectively MUBs and SIC-POVMs with arbitrary precision, local_bound that uses a parallelized algorithm to compute the local bound of a Bell inequality, and partial_trace and partial_transpose, that compute the partial trace and partial transpose in a way that can be used for optimization with JuMP. Also worth mentioning are the functions to produce uniformly-distributed random states, unitaries, and POVMs: random_state, random_unitary, random_povm. And the eponymous ket, of course.","category":"page"},{"location":"","page":"Home","title":"Home","text":"For the full list of functions see the documentation.","category":"page"}] }