The problem was that this setting was incorrect because the RHS of the rule requires a vbundle, not a metric. This was breaking the canonicalization algorithm.
SetOptions[ToCanonical,UseMetricOnVBundle->g];
In fact, when working with partial derivatives of the metric, it is better not to allow metric lowering and raising of indices.
Load packages
Load packages
<<xAct`xTensor`
Configuration
Configuration
$PrePrint=ScreenDollarIndices;$RiemannSign=-1;
SetOptions[ToCanonical,UseMetricOnVBundle->{}];SetOptions[ContractMetric,OverDerivatives->True];
Initialize fundamental quantities
Initialize fundamental quantities
(*Dimensionofthemanifold*)DefConstantSymbol[dim];$Assumptions=dim>2;
(*Manifold*)DefManifold[M,dim,Join[IndexRange[a,e],IndexRange[i,n]]];
(*Lorentzianmetric*)DefMetric[-1,g[-a,-b],lc];
(*Metricaffinecovariantderivative*)DefCovD[cd[-a],Torsion->True,{"|",""}];
Initialize additional tensors
Initialize additional tensors
(*Torsionvector*)DefTensor[T[-a],M];
T
a
(**)DefTensor[f[-a],M];
f
a
(*Shifttensor*)DefTensor[S[a,-b,-c],M,Symmetric[{-b,-c}]];
a
S
bc
Define tensors
Define tensors
(*Shifttensor:=+-*)IndexSet[S[a_,-b_,-c_],g[a,-b]f[-c]+g[a,-c]f[-b]-g[-b,-c]f[a]];
a
S
bc
a
δ
b
f
c
a
δ
c
f
b
g
bc
a
f
(*Metricaffineconnection:=++*)rule=IndexRuleChristoffelcd[a_,-b_,-c_],Christoffellc[a,-b,-c]+T[-b]g[a,-c]+S[a,-b,-c];
a
Γ
bc
a
{
bc
1
D-1
T
b
a
δ
c
1
D-2
a
S
bc
1
dim-1
1
dim-2
Compute curvature related quantities
Compute curvature related quantities
Riemann:
Riemanncd[-c,-d,-b,a]-Riemannlc[-c,-d,-b,a]//RiemannToChristoffel
-
+
+
-
+
-
-
+
Γ[] |
|
Γ[] |
|
Γ[] |
|
Γ[] |
|
Γ[▽] |
|
Γ[▽] |
|
Γ[▽] |
|
Γ[▽] |
|
∂
c
Γ[] |
|
∂
c
Γ[▽] |
|
∂
d
Γ[] |
|
∂
d
Γ[▽] |
|
%/.rule//ContractMetric//Simplification
-
+
-
+
+
-
-
+
+
+
-
-
-
+
+
-
+
+
-
-
+
-
Γ[▽] |
|
f |
|
-2+dim
Γ[▽] |
|
f |
|
-2+dim
δ |
|
f |
|
f |
|
2
(-2+dim)
δ |
|
f |
|
f |
|
2
(-2+dim)
Γ[▽] |
|
δ |
|
f |
|
-2+dim
Γ[▽] |
|
δ |
|
f |
|
-2+dim
f |
|
f |
|
g |
|
2
(-2+dim)
Γ[▽] |
|
f |
|
g |
|
-2+dim
δ |
|
f |
|
f |
|
g |
|
2
(-2+dim)
f |
|
f |
|
g |
|
2
(-2+dim)
Γ[▽] |
|
f |
|
g |
|
-2+dim
δ |
|
f |
|
f |
|
g |
|
2
(-2+dim)
g |
|
∂
c
f |
|
-2+dim
δ |
|
∂
c
f |
|
-2+dim
δ |
|
∂
c
f |
|
-2+dim
f |
|
∂
c
g |
|
-2+dim
δ |
|
∂
c
T |
|
-1+dim
g |
|
∂
d
f |
|
-2+dim
δ |
|
∂
d
f |
|
-2+dim
δ |
|
∂
d
f |
|
-2+dim
f |
|
∂
d
g |
|
-2+dim
δ |
|
∂
d
T |
|
-1+dim
Ricci :
delta[-a,d]%//ContractMetric//Simplification
-+
-
-
+-+
-++
+
-
-
-
++
(-1+dim)
Γ[▽] |
|
f |
|
-2+dim
Γ[▽] |
|
f |
|
-2+dim
Γ[▽] |
|
f |
|
-2+dim
Γ[▽] |
|
f |
|
-2+dim
2
f |
|
f |
|
2
(-2+dim)
dim
f |
|
f |
|
2
(-2+dim)
Γ[▽] |
|
f |
|
g |
|
-2+dim
2
f |
|
f |
|
g |
|
2
(-2+dim)
dim
f |
|
f |
|
g |
|
2
(-2+dim)
g |
|
∂
a
f |
|
-2+dim
f |
|
∂
a
g |
|
-2+dim
∂
b
f |
|
-2+dim
∂
b
T |
|
-1+dim
∂
c
f |
|
-2+dim
dim
∂
c
f |
|
-2+dim
∂
c
T |
|
-1+dim
Ricci scalar:
g[b,c]%//ContractMetric//Simplification
1
-2+dim
Γ[▽] |
|
f |
|
Γ[▽] |
|
f |
|
Γ[▽] |
|
f |
|
Γ[▽] |
|
f |
|
Γ[▽] |
|
f |
|
f |
|
f |
|
f |
|
f |
|
∂
a
f |
|
∂
a
f |
|
f |
|
g |
|
∂
a
g |
|
f |
|
g |
|
∂
c
g |
|
f |
|
g |
|
∂
c
g |
|
%//ChristoffelToGradMetric//ContractMetric//Simplification
(-1+dim)(
+2
+
)
f |
|
f |
|
∂
a
f |
|
f |
|
g |
|
∂
a
g |
|
-2+dim