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: regfans now ships a C extension (the grow4d triangulation backend), so installing from source needs a C compiler. Wheels carry it prebuilt. Set REGFANS_NATIVE=1 before pip install -e . to tune the build to the local CPU, which is faster but not portable to other machines.

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
│   ├── grow4d.pyx        # Cython wrapper for the grow4d enumeration backend
│   ├── grow4d.h          # header-only C kernel: all fans by growth + backtracking
│   └── 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
├── setup.py                   # builds the grow4d C extension
└── 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.4.0.tar.gz (238.4 kB view details)

Uploaded Source

Built Distributions

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

regfans-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (818.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

regfans-0.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (780.6 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

regfans-0.4.0-cp313-cp313-macosx_11_0_arm64.whl (315.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

regfans-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (825.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

regfans-0.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (790.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

regfans-0.4.0-cp312-cp312-macosx_11_0_arm64.whl (315.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

regfans-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (825.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

regfans-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (798.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

regfans-0.4.0-cp311-cp311-macosx_11_0_arm64.whl (315.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

regfans-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (799.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

regfans-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (774.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

regfans-0.4.0-cp310-cp310-macosx_11_0_arm64.whl (316.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

regfans-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (798.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

regfans-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (772.3 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

regfans-0.4.0-cp39-cp39-macosx_11_0_arm64.whl (316.8 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: regfans-0.4.0.tar.gz
  • Upload date:
  • Size: 238.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for regfans-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1189a397bcb8a615eda42168b465370bfb32591f50a87619ccaafd33f7b98b6e
MD5 fd78ba2d5fd3f7a93f8d73c1d8cc75a3
BLAKE2b-256 7200920e6465a2c35e7a5a2fb28e21aae186668ecada13a6c00010139afa8361

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0.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.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0b3966510b83ea95c88261a0b8908823e07941fe06c35e298ae8d9a72631a472
MD5 89097c9f37a9ef17642bb36e53124a2d
BLAKE2b-256 781e0b4cd80192b0d4c8b26c0cdbb905009c27aa734241d8e0e3c6ee86633035

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.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.

File details

Details for the file regfans-0.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6a5c15c9340241933e31548ec34a730b8e7198f48aa0d7305395a740bb758f34
MD5 75dc3ad16e3477601f9cfb802d156cf5
BLAKE2b-256 753faa00d85033ad37c98cc9b4d1767fa1c24fd79b5ef3774229f76ea791ce39

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.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.

File details

Details for the file regfans-0.4.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d39f59fa14274ef4bfd23919a59f93f4e522a11ed0b6be1790135c64726f41d
MD5 09fb64a514447ec979802993dfad4429
BLAKE2b-256 5b6b0354fc295a96d12b2afe2cf302f841a3ea563720cdd2bf5e48e862d28fea

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp313-cp313-macosx_11_0_arm64.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.

File details

Details for the file regfans-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5fc3cd009a2f8410f4635586aa5308af740ce5395a6a1daee1270189073f0035
MD5 2d14daecc99e9995d75a57e619332495
BLAKE2b-256 342ab3b1572c43223898326970c30147f193b7193f16ec653c1b6911c7668762

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.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.

File details

Details for the file regfans-0.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3a5ed4876c04d0ebd2bc47bfd352650ea9ef91c89803600e0ba17b2695b9dd18
MD5 21351a3a0a87dfffe71ddd5436ca6f1e
BLAKE2b-256 dd3895395a4a6b88fa76d677062c76ae8e4a00d64dc1310ff5cc141315fb8ca0

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.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.

File details

Details for the file regfans-0.4.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4507f552487c7a32fdc6d0bf7a4d107938e8ace64e1137264bbe8807d2f387a6
MD5 90e3342d782f8d3e4bd9b5441539ae28
BLAKE2b-256 106595f0df33cfa5b7265423d8fec11d0958e77132caf44432e5bb3601b21ad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp312-cp312-macosx_11_0_arm64.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.

File details

Details for the file regfans-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6acb3edafee1a6fd3e1ca65205fac201fdacb1d265766ae2c3d3e3297bcb0bfb
MD5 3d44924411b50c07583f39625a5642e1
BLAKE2b-256 dffa92e598d0413f1ce114f4d97e6a3c1a938e57a1d3ad52983715263daae246

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.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.

File details

Details for the file regfans-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5fe40bb58465cc32ee28f2e6ade4b463f95793c3f6b832a263653b5a2c74e240
MD5 04b3d0d4010a6b8ccbdf6ff40cdb00ca
BLAKE2b-256 0e9b53c4d98ee27dd24d9ced16d4e55c5da098925bbb8c9ede2592977cfab185

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.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.

File details

Details for the file regfans-0.4.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee527dafaa156bc091f9b6530e9c525ac7b8d4158aa27a6fe1585111fb469fc7
MD5 7384ba781818b904494b0f3adb49e563
BLAKE2b-256 b4e1299a11b77703d4119b05bf9e4a5d602c6997880e4f185f667e774ccc36da

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp311-cp311-macosx_11_0_arm64.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.

File details

Details for the file regfans-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc83745f3b1f795f96c7020a5debb756b0bb12cebbe7d58c3b0ef60389e5d253
MD5 746eaab1c4355c86e99c96a9834aea58
BLAKE2b-256 8ad3bde42ba608dbb8884cfc8e01ab6b65a2e1bb94d58918776b272aac728e74

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.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.

File details

Details for the file regfans-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 742b575ab21597ace942d0b5b4087a8cad75d1ba20fc177164aebce943408105
MD5 36a6ab5f9e15901602edf6f86eba1cc1
BLAKE2b-256 2b3082c263a468a4bfaa330161ea2554feac4a48377fe71d4d639a1ee32cb5bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.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.

File details

Details for the file regfans-0.4.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dad521be9cb1dc2e8e3d1e48cb83d1b86f6f3ed54987722458cafeda188b3647
MD5 6b6e82e53d023cbe48df6669c8738be6
BLAKE2b-256 986a7b17089184f2763035b3f5af78ec21e53c04e711871af4d12c54f3e25a59

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp310-cp310-macosx_11_0_arm64.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.

File details

Details for the file regfans-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a56709db44c72702d65e6ffd4830d95b74d4a4273b53868c36241f047d342cfb
MD5 b2cbcfd05b93118e8828de94d7403ec6
BLAKE2b-256 a1617c604a2e6c05725ce994d2303d418cbbd24a2a43c88ec7a936f73c436aca

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.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.

File details

Details for the file regfans-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ed2d378262f6591e3cac483cc2335c9427590e3086788cf3641db52195981909
MD5 e9b8e9d802d434cc53777267053c19ff
BLAKE2b-256 ebe88a2b5dfcf1c42a4cfc7b6ba6fe6b4523ed7ba37d71ae26ad7259f121310d

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.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.

File details

Details for the file regfans-0.4.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for regfans-0.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ddfbb19c910a8f99827f408a50e79e52b3dde61a3f7a85ee5093cfdf625cd7a1
MD5 ee8206a3ff6fbb703e2915965fd22b18
BLAKE2b-256 64d3709234b03dcfd517754926dc17af756d1f3c1b41f5e180ea5ffedcdfe318

See more details on using hashes here.

Provenance

The following attestation bundles were made for regfans-0.4.0-cp39-cp39-macosx_11_0_arm64.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

This release

0.4.0 This release

16 files

0.2.1

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