Horndeski in the Cosmic Linear Anisotropy Solving System
An Einstein-Boltzmann solver for dark energy and modified gravity.
99 papers v3.3.4.4 pip install hiclassy built on CLASS ascl:1808.010
News
Recent developments
-
hi_classv3.3.4.4 was released, rebuilt on CLASS v3.3.4. The beyond-Horndeski (GLPV) and conformally coupled Galileon models are now part of the public code.hiclassyon PyPI carries the same version: v3.3.4.4 · PyPI -
Single Scalar Field Dark Energy: 2026 Status Report, a review talk on where the field stands, by Carlos García-García and William Wolf. video
-
The Python wrapper was published on PyPI as
hiclassy, sopip install hiclassyis all it takes to drivehi_classfrom a script. PyPI -
DESI put out modified-gravity constraints from the full-shape modelling of its 2024 clustering measurements, computed with
hi_class. JCAP 09 (2025)
The Science
Cosmology for general scalar-tensor gravity
hi_class implements Horndeski's theory in the modern
Cosmic Linear Anisotropy Solving System.
Any background or linear cosmological observable can be computed, including FRW distances, CMB,
matter power and number count spectra. hi_class can be readily interfaced with
Monte Python
to test gravity and dark energy models.
Horndeski is the
most general scalar-tensor theory whose equations of motion remain second order, and
contains many well known models, including (but by no means limited to) covariant Galileons, Brans-Dicke,
f(R), chameleons, k-essence and quintessence. It is not, however, the most general healthy scalar-tensor
theory: general disformal couplings and degenerate theories generalize Horndeski without introducing
Ostrogradski instabilities (see
PRD 89 (2014) 064046
and JHEP 12 (2016) 100).
hi_class implements GLPV theories beyond Horndeski
(PRL 114 (2015) 211101),
used for example in
JCAP 08 (2019) 035;
they ship with the code as glpv_galileon and propto_omega_bh.
hi_class relies on a reformulation of the Effective Field Theory for Dark Energy developed
by E. Bellini and I. Sawicki (see
JCAP 1407 (2014) 050).
Any linear observable
FRW distances, CMB temperature and polarization, matter power and number counts — and their cross-correlations.
Fast enough for Bayesian analysis
A full Horndeski model — background, lensed CMB and matter power spectrum — computes fast enough to sample the parameter space of each model. Interfaces directly with Monte Python.
Covariant or effective theory
Start from a Horndeski Lagrangian and hi_class derives the background and
α-functions itself, or parametrize the α-functions directly.
Free and open
Available to the scientific community on GitHub, and registered in the Astrophysics Source Code Library.
Flexible input
Two ways to test gravity
The effective-theory approach consists of providing a parametrization of the α-functions and the dark-energy equation of state, independent of any underlying theory, with the aim of testing for particular physical effects.
The covariant-theory approach starts from a particular model defined in terms of the
Horndeski functions Gi. Upon specifying the initial conditions for the background field
and the additional parameters of the theory, hi_class automatically computes the
cosmological background and the α-functions are fully determined.
Sixteen worked-out examples ship with the code — Galileon, nKGB, quintessence (monomial and
tracker), Brans-Dicke, α-attractors, the conformally coupled cubic Galileon and the
beyond-Horndeski models — and serve as a template for further implementations.
hi_class is easy to use and to modify, so new models are straightforward to add.
hi_class derive the α-functions; the effective-theory approach
specifies those functions directly, and never commits to an underlying theory. After
JCAP 08 (2017) 019.Cosmological observables: effective vs covariant theories
The animations below illustrate an example of each type as it is driven away from GR+ΛCDM (in gray). Both hold one Planck 2018 cosmology fixed — including the acoustic angular scale 100 θ*, so H0 is derived from it — and vary the dark-energy sector. Left: the expansion rate. Right: the lensed temperature spectrum. The effective theory approach allows for independent variations of the expansion and perturbation parameters, while the covariant theory modifies all observables at once.
Presented and described in
- hi_class: Horndeski in the Cosmic Linear Anisotropy Solving System
- hi_class: Background Evolution, Initial Conditions and Approximation Schemes
Selected results obtained with hi_class
- Single Scalar Field Dark Energy: 2026 Status Report
- The Cosmological Evidence for Non-Minimal Coupling
- Modified gravity constraints from the full shape modeling of clustering measurements from DESI 2024
- Positivity Bounds on Dark Energy: When Matter Matters
- Early modified gravity in light of the H0 tension and LSS data
- Testing modified gravity at cosmological distances with LISA standard sirens
- KiDS+GAMA: Constraints on Horndeski gravity from combined large-scale structure probes
- Dark Energy after GW170817: Dead Ends and the Road Ahead
- Observational future of cosmological scalar-tensor theories
See all 99 publications using
hi_class → If your article is not listed, please
contact us.
The Code
Flexible, fast and accurate
hi_class computes the cosmological predictions of alternative theories of
gravity. It solves the linear equations starting deep in the radiation era, and returns any cosmological
observable — distances, the matter power spectrum, Cosmic Microwave Background temperature and
polarization, and their correlation with the matter distribution.
- Accurate
hi_classlets you balance accuracy against speed through a wide range of precision parameters, and it was the first code to implement self-consistent initial conditions for linear perturbations. Its accuracy was established in a dedicated comparison paper, A comparison of Einstein-Boltzmann solvers for testing General Relativity, which ran the same models through four independent codes. Across that range of models the CMB and matter power spectra agree to 0.1% — as good as base CLASS/CAMB at default precision parameters — and to 0.5% at low multipoles, comfortably within cosmic variance. That is sufficient precision for tests of gravity with next-generation surveys.- Fast
- A full model — background, lensed CMB and matter power spectrum — is computed efficiently, fast
enough to sample the parameter space of each theory.
hi_classalso implements the quasi-static approximation, which speeds up computations on small scales. This makes Bayesian parameter estimation practical, andhi_classinterfaces directly with Monte Python to do it. - Flexible
- Test gravity two ways: parametrize the α-functions and the dark-energy equation of state
independently of any underlying theory, or start from a covariant Horndeski Lagrangian and let
hi_classdetermine the background and the α-functions itself. Worked-out models ship ready to run, and every configuration is screened for ghost and gradient instabilities before it is used.
Covariant theory
# a quartic Galileon Lagrangian
# G2 = -X
# G3 = c3 X /(H0^2 Mp)
# G4 = Mp^2/2 + c4 X^2/(H0^2 Mp)^2
gravity_model = galileon
gravity_submodel = quartic
# xi; the rest follows from the tracker
parameters_smg = 2.43
Omega_smg = -1
# the scalar replaces Lambda entirely
Omega_Lambda = 0
Omega_fld = 0
Effective theory
# the alpha-functions directly, each one
# proportional to Omega_smg(a)
gravity_model = propto_omega
# x_k, x_b, x_m, x_t, M*^2_ini
parameters_smg = 1., 0., 0., 0., 1.
# and an expansion history to go with it
expansion_model = lcdm
expansion_smg = 0.5
Omega_smg = -1
# the scalar replaces Lambda entirely
Omega_Lambda = 0
Omega_fld = 0
From Python
Drive it from a script or a notebook
The code also builds a Python wrapper, inherited from CLASS and published on PyPI as
hiclassy
— pip install hiclassy. Parameters go in as a dictionary — hi_class
options alongside the standard CLASS ones — and spectra come back as arrays, ready to plot.
It is what
CLOE, the Euclid
likelihood library, calls to get modified-gravity predictions. Worked examples ship in
notebooks/.
from hiclassy import HiClass
cosmo = HiClass()
cosmo.set({
'output': 'tCl,pCl,lCl,mPk',
'lensing': 'yes',
# the same quartic Galileon, driven from Python
'gravity_model': 'galileon',
'gravity_submodel': 'quartic',
# xi = (H phi')/(a H0^2); the remaining parameters follow
# from Omega_smg and the tracker condition
'parameters_smg': 2.43,
'Omega_smg': -1, # fixed by the closure equation
'Omega_Lambda': 0,
'Omega_fld': 0,
})
cosmo.compute()
cl = cosmo.lensed_cl(2500) # TT, TE, EE, lensing
pk = cosmo.pk(0.1, 0.) # P(k = 0.1/Mpc, z = 0)
Scope
Other modified gravity codes
Other codes solve a covariant theory in much the same sense: H-EFTCAMB (built on CAMB), COOP, and mochi_class, which extends this architecture with stability-by-construction parametrizations.
A different family — MGCAMB, ISiTGR, MGCLASS II — instead parametrizes the relation between the metric potentials and matter: the μ–Σ approach, a modified Poisson equation.
hi_class is a linear code. Screening — the mechanism that hides the fifth force in
the Solar System, and the reason many of these theories are viable at all — is intrinsically nonlinear
and is not modelled here. For non-linear codes see
MG-PICOLA
and Hi-COLA,
ReACT,
KGB-evolution, and the
ECOSMOG and MG-GADGET families of N-body solvers.
Download
Get hi_class
hi_class is freely available to the scientific community. The code can be cloned from the
GitHub repository or downloaded as a compressed archive. To get started and find detailed information on
the available models and code functionality, please read the hi_class.ini file.
Versions
The current release is v3.3.4.4, built on
CLASS v3.3.4, and it lives on the default master branch — the
separate hi_class branch is gone, so cloning the repository gives you the code.
The Python wrapper carries the same number on PyPI:
hiclassy
3.3.4.4.
Interfaces
How well each of these is supported differs, and the difference is worth stating plainly.
- Monte Python official Documented, and the sampler behind most of the published results below.
-
Cobaya
community
Works as a modified-CLASS theory provider. Cobaya warns that forks carrying an
older CLASS version number may need
ignore_obsolete. - CosmoSIS community Through a third-party wrapper, maintained outside this project.
-
emcee, and any Python sampler
generic
No adapter is needed:
hiclassyis an ordinary Python object, so a log-likelihood that calls it is all it takes.
How to cite
If you use hi_class in a publication or preprint, please cite at least the original CLASS
paper and the two hi_class papers.
Resources
Documentation, courses and tools
The Team
Who develops hi_class
-
Emilio Bellini — main developer
-
Pedro G. Ferreira
-
Carlos Garcia-Garcia
-
Julien Lesgourgues
-
Janina Renk
-
Ignacy Sawicki
-
Dina Traykova
-
Miguel Zumalacarregui — main developer
A green ring marks the main developers.
We are very grateful to Thomas Tram for his invaluable advice, and to the many users who have offered suggestions, found bugs and contributed to improve the code.
Contact
Get in touch
If you are interested in using a beta version, or for other inquiries about hi_class,
please contact emilio - bellini -- ung.si or
miguel - zumalacarregui -- aei.mpg.de.
Bug reports and feature requests are also welcome on the GitHub issue tracker and the hi_class forum.
Publications
Papers using hi_class
99 publications have used hi_class
Spanning 2015–2026, from single-author theory papers to Euclid, DESI, KiDS and LISA collaboration analyses. If your article is missing, please let us know.
2026 7
- The Status of Single Scalar Field Dark Energy
- Constraining dark energy with complementary probes of large-scale structure
- Dark energy perturbations and the robustness of cosmological neutrino-mass constraints
- cloelib: A Flexible Python Library for Computing Cosmological Observables in the Euclid Era
- PySCo-EFT and ECOSMOG-EFT: a tandem of N-body simulation codes for the Effective Field Theory of Dark Energy
- H-EFTCAMB: A Cobaya-Integrated, Python-Wrapped Extension of EFTCAMB for Covariant Horndeski Gravity
- On the Difficulties with Late-Time Solutions for the Hubble Tension
2025 18
- Abundance of cosmic voids in EFT of dark energy
- Non-parametric exploration of minimally coupled gravity with phantom crossing
- KiDS-Legacy: Constraints on Horndeski gravity from weak lensing combined with galaxy clustering and CMB
- Euclid preparation. Review of forecast constraints on dark energy and modified gravity
- Clustering in dynamical dark energy: observational constraints from DESI, CMB, and supernovae
- New multiprobe analysis of modified gravity and evolving dark energy
- A Dynamical Scalar Field Model for Dark Energy: Addressing the Hubble Tension and Cosmic Evolution
- KGB-evolution: a relativistic N-body code for kinetic gravity braiding models
- From Dark Radiation to Dark Energy: Unified Cosmological Evolution in K-essence Models
- Cosmological constraints on Galileon dark energy with broken shift symmetry
- Dark energy constraints in light of theoretical priors
- Monodromic Dark Energy and DESI
- Euclid preparation. Constraining parameterised models of modifications of gravity with the spectroscopic and photometric primary probes
- Nonlinear dynamics in Horndeski gravity: a renormalized approach to effective gravitational coupling
- The Cosmological Evidence for Non-Minimal Coupling
- Modified gravity constraints with Planck ISW-lensing bispectrum
- Preference for evolving dark energy in light of the galaxy bispectrum
- Robustness of Dark Energy Phenomenology Across Different Parameterizations
2024 12
- Exploring cosmological imprints of phantom crossing with dynamical dark energy in Horndeski gravity
- Modified gravity constraints from the full shape modeling of clustering measurements from DESI 2024
- Matching current observational constraints with nonminimally coupled dark energy
- Testing gravity with the full-shape galaxy power spectrum: First constraints on scale-dependent modified gravity
- Fast radio bursts as a probe of gravity on cosmological scales
- Constraints on dark energy and modified gravity from the BOSS Full-Shape and DESI BAO data
- Scant evidence for thawing quintessence
- Interpretable and physics-informed emulator for the linear matter power spectrum from machine learning
- mochi_class: Modelling Optimisation to Compute Horndeski In class
- Modified gravity interpretation of the evolving dark energy in light of DESI data
- A simple prediction of the non-linear matter power spectrum in Brans-Dicke gravity from linear theory
- Constraining dark energy with the integrated Sachs-Wolfe effect
2023 6
- Probing Early Modification of Gravity with Planck, ACT and SPT
- Machine learning unveils the linear matter power spectrum of modified gravity
- Euclid: Constraining linearly scale-independent modifications of gravity with the spectroscopic and photometric primary probes
- Probing Dark Energy and Modifications of Gravity with Ground-Based Millimeter-Wavelength Line Intensity Mapping
- Revisiting Vainshtein Screening for fast N-body simulations
- Testing gravity on cosmological scales: theoretical predictions with the COLA method
2022 6
- The Effective Fluid Approach for Modified Gravity and Its Applications
- Testing gravity with gravitational wave friction and gravitational slip
- A Forecast for Large Scale Structure Constraints on Horndeski Gravity with Line Intensity Mapping
- Neutrino mass and kinetic gravity braiding degeneracies
- Enabling matter power spectrum emulation in beyond-ΛCDM cosmologies with COLA
- Positivity bounds from multiple vacua and their cosmological consequences
2021 5
- On tachyonic stability priors for dark energy
- Fully relativistic predictions in Horndeski gravity from standard Newtonian N-body simulations
- Theoretical priors in scalar-tensor cosmologies: Shift-symmetric Horndeski models
- Positivity Bounds on Dark Energy: When Matter Matters
- Testing modified (Horndeski) gravity by combining intrinsic galaxy alignments with cosmic shear
2020 12
- Can Conformally Invariant Modified Gravity Solve The Hubble Tension?
- Early modified gravity in light of the H0 tension and LSS data
- Scalar-tensor cosmologies without screening
- Constraining Scalar-Tensor Modified Gravity with Gravitational Waves and Large Scale Structure Surveys
- Relativistic Corrections to the Growth of Structure in Modified Gravity
- Cross-bispectra Constraints on Modified Gravity Theories from Nancy Grace Roman Space Telescope and Rubin Observatory Legacy Survey of Space and Time
- Information entropy in cosmological inference problems
- Improvements in cosmological constraints from breaking growth degeneracy
- A larger value for H0 by an evolving gravitational constant
- The H0 tension: ΔG_N vs. ΔN_eff
- Gravity in the Era of Equality: Towards solutions to the Hubble problem without fine-tuned initial conditions
- Cosmological constraints on dark energy in light of gravitational wave bounds
2019 11
- Theoretical priors in scalar-tensor cosmologies: Thawing quintessence
-
hi_class:Background Evolution, Initial Conditions and Approximation Schemes - Testing modified gravity at cosmological distances with LISA standard sirens
- Dark sector evolution in Horndeski models
- The Shape Dependence of Vainshtein Screening in the Cosmic Matter Bispectrum
- Alpha-attractor dark energy in view of next-generation cosmological surveys
- Modified Gravity Away from a ΛCDM Background
- Designing Horndeski and the effective fluid approach
- Positivity in the sky
- The phenomenology of beyond Horndeski gravity
- KiDS+GAMA: Constraints on Horndeski gravity from combined large-scale structure probes
2018 12
- Cosmological parameter constraints for Horndeski scalar-tensor gravity
- Radiative stability and observational constraints on dark energy and modified gravity
- No Slip CMB
- Inflation and Early Dark Energy with a Stage II Hydrogen Intensity Mapping experiment
- Gravity's Islands: Parametrizing Horndeski Stability
- Dark Energy in light of Multi-Messenger Gravitational-Wave astronomy
-
Testing Horndeski gravity as dark matter with
hi_class - Investigating scalar-tensor-gravity with statistics of the cosmic large-scale structure
- Dark energy from α-attractors: phenomenology and observational constraints
- Testing (modified) gravity with 3D and tomographic cosmic shear
- The impact of relativistic effects on cosmological parameter estimation
- A comparison of Einstein-Boltzmann solvers for testing General Relativity
2017 4
2016 5
- Hiding neutrino mass in modified gravity cosmologies
- Early Cosmology Constrained
- Initial conditions for the Galileon dark energy
- Gravity at the horizon: on relativistic effects, CMB-LSS correlations and ultra-large scales in Horndeski's theory
- Constraints on deviations from LCDM within Horndeski gravity
2015 1
No publications match that search.