Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #30200: fix the implementation of the "majorization order."
Browse files Browse the repository at this point in the history
I have used the phrase "majorization order" in the cone catalogue in a
few places. It is however only a preorder, and not a partial order, so
the first order of business is to change that phrase.

There was also one test case that used a majorized_by() function whose
implementation was incorrect. No harm was caused by this, but as a
personal rule I prefer it if a function called majorized_by() actually
implements the majorization order. This commit fixes that as well, by
rearranging the arguments' elements in nonincreasing order, so that
the function truly tests whether or not one argument majorizes the
other.
  • Loading branch information
orlitzky committed Dec 1, 2021
1 parent 5b4f844 commit 931ca5f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/sage/geometry/cone_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def downward_monotonic(ambient_dim=None, lattice=None):
1
The dual of the downward-monotonic cone is the Schur cone
[GS2010]_ that induces the majorization ordering::
[GS2010]_ that induces the majorization preordering::
sage: ambient_dim = ZZ.random_element(10)
sage: K = cones.downward_monotonic(ambient_dim).dual()
Expand Down Expand Up @@ -627,8 +627,8 @@ def schur(ambient_dim=None, lattice=None):
The Schur cone in ``ambient_dim`` dimensions, or living
in ``lattice``.
The Schur cone in `n` dimensions induces the majorization ordering
on the ambient space. If `\left\{e_{1}, e_{2}, \ldots,
The Schur cone in `n` dimensions induces the majorization
preordering on the ambient space. If `\left\{e_{1}, e_{2}, \ldots,
e_{n}\right\}` is the standard basis for the space, then its
generators are `\left\{e_{i} - e_{i+1}\ |\ 1 \le i \le
n-1\right\}`. Its dual is the downward monotonic cone.
Expand Down Expand Up @@ -702,21 +702,25 @@ def schur(ambient_dim=None, lattice=None):
sage: cones.schur(0).is_trivial()
True
The Schur cone induces the majorization ordering, as in Iusem
and Seeger's [IS2005]_ Example 7.3::
The Schur cone induces the majorization preordering, as in Iusem
and Seeger's [IS2005]_ Example 7.3 or Niezgoda's [Niez1998]_
Example 2.2::
sage: ambient_dim = ZZ.random_element(10)
sage: V = VectorSpace(QQ, ambient_dim)
sage: rearrange = lambda z: V(sorted(z.list(),reverse=True))
sage: def majorized_by(x,y):
....: x = rearrange(x)
....: y = rearrange(y)
....: return (all(sum(x[0:i]) <= sum(y[0:i])
....: for i in range(x.degree()-1))
....: and sum(x) == sum(y))
sage: ambient_dim = ZZ.random_element(10)
sage: V = VectorSpace(QQ, ambient_dim)
sage: S = cones.schur(ambient_dim)
sage: majorized_by(V.zero(), S.random_element())
True
sage: x = V.random_element()
sage: y = V.random_element()
sage: majorized_by(x,y) == ( (y-x) in S )
sage: majorized_by(x,y) == ((rearrange(y)-rearrange(x)) in S)
True
If a ``lattice`` was given, it is actually used::
Expand Down

0 comments on commit 931ca5f

Please sign in to comment.