Clayton Shonkwiler PRO
Mathematician and artist
/crest25
this talk!
CREST Mini-Workshop
March 6, 2025
National Science Foundation (DMS–2107700), Simons Foundation (#709150)
Japan Science and Technology Agency CREST: Grant Number JPMJCR19T4
University of Georgia
Colorado State University
University of Georgia
Symplectic geometry, clever programming, and some combinatorics give surprisingly fast algorithms for sampling random polygons.
\(\operatorname{Pol}(n)\) is the space of equilateral \(n\)-gons in \(\mathbb{R}^3\); it consists of (congruence classes of) piecewise-linear maps \(S^1 \to \mathbb{R}^3\) with \(n\) unit-length segments.
\(\operatorname{Pol}(n)\) can be constructed as a symplectic reduction (see Kapovich–Millson and Hausmann–Knutson):
Continuous symmetry \(\Rightarrow\) conserved quantity
Rotations around \(n-3\) chords \(d_i\) by \(n-3\) angles \(\theta_i\) commute.
More precisely, \(\operatorname{Pol}(n)\) is (almost) toric, and the \(d_i\) and \(\theta_i\) are action-angle coordinates.
Theorem [with Cantarella]
The joint distribution of \(d_1,\ldots , d_{n-3}\) and \(\theta_1, \ldots , \theta_{n-3}\) are all uniform on their domains.
Therefore, sampling \(\operatorname{Pol}(n)\) is equivalent to sampling random points in the convex polytope of \(d_i\)’s and random angles \(\theta_i\).
The \((n-3)\)-dimensional moment polytope \(\mathcal{P}_n \subset \mathbb{R}^{n-3}\) is defined by the triangle inequalities
Theorem [with Cantarella, Duplantier, Uehara, 2016]
A direct sampling algorithm (the Action-Angle Method) for equilateral \(n\)-gons with expected performance \(O(n^{5/2})\) per sample.
If we let \(s_i = d_i - d_{i-1}\) for \(i=1,\ldots , n-2\) and \(s_i \in [-1,1]\), then we satisfy the inequalities \(|d_i - d_{i-1}|\leq 1\).
Proposition [with Cantarella, Duplantier, Uehara]
If we build \(d_i\) from \(s_i\) sampled uniformly from the hypercube \([-1,1]^{n-3}\), the \(d_i\) obey the triangle inequalities with probability asymptotic to
Idea
Don’t generate all the \(s_i\) and then check inequalities at the end: progressively check inequalities as each \(s_i\) is generated.
Proposition [with Cantarella and Schumacher, 2024]
The expected number of \(s_i\) you generate before either failing an inequality (and restarting) or succeeding is \(\sim \sqrt{\frac{24}{\pi}n}\).
Proof sketch.
The probability \(p(k)\) that \(d_0 + d_1 \geq 1, \dots , d_{k-1} + d_k \geq 1\) is
\(p(k) = \frac{2}{\pi} \int_0^\infty \operatorname{sinc}^{k+1} t \, dt.\)
Expected number of inequalities checked is \(p(0) + \dots + p(n-3)\).
Proving this formula for \(p(k)\) uses surprisingly fancy math.
Theorem [with Cantarella and Schumacher, 2024]
A direct sampling algorithm (the Progressive Action-Angle Method) for equilateral \(n\)-gons with expected performance \(O(n^2)\) per sample.
Time to generate samples on an Apple M1 Max laptop (8 parallel cores)
git clone --recurse-submodules git@github.com:HenrikSchumacher/CoBarSLink.git
In terminal:
Then in Mathematica:
Get[FileNameJoin[{$HomeDirectory,"CobarSLink","CobarSLink.m"}]];
ActionAngleSample[17, 1]["VertexPositions"]
Xiong, Taylor, Dennis, and Whittington (2021) propose the model
\(P_K(n) \simeq C_K n^{\nu_0 + n_p(K)} \exp(-n/n_0) [1+\beta_K n^{-1/2} + \gamma_K n^{-1}]\),
where \(n_p(K)\) is the number of prime summands in \(K\),
\(\nu_0 =-0.19 \pm 0.001\) and \(n_0 = 259.3 \pm 0.2\) are characteristic of the random polygon model, and \(\beta_K, \gamma_K\) are finite-size corrections.
Deguchi and Uehara (2020) propose
\(P_K(n) = \hat{C}_K(n/\hat{n}_K)^{\hat{\nu}_0 + n_p(K)}\exp(-n/\hat{n}_K)\exp(\hat{\beta}_K/n)\)
We generated 600 unknotted \(n\)-gons for \(n\) up to 3043, which took 58 hours on an Apple M1 Ultra desktop (16 parallel cores)
We got an excellent fit with \(C = 3.63 \pm 0.09\), \(\beta = 3.8 \pm 0.4\), \(\gamma = 7.2 \pm 1.7\).
Xiong et al. measured \(C \simeq 3.67\), \(\beta \simeq 3.8\), \(\gamma \simeq 8.3\).
Xiong et al. claim to rule out the “pure exponential” model
\(P_{0_1}(n) \simeq \exp(-n/n_0)[1+\beta n^{-1/2} + \gamma n^{-1}]\)
We found that, with \(n_0 = 251.3 \pm 0.8\), \(\beta = -0.51 \pm 0.35\), \(\gamma = -1.2 \pm 1.9\), the pure exponential fits about as well as the power law!
If we want to sample polygons in rooted, spherical confinement of radius \(R\), then we simply add the constraints \(d_i \leq R\) for all \(i\).
Algorithm [with Cantarella, 2016]
A uniformly ergodic Markov chain for sampling random equilateral \(n\)-gons in rooted spherical confinement (implemented in plCurve).
Algorithm [Diao–Ernst–Montemayor–Ziegler, 2012]
An algorithm for directly sampling successive marginals of Lebesgue measure on \(\mathcal{P}_n(R)\).
“The data shows that the runtime grows slower than an exponential function, but faster than a power function.”
When \(R=1\), the inequalities reduce to
\(0\leq d_i \leq 1 \qquad 1 \leq d_i + d_{i+1}\)
Define \(\phi: (d_1, d_2, \dots ) \mapsto (d_1, 1-d_2, d_3, 1-d_4, \dots )\), which sends \(\mathcal{P}_n(1)\) to
which define a polytope \(\mathcal{P}_n(1) \subset [0,1]^{n-3}\).
\(\mathcal{O_{n-3}} := \{(s_1, \dots , s_{n-3}) \in [0,1]^{n-3} : s_1 \geq s_2 \leq s_3 \geq s_4 \leq \dots\}\),
The order polytope of the zig-zag (fence) poset.
Each possible total ordering \(s_{\sigma(i_1)} \leq \dots \leq s_{\sigma(i_{n-3})}\) corresponds to a linear extension of the zig-zag poset or, equivalently, an alternating permutation.
Each alternating permutation \(\sigma\) determines an orthoscheme \(\Delta_\sigma\) in a unimodular triangulation of \(\mathcal{O}_{n-3}\).
\(\Leftrightarrow d_1 \geq 1-d_2 \leq d_3 \geq 1-d_3 \leq \dots\)
When \(R=1\), the inequalities reduce to
\(0\leq d_i \leq 1 \qquad 1 \leq d_i + d_{i+1}\)
which define a polytope \(\mathcal{P}_n(1) \subset [0,1]^{n-3}\).
Each alternating permutation determines an orthoscheme \(\Delta_\sigma\) in a triangulation of \(\mathcal{O}_{n-3}\).
\((1)\)
\((21)\)
\((213),(312)\)
\((2143),(3142),(3241),(4132),(4231)\)
\((21435),(21534),(31425),(31524),\dots\)
\((214365),(215364),(216354),\dots\)
\(n\)
\(E_n\)
\(1\)
\(1\)
\(2\)
\(1\)
\(2\)
\(3\)
\(4\)
\(5\)
\(5\)
\(16\)
\(6\)
\(61\)
The number of alternating permutations on \(n\) letters is denoted \(E_n\) and called an Euler number.
\(\text{Vol}(\mathcal{P}_n(1)) = \frac{E_{n-3}}{(n-3)!} \sim 2 \left(\frac{2}{\pi}\right)^{n-2}\)
Rejection sampling won’t work!
Theorem [w/ Theis]
CPOP generates random polygons in \(\operatorname{Pol}(n;1)\) with average time complexity \(\Theta(n)\).
Download CPOP.nb
from https://github.com/shonkwiler/CPOP
Open in Mathematica, evaluate initialization cells, then run:
CPOP[200]
CPOP[20000]
For unconfined polygons:
Theorem [Grosberg]
\(\mathbb{E}_{\operatorname{Pol}(n)}(\kappa) = \frac{\pi}{2}n + \frac{3\pi}{8} + O\left(\frac{1}{n}\right)\)
Conjecture [w/ Theis]
\(\mathbb{E}_{\operatorname{Pol}(n;1)}(\kappa) = 2.14625 n - 0.46742 + o(1).\)
Theorem [w/ Theis]
This is the asymptotic limit, and we have an explicit (terrible!) formula.
Model:
\(P_K(n) = C_K\left( \frac{n- \Delta n_K}{n_K}\right)^{m_K}\exp\left( -\frac{n-\Delta n_K}{n_K}\right)\)
Direct sampling of confined polygons in linear time
Clayton Shonkwiler and Kandin Theis
Preprint, 2025. arXiv: 2501.04885 [math.GT]
The symplectic geometry of closed equilateral random walks in 3-space
Jason Cantarella and Clayton Shonkwiler
Annals of Applied Probability 26 (2016), no. 1, 549–596
A fast direct sampling algorithm for equilateral closed polygons
Jason Cantarella, Bertrand Duplantier, Clayton Shonkwiler, and Erica Uehara
Journal of Physics A: Mathematical and Theoretical 46 (2016), no. 27, 275202
A faster direct sampling algorithm for equilateral closed polygons and the probability of knotting
Jason Cantarella, Henrik Schumacher, and Clayton Shonkwiler
Journal of Physics A: Mathematical and Theoretical 57 (2024), no. 28, 285205
By Clayton Shonkwiler