Skip to content

Commit 0b7c4fa

Browse files
committed
cutgeneratingfunctionology/multirow/equivariant-iii-remark-2-13.sage: New
1 parent 05c5497 commit 0b7c4fa

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
## Example from Equivariant III, Remark 2.13
2+
3+
def remark_2_13_vertices():
4+
"""
5+
The additivity domain from Remark 2.13.
6+
7+
The following doctests verify some claims of this remark.
8+
9+
TESTS::
10+
11+
sage: vertices = remark_2_13_vertices()
12+
sage: F = Polyhedron(vertices)
13+
sage: len(vertices) == len(F.vertices())
14+
True
15+
sage: p1F, p2F, p3F = projections(F)
16+
sage: sorted(p1F.vertices_list())
17+
[[0, 3], [0, 4], [3, 4]]
18+
sage: sorted(p2F.vertices_list())
19+
[[4, 1], [5, 0], [5, 2]]
20+
sage: sorted(p3F.vertices_list())
21+
[[5, 5], [5, 6], [8, 4]]
22+
sage: F == FIJK(p1F, p2F, p3F)
23+
True
24+
25+
EXAMPLES::
26+
27+
Reproduce a part of Figure 4.
28+
29+
sage: plot(p1F,polygon='red') + plot(p2F,polygon='blue') + plot(p3F,polygon='green') #not tested
30+
31+
"""
32+
vertices = [ vector (v)
33+
for v in [ [ 0, 4, 5, 1 ], [ 0, 3, 5, 2 ], [ 2, 11/3, 4, 1],
34+
[ 1, 4, 4, 1 ], [ 8/3, 35/9, 4, 1 ], [ 5/2, 4, 4, 1 ],
35+
[ 1, 10/3, 5, 2 ], [ 0, 4, 5, 2 ], [ 3, 4, 5, 0 ] ] ]
36+
return vertices
37+
38+
def projections(F):
39+
"""
40+
Return the projections p1, p2, p3 of a face F.
41+
42+
Currently only implemented for the two-dimensional case.
43+
"""
44+
vertices = F.vertices()
45+
p1 = matrix(QQ, [[1, 0, 0, 0], [0, 1, 0, 0]])
46+
p1F = Polyhedron([ p1 * v.vector() for v in vertices ])
47+
p2 = matrix(QQ, [[0, 0, 1, 0], [0, 0, 0, 1]])
48+
p2F = Polyhedron([ p2 * v.vector() for v in vertices ])
49+
p3 = p1 + p2
50+
p3F = Polyhedron([ p3 * v.vector() for v in vertices ])
51+
return p1F, p2F, p3F
52+
53+
def FIJK(I, J, K):
54+
"""
55+
The face (polyhedron) F(I, J, K), where I, J, K are polyhedra.
56+
"""
57+
zero = [0] * I.ambient_dim()
58+
ieqs = []
59+
eqns = []
60+
ieqs.extend( [ [i[0]] + list(i[1:]) + zero
61+
for i in I.inequality_generator() ] )
62+
eqns.extend( [ [i[0]] + list(i[1:]) + zero
63+
for i in I.equation_generator() ] )
64+
ieqs.extend( [ [i[0]] + zero + list(i[1:])
65+
for i in J.inequality_generator() ] )
66+
eqns.extend( [ [i[0]] + zero + list(i[1:])
67+
for i in J.equation_generator() ] )
68+
ieqs.extend( [ [i[0]] + list(i[1:]) + list(i[1:])
69+
for i in K.inequality_generator() ] )
70+
eqns.extend( [ [i[0]] + list(i[1:]) + list(i[1:])
71+
for i in K.equation_generator() ] )
72+
return Polyhedron(ieqs=ieqs, eqns=eqns)

0 commit comments

Comments
 (0)