Root-finding and optimization on polyhedral fans
Project description
fanroots
Nate MacFadden, Liam McAllister Group, Cornell
Root-finding and optimization for vector-valued functions defined over the secondary fan of a point or vector configuration. Built for Kähler moduli stabilization (KMS) in string compactifications, where it delivers order-of-magnitude speedups over prior methods (see arXiv:2406.13751).
The Problem
Given a vector/point configuration with $N$ elements, the secondary fan partitions $\mathbb{R}^N$ (or, for vector configurations, a convex subregion of this space) into convex 'secondary' cones. Call $\mathbb{R}^N$ 'height space'. This software is designed for continuous, differentiable functions whose analytic form may vary chamber-by-chamber. One example is KMS, which depends on the intersection numbers of the toric variety associated to each triangulation. These numbers change discretely as one crosses walls of the secondary fan, but the function remains smooth.
The major complication in practice is the semi-high dimension $\mathbb{R}^N$ as well as the large number of chambers (depending roughly exponentially on N - see arXiv:2008.01730, arXiv:2309.10855, and arXiv:2602.16909). At $N$ of interest, there are far too many chambers to enumerate, so operations are instead taken locally.
Algorithm
fanroots solves this by moving through the fan adaptively:
- Large steps (
JumpStep): jump directly to target heights, recomputing the triangulation from scratch. Effective when the function varies slowly chamber-by-chamber, as is typical for finding locations in Kähler moduli space where the divisors take certain volumes. - Small steps (
FlopStep): walk along the step direction viaregfans'flip_linear, flipping through chamber walls one at a time. Efficient for fine-grained convergence once near a solution.
A schedule can mix both strategies dynamically based on step size. Step proposals include Newton's method, Gauss-Newton, gradient descent, and Levenberg-Marquardt. Step sizes are tuned via backtracking line search, ternary search, or 'shrinking'.
For functions depending on the intersection numbers, performance is further boosted by my recent development of a fast intersection number kernel in CYTools, since computation of the intersection numbers typically becomes the bottleneck for such cases.
Installation
pip install -e .
Requires regfans. For string-theoretic applications, CYTools is also required.
Usage
This operates via an optimization class FanRoots:
from fanroots import FanRoots
optimizer = FanRoots(
vc=my_vector_configuration,
fct=fct,
jac=jac,
step_proposal="newton", # "newton", "gauss_newton", "grad", "lma"
step_size_optimizer="shrink", # "shrink", "backtracking", "ternary", "naive"
step_taking_method="jump", # "jump", "flop"
tolerance=1e-6,
)
optimizer.run()
Key arguments (see help(FanRoots) for the full list):
| Argument | Options | Description |
|---|---|---|
step_proposal |
"newton", "gauss_newton", "grad", "lma" |
Step direction method |
step_size_optimizer |
"shrink", "backtracking", "ternary", "naive" |
Step size tuning |
step_taking_method |
"jump", "flop" |
How to move through the fan; overridden by step_taking_schedule for mixed strategies |
learning_rate |
float | Scales the proposed step before size optimization |
tolerance |
float | Halt when |fct(h)|_2 < tolerance |
min_step_size |
float | Halt if step shrinks below this |
verbosity |
int | Controls diagnostic output |
See demo/volume_finder.py for a complete example finding Kähler parameters that realize prescribed divisor volumes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fanroots-0.0.1.tar.gz.
File metadata
- Download URL: fanroots-0.0.1.tar.gz
- Upload date:
- Size: 36.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dc920b64905026cf10960d35f21b74c2f978dd45a24b7e11a355082ef71566a
|
|
| MD5 |
ca4182a1fcc4390906f27d0c1f6c63e3
|
|
| BLAKE2b-256 |
91a187f52ea9daccb691f93f1ace673e358852d4d9bf223eb539b6ad978ac5a4
|
Provenance
The following attestation bundles were made for fanroots-0.0.1.tar.gz:
Publisher:
publish.yml on natemacfadden/fanroots
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fanroots-0.0.1.tar.gz -
Subject digest:
5dc920b64905026cf10960d35f21b74c2f978dd45a24b7e11a355082ef71566a - Sigstore transparency entry: 1221427029
- Sigstore integration time:
-
Permalink:
natemacfadden/fanroots@f167447c4dc9b5d7da1ad509a9b5e261a07bfeb3 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/natemacfadden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f167447c4dc9b5d7da1ad509a9b5e261a07bfeb3 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fanroots-0.0.1-py3-none-any.whl.
File metadata
- Download URL: fanroots-0.0.1-py3-none-any.whl
- Upload date:
- Size: 43.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c276adf81752e07819d9dbee83121170c48371cf6490258bf9b79cea13970353
|
|
| MD5 |
8fd616648ce5dd5e81bf2fabb79eb03b
|
|
| BLAKE2b-256 |
ba57924899f3616aa8dd8baaf1db758c214f0046beb0ca015fbd1792a41b5a2a
|
Provenance
The following attestation bundles were made for fanroots-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on natemacfadden/fanroots
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fanroots-0.0.1-py3-none-any.whl -
Subject digest:
c276adf81752e07819d9dbee83121170c48371cf6490258bf9b79cea13970353 - Sigstore transparency entry: 1221427098
- Sigstore integration time:
-
Permalink:
natemacfadden/fanroots@f167447c4dc9b5d7da1ad509a9b5e261a07bfeb3 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/natemacfadden
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f167447c4dc9b5d7da1ad509a9b5e261a07bfeb3 -
Trigger Event:
release
-
Statement type: