API reference
Ket._fiducial_WH
— Method_fiducial_WH(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
Ket._partition
— Methodpartition(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.
Ket.anti_isotropic
— MethodProduces the anti-isotropic state of local dimension d
with visibility v
Ket.binary_entropy
— Methodbinary_entropy([b=2,] p::Real)
Computes the Shannon entropy -p log(p) - (1-p)log(1-p) of a probability p
using a base b
logarithm.
Reference: Entropy (information theory).
Ket.binary_relative_entropy
— Methodbinary_relative_entropy([b=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 b
logarithm.
Reference: Relative entropy.
Ket.cglmp
— Methodcglmp([T=Float64,] d::Integer)
CGLMP nonlocal game in full probability notation. If T
is an integer type the game is unnormalized.
References: arXiv:quant-ph/0106024 for the original game, and arXiv:2005.13418 for the form presented here.
Ket.chsh
— Methodchsh([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.
Ket.cleanup!
— Methodcleanup!(M::AbstractArray{T}; tol = Base.rtoldefault(real(T)))
Zeroes out real or imaginary parts of M
that are smaller than tol
.
Ket.clock
— Methodclock([T=ComplexF64,] d::Integer, p::Integer = 1)
Constructs the clock operator Z of dimension d
to the power p
.
Reference: Generalized Clifford algebra
Ket.correlation_tensor
— Methodcorrelation_tensor(p::AbstractArray{T, N2}; marg::Bool = true)
Applies N sets of POVMs 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).
Ket.dilate_povm
— Methoddilate_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.
Ket.dilate_povm
— Methoddilate_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.
Ket.entropy
— Methodentropy([b=2,] ρ::AbstractMatrix)
Computes the von Neumann entropy -tr(ρ log ρ) of a positive semidefinite operator ρ
using a base b
logarithm.
Reference: von Neumann entropy.
Ket.entropy
— Methodentropy([b=2,] p::AbstractVector)
Computes the Shannon entropy -Σᵢpᵢlog(pᵢ) of a non-negative vector p
using a base b
logarithm.
Reference: Entropy (information theory).
Ket.fp2cg
— Methodfp2cg(V::Array{T,4}) where {T <: Real}
Takes a bipartite Bell functional V
in full probability notation and transforms it to Collins-Gisin notation.
Ket.gell_mann!
— Methodgell_mann!(res::AbstractMatrix{T}, i::Integer, j::Integer, d::Integer = 3)
In-place version of gell_mann
.
Ket.gell_mann
— Methodgell_mann([T=ComplexF64,], d::Integer = 3)
Constructs the set G
of generalized Gell-Mann matrices in dimension d
such that G[1] = I
and G[i]*G[j] = 2 δ_ij
.
Reference: Generalizations of Pauli matrices
Ket.gell_mann
— Methodgell_mann([T=ComplexF64,], i::Integer, j::Integer, d::Integer = 3)
Constructs the set i
,j
th Gell-Mann matrix of dimension d
.
Reference: Generalizations of Pauli matrices
Ket.isotropic
— MethodProduces the isotropic state of local dimension d
with visibility v
Ket.ket
— Methodket([T=ComplexF64,] i::Integer, d::Integer)
Produces a ket of dimension d
with nonzero element i
.
Ket.ketbra
— Methodketbra(v::AbstractVector)
Produces a ketbra of vector v
.
Ket.kyfan_norm
— Functionkyfan_norm(X::AbstractMatrix, k::Int, p::Real = 2)
Computes Ky-Fan (k
,p
) norm of matrix X
.
Ket.local_bound
— Methodlocal_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.
Ket.mub
— Methodmub(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.
Ket.phiplus
— MethodProduces the maximally entangled state Φ⁺ of local dimension d
Ket.povm
— Methodpovm(A::Array{T, 4}, n::Vector{Int64})
Converts a set of POVMs 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.
Ket.povm
— Methodpovm(B::Vector{<:AbstractMatrix{T}})
Creates a set of (projective) POVMs from a set of bases given as unitary matrices.
Ket.probability_tensor
— Methodprobability_tensor(Aax::Vector{POVM{T}})
Applies N sets of POVMs onto a state rho
to form a probability array.
Ket.proj
— Methodproj([T=ComplexF64,] i::Integer, d::Integer)
Produces a projector onto the basis state i
in dimension d
.
Ket.psiminus
— MethodProduces the maximally entangled state ψ⁻ of local dimension d
Ket.random_povm
— Methodrandom_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.
Ket.random_probability
— Methodrandom_probability([T=Float64,] d::Integer)
Produces a random probability vector of dimension d
uniformly distributed on the simplex.
Reference: Dirichlet distribution
Ket.random_state
— Methodrandom_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.
Ket.random_state_vector
— Methodrandom_state_vector([T=ComplexF64,] d::Integer)
Produces a Haar-random quantum state vector in dimension d
.
Reference: Życzkowski and Sommers, arXiv:quant-ph/0012101.
Ket.random_unitary
— Methodrandom_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: Mezzadri, arXiv:math-ph/0609050.
Ket.relative_entropy
— Methodrelative_entropy([b=2,] ρ::AbstractMatrix, σ::AbstractMatrix)
Computes the (quantum) relative entropy tr(ρ
(log ρ
- log σ
)) between positive semidefinite matrices ρ
and σ
using a base b
logarithm. Note that the support of ρ
must be contained in the support of σ
but for efficiency this is not checked.
Reference: Quantum relative entropy.
Ket.relative_entropy
— Methodrelative_entropy([b=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 b
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.
Ket.schatten_norm
— Methodschatten_norm(X::AbstractMatrix, p::Real)
Computes Schatten p
-norm of matrix X
.
Ket.shift
— Methodshift([T=ComplexF64,] d::Integer, p::Integer = 1)
Constructs the shift operator X of dimension d
to the power p
.
Reference: Generalized Clifford algebra
Ket.sic_povm
— Methodsic_povm(d::Integer)
Constructs 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.
Reference: Appleby, Yadsan-Appleby, Zauner, arXiv:1209.1813
Ket.test_mub
— MethodCheck whether the input is indeed mutually unbiased
Ket.test_sic
— Methodtest_sic(vecs)
Tests whether vecs
is a vector of d²
vectors |vᵢ⟩ such that |vᵢ⟩⟨vᵢ| forms a SIC-POVM of dimension d
.
Ket.trace_norm
— Methodtrace_norm(X::AbstractMatrix)
Computes trace norm of matrix X
.
Ket.tsirelson_bound
— Methodtsirelson_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".