Automating d^2 A = 0 in xTensor language

51 views
Skip to first unread message

Michael Seifert

unread,
Jun 27, 2025, 7:18:58 PMJun 27
to xAct Tensor Computer Algebra
Hey there folks,

I'm trying to do some calculations involving the stress-energy tensor of a two-form field, and as part of this I'm trying to take the divergence of the stress-energy and show that it is automatically conserved so long as the equations of motion are satisfied. As a test case, I'm trying to do similar calculations for the Maxwell field, with the following code:

Needs["xAct`xTensor`"]
Needs["xAct`xTras`"]

DefManifold[M, 4, IndexRange[a, z]]
DefMetric[-1, gmet[-a, -b], CD, PrintAs -> "g", SymbolOfCovD -> {";", "\[Del]"}]
DefTensor[A[-a], M]
DefTensor[F[-a, -b], M, Antisymmetric[{-a, -b}]]
DefTensor[T[-a, -b], M, Symmetric[{-a, -b}]]
DefTensor[maxeqn[-a, -b], M, Antisymmetric[{-a, -b}]]

IndexSet[F[a_, b_], CD[a][A[b]] - CD[b][A[a]]]
IndexSet[T[a_, b_], F[c, a] F[-c, b] - 1/4 gmet[a, b] F[c, d] F[-c, -d]]
IndexSet[maxeqn[a_], CD[c][F[-c, a]]]

foo = CD[a][T[-a, -b]] + F[a, -b] maxeqn[-a]
foo // ContractMetric // Simplification

This should yield zero identically, but instead it yields a term proportional to \nabla_[a \nabla_b A_c].  This quantity is always zero (it's the tensor language equivalent of d(dA)  for differential forms) but xTensor does not recognize it as such.  Is there an easy way to get it to do so?

Juan Margalef

unread,
Jun 30, 2025, 6:19:36 AMJun 30
to xAct Tensor Computer Algebra
The problem is that the required symmetry is a multiterm symmetry, and there are no known algorithms to canonicalize them in general. In this case, it is equivalent to the Bianchi identity, and I thought FullSimplification would work:


foo = CD[a][T[-a, -b]] + F[a, -b] maxeqn[-a];
foo // FullSimplification[]

but it does not. According to the documentation, "FullSimplification[][expr] tries to simplify expr as much as possible, taking Bianchi identities into account and sorting covariant derivatives" but maybe it only takes into account the contracted Bianchi identities. You can check the code to see what it does or maybe Teake might chip in. You can also take a look at the new TInvar package (https://groups.google.com/g/xAct/c/dl79OFhtkBc), which I haven't had time to check yet.

In any case, here you have two xAct solutions to your question:

1. 

foo = CD[a][T[-a, -b]] + F[a, -b] maxeqn[-a];
foo // ContractMetric // Simplification // ChangeCovD //
 ToCanonical

2.

foo = CD[a][T[-a, -b]] + F[a, -b] maxeqn[-a];
foo // ContractMetric // Simplification // SortCovDs //
  ChangeCurvature // ToCanonical

In both examples, ToCanonical will complain about using PD, which is not compatible with the metric. You can solve that either by adding //Quiet at the end (which simply hides the messages) or, better, by adding the option UseMetricOnVBundle -> None:


foo = CD[a][T[-a, -b]] + F[a, -b] maxeqn[-a];
foo // ContractMetric // Simplification // ChangeCovD //
 ToCanonical[#, UseMetricOnVBundle -> None] &

Thomas Bäckdahl

unread,
Jun 30, 2025, 6:32:53 AMJun 30
to xa...@googlegroups.com
Hi!

Multi-term symmetries are not fully implemented for general tensors in xAct. However, to solve your problem, there are enough functions implemented in xTras.

You can try

ToCanonical@RiemannYoungProject@SortCovDs@ToCanonical@ContractMetric@foo

You can of course also transform everything into spinor language. In that case the tools are much more complete.

Regards
Thomas
--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xact/39f448e5-6e22-45d7-83c2-bbd67c40dea2n%40googlegroups.com.

Barry Wardell

unread,
Jul 3, 2025, 5:39:41 PMJul 3
to Thomas Bäckdahl, xa...@googlegroups.com
Hi ,

Just to add that TInvar (like Invar before it) only knows about the Bianchi identity for the Riemann tensor. You're interested in the identity for a two-form. It would be possible to implement this using the same methods as for the Riemann tensor but it has not yet been implemented.

Regards,
Barry

Reply all
Reply to author
Forward
0 new messages