I want to compute the functional derivative with respect to a partial derivative of the metric with the mathematica package xAct.
This is what I have tried so far:
DefManifold[M, 4, IndexRange[a, z]]
DefMetric[-1, met[-a, -b], CD, PrintAs -> "g", CurvatureRelations -> True]
Ctil[a_, b_, c_, d_, e_, f_] := RiemannCD[-a, -b, -c, -d] epsilonmet[a, b, -e, -f] RiemannCD[e, f, c,d]
DefTensor[pdg[-x, -y, -z], M, Symmetric[{1, 2, 3}]]
L2b = Ctil[g, h, i, j, k, l] // RiemannToChristoffel//ChristoffelToGradMetric
L2b = L2b /. PD[-a__][met[-b__, -c__]] :> pdg[-a, -b, -c]
VarDL2b = VarL[pdg[-x, -y, -z], CD][L2b] // FullSimplification[] // CollectTensors
and the errors that I am getting are of the type: IndexForm: Attempting to apply IndexForm on <<2>> and ToCanonical: Unknown expression not canonicalized