<<xAct`xPert`

DefManifold[M,4,{a,b,c,d,e,f,h,i,j,k,l}]
DefMetric[-1,g[-a,-b],CD]

DefMetricPerturbation[g,gpert,ϵ]
PrintAs[gpert]^="h"

Unprotect[IndexForm]
IndexForm[LI[x_]]:=ColorString[ToString[x],RGBColor[0,0,1]]
Protect[IndexForm]

DefTensor[n[a],M]
DefTensorPerturbation[Pertn[LI[order]],n[a],M,PrintAs→"δn"]

DefTensor[v[a],M]
DefTensorPerturbation[Pertn[LI[order]],v[a],M,PrintAs→"δv"]

DefTensor[Q[a,b],M]
DefTensorPerturbation[Pertn[LI[order]],Q[a,b],M,PrintAs→"δQ"]

AutomaticRules[n,MakeRule[{n[a] n[-a],-1}]]
AutomaticRules[n,MakeRule[{g[-a,-b] n[a] n[b],-1}]]

L1=Perturbed[Sqrt[g[-a,-b]v[a]v[b]],1]/.Perturbation[v[_],1]-> 0//ExpandPerturbation

L2=Perturbation[WeylCD[-c,-d,-e,-f]n[d]n[f]Q[c,e],2]/.{Perturbation[n[_],1]-> 0,Perturbation[n[_],2]-> 0, Perturbation[Q[__],1]-> 0, Perturbation[Q[__],2]-> 0}//ExpandPerturbation

L=L1 L2//Expand//ContractMetric//ToCanonical

DefMetric[{3,1,0},Mink[-a,-b],PD,{",","∂"},FlatMetric->True,PrintAs-> "η"]

(*var1=VarD[gpert[LI[1],-a,-b],CD][L]/.delta[-LI[1],LI[1]]→1//Simplify//Expand//ContractMetric//ToCanonicalP*)

gtoη=Join[MakeRule[{g[-a,-b],Mink[-a,-b]},MetricOn-> None,ContractMetrics-> False],MakeRule[{g[a,b],InvMink[a,b]},MetricOn-> None,ContractMetrics-> False]]

L;
SeparateMetric[]/@%;
ChangeCurvature/@%;
ChangeCovD[#,CD,PD]&/@%;
ChristoffelToGradMetric/@%;
%//.gtoη;
Expand/@%;
ContractMetric/@%;
ToCanonical[#,UseMetricOnVBundle-> None]&/@%;
Lflat=Simplify/@%

Lflat1=Lflat/.ϵ-> 1