129
129
130
130
You can work with subcones that form faces of other cones::
131
131
132
- sage: face = four_rays.faces(dim=2)[0] # needs sage.graphs
133
- sage: face # needs sage.graphs
132
+ sage: # needs sage.graphs
133
+ sage: face = four_rays.faces(dim=2)[0]
134
+ sage: face
134
135
2-d face of 3-d cone in 3-d lattice N
135
- sage: face.rays() # needs sage.graphs
136
+ sage: face.rays()
136
137
N(-1, -1, 1),
137
138
N(-1, 1, 1)
138
139
in 3-d lattice N
139
- sage: face.ambient_ray_indices() # needs sage.graphs
140
+ sage: face.ambient_ray_indices()
140
141
(2, 3)
141
- sage: four_rays.rays(face.ambient_ray_indices()) # needs sage.graphs
142
+ sage: four_rays.rays(face.ambient_ray_indices())
142
143
N(-1, -1, 1),
143
144
N(-1, 1, 1)
144
145
in 3-d lattice N
145
146
146
147
If you need to know inclusion relations between faces, you can use ::
147
148
148
- sage: L = four_rays.face_lattice() # needs sage.graphs
149
- sage: [len(s) for s in L.level_sets()] # needs sage.graphs
149
+ sage: # needs sage.graphs
150
+ sage: L = four_rays.face_lattice()
151
+ sage: [len(s) for s in L.level_sets()]
150
152
[1, 4, 4, 1]
151
- sage: face = L.level_sets()[2][0] # needs sage.graphs
152
- sage: face.rays() # needs sage.graphs
153
+ sage: face = L.level_sets()[2][0]
154
+ sage: face.rays()
153
155
N(1, 1, 1),
154
156
N(1, -1, 1)
155
157
in 3-d lattice N
156
- sage: L.hasse_diagram().neighbors_in(face) # needs sage.graphs
158
+ sage: L.hasse_diagram().neighbors_in(face)
157
159
[1-d face of 3-d cone in 3-d lattice N,
158
160
1-d face of 3-d cone in 3-d lattice N]
159
161
@@ -2095,13 +2097,14 @@ def adjacent(self):
2095
2097
2096
2098
EXAMPLES::
2097
2099
2100
+ sage: # needs sage.graphs
2098
2101
sage: octant = Cone([(1,0,0), (0,1,0), (0,0,1)])
2099
- sage: octant.adjacent() # needs sage.graphs
2102
+ sage: octant.adjacent()
2100
2103
()
2101
- sage: one_face = octant.faces(1)[0] # needs sage.graphs
2102
- sage: len(one_face.adjacent()) # needs sage.graphs
2104
+ sage: one_face = octant.faces(1)[0]
2105
+ sage: len(one_face.adjacent())
2103
2106
2
2104
- sage: one_face.adjacent()[1] # needs sage.graphs
2107
+ sage: one_face.adjacent()[1]
2105
2108
1-d face of 3-d cone in 3-d lattice N
2106
2109
2107
2110
Things are a little bit subtle with fans, as we illustrate below.
@@ -2176,12 +2179,14 @@ def ambient(self):
2176
2179
3-d cone in 3-d lattice N
2177
2180
sage: cone.ambient() is cone
2178
2181
True
2179
- sage: face = cone.faces(1)[0] # needs sage.graphs
2180
- sage: face # needs sage.graphs
2182
+
2183
+ sage: # needs sage.graphs
2184
+ sage: face = cone.faces(1)[0]
2185
+ sage: face
2181
2186
1-d face of 3-d cone in 3-d lattice N
2182
- sage: face.ambient() # needs sage.graphs
2187
+ sage: face.ambient()
2183
2188
3-d cone in 3-d lattice N
2184
- sage: face.ambient() is cone # needs sage.graphs
2189
+ sage: face.ambient() is cone
2185
2190
True
2186
2191
"""
2187
2192
return self ._ambient
@@ -2377,22 +2382,23 @@ def embed(self, cone):
2377
2382
If we want to operate with this ray as a face of the cone, we need to
2378
2383
embed it first::
2379
2384
2380
- sage: e_ray = c.embed(ray) # needs sage.graphs
2381
- sage: e_ray # needs sage.graphs
2385
+ sage: # needs sage.graphs
2386
+ sage: e_ray = c.embed(ray)
2387
+ sage: e_ray
2382
2388
1-d face of 3-d cone in 3-d lattice N
2383
- sage: e_ray.rays() # needs sage.graphs
2389
+ sage: e_ray.rays()
2384
2390
N(0, -1, 1)
2385
2391
in 3-d lattice N
2386
- sage: e_ray is ray # needs sage.graphs
2392
+ sage: e_ray is ray
2387
2393
False
2388
- sage: e_ray.is_equivalent(ray) # needs sage.graphs
2394
+ sage: e_ray.is_equivalent(ray)
2389
2395
True
2390
- sage: e_ray.ambient_ray_indices() # needs sage.graphs
2396
+ sage: e_ray.ambient_ray_indices()
2391
2397
(3,)
2392
- sage: e_ray.adjacent() # needs sage.graphs
2398
+ sage: e_ray.adjacent()
2393
2399
(1-d face of 3-d cone in 3-d lattice N,
2394
2400
1-d face of 3-d cone in 3-d lattice N)
2395
- sage: e_ray.ambient() # needs sage.graphs
2401
+ sage: e_ray.ambient()
2396
2402
3-d cone in 3-d lattice N
2397
2403
2398
2404
Not every cone can be embedded into a fixed ambient cone::
@@ -2492,19 +2498,20 @@ def face_lattice(self):
2492
2498
However, you can achieve some of this functionality using
2493
2499
:meth:`facets`, :meth:`facet_of`, and :meth:`adjacent` methods::
2494
2500
2495
- sage: face = quadrant.faces(1)[0] # needs sage.graphs
2496
- sage: face # needs sage.graphs
2501
+ sage: # needs sage.graphs
2502
+ sage: face = quadrant.faces(1)[0]
2503
+ sage: face
2497
2504
1-d face of 2-d cone in 2-d lattice N
2498
- sage: face.rays() # needs sage.graphs
2505
+ sage: face.rays()
2499
2506
N(1, 0)
2500
2507
in 2-d lattice N
2501
- sage: face.facets() # needs sage.graphs
2508
+ sage: face.facets()
2502
2509
(0-d face of 2-d cone in 2-d lattice N,)
2503
- sage: face.facet_of() # needs sage.graphs
2510
+ sage: face.facet_of()
2504
2511
(2-d cone in 2-d lattice N,)
2505
- sage: face.adjacent() # needs sage.graphs
2512
+ sage: face.adjacent()
2506
2513
(1-d face of 2-d cone in 2-d lattice N,)
2507
- sage: face.adjacent()[0].rays() # needs sage.graphs
2514
+ sage: face.adjacent()[0].rays()
2508
2515
N(0, 1)
2509
2516
in 2-d lattice N
2510
2517
@@ -2720,7 +2727,7 @@ def faces(self, dim=None, codim=None):
2720
2727
sage: halfplane.faces() # needs sage.graphs
2721
2728
((1-d face of 2-d cone in 2-d lattice N,),
2722
2729
(2-d cone in 2-d lattice N,))
2723
- sage: plane = Cone([(1,0), (0,1), (-1,-1)]) # needs sage.graphs
2730
+ sage: plane = Cone([(1,0), (0,1), (-1,-1)])
2724
2731
sage: plane.faces(1) # needs sage.graphs
2725
2732
()
2726
2733
sage: plane.faces() # needs sage.graphs
@@ -2745,16 +2752,17 @@ def faces(self, dim=None, codim=None):
2745
2752
We also ensure that a call to this function does not break
2746
2753
:meth:`facets` method (see :trac:`9780`)::
2747
2754
2748
- sage: cone = toric_varieties.dP8().fan().generating_cone(0); cone # needs palp
2755
+ sage: # needs palp
2756
+ sage: cone = toric_varieties.dP8().fan().generating_cone(0); cone # needs sage.graphs
2749
2757
2-d cone of Rational polyhedral fan in 2-d lattice N
2750
- sage: for f in cone.facets(): print(f.rays()) # needs palp sage.graphs
2758
+ sage: for f in cone.facets(): print(f.rays()) # needs sage.graphs
2751
2759
N(1, 1)
2752
2760
in 2-d lattice N
2753
2761
N(0, 1)
2754
2762
in 2-d lattice N
2755
- sage: len(cone.faces()) # needs palp sage.graphs
2763
+ sage: len(cone.faces()) # needs sage.graphs
2756
2764
3
2757
- sage: for f in cone.facets(): print(f.rays()) # needs palp sage.graphs
2765
+ sage: for f in cone.facets(): print(f.rays()) # needs sage.graphs
2758
2766
N(1, 1)
2759
2767
in 2-d lattice N
2760
2768
N(0, 1)
@@ -3263,7 +3271,7 @@ def is_isomorphic(self, other):
3263
3271
sage: K.is_isomorphic(K) # needs sage.graphs
3264
3272
True
3265
3273
sage: K = cones.trivial(2)
3266
- sage: K.is_isomorphic(K) # needs sage.graphs
3274
+ sage: K.is_isomorphic(K)
3267
3275
True
3268
3276
3269
3277
A random (strictly convex) cone is isomorphic to itself::
@@ -6056,19 +6064,20 @@ def cross_positive_operators_gens(self):
6056
6064
The cross-positive operators of a permuted cone can be obtained by
6057
6065
conjugation::
6058
6066
6067
+ sage: # needs sage.groups
6059
6068
sage: K = random_cone(max_ambient_dim=3)
6060
6069
sage: L = ToricLattice(K.lattice_dim()**2)
6061
- sage: p = SymmetricGroup(K.lattice_dim()).random_element().matrix() # needs sage.groups
6062
- sage: pK = Cone((p*k for k in K), K.lattice(), check=False) # needs sage.groups
6063
- sage: cp_gens = pK.cross_positive_operators_gens() # needs sage.groups
6064
- sage: actual = Cone((g.list() for g in cp_gens), # needs sage.groups
6070
+ sage: p = SymmetricGroup(K.lattice_dim()).random_element().matrix()
6071
+ sage: pK = Cone((p*k for k in K), K.lattice(), check=False)
6072
+ sage: cp_gens = pK.cross_positive_operators_gens()
6073
+ sage: actual = Cone((g.list() for g in cp_gens),
6065
6074
....: lattice=L,
6066
6075
....: check=False)
6067
6076
sage: cp_gens = K.cross_positive_operators_gens()
6068
- sage: expected = Cone(((p*g*p.inverse()).list() for g in cp_gens), # needs sage.groups
6077
+ sage: expected = Cone(((p*g*p.inverse()).list() for g in cp_gens),
6069
6078
....: lattice=L,
6070
6079
....: check=False)
6071
- sage: actual.is_equivalent(expected) # needs sage.groups
6080
+ sage: actual.is_equivalent(expected)
6072
6081
True
6073
6082
6074
6083
An operator is cross-positive on a cone if and only if its
0 commit comments