qit.utils.majorize

qit.utils.majorize(x: array[float], y: array[float], tol: float = 1e-08) bool

Majorization partial order of real vectors.

Returns True iff x is majorized by y, denoted by xy. This is equivalent to

k=1nxkk=1nykfor alln{1,2,,d},

where x is the vector x with the elements sorted in nonincreasing order.

xy if and only if x is in the convex hull of all the coordinate permutations of y.

Parameters
  • x (array[float]) – real vectors, equal length

  • y (array[float]) – real vectors, equal length

  • tol (float) – numerical tolerance

Returns

xy

Return type

bool