Skip to content

Latest commit

 

History

History
76 lines (60 loc) · 3.44 KB

File metadata and controls

76 lines (60 loc) · 3.44 KB

Repo notes for Claude

Purpose

Produce a Wolfram Community post — community/cosmic_ph.nb — on persistent homology of the cosmic web. Take a 3D galaxy catalogue (SDSS spectroscopic slice + a log-normal Wolfram-native mock), compute persistent homology in pure Wolfram Language, and read the H₀ / H₁ / H₂ features as clusters, filament loops, and voids.

Hard constraint — pure Wolfram Language

Per the global ~/.claude/CLAUDE.md: Wolfram Community posts are pure Wolfram Language. No Python in the notebook, no shell hybrids. The PH engine is built from scratch on top of DelaunayMesh. An external Python bridge (ripser / GUDHI via ExternalEvaluate) is permitted only as a private tool to regenerate cached CSV outputs on a beefy machine — its output is committed CSV; the notebook never calls it.

Pipeline (pure Wolfram Language)

wolfram/fetcher_common.wl    ── HTTP helpers (URLRead + status check)
wolfram/load_data.wl         ── tidy CSV / JSON loaders
wolfram/cosmology.wl         ── LCDM comoving-distance integral
wolfram/alpha_complex.wl     ── DelaunayMesh → filtered alpha complex
wolfram/persistence.wl       ── GF(2) boundary-matrix reduction
                                → {dim, birth, death} pairs

wolfram/fetch_sdss.wls       ── SDSS DR17 SkyServer SQL → data/sdss_slice.csv
wolfram/mock_galaxies.wls    ── log-normal density field → data/mock_galaxies.csv
wolfram/fetch_all.wls        ── one-shot data driver

wolfram/reference_shapes.wls ── PH of torus / sphere / Swiss cheese (teaching figs)
wolfram/filaments.wls        ── PH of mock + SDSS, writes docs/images/*.png
                                                       + data/persistence_*.csv
wolfram/run_all.wls          ── one entry point

community/cosmic_ph_helpers.wl   ── cell helpers (titleCell, asRaster, callout)
community/build_notebook.wls     ── assembles cosmic_ph.nb + .pdf

tests/ph_sanity.wls         ── PH correctness: circle / sphere / torus
                                + cross-check vs ResourceFunction[PersistentHomology]

Conventions

  • Plain-text .wls / .wl is the source of truth; the .nb and .pdf in community/ are committed outputs (for diff-review and so the Wolfram Community submission is trivial).
  • All HTTP fetches use URLRead[HTTPRequest[...]] and check the status code — URLDownload silently writes server error pages on 4xx/5xx, so don't use it.
  • Heavy graphics (3D galaxy plots, persistence diagrams on ~10⁴ pairs) are pre-rasterized via asRaster (community/cosmic_ph_helpers.wl) before being embedded in the notebook — this is the BifurcationAutoWL idiom; keeps .nb size manageable.
  • Persistence pairs are cached to data/persistence_*.csv so the notebook build never re-runs the reduction. Re-run wolfram/run_all.wls to refresh.
  • Subsample any point cloud to Min[1500, n] before PH — quadratic in the simplex count.

Performance staircase

  1. Pure-WL alpha + reduction, ≤2000 points — primary engine.
  2. ResourceFunction["PersistentHomology"] — sanity-check only.
  3. Private Python bridge (ripser / GUDHI via ExternalEvaluate) — only to regenerate CSVs at larger scale on a workstation; never loaded by the notebook.

Commit cadence

Commit + push after each meaningful step (skeleton, PH engine, sanity tests, reference shapes, mock, SDSS, filaments analysis, notebook). Short, factual messages.