Skip to main content

Fan flip graph

regfans

Nate MacFadden, Liam McAllister Group, Cornell

DOI

regfans is a Python library for studying lattice vector configurations.

Used by CYTools.

Core Functionality

The library computes and modifies regular triangulations of vector configurations. These could also be known as "regular polyhedral fans" or "vex triangulations".

Key capabilities:

  • Verify properties of vector configurations (solid, totally-cyclic) and fans (fine, regular, point-configuration-compatible),
  • Construct regular triangulations via lifting,
  • Compute all (regular) triangulations via flip graph traversal, and
  • Perform efficient linear flips.

See Triangulations: Structures for Algorithms and Applications by De Loera, Rambau, and Santos for a definitive reference on such topics. It is a wonderful book.

regfans has a lot of overlap with TOPCOM; regfans will port over more computations to TOPCOM as beneficial for speed (via triangulumancer).

Installation

Install via conda (most robust across platforms):

conda env create -f environment.yml
conda activate regfans
pip install -e .

Or via pip (see also PyPI listing):

pip install regfans

Note: Most methods require dual cone computation via pplpy. On macOS and Linux x86_64, pip install pulls a prebuilt pplpy wheel automatically (no system libraries needed). On other platforms (Windows, or ARM/musl Linux on older Pythons) there is no wheel and pip falls back to a source build that needs the ppl/gmp C libraries; the conda environment supplies those reliably.

Tests

Install the test extra and run the suite:

pip install -e ".[test]"
pytest

Primary Interface

The main class is VectorConfiguration:

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 for the full API reference and the tutorials directory for annotated examples.

Citation

If you are using regfans for toric-geometric or Calabi-Yau applications, please cite Calabi-Yau Threefolds from Vex Triangulations:

@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:

@software{regfans,
  author  = {MacFadden, Nate},
  title   = {regfans},
  doi     = {10.5281/zenodo.19406101},
  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, supported in part by NSF grant PHY-2309456. Toric-geometric computations are provided by CYTools, which extends regfans via a vector_config module.

Organization

regfans/
├── src/regfans/
│   ├── vectorconfig.py   # VectorConfiguration class: triangulations, flip graph, VC properties
│   ├── fan.py            # Fan class: triangulation of a vector configuration
│   ├── circuits.py       # Circuit and Circuits classes
│   └── util.py           # shared utilities for vector configuration computations
├── tests/
│   ├── test_vectorconfig.py   # tests for VectorConfiguration
│   ├── test_fan.py            # tests for Fan
│   ├── test_circuits.py       # tests for circuits
│   └── test_util.py           # tests for utilities
├── tutorials/
│   ├── simple_lifting_ex.py   # constructing a regular triangulation via lifting
│   └── all_fans_ex.py         # computing all triangulations and the flip graph
├── documentation/
│   ├── api.md                 # full API reference
│   └── clean_api.py           # script to generate api.md
└── pyproject.toml

License

GPLv3. Copyright (c) 2026 Nate MacFadden.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

regfans-0.2.1.tar.gz (58.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

regfans-0.2.1-py3-none-any.whl (53.4 kB view details)

Uploaded Python 3

File details

Details for the file regfans-0.2.1.tar.gz.

File metadata

  • Download URL: regfans-0.2.1.tar.gz
  • Upload date:
  • Size: 58.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regfans-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d3eef02f33a0a582cb9e7e91a98d5f088c07b53faf40aad8def3b3824a730934
MD5 bfb94405ab9425555a7007432437afb6
BLAKE2b-256 3d494b4017be3f8244540d3e93ba1f999588fb742d37785839b2ba5f684c15f9

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.2.1.tar.gz:

Publisher: publish.yml on natemacfadden/regfans

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file regfans-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: regfans-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 53.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for regfans-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 99e4153cf47f51f9607b19ec60ea145a63b65c2e0fa35fadda8954840347476e
MD5 b4685e72a1f6a7567e0d7b64c4162f5e
BLAKE2b-256 af28e33dee2274f3e25d72be11c076201a81f288d536e8d78cbe34512aa707e3

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.2.1-py3-none-any.whl:

Publisher: publish.yml on natemacfadden/regfans

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.1

16 files

0.4.0

16 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page