-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple_lifting_ex.py
More file actions
50 lines (40 loc) · 1.77 KB
/
simple_lifting_ex.py
File metadata and controls
50 lines (40 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from regfans import VectorConfiguration
# specify the points/vectors in the configuration
# (below is from the points of a 4D reflexive polytope but that doesn't matter...)
pts = [[1, -2, -1, -1], [1, 1, -1, 2], [-2, 0, 0, -1], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1], [1, -1, -1, 0], [1, 0, -1, 1], [1, 0, 0, 0], [-1, 0, 0, 0]]
# specify the heights
heights = None # picks a default Delaunay triangulation
#heights = [1]*len(pts) # picks a refinemenent of the central subdivision
#heights = [-1]*len(pts) # these heights are invalid
#heights = [...] # enter your own heights!
# study the vector configuration
# ------------------------------
vc = VectorConfiguration(pts)
print(f"constructed the following VC: {vc}")
print()
print('-'*60)
print()
# optional: check properties of the VC
# ------------------------------------
# the defined VC is solid (full-dimensional) and totally-cyclic (i.e., support=\mathbb{R}^4)
print(f"is the VC solid? {vc.is_solid()}")
print(f"is the VC totally cyclic? {vc.is_totally_cyclic()}")
print(f"what are the bounding hyperplanes of the VC? {vc.support()}")
print()
print('-'*60)
print()
# construct/study a triangulation via lifting
# -------------------------------------------
# via lifting
fan = vc.subdivide(heights=heights)
print(f"constructed the following fan: {fan}")
print()
print('-'*60)
print()
# read some properies of the fan
print(f"the triangulation has cones {fan.cones()}")
print(f"some heights defining the triangulation are {fan.heights().tolist()}")
print(f"is the triangulation valid? {fan.is_valid()}")
print(f"is the triangulation fine? {fan.is_fine()}")
print(f"is the triangulation regular? {fan.is_regular()}")
print(f"does the triangulation define a triangulation of the associated PC? {fan.respects_ptconfig()}")