Search

Libraries and sources

Code

All of the project's code — the spherical solver, the 3D modules for GRTeclyn and GRChombo, the analysis scripts and the verified diagnostics module. Read the sources right here or download them as archives.

Running it

The pbhgr library needs Python ≥ 3.12 with numpy, scipy, psutil, pyyaml, h5py, plus a small C kernel:

tar xzf pbhgr-*.tar.gz && cd pbhgr
make            # builds pbhgr/_kernels.so from csrc/kernels.c
make test       # pytest: FLRW, vacuum, dust collapse, decay, static solutions
python3 scripts/v1_ladder.py --help

The 3D modules are built inside the GRTeclyn (AMReX) and GRChombo (Chombo) source trees: how this was done on the server is described in the build document (Russian) and in scripts/grchombo/build_grchombo_ax102.sh; production parameter files sit next to the sources (params_*.txt) and are generated by scripts/grchombo/stage1b_params.py.

The archives are built from the latest commit of each repository, with server addresses removed. The files below are shown with syntax highlighting and line numbers; the "raw" link serves the unprocessed file.

pbhgr

14 files · 2 196 lines · pbhgr

Main Python + C library: spherical Einstein–Vlasov in the horizon-penetrating areal–CMC gauge, the exact LTB solution, peak profiles, a Newtonian 3D particle-mesh code, initial data and run provenance. The C kernel does particle substeps and constraint integration.

Filelines
pbhgr/__init__.pypbhgr: Stage-A spherical Einstein-Vlasov + decay solver and campaign scaffolding.6raw
pbhgr/analytic.pyAnalytic references for the mandatory Stage-A tests.41raw
pbhgr/background.pyHomogeneous flat FLRW with cold X + radiation + X -> radiation decay.48raw
pbhgr/cosmo_ev.pySpherically symmetric Einstein-Vlasov solver in the areal-CMC gauge with an expanding FLRW exterior (Stage A step 2; equations in Appendix B of brief_verification/verification_and_plan.md).656raw
pbhgr/cosmo_id.pyCosmological initial data for the areal-CMC spherical Einstein-Vlasov solver (Stage A step 2).125raw
pbhgr/initial_data.pyInitial data families for the spherical solver.64raw
pbhgr/ltb.pyExact growing-mode LTB solution for a Gaussian curvature profile (Yoo et al. 2026, arXiv:2609.14218).119raw
pbhgr/pm3d.pyNewtonian 3D particle-mesh code for one triaxial peak in an Einstein-de Sitter background (item 3b of the plan).160raw
pbhgr/profiles.pyCurvature profiles zeta(r) beyond the Yoo Gaussian: mean peak profiles of log-normal spectra (BBKS conditioning on the peak height nu and the mean curvature x_bar(nu, gamma)) and a broad near-top-hat control.63raw
pbhgr/provenance.pyRun provenance record, as required by the specification (section 12, Reproducibility).84raw
pbhgr/scan.pyOutcome-map scan driver for the spherical solver (Stage A, section 4 'Скан').77raw
pbhgr/spherical_ev.pySpherically symmetric Einstein-Vlasov system with X decay (Stage A prototype).492raw
pbhgr/steady_state.pyStatic spherically symmetric Einstein-Vlasov solutions (isotropic polytropes, Rein-Rendall type ansatz f = (E0 - e^mu E)_+^k) and particle sampling from them.89raw
csrc/kernels.cCompiled kernels for the spherical Einstein-Vlasov solver (polar-areal gauge). mass_integrate: integrate the Hamiltonian constraint dm/dr = s_k * sqrt(1 - 2 m / r) across K cells [r_e[k], r_e[k+1]] with piecewise-constant coordinate…172raw

PBHVlasov (GRTeclyn)

19 files · 3 558 lines · pbhgr

3D Vlasov particle module for GRTeclyn/AMReX: deposition across AMR levels, geodesic push with proper time, the PBH gauge, early start from Yoo data, ray and sphere horizon diagnostics.

Filelines
grteclyn/PBHVlasov/GNUmakefileLine extraction uses the particle interpolator.42raw
grteclyn/PBHVlasov/Main_PBHVlasov.cppEngage!80raw
grteclyn/PBHVlasov/PBHAHFinder.hppCopy of GRTeclyn's AHFinder (branch AHFinder, fd76177, BSD-3) with an iteration cap, quiet iterations and public accessors, for use inside a PBHVlasov run.163raw
grteclyn/PBHVlasov/PBHAHFinder.impl.hppCopy of GRTeclyn's AHFinder (branch AHFinder, fd76177, BSD-3) with an iteration cap, quiet iterations and public accessors, for use inside a PBHVlasov run.513raw
grteclyn/PBHVlasov/PBHGaugeTeclyn.hppPBHVlasov example (pbhgr project).53raw
grteclyn/PBHVlasov/PBHVlasovAmr.hppPBHVlasov example for GRTeclyn (pbhgr project).70raw
grteclyn/PBHVlasov/PBHVlasovLevel.cppPBHVlasov example for GRTeclyn (pbhgr project, stage 2).1217raw
grteclyn/PBHVlasov/PBHVlasovLevel.hppPBHVlasov example for GRTeclyn (pbhgr project, stage 2): BSSN/CCZ4 + Vlasov particles.64raw
grteclyn/PBHVlasov/ParticleMatter.hppPBHVlasov example for GRTeclyn (pbhgr project). matter_t for CCZ4RHSWithMatter / ConstraintsWithMatter: the energy-momentum tensor is read from the grid variables deposited from the particles (rho_p, S_i, S_ij, all measured by the…96raw
grteclyn/PBHVlasov/ParticleMatterVars.hppPBHVlasov example for GRTeclyn (pbhgr project).26raw
grteclyn/PBHVlasov/SimulationParameters.hppPBHVlasov example for GRTeclyn (pbhgr project).33raw
grteclyn/PBHVlasov/StateVariables.hppPBHVlasov example for GRTeclyn (pbhgr project, stage 2).46raw
grteclyn/PBHVlasov/VlasovParticles.cppPBHVlasov example for GRTeclyn (pbhgr project, stage 2).787raw
grteclyn/PBHVlasov/VlasovParticles.hppPBHVlasov example for GRTeclyn (pbhgr project, stage 2).149raw
grteclyn/PBHVlasov/params_flrw.txtPBHVlasov: FLRW dust test (periodic box, geodesic slicing).33raw
grteclyn/PBHVlasov/params_flrw_amr1.txtPBHVlasov: FLRW dust test (periodic box, geodesic slicing).35raw
grteclyn/PBHVlasov/params_yoo_flrw.txtEarly-start test 1: FLRW (mu = 0) from t_i = 2/(3 H_i) with the expansion-aware step and adaptive subcycling.42raw
grteclyn/PBHVlasov/params_yoo_mu0.3_e0_prod.txtStage 1b production template: Yoo long-wavelength data from t_i, seven levels, same box and coordinates as the validated late-start runs (a_ref = a(0.5 t_C(0)) for mu = 0.3).57raw
grteclyn/PBHVlasov/params_yoo_mu0.3_l2.txtEarly-start test 2: Yoo profile mu = 0.3, e = p = 0 on three levels (same box and coordinates as the validated late-start runs: a_ref = a(0.5 t_C(0)), L' = 6194.41), from t_i to 0.97 t_C(0); shell check against LTB.52raw

PBHCosmo (GRChombo)

16 files · 1 272 lines · pbhgr

Stage 1: a scalar field in GRChombo — LTB initial data, a gauge with a profile-referenced K, diagnostics. It showed the coherent core bounce (Kaup limit).

Filelines
grchombo/PBHCosmo/ConstraintsExtraction.hpp!117raw
grchombo/PBHCosmo/CosmoDiagnostics.hpp!66raw
grchombo/PBHCosmo/CosmoDiagnostics.impl.hpperror "This file should only be included through CosmoDiagnostics.hpp"55raw
grchombo/PBHCosmo/CustomExtraction.hppFunction to convert double to string with precision124raw
grchombo/PBHCosmo/DiagnosticVariables.hppassign an enum to each variable38raw
grchombo/PBHCosmo/GNUmakefile-*- Mode: Makefile -*- PBHCosmo example: copy this directory into $GRCHOMBO_HOME/Examples/PBHCosmo and run make all24raw
grchombo/PBHCosmo/InitialLTBData.hppPBHCosmo example for GRChombo (pbhgr project, plan 6.12 stage 1).122raw
grchombo/PBHCosmo/Main_PBHCosmo.cppChombo includes112raw
grchombo/PBHCosmo/PBHCosmoLevel.cppPBHCosmo example for GRChombo (pbhgr project).243raw
grchombo/PBHCosmo/PBHCosmoLevel.hppPBHCosmo example for GRChombo (pbhgr project).36raw
grchombo/PBHCosmo/PBHGauge.hppPBHCosmo example (pbhgr project).59raw
grchombo/PBHCosmo/Potential.hpp!40raw
grchombo/PBHCosmo/ScalarFieldRef.hppPBHCosmo example (pbhgr project).89raw
grchombo/PBHCosmo/SimulationParameters.hppPBHCosmo example for GRChombo (pbhgr project).70raw
grchombo/PBHCosmo/SphereTaggingCriterion.hppPBHCosmo example (pbhgr project): nested-sphere tagging — level l+1 is created inside radius radii[l] around the centre (coordinate radius). criterion = 100 inside, 0 outside; use regrid_threshold < 100.39raw
grchombo/PBHCosmo/UserVariables.hppassign an enum to each variable38raw

scripts

31 files · 2 460 lines · pbhgr

Run drivers, scans, benchmarks, 3D-vs-1D/LTB comparisons, parameter generators, the GRChombo build script.

Filelines
scripts/build_gallery.pyAssemble reports/gallery.html: the figure set with reading notes, PNGs embedded as data URIs.132raw
scripts/debug_ah.py23raw
scripts/debug_caustic.py23raw
scripts/debug_inner.py27raw
scripts/debug_ueq.py27raw
scripts/ellipsoidal_collapse.pyBond-Myers (1996) ellipsoidal collapse of a homogeneous ellipsoid in a matter-dominated background, external tide in linear theory, Zel'dovich initial conditions (lambda_1 >= lambda_2 >= lambda_3, delta = sum lambda, e = (l1 - l3)/(2…74raw
scripts/make_figures.pyBuild the visualisation set in reports/figures from runs/viz, runs/scan_pilot, runs/resource_probe.json.235raw
scripts/newton_shells.pyNewtonian spherical shell code started from the exact LTB state at 0.9 t_C(0) (LTB shell dynamics are Newtonian in form, so this is exact until the first crossing).44raw
scripts/pm3d_peak.pyItem 3b: Newtonian 3D PM run of one triaxial peak.36raw
scripts/pm3d_shelltest.pyLagrangian-shell test of the PM code against the exact LTB solution (spherical Yoo profile, mu = 0.1).28raw
scripts/resource_probe.pyMeasure wall time per RK4 step and peak RSS vs particle number / grid size, then extrapolate the Stage-A workload to see where this VPS stops being sufficient.31raw
scripts/run_scan.pyPilot outcome scan on the dev VPS.21raw
scripts/run_showcase.pyRun representative cases with full snapshot storage for visualisation -> runs/viz/*.pkl41raw
scripts/v1_caustic_bench.pyCaustic benchmark: cold dust sphere at rest (time-symmetric, weak field), evolved with the GR areal/maximal-slicing code (StaticBackground) and with a Newtonian multi-stream shell code on IDENTICAL shells.80raw
scripts/v1_caustic_polar.pyCross-code check of the caustic benchmark: the same cold Gaussian sphere at rest evolved with pbhgr's polar-areal Einstein-Vlasov code (spherical_ev.py: polar slicing, zero shift, independent implementation) and sampled at equal central…47raw
scripts/v1_ladder.pyV1 validation ladder, steps 1-3 (areal-CMC gauge): flrw homogeneous FLRW to a chosen t/t_H: alpha = 1, A = 1, Kth = -H, particles static in x, P ∝ 1/a idcheck Yoo spherical CMC initial data vs the exact LTB functions (mass and energy…161raw
scripts/v1_static_test.pyLadder step 4: an Einstein-Vlasov steady state (isotropic polytrope from pbhgr.steady_state) must stay static in the areal gauge with maximal slicing (K = 0).41raw
scripts/verify_bh_convergence.pyConvergence of the horizon-approach case (nu=0.3, flat=3, L_rms=0.5) in time step, grid and particles.35raw
scripts/verify_cold_convergence.pyCold-limit convergence: nearly cold cloud (L_rms=0.05) at three (K, N) resolutions.28raw
scripts/verify_static.pyStatic Einstein-Vlasov benchmark: sampled steady state must remain steady under evolution.42raw
scripts/verify_static_res.pyStatic benchmark: does the slow secular drift of max 2m/r shrink with grid resolution / time step?28raw
scripts/warm_summary.pySummary table of the warm campaign: python3 scripts/warm_summary.py [dir]28raw
scripts/grchombo/build_grchombo_ax102.sh============================================================================ build_grchombo_ax102.sh — GRChombo + Chombo + GRTresna on Hetzner AX102-1 (AMD Ryzen 9 7950X3D 16C/32T, 128 GB DDR5 ECC, 2x1.92 TB NVMe, Ubuntu 24.04 LTS)…397raw
scripts/grchombo/chk_diag.pyDiagnostics of a GRTeclyn/PBHVlasov checkpoint: per-level min/max of the state, an x-line through the centre on the finest level, coordinate-speed bound of the particle push, and the spherical expansion Theta(r).111raw
scripts/grchombo/ltb_to_grchombo.pyLate-start initial data for the GRChombo PBHCosmo example from the exact LTB solution (e = 0 test, plan 6.12 stage 1).320raw
scripts/grchombo/pbh_analyse.pyAnalyse a PBHCosmo (GRChombo) run directory: data/data_out.dat, data/*_lineout.dat, AH stats.65raw
scripts/grchombo/stage1b_params.pyParameter file for a stage-1b early-start run (Yoo long-wavelength data, seven levels, geodesic phase to 0.5 t_C(0), then the profile-referenced 1+log lapse and the Gamma-driver) for given (mu, e, p).93raw
scripts/grchombo/vlasov_gauge_check.pyGauge check of the particle push: central density versus the proper time of the core, compared with LTB.52raw
scripts/grchombo/vlasov_ltb_compare.pyCompare a PBHVlasov (GRTeclyn) LTB e = 0 particle run in geodesic slicing with the analytic LTB solution.72raw
scripts/grchombo/vlasov_shell_check.pyInvariant check of the 3D particle run against LTB before the caustic, shell by shell.45raw
scripts/grchombo/vlasov_tau_compare.pyInvariant comparison of the 3D particle run with the 1D Einstein-Vlasov references and LTB: horizon mass M_AH versus the proper time of the matter at the horizon.73raw

tests

7 files · 274 lines · pbhgr

Phase 1 pytest suite: FLRW, Schwarzschild vacuum, dust collapse, decay, static solutions.

Filelines
tests/conftest.py16raw
tests/test_background.py35raw
tests/test_decay.pyProper-time decay of macroparticles, daughter emission, energy bookkeeping, Gamma -> 0.53raw
tests/test_dust_collapse.pyCold dust collapse (LTB / Oppenheimer-Snyder): every shell is a radial Schwarzschild geodesic of the mass m(r0) enclosed initially, in its own proper time; the outermost shell also follows the exterior coordinate-time law.65raw
tests/test_static_exterior.py18raw
tests/test_static_solution.pyKnown Einstein-Vlasov benchmark: an isotropic polytropic steady state (f = (E0 - e^mu E)_+) sampled into macroparticles must reproduce the analytic metric at t = 0 and remain static.33raw
tests/test_vacuum.pySchwarzschild vacuum regression: excised interior mass, zero-weight test particles.54raw

sphdiag (PBH-VERIFY-01)

6 files · 1 466 lines · pbh_verify_01

Verified diagnostics for a spherical 3+1 slice: matter projections, constraint residuals, Misner–Sharp mass, θ±, apparent-horizon candidates with status flags.

Filelines
src/sphdiag/__init__.pysphdiag -- physical diagnostics of spherically symmetric 3+1 slices (PBH-VERIFY-01).20raw
src/sphdiag/diagnose.pydiagnose(): physical diagnostics of a spherically symmetric slice (contract §5-§10).839raw
src/sphdiag/fd.pyFinite-difference machinery for sphdiag (contract §8).187raw
src/sphdiag/matter.pyMatter adapters (contract §4): n-frame projections rho, j_r, S^r_r, S^theta_theta.152raw
src/sphdiag/slice.pySphericalSlice: container + validation of the 3+1 slice data (contract §2, §3, §8, §9).176raw
src/sphdiag/README.mdsphdiag92raw