CircularCoordinates
Circular coordinates (de Silva, Morozov, Vejdemo-Johansson, "Persistent Cohomology and Circular Coordinates," Discrete & Computational Geometry 45:737-759, 2011): given a persistent H¹ class of a Vietoris-Rips complex, produce a map from (a connected subset of) the point cloud to the circle R/Z representing that class -- a genuinely topological coordinate capturing periodic/cyclic structure in data. .claude/WORKLOG-mainstream- feature-gap-analysis.md item 2, including the user's own reframing of the original open question (see that worklog for the full derivation this implementation follows) and cross-checked against a real reference implementation (scikit-tda/DREiMac's toroidalcoords.py, fetched directly -- not recalled from memory, matching this codebase's own io-module verification ethos) for the exact harmonic-smoothing linear system and the "coordinate is literally the smoothed potential itself, mod 1" formula, which is less obvious from the paper's own more abstract framing than it looks once seen written out as code.
'''The reframing''' (this is what makes the construction tractable): rather than asking whether a finite H¹ bar's representative restricts to a nonzero cocycle on some sub-level complex K_r (an open question about an already-computed representative), fix r inside the target bar's own [birth, death) range up front, build the static truncated complex K_r (maxFiltrationValue = Some(r), the same knob that already implements enclosing-radius truncation, plus a cell-dimension cap so CellularCohomologyContext -- which fully materializes its input, no maxDim of its own -- doesn't build cells above what H¹ needs), and compute cohomology of that fixed complex directly. The target class is essential there by construction (nothing survives past r in a view that stops at r) -- the verification question dissolves rather than needing an answer. Matching multiple simultaneously-alive classes at K_r back to a specific full-filtration bar turns out to need only a birth-value comparison, not a more elaborate algorithm: K_r's own persistent cohomology (fed the same filtration values, just cut off at r) assigns every bar the SAME birth it would have in the full computation (truncating the end of a filtration cannot change how early something is born), so an essential bar at K_r with birth b is unambiguously "the same" class as a full-computation bar with that same birth b, found by direct comparison -- no separate matching machinery needed.
'''Harmonic smoothing''': the chosen cocycle z (an integer 1-cochain, lifted from a large-prime field representative -- see prime's own doc) is smoothed by solving min_g ||z - d0 g||^2 for a real-valued vertex function g (d0, the 0-coboundary map, is (d0 g)(edge [i,j]) = g(j) - g(i)), via the normal equations d0^T d0 g = d0^T z -- a sparse SPD least-squares solve, not "optimization" in the LP/QP sense. Solved matrix-free (org.apache.commons.math3.linear.ConjugateGradient against a RealLinearOperator built directly from Simplex.boundary[Double], no dense matrix ever materialized, no new dependency -- commons-math3 is already vendored) over the connected component of K_r's 1-skeleton containing the cocycle's own support (a class is only meaningful there -- other components have no path along which it could be defined at all), with one arbitrarily-chosen vertex in that component anchored at g = 0 to make the reduced system genuinely positive definite, not just semi-definite (the unreduced graph Laplacian is singular on constants, one dimension of null space per connected component -- anchoring one vertex removes exactly that one dimension, rather than disabling ConjugateGradient's own positive-definiteness check and hoping).
The output coordinate is then, remarkably directly, theta(v) = frac(g(v)): no separate path-integration step is needed (confirmed against DREiMac's own code, not derived from the paper's more abstract statement alone).
Attributes
- Experimental
- true
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
CircularCoordinates.type