<<xACT`xTensor`

<<xACT`xPert`

<<xACT`xTras`

DefManifold[M4,4,{a,b,c,d,e,i,j,k,l,m,n,p}]

DefMetricPerturbation/.Options@DefMetric

DefMetric[-1,g[-a,-b], CD,{";","∇"}]

LagHatRicci:= g[a,b]RicciCD[-a,-b]

LagHatRicci

LagRicci:=Sqrt[-Detg[]]*g[a,b]RicciCD[-a,-b]

LagRicci

eom1:=VarD[g[a,b],CD][LagRicci]

eom1/Sqrt[-Detg[]]==0//ContractMetric

eom2:=VarL[g[a,b],CD][LagHatRicci]

eom2 ==0// ContractMetric

DefConstantSymbol[Λ]

LagHatCosmo := LagHatRicci - 2*Λ

LagCosmo:= Sqrt[-Detg[]]*(LagHatRicci - 2*Λ)

eom3:= VarD[g[-a,-b],CD][LagCosmo]

eom3/Sqrt[-Detg[]]==0//ContractMetric

eom4:= VarL[g[-a,-b],CD][LagHatCosmo]

eom4==0//ContractMetric