Skip to content

Commit

Permalink
gh-36033: sage.geometry: Update # needs, use block-scoped tags
Browse files Browse the repository at this point in the history
    
<!-- ^^^^^
Please provide a concise, informative and self-explanatory title.
Don't put issue numbers in there, do this in the PR body below.
For example, instead of "Fixes #1234" use "Introduce new method to
calculate 1+1"
-->
<!-- Describe your changes here in detail -->

<!-- Why is this change required? What problem does it solve? -->
Cherry-picked from
- #35095
Part of
- #29705
<!-- If this PR resolves an open issue, please link to it here. For
example "Fixes #12345". -->
<!-- If your change requires a documentation PR, please link it
appropriately. -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->
<!-- If your change requires a documentation PR, please link it
appropriately -->
<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
<!-- Feel free to remove irrelevant items. -->

- [x] The title is concise, informative, and self-explanatory.
- [ ] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on
- #12345: short description why this is a dependency
- #34567: ...
-->

<!-- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
    
URL: #36033
Reported by: Matthias Köppe
Reviewer(s): Kwankyu Lee, Matthias Köppe
  • Loading branch information
Release Manager committed Aug 12, 2023
2 parents 1039d66 + 897660f commit e8453e1
Show file tree
Hide file tree
Showing 61 changed files with 2,823 additions and 2,576 deletions.
18 changes: 9 additions & 9 deletions src/sage/geometry/abc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class LatticePolytope:
EXAMPLES::
sage: import sage.geometry.abc
sage: P = LatticePolytope([(1,2,3), (4,5,6)]) # optional - sage.geometry.polyhedron
sage: isinstance(P, sage.geometry.abc.LatticePolytope) # optional - sage.geometry.polyhedron
sage: P = LatticePolytope([(1,2,3), (4,5,6)]) # needs sage.geometry.polyhedron
sage: isinstance(P, sage.geometry.abc.LatticePolytope) # needs sage.geometry.polyhedron
True
By design, there is a unique direct subclass::
sage: sage.geometry.abc.LatticePolytope.__subclasses__() # optional - sage.geometry.polyhedron
sage: sage.geometry.abc.LatticePolytope.__subclasses__() # needs sage.geometry.polyhedron
[<class 'sage.geometry.lattice_polytope.LatticePolytopeClass'>]
sage: len(sage.geometry.abc.Polyhedron.__subclasses__()) <= 1
Expand All @@ -39,13 +39,13 @@ class ConvexRationalPolyhedralCone:
EXAMPLES::
sage: import sage.geometry.abc
sage: C = cones.nonnegative_orthant(2) # optional - sage.geometry.polyhedron
sage: isinstance(C, sage.geometry.abc.ConvexRationalPolyhedralCone) # optional - sage.geometry.polyhedron
sage: C = cones.nonnegative_orthant(2) # needs sage.geometry.polyhedron
sage: isinstance(C, sage.geometry.abc.ConvexRationalPolyhedralCone) # needs sage.geometry.polyhedron
True
By design, there is a unique direct subclass::
sage: sage.geometry.abc.ConvexRationalPolyhedralCone.__subclasses__() # optional - sage.geometry.polyhedron
sage: sage.geometry.abc.ConvexRationalPolyhedralCone.__subclasses__() # needs sage.geometry.polyhedron
[<class 'sage.geometry.cone.ConvexRationalPolyhedralCone'>]
sage: len(sage.geometry.abc.Polyhedron.__subclasses__()) <= 1
Expand All @@ -65,13 +65,13 @@ class Polyhedron:
EXAMPLES::
sage: import sage.geometry.abc
sage: P = polytopes.cube() # optional - sage.geometry.polyhedron
sage: isinstance(P, sage.geometry.abc.Polyhedron) # optional - sage.geometry.polyhedron
sage: P = polytopes.cube() # needs sage.geometry.polyhedron
sage: isinstance(P, sage.geometry.abc.Polyhedron) # needs sage.geometry.polyhedron
True
By design, there is a unique direct subclass::
sage: sage.geometry.abc.Polyhedron.__subclasses__() # optional - sage.geometry.polyhedron
sage: sage.geometry.abc.Polyhedron.__subclasses__() # needs sage.geometry.polyhedron
[<class 'sage.geometry.polyhedron.base0.Polyhedron_base0'>]
sage: len(sage.geometry.abc.Polyhedron.__subclasses__()) <= 1
Expand Down
296 changes: 156 additions & 140 deletions src/sage/geometry/cone.py

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions src/sage/geometry/cone_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ def rearrangement(p, ambient_dim=None, lattice=None):
sage: ambient_dim = ZZ.random_element(2,10).abs()
sage: p = ZZ.random_element(1, ambient_dim)
sage: K = cones.rearrangement(p, ambient_dim)
sage: P = SymmetricGroup(ambient_dim).random_element().matrix() # optional - sage.groups
sage: all(K.contains(P*r) for r in K) # optional - sage.groups
sage: P = SymmetricGroup(ambient_dim).random_element().matrix() # needs sage.groups
sage: all(K.contains(P*r) for r in K) # needs sage.groups
True
The smallest ``p`` components of every element of the rearrangement
Expand Down Expand Up @@ -527,13 +527,14 @@ def schur(ambient_dim=None, lattice=None):
generators of the Schur cone and the nonnegative orthant in
dimension five is `\left(3/4\right)\pi`::
sage: # needs sage.rings.number_fields
sage: P = cones.schur(5)
sage: Q = cones.nonnegative_orthant(5)
sage: G = ( g.change_ring(QQbar).normalized() for g in P ) # optional - sage.rings.number_fields
sage: H = ( h.change_ring(QQbar).normalized() for h in Q ) # optional - sage.rings.number_fields
sage: actual = max(arccos(u.inner_product(v)) for u in G for v in H) # optional - sage.rings.number_fields
sage: expected = 3*pi/4 # optional - sage.rings.number_fields
sage: abs(actual - expected).n() < 1e-12 # optional - sage.rings.number_fields
sage: G = ( g.change_ring(QQbar).normalized() for g in P )
sage: H = ( h.change_ring(QQbar).normalized() for h in Q )
sage: actual = max(arccos(u.inner_product(v)) for u in G for v in H)
sage: expected = 3*pi/4
sage: abs(actual - expected).n() < 1e-12
True
The dual of the Schur cone is the "downward monotonic cone"
Expand Down Expand Up @@ -566,7 +567,7 @@ def schur(ambient_dim=None, lattice=None):
True
sage: x = V.random_element()
sage: y = V.random_element()
sage: majorized_by(x,y) == ( (y-x) in S ) # optional - sage.rings.number_fields
sage: majorized_by(x,y) == ( (y-x) in S )
True
If a ``lattice`` was given, it is actually used::
Expand Down
Loading

0 comments on commit e8453e1

Please sign in to comment.