# RLMT Companion Paper: Code Bundle Supporting code for "R-layer Mode Theory: A Representation-Theoretic Origin for the Mode Amplitude Coefficients, and a Negative Result for Tensor-Sector Coupling" (companion to the RLMT/Planck 2018 paper, Tohi 2026). ## Requirements ``` pip install camb numpy scipy --break-system-packages ``` Tested with CAMB 1.6.6, Python 3.12. ## Files and what they reproduce - **cmbs4_forecast.py** -- Core module. Implements the RLMT primordial spectrum (Eq. 5.1-5.5 of the parent paper), a CAMB wrapper, a CMB-S4-like noise model, and the base Fisher-matrix builder (TT+TE+EE). All other scripts import from this file. Running it directly reproduces the full 13-parameter CMB-S4 Fisher forecast at the Planck best-fit point (Table 1 of the parent paper) and shows the near-singular behaviour discussed in Appendix on the exact scaling degeneracy. - **cmbs4_forecast_extended.py** -- Eigen-decomposition of the Fisher matrix (identifies the exact beta_eff/c_n scaling degeneracy), external BAO/LSS Fisher-prior builders, and a CMB lensing (phi-phi) Fisher block with a flat-sky TT-only N0 reconstruction-noise calculation. Reproduces the sigma(kc), sigma(eps3) tables at the paper's detectability threshold (kc=0.3, eps3=0.02). - **tensor_coupling_candidates.py** -- The full tensor-sector search. Implements six candidate tensor-coupling constructions (shared-kc cutoff, ad hoc -eps3 tilt, standard consistency relation, and three Clebsch-Gordan/quadrupole constructions) and the CMB-S4 BB Fisher pipeline. Reproduces every number quoted in the "tensor-sector coupling" section of the companion paper, including the two corrected bugs described there (tensor-only vs total BB; proper marginalisation over ns, As when combining with TT/TE/EE). - **external_ns_prior.py** -- Reproduces the external-Planck-ns-prior result (importing sigma(ns)=0.0042 breaks the internal eps3-ns degeneracy in a way LSS/21cm/mu-distortion probes at the same k-range cannot). - **mu_distortion.py**, **lss_shape_fisher_v2.py**, **future_probes_forecast.py** -- The mu-distortion (PIXIE-like), Lyman-alpha forest, and 21cm intensity-mapping Fisher forecasts (both the optimistic kmax=2 and the realistic kmax=0.3-0.5 + foreground/nonlinear-suppression versions) referenced in the "external probes" discussion. ## Typical usage ```bash # Base Fisher forecast at the Planck best-fit (shows the degeneracy problem) python3 cmbs4_forecast.py # Eigen-analysis + external BAO/LSS + lensing, at the detectability threshold python3 cmbs4_forecast_extended.py # Full tensor-coupling candidate comparison (takes ~5 minutes: CAMB is # called ~20-30 times with WantTensors=True) python3 tensor_coupling_candidates.py # External ns-prior comparison python3 external_ns_prior.py ``` Note: `cmbs4_forecast_extended.py` and `tensor_coupling_candidates.py` expect a cached `F_threshold.npy` (the 8-parameter Fisher matrix at the kc=0.3, eps3=0.02 fiducial) in the working directory; running `cmbs4_forecast_extended.py`'s `main()` first will generate it, or see the inline `build_fisher(...)` calls to regenerate it directly. ## Caveats (see paper for full discussion) - The 21cm and Lyman-alpha forecasts use a simplified Tegmark (1997) effective-volume Fisher formula, not real survey covariances; DESI and SKA's actual published forecasts (see paper Sec. on external data) generally import an external ns prior rather than self-constraining it, which the toy model here reproduces qualitatively but not quantitatively. - The CMB lensing N0 is a flat-sky, TT-only minimum-variance estimator (Hu & Okamoto 2002 limit), not the full TT+TE+EE+EB+TB combination a real CMB-S4 analysis would use. - All tensor-coupling constructions in `tensor_coupling_candidates.py` are explicitly flagged in-code as postulates, not derivations, with the single exception of the linear-response coherence calculation (candidate justification in the paper's Sec. on microscopic derivation), which is a genuine first-order perturbative result -- and which is exactly what rules out the earlier postulates.