Metadata-Version: 2.4
Name: regfans
Version: 0.1.0
Summary: A Python library for computing regular triangulations of lattice vector configurations
Author: Nate MacFadden
License-Expression: GPL-3.0-or-later
Project-URL: Repository, https://github.com/natemacfadden/regfans
Project-URL: Documentation, https://github.com/natemacfadden/regfans/blob/main/documentation/api.md
Project-URL: Issues, https://github.com/natemacfadden/regfans/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: python-flint
Requires-Dist: ortools
Requires-Dist: networkx
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: triangulumancer
Provides-Extra: test
Requires-Dist: pplpy; extra == "test"
Requires-Dist: pytest; extra == "test"
Dynamic: license-file

![Fan flip graph](https://raw.githubusercontent.com/natemacfadden/regfans/main/images/fan_flip_graph.png)

# regfans

**regfans** is a Python library for studying lattice vector configurations, developed by Nate MacFadden at the Liam McAllister Group in Cornell.

## Core Functionality

The library computes and modifies regular triangulations of vector configurations (regular polyhedral fans; "vex triangulations").

Key capabilities:
- Construct regular triangulations via lifting
- Compute all (regular) triangulations via flip graph traversal
- Verify properties of vector configurations (solid, totally-cyclic) and fans (fine, regular, point-configuration-compatible)
- Efficient linear flipping

See [Triangulations: Structures for Algorithms and Applications](https://link.springer.com/book/10.1007/978-3-642-12971-1) by De Loera, Rambau, and Santos for a definitive reference on such topics.

## Installation

Install via conda (recommended — includes pplpy):

```
conda env create -f environment.yml
conda activate regfans
```

Or via pip (see also [PyPI listing](https://pypi.org/project/regfans/)):

```
pip install regfans
```

**Note:** Most methods require dual cone computation via [pplpy](https://pypi.org/project/pplpy/), which cannot be installed automatically via pip. The conda environment handles this automatically.

## Primary Interface

The main class is `VectorConfiguration`:

```python
from regfans import VectorConfiguration

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]]
vc = VectorConfiguration(pts)

# construct a regular triangulation via lifting
fan = vc.subdivide()
print(fan.is_fine(), fan.is_regular())

# compute all triangulations and the flip graph
all_fans = vc.all_triangulations()
G, fans, labels = vc.flip_graph(compute_node_labels=True)
```

See [documentation/api.md](documentation/api.md) for the full API reference and the [tutorials directory](tutorials/) for annotated examples.

## Citation

If you are using `regfans` for toric-geometric or Calabi-Yau applications, please cite [Calabi-Yau Threefolds from Vex Triangulations](https://arxiv.org/abs/2512.14817):

```bibtex
@article{MacFadden:2512.14817,
  author  = {MacFadden, Nate and Sheridan, Elijah},
  title   = {Calabi-{Y}au Threefolds from Vex Triangulations},
  doi     = {10.48550/arXiv.2512.14817},
  url     = {https://arxiv.org/abs/2512.14817},
}
```

Otherwise, please cite this repository:

```bibtex
@software{regfans,
  author  = {MacFadden, Nate},
  title   = {regfans},
  doi     = {ZENODO_DOI_PLACEHOLDER},
  url     = {https://github.com/natemacfadden/regfans},
  orcid   = {0000-0002-8481-3724},
}
```

This package was developed for constructing toric varieties in [Calabi-Yau Threefolds from Vex Triangulations](https://arxiv.org/abs/2512.14817), supported in part by NSF grant PHY-2309456. Toric-geometric computations are provided by [CYTools](https://github.com/LiamMcAllisterGroup/cytools), which extends regfans via a `vector_config` module.
