Skip to content

Commit cd18f99

Browse files
author
Matthias Koeppe
committed
sage.geometry: Use even more block tags
1 parent a3c20be commit cd18f99

23 files changed

+428
-357
lines changed

src/sage/geometry/cone.py

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,22 +2518,23 @@ def face_lattice(self):
25182518
Note that if ``cone`` is a face of ``supercone``, then the face
25192519
lattice of ``cone`` consists of (appropriate) faces of ``supercone``::
25202520
2521+
sage: # needs sage.combinat sage.graphs
25212522
sage: supercone = Cone([(1,2,3,4), (5,6,7,8),
25222523
....: (1,2,4,8), (1,3,9,7)])
2523-
sage: supercone.face_lattice() # needs sage.combinat sage.graphs
2524+
sage: supercone.face_lattice()
25242525
Finite lattice containing 16 elements with distinguished linear extension
2525-
sage: supercone.face_lattice().top() # needs sage.combinat sage.graphs
2526+
sage: supercone.face_lattice().top()
25262527
4-d cone in 4-d lattice N
2527-
sage: cone = supercone.facets()[0] # needs sage.combinat sage.graphs
2528-
sage: cone # needs sage.combinat sage.graphs
2528+
sage: cone = supercone.facets()[0]
2529+
sage: cone
25292530
3-d face of 4-d cone in 4-d lattice N
2530-
sage: cone.face_lattice() # needs sage.combinat sage.graphs
2531+
sage: cone.face_lattice()
25312532
Finite poset containing 8 elements with distinguished linear extension
2532-
sage: cone.face_lattice().bottom() # needs sage.combinat sage.graphs
2533+
sage: cone.face_lattice().bottom()
25332534
0-d face of 4-d cone in 4-d lattice N
2534-
sage: cone.face_lattice().top() # needs sage.combinat sage.graphs
2535+
sage: cone.face_lattice().top()
25352536
3-d face of 4-d cone in 4-d lattice N
2536-
sage: cone.face_lattice().top() == cone # needs sage.combinat sage.graphs
2537+
sage: cone.face_lattice().top() == cone
25372538
True
25382539
25392540
TESTS::
@@ -2721,16 +2722,17 @@ def faces(self, dim=None, codim=None):
27212722
In the case of non-strictly convex cones even faces of small
27222723
non-negative dimension may be missing::
27232724
2725+
sage: # needs sage.graphs
27242726
sage: halfplane = Cone([(1,0), (0,1), (-1,0)])
2725-
sage: halfplane.faces(0) # needs sage.graphs
2727+
sage: halfplane.faces(0)
27262728
()
2727-
sage: halfplane.faces() # needs sage.graphs
2729+
sage: halfplane.faces()
27282730
((1-d face of 2-d cone in 2-d lattice N,),
27292731
(2-d cone in 2-d lattice N,))
27302732
sage: plane = Cone([(1,0), (0,1), (-1,-1)])
2731-
sage: plane.faces(1) # needs sage.graphs
2733+
sage: plane.faces(1)
27322734
()
2733-
sage: plane.faces() # needs sage.graphs
2735+
sage: plane.faces()
27342736
((2-d cone in 2-d lattice N,),)
27352737
27362738
TESTS:
@@ -2908,19 +2910,20 @@ def facet_of(self):
29082910
29092911
EXAMPLES::
29102912
2913+
sage: # needs sage.graphs
29112914
sage: octant = Cone([(1,0,0), (0,1,0), (0,0,1)])
2912-
sage: octant.facet_of() # needs sage.graphs
2915+
sage: octant.facet_of()
29132916
()
2914-
sage: one_face = octant.faces(1)[0] # needs sage.graphs
2915-
sage: len(one_face.facet_of()) # needs sage.graphs
2917+
sage: one_face = octant.faces(1)[0]
2918+
sage: len(one_face.facet_of())
29162919
2
2917-
sage: one_face.facet_of()[1] # needs sage.graphs
2920+
sage: one_face.facet_of()[1]
29182921
2-d face of 3-d cone in 3-d lattice N
29192922
29202923
While fan is the top element of its own cone lattice, which is a
29212924
variant of a face lattice, we do not refer to cones as its facets::
29222925
2923-
sage: fan = Fan([octant])
2926+
sage: fan = Fan([octant]) # needs sage.graphs
29242927
sage: fan.generating_cone(0).facet_of() # needs sage.graphs
29252928
()
29262929
@@ -3923,17 +3926,18 @@ def sublattice_quotient(self, *args, **kwds):
39233926
39243927
EXAMPLES::
39253928
3929+
sage: # needs sage.graphs
39263930
sage: C2_Z2 = Cone([(1,0), (1,2)]) # C^2/Z_2
3927-
sage: c1, c2 = C2_Z2.facets() # needs sage.graphs
3928-
sage: c2.sublattice_quotient() # needs sage.graphs
3931+
sage: c1, c2 = C2_Z2.facets()
3932+
sage: c2.sublattice_quotient()
39293933
1-d lattice, quotient of 2-d lattice N by Sublattice <N(1, 2)>
39303934
sage: N = C2_Z2.lattice()
39313935
sage: n = N(1,1)
3932-
sage: n_bar = c2.sublattice_quotient(n); n_bar # needs sage.graphs
3936+
sage: n_bar = c2.sublattice_quotient(n); n_bar
39333937
N[1, 1]
3934-
sage: n_bar.lift() # needs sage.graphs
3938+
sage: n_bar.lift()
39353939
N(1, 1)
3936-
sage: vector(n_bar) # needs sage.graphs
3940+
sage: vector(n_bar)
39373941
(-1)
39383942
"""
39393943
if "_sublattice_quotient" not in self.__dict__:
@@ -4205,30 +4209,32 @@ def relative_orthogonal_quotient(self, supercone):
42054209
42064210
EXAMPLES::
42074211
4212+
sage: # needs sage.graphs
42084213
sage: rho = Cone([(1,1,1,3), (1,-1,1,3), (-1,-1,1,3), (-1,1,1,3)])
42094214
sage: rho.orthogonal_sublattice()
42104215
Sublattice <M(0, 0, 3, -1)>
4211-
sage: sigma = rho.facets()[1] # needs sage.graphs
4212-
sage: sigma.orthogonal_sublattice() # needs sage.graphs
4216+
sage: sigma = rho.facets()[1]
4217+
sage: sigma.orthogonal_sublattice()
42134218
Sublattice <M(0, 1, 1, 0), M(0, 0, 3, -1)>
4214-
sage: sigma.is_face_of(rho) # needs sage.graphs
4219+
sage: sigma.is_face_of(rho)
42154220
True
4216-
sage: Q = sigma.relative_orthogonal_quotient(rho); Q # needs sage.graphs
4221+
sage: Q = sigma.relative_orthogonal_quotient(rho); Q
42174222
1-d lattice, quotient
42184223
of Sublattice <M(0, 1, 1, 0), M(0, 0, 3, -1)>
42194224
by Sublattice <M(0, 0, 3, -1)>
4220-
sage: Q.gens() # needs sage.graphs
4225+
sage: Q.gens()
42214226
(M[0, 1, 1, 0],)
42224227
42234228
Different codimension::
42244229
4230+
sage: # needs sage.graphs
42254231
sage: rho = Cone([[1,-1,1,3],[-1,-1,1,3]])
4226-
sage: sigma = rho.facets()[0] # needs sage.graphs
4227-
sage: sigma.orthogonal_sublattice() # needs sage.graphs
4232+
sage: sigma = rho.facets()[0]
4233+
sage: sigma.orthogonal_sublattice()
42284234
Sublattice <M(1, 0, 2, -1), M(0, 1, 1, 0), M(0, 0, 3, -1)>
4229-
sage: rho.orthogonal_sublattice() # needs sage.graphs
4235+
sage: rho.orthogonal_sublattice()
42304236
Sublattice <M(0, 1, 1, 0), M(0, 0, 3, -1)>
4231-
sage: sigma.relative_orthogonal_quotient(rho).gens() # needs sage.graphs
4237+
sage: sigma.relative_orthogonal_quotient(rho).gens()
42324238
(M[-1, 0, -2, 1],)
42334239
42344240
Sign choice in the codimension one case::
@@ -5741,19 +5747,20 @@ def positive_operators_gens(self, K2=None):
57415747
The positive operators on a permuted cone can be obtained by
57425748
conjugation::
57435749
5750+
sage: # needs sage.groups
57445751
sage: K = random_cone(max_ambient_dim=3)
57455752
sage: L = ToricLattice(K.lattice_dim()**2)
5746-
sage: p = SymmetricGroup(K.lattice_dim()).random_element().matrix() # needs sage.groups
5747-
sage: pK = Cone((p*k for k in K), K.lattice(), check=False) # needs sage.groups
5748-
sage: pi_gens = pK.positive_operators_gens() # needs sage.groups
5749-
sage: actual = Cone((g.list() for g in pi_gens), # needs sage.groups
5753+
sage: p = SymmetricGroup(K.lattice_dim()).random_element().matrix()
5754+
sage: pK = Cone((p*k for k in K), K.lattice(), check=False)
5755+
sage: pi_gens = pK.positive_operators_gens()
5756+
sage: actual = Cone((g.list() for g in pi_gens),
57505757
....: lattice=L,
57515758
....: check=False)
57525759
sage: pi_gens = K.positive_operators_gens()
5753-
sage: expected = Cone(((p*g*p.inverse()).list() for g in pi_gens), # needs sage.groups
5760+
sage: expected = Cone(((p*g*p.inverse()).list() for g in pi_gens),
57545761
....: lattice=L,
57555762
....: check=False)
5756-
sage: actual.is_equivalent(expected) # needs sage.groups
5763+
sage: actual.is_equivalent(expected)
57575764
True
57585765
57595766
An operator is positive from one cone to another if and only if

src/sage/geometry/cone_catalog.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,13 +527,14 @@ def schur(ambient_dim=None, lattice=None):
527527
generators of the Schur cone and the nonnegative orthant in
528528
dimension five is `\left(3/4\right)\pi`::
529529
530+
sage: # needs sage.rings.number_fields
530531
sage: P = cones.schur(5)
531532
sage: Q = cones.nonnegative_orthant(5)
532533
sage: G = ( g.change_ring(QQbar).normalized() for g in P )
533534
sage: H = ( h.change_ring(QQbar).normalized() for h in Q )
534-
sage: actual = max(arccos(u.inner_product(v)) for u in G for v in H) # needs sage.rings.number_fields
535-
sage: expected = 3*pi/4 # needs sage.rings.number_fields
536-
sage: abs(actual - expected).n() < 1e-12 # needs sage.rings.number_fields
535+
sage: actual = max(arccos(u.inner_product(v)) for u in G for v in H)
536+
sage: expected = 3*pi/4
537+
sage: abs(actual - expected).n() < 1e-12
537538
True
538539
539540
The dual of the Schur cone is the "downward monotonic cone"

src/sage/geometry/fan.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,12 @@
196196
197197
We can also make ``fan3`` smooth, but it will take a bit more work::
198198
199+
sage: # needs palp
199200
sage: cube = lattice_polytope.cross_polytope(3).polar()
200-
sage: sk = cube.skeleton_points(2) # needs palp
201-
sage: rays = [cube.point(p) for p in sk] # needs palp
202-
sage: fan4 = fan3.subdivide(new_rays=rays) # needs palp
203-
sage: fan4.is_smooth() # needs palp
201+
sage: sk = cube.skeleton_points(2)
202+
sage: rays = [cube.point(p) for p in sk]
203+
sage: fan4 = fan3.subdivide(new_rays=rays)
204+
sage: fan4.is_smooth()
204205
True
205206
206207
Let's see how "different" are ``fan2`` and ``fan4``::

0 commit comments

Comments
 (0)