mochi_class: Stable EFT Solver for Horndeski Models
- mochi_class is an extension of hi_class designed to model Horndeski scalar–tensor gravity via a stable effective-field-theory basis, ensuring ghost-free and gradient-stable simulations.
- It reconstructs conventional EFT functions from arbitrary time-dependent inputs, avoiding hard-coded parametrizations and numerical instabilities typical in standard Horndeski scans.
- The solver employs metric-level quasi-static and GR activation schemes to accurately compute background expansion, CMB anisotropies, and matter power spectra in modified gravity models.
Searching arXiv for the specified topic and closely related papers to ground the article. mochi_class is an extension of the Einstein–Boltzmann solver hi_class, itself built on CLASS, developed to model the linear cosmology of Horndeski scalar–tensor gravity with arbitrary time-dependent inputs and an explicitly stability-oriented formulation. Its defining feature is the replacement of the conventional Horndeski -parametrisation by a stable effective-field-theory basis, so that broad classes of ghost-free and gradient-stable models can be explored without committing to hard-coded parametrisations or a specific covariant Lagrangian. In the original code paper and in subsequent phenomenological studies, mochi_class is presented both as a numerical solver and as a framework for non-parametric exploration of modified gravity, including weak-gravity sectors of Horndeski theory and minimally coupled kinetic gravity braiding models with phantom crossing (Cataneo et al., 2024).
1. Software lineage and scientific scope
mochi_class, whose title expands as “Modelling Optimisation to Compute Horndeski In class,” is a patch on top of hi_class and CLASS that changes how Horndeski gravity is specified and evolved at linear order. Rather than requiring either a covariant Horndeski action or a small set of fixed functional forms for the EFT functions, it allows the modified-gravity sector and, if desired, the background expansion sector to be supplied as arbitrary precomputed functions of time. The code is publicly available at https://github.com/mcataneo/mochi_class_public (Cataneo et al., 2024).
The target theory space is Horndeski gravity in the gravitational-wave-compatible subclass with , so that tensor waves propagate at the speed of light. Within this sector, mochi_class is designed to compute the background expansion, the evolution of linear perturbations, CMB anisotropy spectra, linear matter power spectra , and derived modified-gravity observables such as and . Later applications explicitly use it to output CMB TT spectra, including the late-time ISW contribution, and linear matter power spectra for large ensembles of generated models (Thummel et al., 7 Aug 2025).
Its development is motivated by several numerical and phenomenological issues in standard Horndeski scans. Direct sampling in space often allocates most prior volume to unstable or numerically pathological models. Hard-coded parametrisations such as or can also obscure viable sectors of theory space. mochi_class was introduced precisely to enlarge the accessible Horndeski landscape while improving robustness and reducing the need for fine-tuning (Cataneo et al., 2024).
2. Stable EFT basis and reconstruction of Horndeski functions
The theoretical core of mochi_class is a stable basis built from quantities that appear directly in the linear stability conditions. In the code paper, the basis is written as
together with a background descriptor such as 0 or 1. The positivity conditions
2
enforce the absence of scalar ghosts, a healthy effective Planck mass, and the absence of scalar gradient instabilities by construction (Cataneo et al., 2024).
The stable basis is related to the standard Bellini–Sawicki variables through
3
with 4 reconstructed by solving a first-order differential equation and 5 then obtained from
6
This reconstruction strategy is central: the user specifies positive functions in the stable basis, while mochi_class reconstructs the conventional EFT functions internally (Cataneo et al., 2024).
Subsequent work adopts the same logic in an “inherently stable basis” written as
7
where 8. In that notation, 9 is the effective Planck mass and 0 is again not freely input, but obtained by solving an ODE derived from the definition of 1. This continuity of notation across code and applications is one of the reasons mochi_class can be used as a backend for non-parametric Horndeski model generation (Thummel et al., 7 Aug 2025).
A recurrent practical point is that this basis avoids numerical cancellation problems in models where 2 is analytically simple but numerically delicate. The code paper highlights designer 3 gravity as an example: in hi_class, cancellations can spuriously drive the derived 4 negative, whereas in mochi_class 5 is supplied directly as an input function, preventing stable models from being misclassified as unstable (Cataneo et al., 2024).
3. Numerical approximations, activation schemes, and viability controls
A second defining component of mochi_class is its implementation of the quasi-static approximation at the level of the modified metric potentials rather than at the level of the scalar fluctuation equation. In Newtonian gauge, the QSA is written through Poisson-like relations for 6 and the slip parameter 7, with modified-gravity functions 8 and 9 constructed from precomputed background quantities such as 0, 1, and 2. The code paper emphasizes that this scheme is especially accurate for models transitioning between super- and sub-Compton regimes (Cataneo et al., 2024).
mochi_class also introduces a GR-approximation scheme that activates modified gravity only after a user-chosen redshift. Above 3 the code evolves exactly 4CDM; at activation, the scalar degree of freedom is introduced with QSA-matched initial conditions so that 5 and 6 remain smooth. The implementation includes a braiding activation threshold, allowing the effective onset of modified gravity to be tied to the time when 7 exceeds a prescribed small value. This is intended to suppress numerical sensitivity to the poorly constrained very-early-time behavior of the EFT functions (Cataneo et al., 2024).
Beyond the physical stability conditions built into the basis, mochi_class monitors what the papers describe as “mathematical instabilities,” namely exponentially growing modes of the scalar fluctuation equation. The solver evaluates the growth rates implied by the coefficients of the scalar perturbation equation and rejects models whose real growth rates exceed a tunable threshold relative to 8. Additional runtime checks include rejection of trajectories for which 9 crosses the critical value 0, where the synchronous-gauge system inherits a known discontinuity from hi_class (Cataneo et al., 2024).
These numerical controls are not ancillary. They are part of the code’s scientific program: broad scans become feasible precisely because ghost and gradient stability are handled at the level of inputs, while pathological low-1 or rapidly growing solutions are filtered during explicit time integration.
4. Inputs, outputs, and operational workflow
At the user level, mochi_class separates the cosmological problem into a background sector and a modified-gravity sector. The background can be specified through expansion_model = lcdm, w0wa, wext, or rho_de. The modified-gravity side is selected with gravity_model = stable_params, in which case the user provides tabulated arrays for the stable basis as functions of 2 (Cataneo et al., 2024).
| Input block | Options or arrays | Function |
|---|---|---|
| Background | lcdm, w0wa, wext, rho_de |
Specify 3, 4, or 5 |
| Stable gravity sector | Delta_M2(lna), D_kin(lna), cs2(lna), lna_smg, alpha_B0 via parameters_smg |
Reconstruct 6, 7, and 8 |
| Approximation controls | method_gr_smg, z_gr_smg, method_qs_smg, braid_activation_threshold |
Control GR activation and QSA behavior |
The operational workflow is correspondingly modular. mochi_class reads the background and stable-basis arrays, computes 9 and 0 where needed, reconstructs 1 and 2, integrates the braiding equation backward from the present using 3, derives 4 from 5, stores QSA background quantities, and then solves the Einstein–Boltzmann system for the requested observables. In Python, the classy interface can pass arrays directly without file I/O (Cataneo et al., 2024).
The outputs are those of a general Einstein–Boltzmann solver specialized to Horndeski EFT: CMB angular power spectra, linear matter power spectra, growth observables, background tables, and effective modified-gravity functions. In the weak-gravity and KGB studies, these outputs are further used to analyze 6, 7, the ISW effect, CMB lensing, redshift-space distortions, weak lensing cosmic shear, and the galaxy–ISW cross-correlation (Thummel et al., 7 Aug 2025).
5. Validation and relation to other Einstein–Boltzmann solvers
The code paper validates mochi_class against hi_class, EFTCAMB, and MGCAMB across simple EFT parametrisations and specific models such as cubic Galileon, nKGB, and 8. For scale-independent models, agreement between mochi_class and hi_class is reported at the 9 level for the matter power spectrum. For Hu–Sawicki 0 with QSA, mochi_class agrees with MGCAMB within 1 up to 2. For designer 3, mochi_class with QSA differs from EFTCAMB by 4 up to 5, reaching 6 at 7; when QSA is disabled in mochi_class, the agreement is 8 (Cataneo et al., 2024).
The same comparison program is used to motivate the metric-level QSA. In 9 models, the original hi_class QSA, which treats the scalar fluctuation equation algebraically, produces percent-level errors on small scales, whereas the mochi_class implementation yields errors 0 in linear 1 out to 2. CMB spectra, including TT, TE, EE, and lensing, agree at 3 across the tested setups, apart from TE zero-crossings where relative differences are not physically informative (Cataneo et al., 2024).
This validation establishes mochi_class as neither a separate phenomenological wrapper nor merely a different parametrisation layer. It is a Horndeski-enabled Einstein–Boltzmann solver whose principal distinctions are the stable EFT basis, the metric-level QSA, the activation scheme for late-time modified gravity, and explicit mathematical-stability diagnostics.
6. Non-parametric weak gravity and “stable islands”
A major application of mochi_class is the search for “stable islands of weak gravity” in Horndeski theory space. In “Stable Islands of Weak Gravity,” the solver is described as the computational backbone for a non-parametric exploration in which Gaussian processes generate time-dependent basis functions while directly enforcing stability and phenomenology criteria. The study begins from the inherently stable basis implemented in mochi_class and focuses first on weak-gravity models that suppress the growth of large-scale structure at late times (Thummel et al., 7 Aug 2025).
In that analysis, weak gravity means 4 in the high-5 quasi-static regime. The small-scale effective gravitational coupling is written as
6
so that a larger effective Planck mass suppresses gravity while the fifth-force contribution is always positive when 7 and 8. The no-slip condition
9
eliminates the fifth-force term, leaving
0
This makes the design of weak gravity largely a question of constructing suitable 1 histories that remain stable when the full perturbation system is evolved (Thummel et al., 7 Aug 2025).
The models are generated non-parametrically with Gaussian processes, using the public GPtools package and a squared-exponential kernel. The GP realizations are conditioned to approach GR at early times, to bias 2 over an intermediate redshift interval relevant for structure growth, and, in some constructions, to satisfy “local-value” or “local-convergence” conditions at 3. mochi_class then reconstructs 4, performs the built-in stability checks, integrates perturbations, and outputs the observables used to identify viable model families. The study reports a broad range of weak-gravity islands and illustrates models that produce a 5 suppression of linear power at 6 relative to GR. It also shows that replacing the 7CDM expansion history with the DESI 8CDM best fit still yields stable islands of weak gravity (Thummel et al., 7 Aug 2025).
A notable negative result concerns a common intuition about local screening requirements. For no-slip models on a 9CDM background, imposing both 0 and 1 drives 2 negative at late times, so there is no stable no-slip local-convergence weak-gravity model in that setting. By contrast, beyond-no-slip constructions with a non-zero fifth force can realize local-convergence solutions while remaining stable. This suggests that the viable weak-gravity sector is structured, rather than generic, even within the stable basis.
7. Minimally coupled KGB, phantom crossing, and current interpretive debates
A second major application uses mochi_class to test whether late-time phantom crossing requires non-minimal conformal coupling. “Non-parametric exploration of minimally coupled gravity with phantom crossing” studies the minimally coupled, luminal Horndeski subclass known as kinetic gravity braiding. In this setting,
3
so the only nontrivial perturbation EFT functions are 4 and 5, while the background is specified by 6 or equivalently 7. The study uses mochi_class in its manifestly stable EFT-basis mode to scan these models non-parametrically (Cataneo et al., 15 Dec 2025).
The scan parameterizes the stable functions in terms of 8,
9
where 00 and 01 are Gaussian-process draws with squared-exponential covariance. The background is not reconstructed non-parametrically in this study; instead, it is fixed to CPL forms
02
including the DESI DR2 + CMB + DES Y5 best fit 03 and two mirage-dark-energy cases. Over 250,000 KGB models are generated and passed through mochi_class, which reconstructs 04 and 05, enforces the stable-basis conditions, and rejects models that develop large mathematical instabilities (Cataneo et al., 15 Dec 2025).
The phenomenological filtering is deliberately conservative. The selected models are required to keep the linear matter power spectrum within 06 of 07CDM on sub-horizon scales at 08 and to produce a positive late-time galaxy–ISW cross-correlation. The resulting models also remain broadly consistent with CMB temperature and lensing power spectra, redshift-space distortions, and cosmic shear. The central conclusion is explicit: viable phantom-crossing solutions exist without conformal coupling. This directly challenges the interpretation that phantom crossing inferred from DESI-era background fits necessarily points toward 09 or a time-varying effective Planck mass (Cataneo et al., 15 Dec 2025).
In this KGB context, mochi_class functions as a stable-basis EFT solver, but also as an instrument for clarifying model-selection biases. A plausible implication is that earlier preferences for non-zero conformal coupling in simple EFT parametrisations may partly reflect the choice of basis and priors, rather than an unavoidable feature of the data. That implication is not a formal theorem of the code; it follows from the fact that a broader, manifestly stable non-parametric scan uncovers minimally coupled phantom-crossing models that had been obscured in more restrictive parametrised analyses.