MajorizationExtrema.jl
MajorizationExtrema.:≺
MajorizationExtrema.:≺
MajorizationExtrema.TV
MajorizationExtrema.localbound
MajorizationExtrema.majmax
MajorizationExtrema.majmax
MajorizationExtrema.majmin
MajorizationExtrema.majmin
MajorizationExtrema.randdm
MajorizationExtrema.randincomppair
MajorizationExtrema.randmajpair
MajorizationExtrema.randprobvec
MajorizationExtrema.randprobvec
MajorizationExtrema.randunitary
MajorizationExtrema.simplexpt
MajorizationExtrema.tracedist
MajorizationExtrema.:≺
— Method.≺(ρ::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. ρ ≺ σ
.
MajorizationExtrema.:≺
— Method.≺(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
.
MajorizationExtrema.TV
— Method.TV(p, q)
Returns the total variation distance between p
and q
(half the sum of the absolute value of the differences).
MajorizationExtrema.localbound
— Method.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, andlocalbound
returnsδ
such that|f(p) - f(q)| <= δ
for any probability vectorq
withTV(p, q) <= ϵ
. - If
p
is a matrix, it is assumed to be a density matrix, andlocalbound
returnsδ
such that|f(p) - f(q)| <= δ
for any density matrixq
withtracedist(p, q) <= ϵ
.
MajorizationExtrema.majmax
— Method.majmax(q::AbstractVector, ϵ)
Returns the maximum in majorization order over the total variation ball (of probability vectors) of radius ϵ
around a probability vector q
.
MajorizationExtrema.majmax
— Method.majmax(ρ::Hermitian, ϵ)
Returns the maximum in majorization order over the trace distance ball (of density matrices) of radius ϵ
around a density matrix ρ
.
MajorizationExtrema.majmin
— Method.majmin(q::AbstractVector, ϵ)
Returns the minimum in majorization order over the total variation ball (of probability vectors) of radius ϵ
around a probability vector q
.
MajorizationExtrema.majmin
— Method.majmin(ρ::Hermitian, ϵ)
Returns the minimum in majorization order over the trace distance ball (of density matrices) of radius ϵ
around a density matrix ρ
.
MajorizationExtrema.randdm
— Method.randdm([rng], d::Int)
Generates a density matrix of dimension d
at random.
MajorizationExtrema.randprobvec
— Method.randprobvec([rng], d::Int)
Generates a random probability vector of length d
using an algorithm by Smith and Tromble.
MajorizationExtrema.randprobvec
— Method.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.
MajorizationExtrema.randunitary
— Method.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".
MajorizationExtrema.tracedist
— Method.tracedist(ρ::AbstractMatrix, σ::AbstractMatrix)
Computes the trace distance between two matrices ρ
and σ
.
MajorizationExtrema.randincomppair
— Method.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.
MajorizationExtrema.randmajpair
— Method.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
.
MajorizationExtrema.simplexpt
— Method.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.