This is a symbolic algorithm that, for both canonical single-field inflation and
-
Primordial spectra: the scalar and tensor primordial power spectra,
$\mathcal P_s(k)$ and$\mathcal P_t(k)$ , through any specified finite relative order$p$ in the slow-roll expansion. -
Consistency relations: the tensor tilt
$n_t=\alpha_0^t\equiv d\ln\mathcal P_t/d\ln k$ and its runnings$\alpha_n^t\equiv d^n n_t/d(\ln k)^n$ ($n\geq1$ ), expressed in terms of the tensor-to-scalar ratio$r=\mathcal P_t/\mathcal P_s$ , the scalar tilt$n_s-1=\alpha_0^s\equiv d\ln\mathcal P_s/d\ln k$ and its runnings$\alpha_n^s\equiv d^n(n_s-1)/d(\ln k)^n$ ($n\geq1$ ). Relations can be calculated for any derivative order$n\geq0$ and slow-roll correction order$p$ . For$k$ -inflation, they also depend on$c_s$ , its logarithmic scale derivative$\alpha_0^{c_s}\equiv d\ln c_s/d\ln k$ and higher derivatives$\alpha_n^{c_s}\equiv d^n\alpha_0^{c_s}/d(\ln k)^n$ ($n\geq1$ ).
Each relation is derived directly, without requiring lower-order tensor consistency relations as inputs. Calculation time and memory increase with order.
Requires Python 3.10 or newer. From the repository root:
pip install -e .Check the installation and try a leading-order (LO) spectrum calculation:
SRI --version
SRI -p 0See the installation guide for optional notebook and validation dependencies.
The universal coefficients and the background algebra can be calculated independently in the following ways:
- Universal coefficients: numerical (default). The coefficients are determined by integrating the normalized mode and pump equations. Their converged numerical values are represented by rational numbers for the subsequent symbolic algebra.
- Universal coefficients: symbolic (
--symbolic). The same coefficients are obtained from exact analytic expressions. Larger mixed coefficients can appear as defined constantsChi((j_1,...,j_m)); their complete expressions are available throughsri.analytic.momentand the coefficient archive. - Background algebra: iterative (default). Intermediate background quantities are constructed successively, and the background is eliminated from consistency relations using the finite difference inverse.
- Background algebra: closed (
--closed). Background quantities are constructed through explicit finite sums, and consistency relations use the closed perturbative background inverse.
With no mode flags, calculations use numerical coefficients and iterative background algebra. --symbolic changes the coefficient mode; --closed changes the algebra method. Both algebra methods support spectra and consistency relations for both physical models, with either coefficient mode. Physical parameters remain symbolic in both coefficient modes. See the analytic coefficient guide for exact-output conventions.
| Flag | Meaning | Default |
|---|---|---|
-p P |
Relative slow-roll order of the spectra and corrections beyond the leading consistency order: 0 for LO, 1 for NLO, 2 for N2LO, and so on. |
Required for spectra; may be inferred for a relation. |
-n N |
Tensor derivative index: 0 for the tilt, 1 for its running, 2 for its running of running, and so on. |
Inferred when p and W are supplied. |
-W W |
Absolute consistency cutoff, n, p, W for a relation. |
Inferred when n and p are supplied. |
--kinflation |
Calculate |
Canonical inflation. |
--symbolic |
Use exact analytic universal coefficients. | Numerical coefficients, without a flag. |
--closed |
Select closed background algebra and elimination. | Iterative algebra, without a flag. |
--coefficient-tolerance T |
Convergence tolerance for numerical universal coefficients; ignored with --symbolic. |
1e-10 |
--simplify |
Collect display factors; numerical output can also recognize simple fractions. | No optional simplification. |
--format FORMAT |
Output as text, latex or yaml. |
text |
--output PATH |
Save the output to a file; its parent directory must exist. | Print to the terminal. |
--version |
Show the installed version and exit. | — |
-h, --help
|
Show the available command-line options and exit. | — |
-
Canonical spectra at N5LO:
SRI -p 5
-
The same spectra for k-inflation:
SRI -p 5 --kinflation
-
Tensor running of running with N2LO corrections (
$n=2$ ,$p=2$ ,$W=5$ ), including both spectra:SRI -n 2 -p 2
-
The same relation with exact coefficients, closed algebra, simplification and YAML export:
SRI -n 2 -p 2 --symbolic --closed --simplify --format yaml --output relation.yaml
See the CLI guide for further details.
The Python interface returns SymPy expressions:
from sri import spectra, consistency
power = spectra(p=2, symbolic=True)
relation = consistency(n=2, p=2, method="closed", symbolic=True)
print(power.scalar)
print(power.tensor)
print(relation.expression)Use kinflation=True for a new spectra(p=2, kinflation=True, symbolic=True). Use symbolic=False (default) for numerical universal coefficients and method="iterative" (default) for iterative algebra. See the Python API guide for numerical evaluation and additional methods.
- 01 — Spectra: calculate scalar and tensor spectra at low order, select the algebra and coefficient modes, and evaluate the expressions numerically.
-
02 — Consistency relations: calculate a relation at
$n=2$ ,$p=2$ , infer orders, and usesimplify. - 03 — Archived results: read saved spectra, consistency relations and coefficients from YAML without rerunning their calculations.
- Universal coefficients: inspect exact analytic coefficients and their saved numerical values.
Open the notebooks in Jupyter or a notebook-capable editor using the environment in which SRI is installed. See the notebook guide for setup and formula-display options.
| Printed symbol | Definition |
|---|---|
P_s |
Scalar power spectrum. |
P_t |
Tensor power spectrum, both polarizations. |
H |
Hubble rate. |
Mpl |
Reduced Planck mass. |
epsilon_1 |
|
epsilon_j |
|
r |
|
alpha_0^s |
Scalar tilt |
alpha_n^s |
|
alpha_0^t |
Tensor tilt |
alpha_n^t |
|
c_s |
Scalar sound speed. |
c_t |
Tensor propagation speed; |
alpha_0^cs |
|
alpha_n^cs |
|
C |
|
EulerGamma |
Euler–Mascheroni constant |
Chi((j_1,...,j_m)) |
Exact universal coefficient |
pi |
|
log |
Natural logarithm. |
zeta(q) |
Riemann zeta function |
n |
Tensor derivative index. |
p |
Relative slow-roll correction order. |
W |
Absolute cutoff |
O(SR^q) |
Remainder starting at slow-roll weight |
The common reference is x=-k*eta=1, where k is the comoving wavenumber and eta is conformal time. For c_s and its derivatives refer to this same tensor reference; tau in the scalar-reference metadata is acoustic conformal time,
Text and YAML formulas use * for multiplication and ** for powers. The suffixes ^s, ^t and ^cs label the sector in derivative names.
- Canonical inflation: scalar and tensor spectra and consistency relations through N10LO.
- k-inflation: the corresponding results through N10LO with variable scalar sound speed.
- Universal coefficients: all 138 coefficients through slow-roll weight ten, with exact expressions and saved analytic and independent numerical values.
Spectra and consistency relations are available as PDF, LaTeX and YAML; universal coefficients are stored in YAML. Each collection's README lists the available orders and explains how to read and reuse the results.
- Universal coefficients: independent analytic and mode-equation determinations agree for all 138 coefficients through weight ten, including 67 mixed patterns. See the coefficient comparisons.
-
Known spectra: comparisons through N3LO include canonical spectra and a direct
$k$ -inflation comparison with the Bianchi–Gamonal analytic results. See the canonical checks and direct literature comparison. - Physical mode equations: exact Hankel limits and independent integrations on nonconstant backgrounds check spectral amplitudes, normalization and the sound-speed reference-scale translation. See the validation guide.
-
Iterative and closed methods: complete comparisons cover
$p=0,\ldots,4$ and$n=0,\ldots,3$ for canonical inflation, and$p=0,\ldots,3$ with the same derivative indices for$k$ -inflation. - Background elimination: exact forward-substitution checks cover all 64 published consistency relations, 32 per model. The coverage guide lists their orders and saved results.
-
LO derivative hierarchy: symbolic comparisons through
$n=8$ and exact rational and finite-field checks through$n=1000$ test high derivative orders separately from high slow-roll orders. See the large-$n$ checks.
Run package tests (pytest required):
python -m pytest -q testsRegenerate and compare all coefficients through weight 10:
python validation/symbolic_coefficients/run.py --orders 8 9 10 --family-seconds 0 --order-seconds 0 --freshWarning
Full coefficient reproduction through weight 10 can take several hours.
See the validation guide for details and saved reports.
-
source/— Implementation of thesripackage: CLI, background variables, spectra, consistency relations and polynomial algebra. -
utils/— Reusable helpers for archived formulas, notebook display and export algebra. -
scripts/— Commands to export equation documents, create YAML archives and inspect scientific validation coverage. -
notebooks/— The three numbered usage notebooks for spectra, consistency relations and archived results. -
results/— Published spectra, consistency relations and universal coefficients. -
validation/— Scientific checks, independent references, reproducible notebooks and saved reports. -
tests/— Automated tests of the public interfaces, algebra, physical calculations, output formats and archive readers. -
docs/— Detailed installation, CLI, Python API, module, analytic-coefficient and validation guides.
If you use this code or results in your research, please cite:
W. Giarè, Slow-Roll Inflation at Arbitrary Order, arXiv:2610.28608.
BibTeX
@article{Giare:2026ger,
author = "Giar{\`e}, William",
title = "{Slow-Roll Inflation at Arbitrary Order}",
eprint = "2610.28608",
archivePrefix = "arXiv",
primaryClass = "astro-ph.CO",
month = "10",
year = "2026",
url = "https://arxiv.org/abs/2610.28608"
}The BibTeX entry is also provided in CITATION.bib.