Skip to content

Commit 7dd8867

Browse files
committed
update documentation
1 parent 299541b commit 7dd8867

File tree

1 file changed

+80
-76
lines changed

1 file changed

+80
-76
lines changed

documentation/api.md

Lines changed: 80 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ configuration. This is handled by the hidden [`__init__`](#__init__)
333333
function.
334334

335335
This class is *not* intended to be called directly. Instead, it is meant to
336-
be called through VectorConfiguration.subdivide.
336+
be called through VectorConfiguration.triangulate.
337337

338338
**Arguments:**
339339
- `vc`: The ambient vector configuration that this fan is over.
@@ -714,7 +714,7 @@ def respects_ptconfig() -> bool
714714

715715
**Description:**
716716
Return whether or not the fan also defines a (star) subdivision of the
717-
underlying point configuration.
717+
original underlying point configuration.
718718

719719
**Arguments:**
720720
None.
@@ -1181,6 +1181,60 @@ the property to a bool)
11811181

11821182
# util
11831183

1184+
<a id="util.gcd"></a>
1185+
1186+
---
1187+
1188+
1189+
#### gcd
1190+
1191+
```python
1192+
def gcd(vals: list[float], max_denom: float = 10**6) -> float
1193+
```
1194+
1195+
**Description:**
1196+
Computes the 'GCD' of a collection of floating point numbers.
1197+
This is the smallest number, g, such that g*values is integral.
1198+
1199+
This is computed by
1200+
1) converting `values` to be rational [n0/d0, n1/d1, ...],
1201+
2) computing the LCM, l, of [d0, d1, ...],
1202+
3) computing the GCD, g', of [l*n0/d0, l*n1/d1, ...], and then
1203+
4) returning g=g'/l.
1204+
1205+
**Arguments:**
1206+
- `vals`: The numbers to compute the GCD of.
1207+
- `max_denom`: Assert |di| <= max_denom
1208+
1209+
**Returns:**
1210+
The minimum number g' such that g'*vals is integral.
1211+
1212+
<a id="util.primitive"></a>
1213+
1214+
---
1215+
1216+
1217+
#### primitive
1218+
1219+
```python
1220+
def primitive(vec: list[float], max_denom=10**10)
1221+
```
1222+
1223+
**Description:**
1224+
Computes the primitive vector associated to the input ray {c*vec: c>=0}.
1225+
Very similar to the gcd function.
1226+
1227+
This is equivalent to
1228+
vec/gcd(vec)
1229+
but just uses a rational representation.
1230+
1231+
**Arguments:**
1232+
- `vec`: A vector defining the ray {c*vec: c>=0}
1233+
- `max_denom`: Assert |di| <= max_denom
1234+
1235+
**Returns:**
1236+
The primitive vector along the ray.
1237+
11841238
<a id="util.lerp"></a>
11851239

11861240
---
@@ -1420,60 +1474,6 @@ Modified from CYTools' `Cone.find_interior_point`.
14201474
**Returns:**
14211475
A point p in the strict interior.
14221476

1423-
<a id="util.gcd"></a>
1424-
1425-
---
1426-
1427-
1428-
#### gcd
1429-
1430-
```python
1431-
def gcd(vals: list[float], max_denom: float = 10**6) -> float
1432-
```
1433-
1434-
**Description:**
1435-
Computes the 'GCD' of a collection of floating point numbers.
1436-
This is the smallest number, g, such that g*values is integral.
1437-
1438-
This is computed by
1439-
1) converting `values` to be rational [n0/d0, n1/d1, ...],
1440-
2) computing the LCM, l, of [d0, d1, ...],
1441-
3) computing the GCD, g', of [l*n0/d0, l*n1/d1, ...], and then
1442-
4) returning g=g'/l.
1443-
1444-
**Arguments:**
1445-
- `vals`: The numbers to compute the GCD of.
1446-
- `max_denom`: Assert |di| <= max_denom
1447-
1448-
**Returns:**
1449-
The minimum number g' such that g'*vals is integral.
1450-
1451-
<a id="util.primitive"></a>
1452-
1453-
---
1454-
1455-
1456-
#### primitive
1457-
1458-
```python
1459-
def primitive(vec: list[float], max_denom=10**10)
1460-
```
1461-
1462-
**Description:**
1463-
Computes the primitive vector associated to the input ray {c*vec: c>=0}.
1464-
Very similar to the gcd function.
1465-
1466-
This is equivalent to
1467-
vec/gcd(vec)
1468-
but just uses a rational representation.
1469-
1470-
**Arguments:**
1471-
- `vec`: A vector defining the ray {c*vec: c>=0}
1472-
- `max_denom`: Assert |di| <= max_denom
1473-
1474-
**Returns:**
1475-
The primitive vector along the ray.
1476-
14771477
<a id="__init__"></a>
14781478

14791479
---
@@ -2031,31 +2031,35 @@ I.e., map from chamber-space to height-space
20312031
**Returns:**
20322032
The chamber-space vector.
20332033

2034-
<a id="vectorconfig.VectorConfiguration.subdivide"></a>
2034+
<a id="vectorconfig.VectorConfiguration.triangulate"></a>
20352035

20362036
---
20372037

20382038

2039-
#### subdivide
2039+
#### triangulate
20402040

20412041
```python
2042-
def subdivide(heights: "ArrayLike" = None,
2043-
cells: "ArrayLike" = None,
2044-
tol: float = 1e-14,
2045-
seed: int = 0,
2046-
verbosity: int = 0) -> "Fan"
2042+
def triangulate(heights: "ArrayLike" = None,
2043+
cells: "ArrayLike" = None,
2044+
tol: float = 1e-14,
2045+
backend: str = None,
2046+
check_heights: bool = True,
2047+
verbosity: int = 0) -> "Fan"
20472048
```
20482049

20492050
**Description:**
20502051
Subdivide the vector configuration either by specified cells/simplices
20512052
or by heights.
20522053

20532054
**Arguments:**
2054-
- `heights`: The heights to lift the vectors by.
2055-
- `cells`: The cells to use in the triangulation.
2056-
- `backend`: The lifting backend. Use 'qhull'.
2057-
- `tol`: Numerical tolerance used.
2058-
- `verbosity`: The verbosity level. Higher is more verbose
2055+
- `heights`: The heights to lift the vectors by.
2056+
- `cells`: The cells to use in the triangulation.
2057+
- `tol`: Numerical tolerance used for curing negative heights
2058+
- `backend`: The lifting backend. Currently allowed to be "cgal"
2059+
or "ppl".
2060+
- `check_heights`: Whether to check that the heights land in the
2061+
secondary cone of the output triangulation.
2062+
- `verbosity`: The verbosity level. Higher is more verbose
20592063

20602064
**Returns:**
20612065
The resultant subdivision.
@@ -2119,7 +2123,8 @@ def random_triangulations_fast(
21192123
N: int = None,
21202124
as_list: bool = False,
21212125
attempts_per_triang: int = 1000,
2122-
backend: str = "qhull",
2126+
backend: str = None,
2127+
seed: int = 0,
21232128
verbosity: int = 0) -> Generator["Fan"] | list["Fan"]
21242129
```
21252130

@@ -2144,7 +2149,9 @@ O/w, then the first N height vectors are used
21442149
or as a generator.
21452150
- `attempts_per_triang`:Quit if we can't generate a new triangulation
21462151
after this many tries.
2147-
- `backend`: The lifting backend.
2152+
- `backend`: The lifting backend. See
2153+
`VectorConfiguration.triangulate`.
2154+
- `seed`: A random number seed.
21482155
- `verbosity`: The verbosity level. Higher is more verbose.
21492156

21502157
**Returns:**
@@ -2250,7 +2257,6 @@ labels equal to the corresponding circuit.
22502257

22512258
```python
22522259
def secondary_fan(only_fine: bool = False,
2253-
project_lineality: bool = False,
22542260
formal_fan: bool = False,
22552261
verbosity: int = 0)
22562262
```
@@ -2259,11 +2265,9 @@ def secondary_fan(only_fine: bool = False,
22592265
Compute the secondary fan of the vector configuration.
22602266

22612267
**Arguments:**
2262-
- `only_fine`: Restrict to fine triangulations.
2263-
- `project_lineality`: Project out lineality space with the gale
2264-
transform, mapping to the chamber complex.
2265-
- `formal_fan`: Save as a formal Fan object.
2266-
- `verbosity`: The verbosity level. Higher is more verbose
2268+
- `only_fine`: Restrict to fine triangulations.
2269+
- `formal_fan`: Save as a formal Fan object.
2270+
- `verbosity`: The verbosity level. Higher is more verbose
22672271

22682272
**Returns:**
22692273
The secondary fan triangulations.

0 commit comments

Comments
 (0)