Home

MajorizationExtrema.jl

≺(ρ::Hermitian, σ::Hermitian; tol=1e-8)

Returns true if σ majorizes ρ and false otherwise. The keyword argument tol specifies a tolerance for the comparisons. Can be used in infix form, i.e. ρ ≺ σ.

source
≺(p::AbstractVector{T1}, q::AbstractVector{T2}; tol = (T1 <: AbstractFloat || T2 <: AbstractFloat) ? T2(1e-8) : zero(T2) ) where {T1, T2}

Returns true if q majorizes p and false otherwise. The keyword argument tol specifies a tolerance for the comparisons. Can be used in infix form, i.e. p ≺ q.

source
TV(p, q)

Returns the total variation distance between p and q (half the sum of the absolute value of the differences).

source
localbound(f, p, ϵ)

Requires f to be Schur convex or Schur concave (but does not check this condition).

  • If p is a vector, it is a assumed to be a probability vector, and localbound returns δ such that |f(p) - f(q)| <= δ for any probability vector q with TV(p, q) <= ϵ.
  • If p is a matrix, it is assumed to be a density matrix, and localbound returns δ such that |f(p) - f(q)| <= δ for any density matrix q with tracedist(p, q) <= ϵ.
source
majmax(q::AbstractVector, ϵ)

Returns the maximum in majorization order over the total variation ball (of probability vectors) of radius ϵ around a probability vector q.

source
majmax(ρ::Hermitian, ϵ)

Returns the maximum in majorization order over the trace distance ball (of density matrices) of radius ϵ around a density matrix ρ.

source
majmin(q::AbstractVector, ϵ)

Returns the minimum in majorization order over the total variation ball (of probability vectors) of radius ϵ around a probability vector q.

source
majmin(ρ::Hermitian, ϵ)

Returns the minimum in majorization order over the trace distance ball (of density matrices) of radius ϵ around a density matrix ρ.

source
randdm([rng], d::Int)

Generates a density matrix of dimension d at random.

source
randprobvec([rng], d::Int)

Generates a random probability vector of length d using an algorithm by Smith and Tromble.

source
randprobvec([rng], d::Int, N::T) where {T <: Integer}

Generates a random probability vector of length d whose entries are rational numbers with denominator at most N using an algorithm by Smith and Tromble.

source
randunitary([rng], d::Int)

Generates a unitary matrix of dimension d at random according to the Haar measure, using an algorithm described by Maris Ozols in "How to generate a random unitary matrix".

source
tracedist(ρ::AbstractMatrix, σ::AbstractMatrix)

Computes the trace distance between two matrices ρ and σ.

source
randincomppair([rng], [T], d::Int, [N]; sortby = entropy)

Generates a pair of probability vectors p, q of length d such that !(p ≺ q) and !(q ≺ p) by rejection sampling. Supply a type T to choose the numeric type of the elements of the vectors, and an integer N to use rational numbers with maximum denominator N.

Optionally, pass a function (from probability vectors to an ordered set) to the keyword argument sortby to sort the results.

source
randmajpair([rng], [T], d::Int, [N])

Generates a pair of probability vectors p, q of length d such that p ≺ q by rejection sampling. Supply a type T to choose the numeric type of the elements of the vectors, and an integer N to use rational numbers with maximum denominator N.

source
simplexpt(unif)

Takes a vector of length d-1 of numbers between 0 and 1 and converts it a point on the standard d-1 dimensional simplex.

source