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 · pbhgrMain 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.
| File | lines | |
|---|---|---|
pbhgr/__init__.pypbhgr: Stage-A spherical Einstein-Vlasov + decay solver and campaign scaffolding. | 6 | raw |
pbhgr/analytic.pyAnalytic references for the mandatory Stage-A tests. | 41 | raw |
pbhgr/background.pyHomogeneous flat FLRW with cold X + radiation + X -> radiation decay. | 48 | raw |
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). | 656 | raw |
pbhgr/cosmo_id.pyCosmological initial data for the areal-CMC spherical Einstein-Vlasov solver (Stage A step 2). | 125 | raw |
pbhgr/initial_data.pyInitial data families for the spherical solver. | 64 | raw |
pbhgr/ltb.pyExact growing-mode LTB solution for a Gaussian curvature profile (Yoo et al. 2026, arXiv:2609.14218). | 119 | raw |
pbhgr/pm3d.pyNewtonian 3D particle-mesh code for one triaxial peak in an Einstein-de Sitter background (item 3b of the plan). | 160 | raw |
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. | 63 | raw |
pbhgr/provenance.pyRun provenance record, as required by the specification (section 12, Reproducibility). | 84 | raw |
pbhgr/scan.pyOutcome-map scan driver for the spherical solver (Stage A, section 4 'Скан'). | 77 | raw |
pbhgr/spherical_ev.pySpherically symmetric Einstein-Vlasov system with X decay (Stage A prototype). | 492 | raw |
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. | 89 | raw |
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… | 172 | raw |
PBHVlasov (GRTeclyn)
19 files · 3 558 lines · pbhgr3D 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.
| File | lines | |
|---|---|---|
grteclyn/PBHVlasov/GNUmakefileLine extraction uses the particle interpolator. | 42 | raw |
grteclyn/PBHVlasov/Main_PBHVlasov.cppEngage! | 80 | raw |
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. | 163 | raw |
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. | 513 | raw |
grteclyn/PBHVlasov/PBHGaugeTeclyn.hppPBHVlasov example (pbhgr project). | 53 | raw |
grteclyn/PBHVlasov/PBHVlasovAmr.hppPBHVlasov example for GRTeclyn (pbhgr project). | 70 | raw |
grteclyn/PBHVlasov/PBHVlasovLevel.cppPBHVlasov example for GRTeclyn (pbhgr project, stage 2). | 1217 | raw |
grteclyn/PBHVlasov/PBHVlasovLevel.hppPBHVlasov example for GRTeclyn (pbhgr project, stage 2): BSSN/CCZ4 + Vlasov particles. | 64 | raw |
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… | 96 | raw |
grteclyn/PBHVlasov/ParticleMatterVars.hppPBHVlasov example for GRTeclyn (pbhgr project). | 26 | raw |
grteclyn/PBHVlasov/SimulationParameters.hppPBHVlasov example for GRTeclyn (pbhgr project). | 33 | raw |
grteclyn/PBHVlasov/StateVariables.hppPBHVlasov example for GRTeclyn (pbhgr project, stage 2). | 46 | raw |
grteclyn/PBHVlasov/VlasovParticles.cppPBHVlasov example for GRTeclyn (pbhgr project, stage 2). | 787 | raw |
grteclyn/PBHVlasov/VlasovParticles.hppPBHVlasov example for GRTeclyn (pbhgr project, stage 2). | 149 | raw |
grteclyn/PBHVlasov/params_flrw.txtPBHVlasov: FLRW dust test (periodic box, geodesic slicing). | 33 | raw |
grteclyn/PBHVlasov/params_flrw_amr1.txtPBHVlasov: FLRW dust test (periodic box, geodesic slicing). | 35 | raw |
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. | 42 | raw |
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). | 57 | raw |
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. | 52 | raw |
PBHCosmo (GRChombo)
16 files · 1 272 lines · pbhgrStage 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).
| File | lines | |
|---|---|---|
grchombo/PBHCosmo/ConstraintsExtraction.hpp! | 117 | raw |
grchombo/PBHCosmo/CosmoDiagnostics.hpp! | 66 | raw |
grchombo/PBHCosmo/CosmoDiagnostics.impl.hpperror "This file should only be included through CosmoDiagnostics.hpp" | 55 | raw |
grchombo/PBHCosmo/CustomExtraction.hppFunction to convert double to string with precision | 124 | raw |
grchombo/PBHCosmo/DiagnosticVariables.hppassign an enum to each variable | 38 | raw |
grchombo/PBHCosmo/GNUmakefile-*- Mode: Makefile -*- PBHCosmo example: copy this directory into $GRCHOMBO_HOME/Examples/PBHCosmo and run make all | 24 | raw |
grchombo/PBHCosmo/InitialLTBData.hppPBHCosmo example for GRChombo (pbhgr project, plan 6.12 stage 1). | 122 | raw |
grchombo/PBHCosmo/Main_PBHCosmo.cppChombo includes | 112 | raw |
grchombo/PBHCosmo/PBHCosmoLevel.cppPBHCosmo example for GRChombo (pbhgr project). | 243 | raw |
grchombo/PBHCosmo/PBHCosmoLevel.hppPBHCosmo example for GRChombo (pbhgr project). | 36 | raw |
grchombo/PBHCosmo/PBHGauge.hppPBHCosmo example (pbhgr project). | 59 | raw |
grchombo/PBHCosmo/Potential.hpp! | 40 | raw |
grchombo/PBHCosmo/ScalarFieldRef.hppPBHCosmo example (pbhgr project). | 89 | raw |
grchombo/PBHCosmo/SimulationParameters.hppPBHCosmo example for GRChombo (pbhgr project). | 70 | raw |
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. | 39 | raw |
grchombo/PBHCosmo/UserVariables.hppassign an enum to each variable | 38 | raw |
scripts
31 files · 2 460 lines · pbhgrRun drivers, scans, benchmarks, 3D-vs-1D/LTB comparisons, parameter generators, the GRChombo build script.
| File | lines | |
|---|---|---|
scripts/build_gallery.pyAssemble reports/gallery.html: the figure set with reading notes, PNGs embedded as data URIs. | 132 | raw |
scripts/debug_ah.py | 23 | raw |
scripts/debug_caustic.py | 23 | raw |
scripts/debug_inner.py | 27 | raw |
scripts/debug_ueq.py | 27 | raw |
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… | 74 | raw |
scripts/make_figures.pyBuild the visualisation set in reports/figures from runs/viz, runs/scan_pilot, runs/resource_probe.json. | 235 | raw |
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). | 44 | raw |
scripts/pm3d_peak.pyItem 3b: Newtonian 3D PM run of one triaxial peak. | 36 | raw |
scripts/pm3d_shelltest.pyLagrangian-shell test of the PM code against the exact LTB solution (spherical Yoo profile, mu = 0.1). | 28 | raw |
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. | 31 | raw |
scripts/run_scan.pyPilot outcome scan on the dev VPS. | 21 | raw |
scripts/run_showcase.pyRun representative cases with full snapshot storage for visualisation -> runs/viz/*.pkl | 41 | raw |
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. | 80 | raw |
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… | 47 | raw |
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… | 161 | raw |
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). | 41 | raw |
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. | 35 | raw |
scripts/verify_cold_convergence.pyCold-limit convergence: nearly cold cloud (L_rms=0.05) at three (K, N) resolutions. | 28 | raw |
scripts/verify_static.pyStatic Einstein-Vlasov benchmark: sampled steady state must remain steady under evolution. | 42 | raw |
scripts/verify_static_res.pyStatic benchmark: does the slow secular drift of max 2m/r shrink with grid resolution / time step? | 28 | raw |
scripts/warm_summary.pySummary table of the warm campaign: python3 scripts/warm_summary.py [dir] | 28 | raw |
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)… | 397 | raw |
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). | 111 | raw |
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). | 320 | raw |
scripts/grchombo/pbh_analyse.pyAnalyse a PBHCosmo (GRChombo) run directory: data/data_out.dat, data/*_lineout.dat, AH stats. | 65 | raw |
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). | 93 | raw |
scripts/grchombo/vlasov_gauge_check.pyGauge check of the particle push: central density versus the proper time of the core, compared with LTB. | 52 | raw |
scripts/grchombo/vlasov_ltb_compare.pyCompare a PBHVlasov (GRTeclyn) LTB e = 0 particle run in geodesic slicing with the analytic LTB solution. | 72 | raw |
scripts/grchombo/vlasov_shell_check.pyInvariant check of the 3D particle run against LTB before the caustic, shell by shell. | 45 | raw |
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. | 73 | raw |
tests
7 files · 274 lines · pbhgrPhase 1 pytest suite: FLRW, Schwarzschild vacuum, dust collapse, decay, static solutions.
| File | lines | |
|---|---|---|
tests/conftest.py | 16 | raw |
tests/test_background.py | 35 | raw |
tests/test_decay.pyProper-time decay of macroparticles, daughter emission, energy bookkeeping, Gamma -> 0. | 53 | raw |
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. | 65 | raw |
tests/test_static_exterior.py | 18 | raw |
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. | 33 | raw |
tests/test_vacuum.pySchwarzschild vacuum regression: excised interior mass, zero-weight test particles. | 54 | raw |
sphdiag (PBH-VERIFY-01)
6 files · 1 466 lines · pbh_verify_01Verified diagnostics for a spherical 3+1 slice: matter projections, constraint residuals, Misner–Sharp mass, θ±, apparent-horizon candidates with status flags.
| File | lines | |
|---|---|---|
src/sphdiag/__init__.pysphdiag -- physical diagnostics of spherically symmetric 3+1 slices (PBH-VERIFY-01). | 20 | raw |
src/sphdiag/diagnose.pydiagnose(): physical diagnostics of a spherically symmetric slice (contract §5-§10). | 839 | raw |
src/sphdiag/fd.pyFinite-difference machinery for sphdiag (contract §8). | 187 | raw |
src/sphdiag/matter.pyMatter adapters (contract §4): n-frame projections rho, j_r, S^r_r, S^theta_theta. | 152 | raw |
src/sphdiag/slice.pySphericalSlice: container + validation of the 3+1 slice data (contract §2, §3, §8, §9). | 176 | raw |
src/sphdiag/README.mdsphdiag | 92 | raw |