ABSTRACT (original article): Determining the active screening mechanism from a general scalar-tensor Lagrangian remains a challenging problem. As a diagnostic tool, we present a systematic study of nonlinear cosmological perturbations in luminal Horndeski theories. Working in the α-basis on a flat FLRW background, we derive and organise the full set of unapproximated second-order perturbation equations, and systematically apply the quasi-static and weak-field limits. We find that second-order effects modify only the scalar field equation. We derive, for static and spherically symmetric configurations, a master screening equation recovering the Vainshtein and Chameleon mechanisms. We also identify a novel regime, which we term Phaedrus screening, characterised by a screening radius that scales linearly with the source mass. For each mechanism, we derive analytical and numerical solutions and clarify the conditions under which they activate. Finally, we introduce two new publicly available software packages: (i) xAlpha, a Mathematica package to compute and organise perturbation equations in scalar-tensor theories, and (ii) escut, a Python module to solve the nonlinear scalar equation. In many cases, these tools enable the identification of the active screening type directly from a luminal Horndeski Lagrangian. CITATION (original article): Sergi Sirera, Tessa Baker, James Hallam, Krishna Naidoo (2026), A Master Equation for Screening in Luminal Horndeski Gravity, arXiv:2605.04154. https://doi.org/10.48550/arXiv.2605.04154
This is the companion notebook to the paper https://arxiv.org/pdf/2605.04154.
In this notebook, we employ the package xAlpha ( https://github.com/sergisl/xAlpha ) to compute the equations of motion in a luminal Horndeski scalar-tensor theory for a FLRW cosmological background to quadratic order in perturbations. We then classify and organise all the terms in these equations and express them in terms of the alpha parameters and their derivatives.
This notebook employs: - xAct ( http://www.xact.es/ ) - xPand ( https://www2.iap.fr/users/pitrou/xpand.htm ) - xAlpha ( http://github.com/sergisl/xAlpha )
If you use any of the results or techniques in this notebook please cite the repository and the corresponding papers.
If you have any comments or feedback please let me know. Thanks!

0. Setup and definitions


1. Theory and background equations of motion

Action

Here we define all contributions to the reduced Horndeski Lagrangian.
In[]:=
LT=Sqrt[-Detg[]](KK[φ[LI[0],LI[0]],X[]]-G3[φ[LI[0],LI[0]],X[]]Scalar[CD[b]@CD[-b]@φ[LI[0],LI[0]]]+G4[φ[LI[0],LI[0]]]RicciScalarCD[])
Out[]=
-

~
g
K
​
φ
,X+
G
4

​
φ
R[∇]-
G
3

​
φ
,X
b
∇
∇
b
​
φ


Background EOMs

We here apply the variational principle to derive the metric and scalar equations of motion.
In[]:=
1
Sqrt[-Detg[]]
VarD[g[b,c],CD][LT/.Xtoφ//NoScalar]//Simplification;​​metricEOMs=(SortCovDs[ContractMetric[%,g],CD]/.HorndeskiDerivativeReplacements1//Simplification)-(*8π*)1/2*T[-b,-c]
Out[]=
1
2
-
​
Pu
(
g
b
c
+
u
b
u
c
)-
u
b
u
c
​
ρu
+
1
2
2
G
4

​
φ

R[∇]
b
c
-
G
3 X

​
φ
,X
∇
a
∇
c
​
φ
a
∇
​
φ
∇
b
​
φ
-
G
3 X

​
φ
,X
∇
a
∇
b
​
φ
a
∇
​
φ
∇
c
​
φ
+2
G
3 φ

​
φ
,X
∇
b
​
φ
∇
c
​
φ
-2
G
4 φφ

​
φ

∇
b
​
φ
∇
c
​
φ
-
K
X

​
φ
,X
∇
b
​
φ
∇
c
​
φ
+
G
3 X

​
φ
,X
∇
a
a
∇
​
φ
∇
b
​
φ
∇
c
​
φ
-2
G
4 φ

​
φ

∇
c
∇
b
​
φ
-
g
b
c
K
​
φ
,X+
G
4

​
φ
R[∇]-2
G
4 φ

​
φ

∇
a
a
∇
​
φ
+
G
3 φ

​
φ
,X
∇
a
​
φ
a
∇
​
φ
-2
G
4 φφ

​
φ

∇
a
​
φ
a
∇
​
φ
-
G
3 X

​
φ
,X
a
∇
​
φ
∇
d
∇
a
​
φ
d
∇
​
φ

In[]:=
1
2Sqrt[-Detg[]]
VarD[φ[],CD][LT/.Xtoφ//NoScalar]//Simplification;​​scalarEOM=ContractMetric[SortCovDs[%,CD],g]/.HorndeskiDerivativeReplacements1//Simplification
Out[]=
1
2
2
(
δ
0
0
)

K
φ

​
φ
,X+
G
4 φ

​
φ
R[∇]-2
G
3 φ

​
φ
,X
∇
a
a
∇
​
φ
+
K
X

​
φ
,X
∇
a
a
∇
​
φ
-
G
3 φφ

​
φ
,X
∇
a
​
φ
a
∇
​
φ
+
K
φX

​
φ
,X
∇
a
​
φ
a
∇
​
φ
-
G
3 X

​
φ
,X
∇
a
a
∇
​
φ
∇
b
b
∇
​
φ
-
G
3 φX

​
φ
,X
∇
a
​
φ
a
∇
​
φ
∇
b
b
∇
​
φ
+
G
3 X

​
φ
,X
R[∇]
a
b
a
∇
​
φ
b
∇
​
φ
+2
G
3 φX

​
φ
,X
a
∇
​
φ
∇
b
∇
a
​
φ
b
∇
​
φ
-
K
XX

​
φ
,X
a
∇
​
φ
∇
b
∇
a
​
φ
b
∇
​
φ
+
G
3 X

​
φ
,X
∇
b
∇
a
​
φ
b
∇
a
∇
​
φ
+
G
3 XX

​
φ
,X
a
∇
​
φ
∇
b
∇
a
​
φ
b
∇
​
φ
∇
c
c
∇
​
φ
-
G
3 XX

​
φ
,X
a
∇
​
φ
b
∇
​
φ
∇
c
∇
b
​
φ
c
∇
∇
a
​
φ

We now evaluate these fully covariant expressions on a FLRW background.
In[]:=
metricEOMsBackground=(-2*MyToxPand[metricEOMs/.Xtoφ,"NewtonGauge",0])/.phidotToX/.HorndeskiDerivativeReplacements1;​​ExtractComponents[metricEOMsBackground,h]​​metricEOMsBackground00=ExtractComponents[metricEOMsBackground,h,{"Time","Time"}];​​metricEOMsBackgroundij=ExtractComponents[metricEOMsBackground,h,{"Space","Space"}];​​metricEOMsBackgroundTraceij=
1
3*ah[LI[0],LI[0]]^2
ContractMetric[metricEOMsBackgroundij*h[b,c],h]//Simplify;
Out[]=
​
n
h
n
-6
G
4

​
φ

2
​
H
-K
​
φ
,X-2
G
3 φ

​
φ
,XX+2
K
X

​
φ
,XX+
​
ρu
-6
G
4 φ

​
φ

​
H

φ
+6
G
3 X

​
φ
,X
​
H
X

φ
0
h
0
6
2
​
a
G
4

​
φ

-
h
b
c
2
​
H
+4
2
​
a
G
4

​
φ

-
h
b
c

H
+
2
​
a
-
h
b
c
K
​
φ
,X+
2
​
a
-
h
b
c
​
Pu
-2
2
​
a
G
3 φ

​
φ
,X
-
h
b
c
X+4
2
​
a
G
4 φφ

​
φ

-
h
b
c
X+4
2
​
a
G
4 φ

​
φ

-
h
b
c
​
H

φ
+2
2
​
a
G
4 φ

​
φ

-
h
b
c
..
φ
-2
2
​
a
G
3 X

​
φ
,X
-
h
b
c
X
..
φ
In[]:=
scalarEOMBackground=-2*MyToxPand[scalarEOM/.Xtoφ,"NewtonGauge",0]/.{delta[-LI[0],LI[0]]->1}/.phidotToX/.HorndeskiDerivativeReplacements1
Out[]=
-26
G
4 φ

​
φ

2
​
H
+3
G
4 φ

​
φ


H
+
1
2
K
φ

​
φ
,X+
G
3 φφ

​
φ
,XX-9
G
3 X

​
φ
,X
2
​
H
X-3
G
3 X

​
φ
,X

H
X-
K
φX

​
φ
,XX+3
G
3 φ

​
φ
,X
​
H

φ
-
3
2
​
H
K
X

​
φ
,X

φ
-3
G
3 φX

​
φ
,X
​
H
X

φ
+
G
3 φ

​
φ
,X
..
φ
-
1
2
K
X

​
φ
,X
..
φ
+
G
3 φX

​
φ
,XX
..
φ
-
K
XX

​
φ
,XX
..
φ
-3
G
3 X

​
φ
,X
​
H

φ
..
φ
-3
G
3 XX

​
φ
,X
​
H
X

φ
..
φ
In[]:=
scalarEOMBackground=-2*MyToxPand[scalarEOM/.Xtoφ,"NewtonGauge",0]/.{delta[-LI[0],LI[0]]->1}/.phidotToX/.HorndeskiDerivativeReplacements1
Out[]=
-26
G
4 φ

​
φ

2
​
H
+3
G
4 φ

​
φ


H
+
1
2
K
φ

​
φ
,X+
G
3 φφ

​
φ
,XX-9
G
3 X

​
φ
,X
2
​
H
X-3
G
3 X

​
φ
,X

H
X-
K
φX

​
φ
,XX+3
G
3 φ

​
φ
,X
​
H

φ
-
3
2
​
H
K
X

​
φ
,X

φ
-3
G
3 φX

​
φ
,X
​
H
X

φ
+
G
3 φ

​
φ
,X
..
φ
-
1
2
K
X

​
φ
,X
..
φ
+
G
3 φX

​
φ
,XX
..
φ
-
K
XX

​
φ
,XX
..
φ
-3
G
3 X

​
φ
,X
​
H

φ
..
φ
-3
G
3 XX

​
φ
,X
​
H
X

φ
..
φ
Compute varE, varP, varS
varEexpr=varE==metricEOMsBackground00/.ρu[LI[0],LI[0]]->0​​varPexpr=varP==metricEOMsBackgroundTraceij/.Pu[LI[0],LI[0]]->0​​varSexpr=varS==scalarEOMBackground
Out[]=
ℰ-6
G
4

​
φ

2
​
H
-K
​
φ
,X-2
G
3 φ

​
φ
,XX+2
K
X

​
φ
,XX-6
G
4 φ

​
φ

​
H

φ
+6
G
3 X

​
φ
,X
​
H
X

φ
Out[]=

G
4

​
φ
6
2
​
H
+4

H
+K
​
φ
,X-2
G
3 φ

​
φ
,XX+4
G
4 φφ

​
φ
X+4
G
4 φ

​
φ

​
H

φ
+2
G
4 φ

​
φ

..
φ
-2
G
3 X

​
φ
,XX
..
φ
Out[]=
-26
G
4 φ

​
φ

2
​
H
+3
G
4 φ

​
φ


H
+
1
2
K
φ

​
φ
,X+
G
3 φφ

​
φ
,XX-9
G
3 X

​
φ
,X
2
​
H
X-3
G
3 X

​
φ
,X

H
X-
K
φX

​
φ
,XX+3
G
3 φ

​
φ
,X
​
H

φ
-
3
2
​
H
K
X

​
φ
,X

φ
-3
G
3 φX

​
φ
,X
​
H
X

φ
+
G
3 φ

​
φ
,X
..
φ
-
1
2
K
X

​
φ
,X
..
φ
+
G
3 φX

​
φ
,XX
..
φ
-
K
XX

​
φ
,XX
..
φ
-3
G
3 X

​
φ
,X
​
H

φ
..
φ
-3
G
3 XX

​
φ
,X
​
H
X

φ
..
φ
Compute all derivatives at once
derivatives=ComputeBackgroundQuantityDerivatives[varEexpr,varPexpr,varSexpr,HorndeskiDerivativeReplacements1];
Extract individual results
varEphiexpr=derivatives["varEphi"];​​varPphiexpr=derivatives["varPphi"];​​varSphiexpr=derivatives["varSphi"];​​varEphiphiexpr=derivatives["varEphiphi"];​​varEphiphiphiexpr=derivatives["varEphiphiphi"];​​varPphiphiexpr=derivatives["varPphiphi"];​​varEphiXexpr=derivatives["varEphiX"];​​varPphiXexpr=derivatives["varPphiX"];​​varEdotexpr=derivatives["varEdot"];​​varPdotexpr=derivatives["varPdot"];​​varSdotexpr=derivatives["varSdot"];​​varEddotexpr=derivatives["varEddot"];​​varPddotexpr=derivatives["varPddot"];​​varSddotexpr=derivatives["varSddot"];​​varEdddotexpr=derivatives["varEdddot"];​​varPdddotexpr=derivatives["varPdddot"];​​varEdddotexpr=derivatives["varEdddot"];​​varPdddotexpr=derivatives["varPdddot"];​​varSdddotexpr=derivatives["varSdddot"];
Solve for varE and varP
BackgroundEOMsSubs={Solve[varEexpr,varE][[1]][[1]],Solve[varPexpr,varP][[1]][[1]]};
The conservation equation is given by
In[]:=
varEdot+3Hh[LI[0],LI[0]](varE+varP)==φ[LI[0],LI[1]]varS​​varEdotexpr[[2]]+3Hh[LI[0],LI[0]](varEexpr+varPexpr)-φ[LI[0],LI[1]]varSexpr/.Solve[varEexpr,varE][[1]]/.Solve[varPexpr,varP][[1]]/.Solve[varSexpr,varS][[1]];​​%//.phidotToX//Simplify
Out[]=

ℰ
+3(ℰ+)
​
H


φ
Out[]=
True

2. Perturbations

Definitions

Set display preferences for tensor components
PrintAs[h]^="γ";​​PrintAs[ρu]^="ρ";​​PrintAs[Pu]^="P";​​PrintAs[Vshu]^="θ";​​PrintAs[Vvhu]^="v";​​PrintAs[Eth]^="h";​​$FirstOrderVectorPerturbations=False;​​$FirstOrderTensorPerturbations=False;
Define perturbation variables
Define PureSecondOrderZero in notebook context
Visualize the metric perturbation structure

Second-order equations of motion

Extracting coefficients

COLLECTION, EXTRACTION, AND VALIDATION

D1QQ

Define the set of non - shift - symmetric derivatives
Extract the Shift - Symmetric Part
Extract the Non - Shift - Symmetric Part (The Leftover)
Define shorthands for xAct variables to keep the factored equation clean
Expression appearing in paper for Non - Shift - Symmetric Part
Calculate and print the difference
Define Symbols
Define the Identities
Solve for high - order derivatives in terms of the functions above and lower - order derivatives
Apply Substitutions Sequentially
Final Simplify with X substitution
Expression appearing in paper for Shift - Symmetric Part
Calculate and print the difference

CITE THIS NOTEBOOK

A master equation for screening in Luminal Horndeski gravity​
by Sergi Sirera, Tessa Baker, James Hallam & Krishna Naidoo
Wolfram Community, STAFF PICKS, August 10, 2026
​https://community.wolfram.com/groups/-/m/t/3776785