Hi Max,
Indeed, xPert is not trained to handle VBundle metrics (they were introduced after xPert was released, and I guess it has not been updated). You can use:
DefMetricVBundlePerturbation[g, h, \[Epsilon]]
where DefMetricVBundlePerturbation is simply DefMetricPerturbation, but removing the parts related to the CovD (that throws the error of your notebook that makes DefMetricPerturbation halt):
DefMetricVBundlePerturbation[metric_, pert_Symbol, param_Symbol : Automatic,options___?OptionQ] :=Module[{vbundle, manifold, indices, pa},
{pa} = {PrintAs} /. CheckOptions[options] /. Options[DefMetricPerturbation];
(* Check of metric *)
If[! MetricQ[metric],Throw@Message[DefMetricPerturbation::unknown, "metric", metric]];
(* Define parameter if it does not exist yet *)
If[! ParameterQ[param],
If[param === Automatic,
DefParameter[GiveSymbol[PerturbationParameter, metric],PrintAs :> GiveOutputString[PerturbationParameter, metric]],
DefParameter[param]
]
];
vbundle = VBundleOfMetric[metric];
manifold = BaseOfVBundle[vbundle];
indices = GetIndicesOfVBundle[vbundle, 2];
DefTensorPerturbation[pert[LI["order"], -indices[[1]], -indices[[2]]],metric[-indices[[1]], -indices[[2]]],DependenciesOfTensor[metric], Symmetric[{2, 3}], PrintAs -> pa];
$PerturbationParameter = param;
(* Define perturbation definitions *)
Unprotect[Perturbation, GeneralPerturbation];
With[{a = indices[[1]], b = indices[[2]]},
xAct`xPert`Private`DefGenPertInvMetric[vbundle, metric[a, b],pert];
xAct`xPert`Private`DefGenPertDet[vbundle, metric, pert];
xAct`xPert`Private`DefGenPertInvMetric[vbundle, metric[a, b],pert];
];
Protect[Perturbation, GeneralPerturbation];
];
More elegant would be to modify xPert so that the same function DefMetricPerturbation handles both cases, but this solution should be good enough, and I hope this helps!