Help with xAct Error in R^2 Model Variation Calculation

72 views
Skip to first unread message

Yerlan Myrzakulov

unread,
Apr 7, 2025, 1:48:56 PM4/7/25
to xAct Tensor Computer Algebra
Dear xAct Community,

I am working on a model with an \( R^2 \) term and a scalar field in general relativity, using xAct. My Lagrangian is defined as \( L = R + \alpha R^2 + \frac{1}{2} \nabla_a \phi \nabla^a \phi - V(\phi) \), and I am trying to compute the variations `VarAction[L, g[a, b]]` and `VarAction[L, \[Phi][]]` in general form (without a specific metric). However, I encounter the following errors:

- Join::heads: Heads IndexList and xAct`xTensor`Private`movedindices at positions 1 and 2 are expected to be the same.
- $RecursionLimit::reclim: Recursion depth of 1024 exceeded.
- Output: `TerminatedEvaluation["RecursionLimit"]` I have set up a chart (`DefChart[generalChart, M4, {x1, x2, x3, x4}, {0, 1, 2, 3}]`) and computed geometric objects (`InvertMetric[g]`, `MetricCompute[g]`, etc.), but the issue persists.

I am attaching the notebook `r2_theory_error.nb` with the full code and error output for reference. Could someone please help me identify the cause of this error and suggest a solution? Any advice would be greatly appreciated!

Could someone please help me identify the cause of this error and suggest a solution? Any advice would be greatly appreciated!
r2_theory_error.nb

Juan Margalef

unread,
Apr 11, 2025, 7:42:07 PM4/11/25
to xAct Tensor Computer Algebra
Hi  Yerlan,

You need to define ALL the objects appearing in the Lagrangian:

DefTensor[\[Phi][], M4]
DefScalarFunction[V]
DefConstantSymbol[\[Alpha]]

As a side note, DefChart doesn't seem to be used in your notebook, but if you need it, load first the package xCoba and then use the proper formatting:

DefChart[generalChart, M4, {0, 1, 2, 3}, {x1[], x2[], x3[], x4[]}]
Reply all
Reply to author
Forward
0 new messages