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 \(x \preceq y\). This is equivalent to

\[\sum_{k=1}^n x^{\downarrow}_k \le \sum_{k=1}^n y^{\downarrow}_k \quad \text{for all} \quad n \in \{1, 2, \ldots, d\},\]

where \(x^{\downarrow}\) is the vector x with the elements sorted in nonincreasing order.

\(x \preceq y\) 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

\(x \preceq y\)

Return type

bool