Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sage.geometry: Update # needs, use block-scoped tags #36033

Merged
merged 9 commits into from
Aug 13, 2023
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