This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

xPPN: An implementation of the parametrized post-Newtonian formalism using xAct for Mathematica

Manuel Hohmann manuel.hohmann@ut.ee Laboratory of Theoretical Physics, Institute of Physics, University of Tartu, W. Ostwaldi 1, 50411 Tartu, Estonia
Abstract

We present a package for the computer algebra system Mathematica, which implements the parametrized post-Newtonian (PPN) formalism. This package, named xPPN, is built upon the widely used tensor algebra package suite xAct, and in particular the package xTensor therein. The main feature of xPPN is to provide functions to perform a proper 3+13+1 decomposition of tensors, as well as a perturbative expansion in so-called velocity orders, which are central tasks in the PPN formalism. Further, xPPN implements various rules for quantities appearing in the PPN formalism, which aid in perturbatively solving the field equations of any metric theory of gravity. Besides Riemannian geometry, also teleparallel and symmetric teleparallel geometry are implemented.

I Introduction

The parametrized post-Newtonian (PPN) formalism Nordtvedt (1968); Thorne and Will (1971); Will (1971a, b, 1993, 2014, 2018) is an indispensable tool for testing the viability of gravity theories. It is used to characterize any given theory of gravity by a set of ten parameters, which are closely related to the phenomenological properties of the theory under consideration. This allows to compare the parameters which are obtained theoretical through the PPN formalism with their values measured in experiments within the solar system and related physical settings.

In order for the PPN formalism to be applicable, the gravity theory under consideration must satisfy a number of assumptions. The most important is the existence of a metric governing the motion of test bodies, which can be described by a perturbation around a flat Minkowski background. Another assumption concerns the source of gravity, which is chosen to be a fluid satisfying the covariant conservation of energy-momentum, encoded in the Euler equations of fluid dynamics. Further, it is assumed that the field equations are of second derivative order, or can be brought into this form, so that their solution take a known standard form in terms of particular Poisson-like integrals over the source matter distribution.

In order to determine the post-Newtonian limit of a given gravity theory, one must perform a 3+13+1 split of its field equations (which are, in general, tensor equations) into space and time components, and then perform a perturbative expansion around a fixed vacuum solution. Depending on the structure of the field equations, both tasks may be challenging to perform by hand, and so the use of computer algebra comes as a useful tool. Due to the common assumptions on which the PPN formalism is based, and the similar steps to be applied to different theories of gravity, it appears natural to implement these common tasks into a general computational tool, which can then be used to calculate the post-Newtonian limit for any given theory. A number of functions to achieve this has already been implemented in Maple Puetzfeld (2006). The aim of xPPN Hohmann (2020a) is to provide another implementation, based on a more extensive framework for performing tensor calculations.

A very powerful tensor algebra software is the xTensor package, which is part of the xAct suite of Mathematica packages Martín-García (2002). It comes with numerous functions to define and manipulate tensorial expressions, and includes concepts such as induced metrics on hypersurfaces orthogonal to a vector field, or component calculations in xCoba, which can be used to achieve a 3+13+1 split of tensorial expressions. The former is employed, for example, for cosmological perturbation theory in the xPand package Pitrou et al. (2013), in conjunction with the xPert package Brizuela et al. (2009) for general tensor perturbations. It thus appears natural to follow a similar approach to implement also the PPN formalism in xAct. However, the latter comes with a few peculiarities which obstruct this strategy. The main difficulty lies in the different treatment of space and time in the PPN formalism, such as assigning different perturbation orders to space and time components of tensors. Another, albeit smaller issue is the different convention for counting the perturbation orders in xPert and the PPN formalism.

Even though it is possible to implement the PPN formalism also using the existing functionality mentioned above, it appears simpler to overcome the aforementioned difficulties by using a different approach both to the 3+13+1 split and the perturbative expansion, without using the induced metric framework or the xCoba and xPert packages. This is the approach followed by xPPN. The key idea is to complement every tensor defined on the spacetime manifold by a number of tensors on a purely spatial manifold, which additionally depend on an external time parameter, and which represent the separated time and space components of the original spacetime tensor. Also derivatives are split into spatial derivatives and derivatives with respect to the time parameter. This approach allows an essentially different treatment of perturbations for space and time components. The aim of this article is to present this approach, as well as the implementation of the PPN formalism which is based on this framework.

This article is structured as follows. We start with a brief review of the PPN formalism and its extensions implemented by xPPN in section II. The general concepts on which this implementation is based are explained in section III. The main functionality of xPPN is laid out in section IV, where we display the geometric objects defined by xPPN, and section V, where we explain the functions provided for the common operations on tensor expressions. A complete usage example is given in section VI, which shows how to calculate the PPN parameters of a simple scalar-tensor theory of gravity. A summary and outlook towards possible future extensions are given in section VII. For further reference, we provide notes on the implementation and internal operation of xPPN in appendix A.

In order to make code listings more readable, the following syntax highlighting is used. Mathematica keywords are typeset in blue, xAct keywords are typeset in green and xPPN keywords are typeset in red. We use lowercase letters for coordinate indices and uppercase letters for Lorentz indices, where in both cases Greek indices run from 0 to 33 and belong to spacetime, while Latin indices run from 11 to 33 and belong to space only.

II Parametrized post-Newtonian formalism

The aim of the xPPN package is to provide an implementation of the parametrized post-Newtonian (PPN) formalism and several of its geometric extensions. Here we briefly summarize these theoretical foundations. We first discuss the standard PPN formalism and the perturbative expansion of the metric in section II.1. An extended formulation using a tetrad as the fundamental field instead of the metric is shown in section II.2. We then display its application to teleparallel gravity in section II.3 and symmetric teleparallel gravity in section II.4.

II.1 Standard formalism for Riemannian geometry

There exist different versions of the PPN formalism. Here we adhere to its form presented in Will (1993). Its starting point is the assumption that the propagation of light and massive test bodies is governed by a pseudo-Riemannian metric gαβg_{\alpha\beta} of Lorentzian signature. This metric is further considered in a weak field limit as an asympotically flat perturbation around a flat Minkowski background. The source of this perturbation is assumed to be of compact support and modeled by the energy-momentum tensor

Θαβ=(ρ+ρΠ+p)uαuβ+pgαβ\Theta^{\alpha\beta}=(\rho+\rho\Pi+p)u^{\alpha}u^{\beta}+pg^{\alpha\beta} (1)

of a perfect fluid with four-velocity uαu^{\alpha}, rest energy density ρ\rho, specific internal energy Π\Pi and pressure pp. Further, a fixed Cartesian coordinate system (xα)=(t,xa)(x^{\alpha})=(t,x^{a}) is used, denoted as the universe rest frame. It is then assumed that the velocity va=ua/u0v^{a}=u^{a}/u^{0} of the source matter in this coordinate system is small compared to the speed of light, |va|c1|v^{a}|\ll c\equiv 1. This velocity takes the role of the perturbation parameter. Physical quantities, such as the metric, are expanded in terms of the source velocity, and any term in this perturbative expansion which is proportional to |va|n|v^{a}|^{n} is said to be of nn’th velocity order, which is commonly denoted 𝒪(n)\mathcal{O}(n) in the literature111Note in particular that 𝒪(1)|v|\mathcal{O}(1)\sim|v| in this notation is the first velocity order, and not unity, which would be 𝒪(0)1\mathcal{O}(0)\sim 1.. For the metric gαβg_{\alpha\beta}, this expansion may be written explicitly in the form

gαβ=n=0g𝑛αβ=g0αβ+g1αβ+g2αβ+g3αβ+g4αβ+𝒪(5),g_{\alpha\beta}=\sum_{n=0}^{\infty}\accentset{n}{g}_{\alpha\beta}=\accentset{0}{g}_{\alpha\beta}+\accentset{1}{g}_{\alpha\beta}+\accentset{2}{g}_{\alpha\beta}+\accentset{3}{g}_{\alpha\beta}+\accentset{4}{g}_{\alpha\beta}+\mathcal{O}(5)\,, (2)

where we used overscripts to indicate velocity orders g𝑛αβ𝒪(n)\accentset{n}{g}_{\alpha\beta}\sim\mathcal{O}(n). Terms beyond the fourth velocity order are usually not considered in the standard PPN formalism implemented by xPPN. The zeroth velocity order is assumed to be the flat Minkowski background,

g0αβ=ηαβ=diag(1,1,1,1).\accentset{0}{g}_{\alpha\beta}=\eta_{\alpha\beta}=\mathrm{diag}(-1,1,1,1)\,. (3)

For the metric perturbations, one finds that the first velocity order vanishes, g1αβ=0\accentset{1}{g}_{\alpha\beta}=0, since the lowest velocity order of the matter source is the second order, as we will argue below. Further, the components g20a,g300,g3ab,g40a\accentset{2}{g}_{0a},\accentset{3}{g}_{00},\accentset{3}{g}_{ab},\accentset{4}{g}_{0a} change their sign under time reversal, and are prohibited by energy-momentum conservation. It follows that only the components

g200,g2ab,g30a,g400,g4ab\accentset{2}{g}_{00}\,,\quad\accentset{2}{g}_{ab}\,,\quad\accentset{3}{g}_{0a}\,,\quad\accentset{4}{g}_{00}\,,\quad\accentset{4}{g}_{ab} (4)

are non-vanishing. For the first four terms, a particular standard gauge is assumed, in which the metric components take the form

g200\displaystyle\accentset{2}{g}_{00} =2U,\displaystyle=2U\,, (5a)
g2ab\displaystyle\accentset{2}{g}_{ab} =2γUδab,\displaystyle=2\gamma U\delta_{ab}\,, (5b)
g30a\displaystyle\accentset{3}{g}_{0a} =12(3+4γ+α1α2+ζ12ξ)Va12(1+α2ζ1+2ξ)Wa,\displaystyle=-\frac{1}{2}(3+4\gamma+\alpha_{1}-\alpha_{2}+\zeta_{1}-2\xi)V_{a}-\frac{1}{2}(1+\alpha_{2}-\zeta_{1}+2\xi)W_{a}\,, (5c)
g400\displaystyle\accentset{4}{g}_{00} =2βU2+(2+2γ+α3+ζ12ξ)Φ1+2(1+3γ2β+ζ2+ξ)Φ2\displaystyle=-2\beta U^{2}+(2+2\gamma+\alpha_{3}+\zeta_{1}-2\xi)\Phi_{1}+2(1+3\gamma-2\beta+\zeta_{2}+\xi)\Phi_{2}
+2(1+ζ3)Φ3+2(3γ+3ζ42ξ)Φ42ξΦW(ζ12ξ)𝒜.\displaystyle\phantom{=}+2(1+\zeta_{3})\Phi_{3}+2(3\gamma+3\zeta_{4}-2\xi)\Phi_{4}-2\xi\Phi_{W}-(\zeta_{1}-2\xi)\mathcal{A}\,. (5d)

For the last term g4ab\accentset{4}{g}_{ab} no such expansion is assumed in the standard PPN formalism, but it may be included in an extended formalism Richter and Matzner (1982a, b). The terms on the right hand side are the so-called PPN potentials and PPN parameters; see sections IV.6 and IV.7 for their definition and Will (1993) for a physical explanation. Here the PPN potentials describe the matter distribution, and their form is independent of the theory under consideration, while the PPN parameters are independent of the matter distribution, and their values are determined by the gravity theory. In order to determine the values of the PPN parameters for a given gravity theory, one follows a well-defined procedure to expand the gravitational field equations into velocity orders, which are then solved successively, up to the fourth order. The virtue of the PPN formalism is the fact that this form of the metric is sufficiently generic to solve the metric field equations of a large number of gravity theories, in which the source of gravity is the matter energy-momentum. In order to obtain this solution, one must also decompose the energy-momentum tensor (1) into space and time components, as well as into velocity orders. For the matter variables, one assigns the orders ρΠ𝒪(2)\rho\sim\Pi\sim\mathcal{O}(2) and p𝒪(4)p\sim\mathcal{O}(4), based on their order of magnitude in the solar system. Lowering the indices of the energy-momentum tensor, its components then take the form

Θ00\displaystyle\Theta_{00} =ρ(1+Π+|v|2g200)+𝒪(6),\displaystyle=\rho\left(1+\Pi+|v|^{2}-\accentset{2}{g}_{00}\right)+\mathcal{O}(6)\,, (6a)
Θ0a\displaystyle\Theta_{0a} =ρva+𝒪(5),\displaystyle=-\rho v_{a}+\mathcal{O}(5)\,, (6b)
Θab\displaystyle\Theta_{ab} =ρvavb+pδab+𝒪(6).\displaystyle=\rho v_{a}v_{b}+p\delta_{ab}+\mathcal{O}(6)\,. (6c)

Further, one assumes that the gravitational field is quasi-static, which means that it changes only due to the motion of the source matter, excluding, e.g., transient gravitational waves. Hence, time derivatives of all physical quantities are weighted with an additional velocity order, 0𝒪(1)\partial_{0}\sim\mathcal{O}(1). In particular, this affects derivatives of the metric, which enter the field equations through the Levi-Civita connection

Γγ=αβ12gγδ(αgδβ+βgαδδgαβ)\accentset{\circ}{\Gamma}^{\gamma}{}_{\alpha\beta}=\frac{1}{2}g^{\gamma\delta}(\partial_{\alpha}g_{\delta\beta}+\partial_{\beta}g_{\alpha\delta}-\partial_{\delta}g_{\alpha\beta}) (7)

and its curvature tensor. Here and in the following, we denote terms related to the Levi-Civita connection with an empty circle, in order to distinguish them from other connections to be introduced later, following the standard convention in the literature on teleparallel and related gravity theories, where this distinction becomes relevant; note that this circle is a distinct symbol from a zero denoting the zeroth velocity order.

II.2 Tetrad extension

There exist numerous gravity theories in which one of the fundamental fields is a tetrad (or coframe) field θΓα\theta^{\Gamma}{}_{\alpha}, which defines the metric via the relation

gαβ=ηΓΔθΓθΔα,βg_{\alpha\beta}=\eta_{\Gamma\Delta}\theta^{\Gamma}{}_{\alpha}\theta^{\Delta}{}_{\beta}\,, (8)

where ηΓΔ=diag(1,1,1,1)\eta_{\Gamma\Delta}=\mathrm{diag}(-1,1,1,1) is again the Minkowski metric, here with Lorentz indices. Its post-Newtonian expansion can be obtained as follows Nitsch and Hehl (1980); Smalley (1980); Hayward (1981). Its zeroth order is given by a diagonal background tetrad,

θ0Γ=αΔΓ=αdiag(1,1,1,1).\accentset{0}{\theta}^{\Gamma}{}_{\alpha}=\Delta^{\Gamma}{}_{\alpha}=\mathrm{diag}(1,1,1,1)\,. (9)

defined in the previous section. For any higher order terms θ𝑘Γα\accentset{k}{\theta}^{\Gamma}{}_{\alpha} in its perturbative expansion, it turns out to be more convenient to work with the expressions Ualikhanova and Hohmann (2019); Hohmann (2021)

τ𝑘αβ=ηαγΔΓθ𝑘Γγ,β\accentset{k}{\tau}_{\alpha\beta}=\eta_{\alpha\gamma}\Delta_{\Gamma}{}^{\gamma}\accentset{k}{\theta}^{\Gamma}{}_{\beta}\,, (10)

which carry only spacetime indices, where

ΔΓ=αdiag(1,1,1,1)\Delta_{\Gamma}{}^{\alpha}=\mathrm{diag}(1,1,1,1) (11)

is the inverse background tetrad. While it is entirely possible to use the perturbations τ𝑘αβ\accentset{k}{\tau}_{\alpha\beta} as fundamental variables, it turns out to be more convenient to decompose them into metric perturbations and another, independent degree of freedom. This can be achieved by noting that the metric perturbations follow from the relation (8) to be given by

g𝑛αβ=ηΓΔk=0nθ𝑘ΓθnkΔα=βηγδk=0nτ𝑘γατnkδβ.\accentset{n}{g}_{\alpha\beta}=\eta_{\Gamma\Delta}\sum_{k=0}^{n}\accentset{k}{\theta}^{\Gamma}{}_{\alpha}\accentset{n-k}{\theta}^{\Delta}{}_{\beta}=\eta^{\gamma\delta}\sum_{k=0}^{n}\accentset{k}{\tau}_{\gamma\alpha}\accentset{n-k}{\tau}_{\delta\beta}\,. (12)

Hence, the nn’th order metric perturbation encodes g𝑛αβ\accentset{n}{g}_{\alpha\beta} the symmetric part 2τ𝑛(αβ)2\accentset{n}{\tau}_{(\alpha\beta)} of the tetrad perturbation, up to lower order terms. Isolating the highest orders from the sum on the right hand side, we find that this symmetric part is given by

τ𝑛αβ+τ𝑛βα=g𝑛αβηγδk=1n1τ𝑘γατnkδβ.\accentset{n}{\tau}_{\alpha\beta}+\accentset{n}{\tau}_{\beta\alpha}=\accentset{n}{g}_{\alpha\beta}-\eta^{\gamma\delta}\sum_{k=1}^{n-1}\accentset{k}{\tau}_{\gamma\alpha}\accentset{n-k}{\tau}_{\delta\beta}\,. (13)

For the antisymmetric part, which constitute the aforementioned independent degree of freedom, one may define another, antisymmetric tensor field by

a𝑛αβ=2τ𝑛[αβ]=τ𝑛αβτ𝑛βα.\accentset{n}{a}_{\alpha\beta}=2\accentset{n}{\tau}_{[\alpha\beta]}=\accentset{n}{\tau}_{\alpha\beta}-\accentset{n}{\tau}_{\beta\alpha}\,. (14)

In summary, the perturbative orders θ𝑛Γα\accentset{n}{\theta}^{\Gamma}{}_{\alpha} of the tetrad for n1n\geq 1 are then defined as

θ𝑛Γ=α12ηβγΔΓ(g𝑛γα+a𝑛γαηΔΘk=1n1θ𝑘ΔθnkΘγ)αβ\accentset{n}{\theta}^{\Gamma}{}_{\alpha}=\frac{1}{2}\eta^{\beta\gamma}\Delta^{\Gamma}{}_{\beta}\left(\accentset{n}{g}_{\gamma\alpha}+\accentset{n}{a}_{\gamma\alpha}-\eta_{\Delta\Theta}\sum_{k=1}^{n-1}\accentset{k}{\theta}^{\Delta}{}_{\gamma}\accentset{n-k}{\theta}^{\Theta}{}_{\alpha}\right) (15)

in terms of g𝑛αβ\accentset{n}{g}_{\alpha\beta} and a𝑛αβ\accentset{n}{a}_{\alpha\beta}. Following a similar line of argument as for the metric, the only non-vanishing components of the antisymmetric tensor up to the fourth velocity order which must be considered are given by

a2ab,a30a,a4ab.\accentset{2}{a}_{ab}\,,\quad\accentset{3}{a}_{0a}\,,\quad\accentset{4}{a}_{ab}\,. (16)

Note finally that the tetrad θΓα\theta^{\Gamma}{}_{\alpha} comes also with an inverse, the frame field eΓαe_{\Gamma}{}^{\alpha}. It follows from its relation with the coframe field that its background is the diagonal element e0Γ=αΔΓα\accentset{0}{e}_{\Gamma}{}^{\alpha}=\Delta_{\Gamma}{}^{\alpha}, while higher perturbation orders are recursively defined as

e𝑛Γ=αΔΓk=0n1βe𝑘ΔθnkΔα,β\accentset{n}{e}_{\Gamma}{}^{\alpha}=-\Delta_{\Gamma}{}^{\beta}\sum_{k=0}^{n-1}\accentset{k}{e}_{\Delta}{}^{\alpha}\accentset{n-k}{\theta}^{\Delta}{}_{\beta}\,, (17)

where the tetrad perturbations on the right hand side are further expanded using the rule (15).

II.3 Teleparallel geometry

The tetrad and its perturbative expansion discussed above play a fundamental role as the dynamical field variable in a particular class of gravity theories known as teleparallel gravity Aldrovandi and Pereira (2013). In their covariant formulation Krssak et al. (2019), another fundamental field variable is used, which is the spin connection ωΓΔα\accentset{\bullet}{\omega}^{\Gamma}{}_{\Delta\alpha}. Together with the tetrad and its inverse, it defines another connection, whose coefficients are given by222Here we follow the convention used by xTensor, in which the first lower index α\alpha on the connection coefficients Γγαβ\accentset{\bullet}{\Gamma}^{\gamma}{}_{\alpha\beta} is the “derivative” index.

Γγ=αβeΓ(αθΓ+βωΓθΔΔα)βγ.\accentset{\bullet}{\Gamma}^{\gamma}{}_{\alpha\beta}=e_{\Gamma}{}^{\gamma}\left(\partial_{\alpha}\theta^{\Gamma}{}_{\beta}+\accentset{\bullet}{\omega}^{\Gamma}{}_{\Delta\alpha}\theta^{\Delta}{}_{\beta}\right)\,. (18)

The spin connection is further restricted to be flat and antisymmetric, so that also the affine connection has vanishing curvature and is metric-compatible,

αΓγβδβΓγ+αδΓγΓλαλβδΓγΓλβλ=αδ0,γgαβ=0,\partial_{\alpha}\accentset{\bullet}{\Gamma}^{\gamma}{}_{\beta\delta}-\partial_{\beta}\accentset{\bullet}{\Gamma}^{\gamma}{}_{\alpha\delta}+\accentset{\bullet}{\Gamma}^{\gamma}{}_{\alpha\lambda}\accentset{\bullet}{\Gamma}^{\lambda}{}_{\beta\delta}-\accentset{\bullet}{\Gamma}^{\gamma}{}_{\beta\lambda}\accentset{\bullet}{\Gamma}^{\lambda}{}_{\alpha\delta}=0\,,\quad\accentset{\bullet}{\nabla}_{\gamma}g_{\alpha\beta}=0\,, (19)

but it possesses non-vanishing torsion. Under these conditions, the spin connection turns out to be a gauge quantity, so that one can locally choose a Lorentz gauge in which it vanishes, known as the Weitzenböck gauge Golovnev et al. (2017). Choosing this gauge, ωΓΔα0\accentset{\bullet}{\omega}^{\Gamma}{}_{\Delta\alpha}\equiv 0, the connecting coefficients (18) are expressed in terms of the tetrad and its inverse alone Ualikhanova and Hohmann (2019). This allows to derive their perturbative expansion, and the perturbative expansion of any derived tensor fields, in terms of the perturbations (15) and (17), and hence in terms of g𝑛αβ\accentset{n}{g}_{\alpha\beta} and a𝑛αβ\accentset{n}{a}_{\alpha\beta}.

II.4 Symmetric teleparallel geometry

Finally, the third class of gravity theories discussed here has become known as symmetric teleparallel gravity theories Nester and Yo (1999). In these theories yet another connection is employed, whose coefficients we denote by Γ×γαβ\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\beta}, and which is assumed to have vanishing curvature and torsion,

αΓ×γβδβΓ×γ+αδΓ×γΓ×λαλβδΓ×γΓ×λβλ=αδ0,Γ×γαβΓ×γ=βα0.\partial_{\alpha}\accentset{\times}{\Gamma}^{\gamma}{}_{\beta\delta}-\partial_{\beta}\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\delta}+\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\lambda}\accentset{\times}{\Gamma}^{\lambda}{}_{\beta\delta}-\accentset{\times}{\Gamma}^{\gamma}{}_{\beta\lambda}\accentset{\times}{\Gamma}^{\lambda}{}_{\alpha\delta}=0\,,\quad\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\beta}-\accentset{\times}{\Gamma}^{\gamma}{}_{\beta\alpha}=0\,. (20)

It follows from these properties that there exists a local coordinate system (xα)(x^{\prime\alpha}), called the coincident gauge, such that its connection coefficients Γ×γαβ\accentset{\times}{\Gamma}^{\prime\gamma}{}_{\alpha\beta} in this coordinate system vanish Jiménez et al. (2018). Hence, in the standard PPN coordinate system (xα)(x^{\alpha}), the connection coefficients are given by

Γ×γ=αβxγxδxδxαxβ.\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\beta}=\frac{\partial x^{\gamma}}{\partial x^{\prime\delta}}\frac{\partial x^{\prime\delta}}{\partial x^{\alpha}\partial x^{\beta}}\,. (21)

The post-Newtonian expansion of these connection coefficients is derived from the assumption that the two coordinate systems (xα)(x^{\alpha}) and (xα)(x^{\prime\alpha}) are related by an infinitesimal coordinate transformation, induced by a vector field ξα\xi^{\alpha}, so that up to the quadratic order one can write

xα=xα+ξα+12ξββξα+x^{\prime\alpha}=x^{\alpha}+\xi^{\alpha}+\frac{1}{2}\xi^{\beta}\partial_{\beta}\xi^{\alpha}+\ldots (22)

From this assumption follows that the connection coefficients take the form

Γ×γ=αβαβξγ+12(ξδαβδξγ+2(αξδβ)δξγαβξδδξγ)+,\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\beta}=\partial_{\alpha}\partial_{\beta}\xi^{\gamma}+\frac{1}{2}\left(\xi^{\delta}\partial_{\alpha}\partial_{\beta}\partial_{\delta}\xi^{\gamma}+2\partial_{(\alpha}\xi^{\delta}\partial_{\beta)}\partial_{\delta}\xi^{\gamma}-\partial_{\alpha}\partial_{\beta}\xi^{\delta}\partial_{\delta}\xi^{\gamma}\right)+\ldots\,, (23)

also up to the quadratic order in the vector field ξα\xi^{\alpha}. Finally, the vector field is expanded in velocity orders. It turns out that in the PPN formalism the only non-vanishing components are given by Flathmann and Hohmann (2021)

ξ2a,ξ30,ξ4a.\accentset{2}{\xi}^{a}\,,\quad\accentset{3}{\xi}^{0}\,,\quad\accentset{4}{\xi}^{a}\,. (24)

From these components the perturbative expansion of the connection coefficients Γ×γαβ\accentset{\times}{\Gamma}^{\gamma}{}_{\alpha\beta} is obtained.

III Mathematical foundation

Two fundamental mathematical concepts form the basis of the PPN formalism detailed in the previous section, and so their implementation is an important part of any computational tool to address this formalism. Here we briefly discuss these concepts and their formulation we choose to implement in xPPN. This will serve as an explanation of the mathematical background for the following sections. We discuss the split of tensors on spacetime into their space and time parts in section III.1 and the perturbative expansion into velocity order in section III.2.

III.1 3+13+1 split of tensors

As explained in the previous section, one of the crucial steps in applying the PPN formalism is the 3+13+1 decomposition of all tensorial quantities. A proper, geometric interpretation of this split can be given by regarding the spacetime manifold M4M_{4}, equipped with coordinates (xα)=(t,xa)(x^{\alpha})=(t,x^{a}), as a product manifold M4T1×S3M_{4}\cong T_{1}\times S_{3}, where tt is the time coordinate on the manifold T1T_{1}\cong\mathbb{R}, while (xa)(x^{a}) are the spatial coordinates on S3S_{3}. It follows that for every tT1t\in T_{1}, one can find a map it:S3M4,(xa)(t,xa)i_{t}:S_{3}\to M_{4},(x^{a})\mapsto(t,x^{a}), whose image in M4M_{4} is called the spatial slice, or constant time hypersurface at time tt. The collection of all spatial slices then forms a foliation of M4M_{4}.

While the construction appears abstract, it gives a clear interpretation of the 3+13+1 split of tensor fields as follows. A vector field with components XαX^{\alpha} on M4M_{4} splits in the form

Xαα=X00+XaaX^{\alpha}\partial_{\alpha}=X^{0}\partial_{0}+X^{a}\partial_{a} (25)

into a temporal part X00X^{0}\partial_{0}, which is parallel to the coordinate lines generated by the time coordinate tt, and a spatial part XaaX^{a}\partial_{a}, which is tangent to the spatial hypersurfaces. Under purely spatial coordinate transformations, X0X^{0} behaves as a scalar, while XaX^{a} are the components of a vector field. For any fixed value of tt, we may thus take the pullback along iti_{t} to obtain a scalar function itX0i_{t}^{*}X^{0}, as well as a vector field it(Xaa)i_{t}^{*}(X^{a}\partial_{a}), both now being tensor fields on S3S_{3}, hence functions of the spatial coordinates (xa)(x^{a}). The dependence of the components XαX^{\alpha} on the time coordinate tt is still present as a dependence on the choice of the spatial hypersurface, and tt is regarded as a parameter which corresponds to this choice, instead of a coordinate.

The interpretation of time tt as a parameter instead of a coordinate is, of course, purely mathematical, but it allows for a number of simplification when it comes to the implementation of the 3+13+1 split in computer algebra. Most importantly for the PPN formalism, it allows to treat time derivatives 0\partial_{0} essentially differently from spatial derivatives a\partial_{a}. This is necessary, because in the PPN formalism time derivatives are weighted with an additional velocity order, which is not the case for spatial derivatives. Another advantage becomes apparent when considering tensors with symmetries. For example, considering an antisymmetric tensor field AαβA_{\alpha\beta}, the 3+13+1 split can be written as

Aαβdxαdxβ=A00dtdt+A0adtdxa+Aa0dxadt+Aabdxadxb,A_{\alpha\beta}\mathrm{d}x^{\alpha}\otimes\mathrm{d}x^{\beta}=A_{00}\mathrm{d}t\otimes\mathrm{d}t+A_{0a}\mathrm{d}t\otimes\mathrm{d}x^{a}+A_{a0}\mathrm{d}x^{a}\otimes\mathrm{d}t+A_{ab}\mathrm{d}x^{a}\otimes\mathrm{d}x^{b}\,, (26)

where A00=0A_{00}=0 and A0a=Aa0A_{0a}=-A_{a0}. Hence, the independent components can be described by a single covector field A0aA_{0a} and antisymmetric tensor field AabA_{ab} on S3S_{3}. Thus, the use of tensor symmetries in conjunction with the 3+13+1 split allows to immediately discard vanishing components, which helps to simplify the calculation.

The outlined interpretation of the 3+13+1 split and the decomposition of tensor fields on spacetime M4M_{4} into tensor fields on space S3S_{3}, with an additional parameter dependence, and corresponding counting of velocity orders, are a central ingredient of xPPN. In section V.1 we explain how to select certain components from the 3+13+1 decomposition of a tensor field, while section V.3 shows how to decompose arbitrary tensorial expressions. The implementation of these operations is outlined in appendix A.1, which shows the internal representation of decomposed tensor fields, while in section A.2 we schematically explain the decomposition algorithm and its treatment of tensor symmetries.

III.2 Perturbative expansion in velocity orders

Another important ingredient of the PPN formalism is the perturbative expansion of tensor fields into velocity orders. Similarly to the expansion (2) for the metric, also any other tensor field AA is expanded as

A=n=0A𝑛,A=\sum_{n=0}^{\infty}\accentset{n}{A}\,, (27)

where each term is of the corresponding velocity order A𝑛𝒪(n)\accentset{n}{A}\sim\mathcal{O}(n), and where we omit tensor indices for brevity. Note that this is different from the convention used, e.g., in the xPert package Brizuela et al. (2009), where the perturbative expansion takes the form

A=n=0εnn!Δn[A],A=\sum_{n=0}^{\infty}\frac{\varepsilon^{n}}{n!}\Delta^{n}[A]\,, (28)

and thus has the explicit form of a Taylor expansion in the perturbation parameter ε\varepsilon. We therefore list a few formulas which follow from the perturbative expansion (27). Most notably, for a tensor A=A1ANA=A_{1}\cdots A_{N} given as a product of NN tensors A1,,ANA_{1},\ldots,A_{N}, one has the nn’th order term given by

A𝑛=k1++kN=ni=1NAiki,\accentset{n}{A}=\sum_{k_{1}+\ldots+k_{N}=n}\prod_{i=1}^{N}\accentset{k_{i}}{A_{i}}\,, (29)

where the orders kik_{i} of the factors AiA_{i} run over non-negative integers. Another important relation is the expansion of expressions F=f(A)F=f(A), where ff is a scalar, or more general a tensorial function. In this case a Taylor expansion of the function ff around the background A0\accentset{0}{A} is used,

f(A)=k=0(AA0)kk!f(k)(A0),f(A)=\sum_{k=0}^{\infty}\frac{\left(A-\accentset{0}{A}\right)^{k}}{k!}f^{(k)}\left(\accentset{0}{A}\right)\,, (30)

where f(k)f^{(k)} denotes the kk’th derivative, and then the product formula (29) is applied. For a function of NN arguments, this formula naturally generalizes to

f(A1,,AN)=k1=0kN=0f(k1,,kN)(A01,,A0N)i=1N(AiA0i)kiki!.f(A_{1},\ldots,A_{N})=\sum_{k_{1}=0}^{\infty}\cdots\sum_{k_{N}=0}^{\infty}f^{(k_{1},\ldots,k_{N})}\left(\accentset{0}{A}_{1},\ldots,\accentset{0}{A}_{N}\right)\prod_{i=1}^{N}\frac{\left(A_{i}-\accentset{0}{A}_{i}\right)^{k_{i}}}{k_{i}!}\,. (31)

Finally, time derivatives are weighted with an additional velocity order, and so for A=0AA^{\prime}=\partial_{0}A one has

A𝑛=0An1,\accentset{n}{A}^{\prime}=\partial_{0}\accentset{n-1}{A}\,, (32)

and analogously for higher derivative orders, where the left hand side is to be understood as the nn’th order term in the expansion of AA^{\prime}.

In xPPN, the perturbative expansion of tensor fields into velocity orders, which takes into account the rules outlined above, is implemented in the function VelocityOrder, which is explained in detail in section V.4. A few notes on the implementation of this function are given in appendix A.3.

IV Geometric objects defined by xPPN

The PPN formalism relies on the existence of a number of objects, such as the spacetime manifold, the physical metric and its background value, as well as a particular set of potentials and constant parameters, which are necessary for its application to any gravity theory. For convenience, these objects are already defined by xPPN when the package is loaded, so that the user must define only those additional geometric objects which are specific to the gravity theory under consideration. Here we give an overview of these pre-defined objects. The manifolds corresponding to the split of spacetime into space and time, as well as a number of bundles over these manifolds, are given in section IV.1. To define tensors on these manifolds and write tensorial expressions, xAct relies on indices; section IV.2 lists the indices defined by xPPN for the given bundles. The geometric objects constituting the background geometry are listed in section IV.3, while section IV.4 gives a detailed account of the dynamical geometry and its perturbative expansion. The energy-momentum tensor and its expansion in fluid variables is shown in section IV.5. Finally, the objects constituting the standard PPN metric are the PPN potentials detailed in section IV.6 and the PPN parameters listed in section IV.7.

IV.1 Manifolds and bundles

Tensors in xTensor are defined with respect to a manifold. In order to implement the 3+13+1 decomposition discussed in section III.1, xPPN defines three manifolds:

  1. 1.

    MfTime is the one-dimensional time manifold T1T_{1}.

  2. 2.

    MfSpace is the three-dimensional space manifold S3S_{3}. All tensors for which the 3+13+1 split into time and space components has been carried out are defined on this manifold, with an additional dependence on the time parameter TimePar.

  3. 3.

    MfSpacetime is the four-dimensional spacetime manifold M4T1×S3M_{4}\cong T_{1}\times S_{3}. It is defined as a product manifold, so that sums over tensor indices of M4M_{4} may automatically be decomposed into sums over T1T_{1} and S3S_{3}. All geometric objects which appear in the theory under consideration should be defined on this manifold.

Each of these manifolds is canonically equipped with a tangent bundle; xTensor defines these automatically, and they are named TangentMfTime, TangentMfSpace and TangentMfSpacetime, respectively, and denoted by prefixing the manifold symbol with 𝕋\mathbb{T}. In addition, xPPN defines another vector bundle over each of these three manifolds, whose rank is the same as the dimension of the manifold, and which is used to define quantities carrying Lorentz indices. These bundles are named LorentzMfTime, LorentzMfSpace and LorentzMfSpacetime, respectively, and denoted by prefixing the manifold symbol with 𝕃\mathbb{L}.

IV.2 Indices

Indices play an important role in xTensor, since they are used to denote tensor expressions and establish the relation between tensor slots and vector bundles. Often a large number of indices is necessary for longer tensor expressions, and each of them must be defined as a symbol (possibly with an appended number). xPPN addresses this problem by pre-defining a large number of indices using symbols which are unlikely to collide with other notation. In particular, the following indices are defined:

  1. 1.

    LI[0] is used by xPPN to denote the time component of the 3+13+1 decomposed forms of tensors, and is printed as 0. From the viewpoint of xTensor, this is a label index, which is not associated with any vector bundle and has no implied meaning. It is used because 3+13+1 decompositions are defined on S3S_{3}, and so only spatial indices can be associated with the tangent bundle. Also it may appear an arbitrary number of times and in any position in any tensor expression.

  2. 2.

    \[ScriptT] (printed as 𝓉\mathpzc{t}) is the generic index on the tangent bundle 𝕋T1\mathbb{T}T_{1}. xTensor will use this to automatically generate as many indices 𝓉1,𝓉2,\mathpzc{t}_{1},\mathpzc{t}_{2},\ldots as needed as an intermediate step when performing a 3+13+1 decomposition of indices, before replacing them with 0.

  3. 3.

    \[ScriptCapitalT] (printed as 𝒯\mathpzc{T}) is the generic index on the Lorentz bundle 𝕃T1\mathbb{L}T_{1}. It is used by xTensor in the same way as 𝓉\mathpzc{t} on 𝕋T1\mathbb{T}T_{1}.

  4. 4.

    Lowercase Latin letters a,,za,\ldots,z (character codes 97–122) are used to denote indices on 𝕋S3\mathbb{T}S_{3}. xPPN automatically defines the symbols T3a, …, T3z to denote these indices, so that there is no need for the user to manually declare any indices, while at the same time avoiding possible name conflicts and leaving single letters free for other use. The prefix “T3” is omitted when the symbol is printed in output form, so that only the index letter itself appears in printed output.

  5. 5.

    Uppercase Latin letters A,,ZA,\ldots,Z (character codes 65–90) are used to denote indices on 𝕃S3\mathbb{L}S_{3}. As for the lowercase indices listed in the previous item, xPPN defines symbols L3A, …, L3Z for these uppercase indices, and omits the prefix “L3” when printing the indices in output form.

  6. 6.

    Lowercase Greek letters α,,ω\alpha,\ldots,\omega (character codes 945–969, 977, 981, 982, 1008, 1009, 1013) are used to denote indices on 𝕋M4\mathbb{T}M_{4}. The corresponding symbols defined by xPPN are denoted T4\textalpha, …, T4\textomega.

  7. 7.

    Uppercase Greek letters A,,Ω\mathrm{A},\ldots,\Omega (character codes 913–929, 931–937) are used to denote indices on 𝕃M4\mathbb{L}M_{4}. The corresponding symbols defined by xPPN are denoted L4\textAlpha, …, L4\textOmega.

To obtain a list of pre-defined indices for any of these bundles, the xTensor command IndicesOfVBundle may be used. For example, to list all indices defined on 𝕋M4\mathbb{T}M_{4}, use:

In[]:= IndicesOfVBundle[TangentMfSpacetime]

The Mathematica command Names, together with a string pattern, may also be used to list these indices. This will give a similar result as the aforementioned command:

In[]:= Names["T4" ~~ _]

IV.3 Background geometry

xPPN automatically defines a number of geometric objects corresponding to the background geometry, around which the perturbative PPN expansion is performed. On each of the three manifolds T1,S3,M4T_{1},S_{3},M_{4} a metric, a tetrad and an inverse tetrad are defined. They are denoted as given in table 1. Each of these geometric objects is defined to be constant with respect to the partial derivative PD on its respective manifold, so that PD applied to any of these objects vanishes. Further, contractions of a tetrad and its inverse are carried out automatically, and yield the corresponding delta tensor.

Symbol Definition Manifold Indices
BkgMetricM4 ηαβ=diag(1,1,1,1)\eta_{\alpha\beta}=\mathrm{diag}(-1,1,1,1) M4M_{4} (𝕋M4,𝕋M4)(-\mathbb{T}M_{4},-\mathbb{T}M_{4})
BkgMetricS3 δab=ηab\delta_{ab}=\eta_{ab} S3S_{3} (𝕋S3,𝕋S3)(-\mathbb{T}S_{3},-\mathbb{T}S_{3})
BkgMetricT1 η00=1\eta_{00}=-1 T1T_{1} (𝕋T1,𝕋T1)(-\mathbb{T}T_{1},-\mathbb{T}T_{1})
BkgTetradM4 ΔΓ=αdiag(1,1,1,1)\Delta^{\Gamma}{}_{\alpha}=\mathrm{diag}(1,1,1,1) M4M_{4} (𝕃M4,𝕋M4)(\mathbb{L}M_{4},-\mathbb{T}M_{4})
BkgTetradS3 ΔAa\Delta^{A}{}_{a} S3S_{3} (𝕃S3,𝕋S3)(\mathbb{L}S_{3},-\mathbb{T}S_{3})
BkgTetradT1 Δ00\Delta^{0}{}_{0} T1T_{1} (𝕃T1,𝕋T1)(\mathbb{L}T_{1},-\mathbb{T}T_{1})
BkgInvTetradM4 ΔΓ=αdiag(1,1,1,1)\Delta_{\Gamma}{}^{\alpha}=\mathrm{diag}(1,1,1,1) M4M_{4} (𝕃M4,𝕋M4)(-\mathbb{L}M_{4},\mathbb{T}M_{4})
BkgInvTetradS3 ΔAa\Delta_{A}{}^{a} S3S_{3} (𝕃S3,𝕋S3)(-\mathbb{L}S_{3},\mathbb{T}S_{3})
BkgInvTetradT1 Δ00\Delta_{0}{}^{0} T1T_{1} (𝕃T1,𝕋T1)(-\mathbb{L}T_{1},\mathbb{T}T_{1})
Table 1: Background geometric objects defined by xPPN.

NB! Note that each of the background metrics is defined as the first metric on its respective manifold. Hence, it is also used by xTensor in order to raise and lower indices, such that for a vector defined as AαA^{\alpha} one has AαAα=AαAβηαβA_{\alpha}A^{\alpha}=A^{\alpha}A^{\beta}\eta_{\alpha\beta}, which can easily be verified by using the xTensor command SeparateMetric:

In[]:= DefTensor[A[T4\textalpha], {MfSpacetime}]
In[]:= ToCanonical[SeparateMetric[][A[-T4\textalpha] A[T4\textalpha]]]
Out[]= AαAβηαβA^{\alpha}A^{\beta}\eta_{\alpha\beta}

In order to raise and lower indices with the physical metric gαβg_{\alpha\beta}, the metric (as defined in the following section) must be written out explicitly.

IV.4 Dynamical geometry

The background geometry detailed above is defined independently of any gravity theory and matter configuration. This is contrasted with the dynamical geometry which we discuss next. These are the dynamical fields which are used to mediate the gravitational interaction, and which are related to the matter source by the gravitational field equations. The most important of these geometric objects is the metric, which we discuss in section IV.4.1. A similar role may be taken by the tetrad, as shown in section IV.4.2. Further, three covariant derivatives are defined, which represent the three connections used in different formulations of general relativity Jiménez et al. (2019): the Levi-Civita connection in section IV.4.3, the teleparallel connection in section IV.4.4 and the symmetric teleparallel connection in section IV.4.5.

IV.4.1 Metric

As detailed in section II.1, the central object in the PPN formalism is the metric gαβg_{\alpha\beta}, which is denoted by Met[-T4\textalpha, -T4\textbeta] in xPPN. Its inverse gαβg^{\alpha\beta} is written as InvMet[T4\textalpha, T4\textbeta]. Also here it must be emphasized that this is different from Met[T4\textalpha, T4\textbeta], which would be interpreted differently:

In[]:= ToCanonical[SeparateMetric[][Met[T4\textalpha, T4\textbeta]]]
Out[]= ηαγηβδgγδ\eta^{\alpha\gamma}\eta^{\beta\delta}g_{\gamma\delta}

A number of rules are defined for the perturbative expansion of the metric, and automatically applied when this expansion is performed. The zeroth order reduces to the background Minkowski metric (3), and so its space and time components are given by

g000=1,g00a=0,g0ab=δab.\accentset{0}{g}_{00}=-1\,,\quad\accentset{0}{g}_{0a}=0\,,\quad\accentset{0}{g}_{ab}=\delta_{ab}\,. (33)

The remaining components, up to the fourth velocity order, are set to vanish, except for the components (4), for which no further rules are defined. These must be solved for in order to determine the PPN parameters. See section V.2 for more information how to apply these rules using the function ApplyPPNRules.

IV.4.2 Tetrad

In order to implement the tetrad extension to the PPN formalism detailed in section II.2, xPPN defines the tetrad θΓα\theta^{\Gamma}{}_{\alpha} as the object Tet[L4\textGamma, -T4\textalpha], together with an appropriate set of rules to evaluate its perturbative expansion using the formula (15). The antisymmetric tensor field aαβa_{\alpha\beta} occurring in this expansion is denoted by Asym[-T4\textalpha, -T4\textbeta] in xPPN. Further, next to the tetrad, also its inverse eΓαe_{\Gamma}{}^{\alpha} is defined in xPPN, which is entered as InvTet[-L4\textGamma, T4\textalpha]. A number of automatically applied rules are defined for these inverse tetrads, so that they are contracted with tetrads if possible, and derivatives are evaluated according to

eΓθΓα=βδβα,eΓθΔα=αδΓΔ,βeΓ=αeΓeΔγβαθΔ.γe_{\Gamma}{}^{\alpha}\theta^{\Gamma}{}_{\beta}=\delta^{\alpha}_{\beta}\,,\quad e_{\Gamma}{}^{\alpha}\theta^{\Delta}{}_{\alpha}=\delta_{\Gamma}^{\Delta}\,,\quad\partial_{\beta}e_{\Gamma}{}^{\alpha}=-e_{\Gamma}{}^{\gamma}e_{\Delta}{}^{\alpha}\partial_{\beta}\theta^{\Delta}{}_{\gamma}\,. (34)

Further, perturbations of the tetrad are evaluated following the formula (17), together with expanding the tetrad perturbation using the expansion (15).

IV.4.3 Levi-Civita connection

Together with the metric Met[-T4\textalpha, -T4\textbeta], xPPN defines its unique metric-compatible, torsion-free Levi-Civita connection, whose coefficients are defined from the metric by the well-known formula (7). The corresponding covariant derivative is entered as CD[-T4\textalpha], and it is written in postfix notation using a semicolon “;”, as well as using the symbol \accentset{\circ}{\nabla} in prefix notation, to distinguish it from other covariant derivatives introduced later. xTensor automatically defines a number of tensors for any covariant derivative. Most notably are the Christoffel “tensors” ChristoffelCD[T4\textgamma, -T4\textalpha, -T4\textbeta], which are defined as the difference between the connection coefficients Γγαβ\accentset{\circ}{\Gamma}^{\gamma}{}_{\alpha\beta} and the (vanishing) coefficients of a fiducial connection associated to the partial derivatives α\partial_{\alpha} with respect to the coordinates. Further, xTensor defines a number of curvature tensors, such as the Riemann, Ricci, Einstein and Weyl tensors. xPPN defines the corresponding perturbative expansions in terms of the metric perturbations for all tensor fields derived from the covariant derivative CD[-T4\textalpha].

IV.4.4 Teleparallel connection

In order to work with teleparallel gravity theories, as discussed in section II.3, xPPN defines also the teleparallel connection (18), along with its torsion tensor and their perturbative expansion. The corresponding covariant derivative is entered as FD[-T4\textalpha], and is denoted \accentset{\bullet}{\nabla} in prefix notation and a bar “|” in postfix notation. Working in the Weitzenböck gauge implies that the connection coefficients ChristoffelFD[T4\textgamma, -T4\textalpha, -T4\textbeta] take the simple form

Γγ=αβeΓαγθΓ,β\accentset{\bullet}{\Gamma}^{\gamma}{}_{\alpha\beta}=e_{\Gamma}{}^{\gamma}\partial_{\alpha}\theta^{\Gamma}{}_{\beta}\,, (35)

and their perturbative expansion is defined accordingly.

IV.4.5 Symmetric teleparallel connection

Finally, to accommodate the PPN formalism for symmetric teleparallel theories of gravity shown in section II.4, xPPN provides yet another pre-defined connection, which is characterized by vanishing torsion and curvature, but which is not compatible with the metric gμνg_{\mu\nu}. Its covariant derivative is entered as ND[-T4\textalpha] and denoted by the symbol ×\accentset{\times}{\nabla} in prefix notation, and a hash “#” in postfix notation. The perturbative expansion (23) of its connection coefficients is expressed in terms of a vector field ξα\xi^{\alpha}, which is defined under the name Xi[T4\textalpha] in xPPN. Its perturbative expansion is implemented such that the only non-vanishing components are the three components (24). Also for this connection, xAct automatically defines torsion and curvature tensors, but both are set to vanish identically. The only tensorial quantity describing this connection and its relation to the Levi-Civita connection is the nonmetricity, which is given by

Qαβγ=×αgβγ.Q_{\alpha\beta\gamma}=\accentset{\times}{\nabla}_{\alpha}g_{\beta\gamma}\,. (36)

In xPPN, the nonmetricity is called NonMet[-T4\textalpha, -T4\textbeta, -T4\textgamma], and its perturbative expansion is obtained from the definition above.

IV.5 Energy-momentum variables

In the PPN formalism it is assumed that the source of gravity is the energy-momentum tensor Θαβ\Theta_{\alpha\beta} of a perfect fluid (1), which defined by xPPN is a tensor on M4M_{4} denoted by EnergyMomentum[-T4\textalpha, -T4\textbeta]. Note that it is defined with lower indices. In order to raise the indices, the physical metric gαβg_{\alpha\beta} must be used explicitly; implicitly raising the indices by writing EnergyMomentum[T4\textalpha, T4\textbeta] would use the background metric ηαβ\eta_{\alpha\beta}, and hence not give the correct result. Also note that we use the symbol Θ\Theta instead of the more conventional TT in order to avoid confusion with the torsion tensor.

For convenience, xPPN also defines the trace-reversed energy-momentum tensor

Θ¯αβ=Θαβ12gαβgγδΘγδ,\bar{\Theta}_{\alpha\beta}=\Theta_{\alpha\beta}-\frac{1}{2}g_{\alpha\beta}g^{\gamma\delta}\Theta_{\gamma\delta}\,, (37)

denoted by TREnergyMomentum[-T4\textalpha, -T4\textbeta], and which is likewise defined as a tensor on M4M_{4}.

In order to describe the 3+13+1 split of the energy-momentum tensor and its decomposition into velocity orders, xPPN further defines the following tensors on S3S_{3} depending on TimePar, which represent the variables describing the perfect fluid:

  1. 1.

    Density[] is the rest mass density ρ𝒪(2)\rho\sim\mathcal{O}(2).

  2. 2.

    Pressure[] is the pressure p𝒪(4)p\sim\mathcal{O}(4).

  3. 3.

    InternalEnergy[] is the specific internal energy Π𝒪(2)\Pi\sim\mathcal{O}(2).

  4. 4.

    Velocity[T3a] is the velocity va𝒪(1)v^{a}\sim\mathcal{O}(1).

When the energy-momentum tensor Θαβ\Theta_{\alpha\beta} is expanded in velocity orders as shown in section V.4, the relations

Θ200=ρ,Θ400=ρ(Π+|v|2g200),Θ30a=ρva,Θ4ab=ρvavb+pδab,\accentset{2}{\Theta}_{00}=\rho\,,\quad\accentset{4}{\Theta}_{00}=\rho\left(\Pi+|v|^{2}-\accentset{2}{g}_{00}\right)\,,\quad\accentset{3}{\Theta}_{0a}=-\rho v_{a}\,,\quad\accentset{4}{\Theta}_{ab}=\rho v_{a}v_{b}+p\delta_{ab}\,, (38)

which follow directly from the expansion (6), are applied, while all other components vanish.

IV.6 Post-Newtonian potentials

The post-Newtonian potentials are a central ingredient to the PPN formalism. In xPPN they are defined as tensors on the space manifold S3S_{3} with an additional time dependence. Most of them are scalars, but there are also vector and tensor potentials, which therefore carry indices in the tangent bundle 𝕋S3\mathbb{T}S_{3}. In particular, the following PPN potentials are defined:

  1. 1.

    PotentialChi[] is the post-Newtonian superpotential

    χ(t,x)=d3xρ(t,x)|xx|.\chi(t,\vec{x})=-\int\mathrm{d}^{3}x^{\prime}\rho(t,\vec{x}^{\prime})|\vec{x}-\vec{x}^{\prime}|\,. (39)
  2. 2.

    PotentialU[] is the Newtonian potential

    U(t,x)=d3xρ(t,x)|xx|.U(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|}\,. (40)
  3. 3.

    PotentialUU[-T3a, -T3b] is the anisotropic potential

    Uab(t,x)=d3xρ(t,x)|xx|3(xaxa)(xbxb)=χ,ab12χδab.U_{ab}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|^{3}}(x_{a}-x_{a}^{\prime})(x_{b}-x_{b}^{\prime})=\chi_{,ab}-\frac{1}{2}\triangle\chi\delta_{ab}\,. (41)
  4. 4.

    PotentialV[-T3a] is the isotropic vector potential

    Va(t,x)=d3xρ(t,x)va(t,x)|xx|.V_{a}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})v_{a}(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|}\,. (42)
  5. 5.

    PotentialW[-T3a] is the anisotropic vector potential

    Wa(t,x)=d3xρ(t,x)vb(t,x)(xaxa)(xbxb)|xx|3.W_{a}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})v_{b}(t,\vec{x}^{\prime})(x_{a}-x_{a}^{\prime})(x_{b}-x_{b}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|^{3}}\,. (43)
  6. 6.

    PotentialPhi1[] is the kinetic energy potential

    Φ1(t,x)=d3xρ(t,x)v(t,x)2|xx|.\Phi_{1}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})v(t,\vec{x}^{\prime})^{2}}{|\vec{x}-\vec{x}^{\prime}|}\,. (44)
  7. 7.

    PotentialPhi2[] is the gravitational self-energy potential

    Φ2(t,x)=d3xρ(t,x)U(t,x)|xx|.\Phi_{2}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})U(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|}\,. (45)
  8. 8.

    PotentialPhi3[] is the internal energy potential

    Φ3(t,x)=d3xρ(t,x)Π(t,x)|xx|.\Phi_{3}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})\Pi(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|}\,. (46)
  9. 9.

    PotentialPhi4[] is the pressure potential

    Φ4(t,x)=d3xp(t,x)|xx|.\Phi_{4}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{p(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|}\,. (47)
  10. 10.

    PotentialA[] is the anisotropic kinetic potential

    𝒜(t,x)=d3xρ(t,x)[va(t,x)(xaxa)]2|xx|3.\mathcal{A}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})\left[v_{a}(t,\vec{x}^{\prime})(x_{a}-x_{a}^{\prime})\right]^{2}}{|\vec{x}-\vec{x}^{\prime}|^{3}}\,. (48)
  11. 11.

    PotentialB[] is the potential related to change in velocity

    (t,x)=d3xρ(t,x)|xx|(xaxa)dva(t,x)dt.\mathcal{B}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\frac{\rho(t,\vec{x}^{\prime})}{|\vec{x}-\vec{x}^{\prime}|}(x_{a}-x_{a}^{\prime})\frac{\mathrm{d}v_{a}(t,\vec{x}^{\prime})}{\mathrm{d}t}\,. (49)
  12. 12.

    PotentialPhiW[] is the Whitehead potential

    ΦW(t,x)=d3xd3x′′ρ(t,x)ρ(t,x′′)xaxa|xx|3(xaxa′′|xx′′|xaxa′′|xx′′|).\Phi_{W}(t,\vec{x})=\int\mathrm{d}^{3}x^{\prime}\int\mathrm{d}^{3}x^{\prime\prime}\rho(t,\vec{x}^{\prime})\rho(t,\vec{x}^{\prime\prime})\frac{x_{a}-x_{a}^{\prime}}{|\vec{x}-\vec{x}^{\prime}|^{3}}\left(\frac{x_{a}^{\prime}-x_{a}^{\prime\prime}}{|\vec{x}-\vec{x}^{\prime\prime}|}-\frac{x_{a}-x_{a}^{\prime\prime}}{|\vec{x}^{\prime}-\vec{x}^{\prime\prime}|}\right)\,. (50)

Note that these integrals are not implemented directly in xPPN, which makes no explicit use of the coordinates apart from the assumption that partial derivatives of the tensors defining the background geometry vanish. However, they enter into the formalism indirectly, since they define the relations between the potentials and the source terms which are explained in detail in section V.6.

IV.7 Post-Newtonian parameters

The PPN parameters are represented in xPPN by objects which are declared as constants within xTensor, so that any derivatives acting on them vanish. A full list is given in table 2. Note that assuming the PPN parameters to be constant, which is one of the standard assumptions of the PPN formalism, means that it cannot be directly applied to, e.g., theories with massive fields mediating the gravitational interaction, since in such theories the values of the PPN parameters depend on the distance between the source and the test mass; also time variation of PPN parameters depending on a cosmological background is not considered. The former may be included in a future version of xPPN by introducing additional Yukawa-type potentials, which depend on a mass determining the interaction scale Zaglauer (1990); Helbig (1991). The latter might be implemented by allowing for PPN parameters which depend on TimePar instead of being declared constant Sanghai and Clifton (2017).

Symbol Parameter
ParameterBeta β\beta
ParameterGamma γ\gamma
ParameterAlpha1 α1\alpha_{1}
ParameterAlpha2 α2\alpha_{2}
ParameterAlpha3 α3\alpha_{3}
ParameterZeta1 ζ1\zeta_{1}
ParameterZeta2 ζ2\zeta_{2}
ParameterZeta3 ζ3\zeta_{3}
ParameterZeta4 ζ4\zeta_{4}
ParameterXi ξ\xi
Table 2: Constants representing the PPN parameters in xPPN.

V Utility functions

We now present a number of utility functions defined by xPPN, which can be used to manipulate terms which typically appear in the post-Newtonian expansion, perform necessary computational steps and solve the gravitational field equations in terms of the post-Newtonian potentials and parameters listed in the previous sections. Which of these functions need to be used highly depends on the gravity theory under consideration, and we show this for a few of them in an explicit example in section VI; here we give an overview of the functions provided and how they are applied. In section V.1 we show how to refer to specific parts of tensors in their space-time decomposition and perturbative expansion. The definition and application of substitution rules for such terms is explained in section V.2. The decomposition of general tensorial expressions into space and time components is shown in section V.3, and further into velocity orders in section V.4. The transformation of terms using the Euler equations derived from energy-momentum conservation is displayed in section V.5, and applied to post-Newtonian potentials in section V.6. Finally, utility functions for sorting derivatives prior to applying these rules are shown in section V.7.

V.1 Selecting space-time components and velocity orders of tensors

As explained in section III.1, xPPN defines for each tensor declared on the spacetime manifold M4M_{4} a number of tensors on the space manifold S3S_{3}, which represent the 3+13+1 decomposition of the initial tensor and its velocity orders. In order to access these components, xPPN defines the utility function PPN to easily obtain them from a tensor head, a sequence of indices and optionally a velocity order. This function can be used in two ways, taking the following arguments:

  1. 1.

    PPN[hh][ii], where hh is a tensor head and ii is a sequence of indices, such that each index either belongs to S3S_{3} or is LI[0] (possible with a minus sign);

  2. 2.

    PPN[hh, nn][ii], where nn is a non-negative integer and hh and ii are as above.

The application of this function is illustrated by the following example of a vector AαA^{\alpha}:

In[]:= DefTensor[A[T4\textalpha], MfSpacetime]
In[]:= PPN[A][T3a]
Out[]= AaA^{a}
In[]:= PPN[A, 2][LI[0]]
Out[]= A20\accentset{2}{A}^{0}

Note that the indices do not have to be in the natural position in which they have been for the tensor head hh. The function PPN yields the same result as if the indices had been specified in their natural position, and then raised or lowed with the background metric BkgMetricS3 on S3S_{3}:

In[]:= DefTensor[A[T4\textalpha], MfSpacetime]
In[]:= ContractMetric[PPN[A][T3b] BkgMetricS3[-T3b, -T3a]]
Out[]= AaA_{a}
In[]:= % == PPN[A][-T3a]
Out[]= True

Tensor symmetries are taken into account, and indices are sorted into canonical order if possible:

In[]:= DefTensor[A[-T4\textalpha, -T4\textbeta], MfSpacetime, Antisymmetric[{1, 2}]]
In[]:= PPN[A][-LI[0], -LI[0]]
Out[]= 0
In[]:= PPN[A][-T3a, -LI[0]]
Out[]= A0a-A_{0a}

V.2 Definition and application of replacement rules

For pre-defined tensors on the spacetime manifold M4M_{4}, such as the metric or the energy-momentum tensor, xPPN defines a number of substitution rules for the terms in their post-Newtonian expansion. In order to apply these rules to any given tensorial expression, xPPN provides the function ApplyPPNRules, which can be invoked in two different ways:

  1. 1.

    ApplyPPNRules[XX] recursively applies the defined PPN rules to all tensors which appear in the expression XX and its subexpressions.

  2. 2.

    ApplyPPNRules[XX, hh] applies the defined PPN rules only to those tensors within XX with head hh.

For example, the zeroth order of the physical metric is given by the Minkowski background metric:

In[]:= {PPN[Met, 0][-LI[0], -LI[0]], PPN[Met, 0][-LI[0], -T3a], PPN[Met, 0][-T3a, -T3b]}
Out[]= {g000\accentset{0}{g}_{00}, g00a\accentset{0}{g}_{0a}, g0ab\accentset{0}{g}_{ab}}
In[]:= ApplyPPNRules /@ %
Out[]= {1-1, 0, δab\delta_{ab}}

By default, xPPNdoes not associate any rules to the terms in the post-Newtonian expansion of user-defined tensors. Therefore, xPPN provides a number of functions to define and undefine such rules. This can be done with the following functions:

  1. 1.

    OrderSet[PPN[hh, nn][ii], XX] defines or replaces a rule, such that ApplyPPNRules substitutes the nn’th order term PPN[hh, nn][ii] by XX, where XX can be any tensorial expression which has the same free indices as defined by ii.

  2. 2.

    OrderUnset[PPN[hh, nn][ii]] removes the PPN rule associated with the term PPN[hh, nn][ii] in the post-Newtonian expansion.

  3. 3.

    OrderClear[hh] removes any PPN rules associated to the tensor head hh.

Their application can be illustrated as follows.

In[]:= DefTensor[A[T4\textalpha], MfSpacetime]
In[]:= a = {PPN[A, 0][LI[0]], PPN[A, 0][T3a], PPN[A, 1][LI[0]], PPN[A, 1][T3a]};
In[]:= ApplyPPNRules /@ a
Out[]= {A00\accentset{0}{A}^{0}, A0a\accentset{0}{A}^{a}, A10\accentset{1}{A}^{0}, A1a\accentset{1}{A}^{a}}
In[]:= OrderSet[PPN[A, 0][LI[0]], 1];
In[]:= OrderSet[PPN[A, 0][T3a], 0];
In[]:= OrderSet[PPN[A, 1][T3a], Velocity[T3a]];
In[]:= ApplyPPNRules /@ a
Out[]= {11, 0, A10\accentset{1}{A}^{0}, vav^{a}}
In[]:= OrderUnset[PPN[A, 1][T3a]];
In[]:= ApplyPPNRules /@ a
Out[]= {11, 0, A10\accentset{1}{A}^{0}, A1a\accentset{1}{A}^{a}}
In[]:= OrderClear[A];
In[]:= ApplyPPNRules /@ a
Out[]= {A00\accentset{0}{A}^{0}, A0a\accentset{0}{A}^{a}, A10\accentset{1}{A}^{0}, A1a\accentset{1}{A}^{a}}

V.3 3+13+1 space-time split of tensorial expressions

xPPN defines two functions handling the 3+13+1 decomposition of arbitrary tensorial expressions on spacetime into their space and time components, as explained in section III.1: SpaceTimeSplit and SpaceTimeSplits. While the former calculates one specific component of the 3+13+1 decomposition, the latter yields an array with all components. In both functions the decomposition is applied to both free and dummy indices.

The function SpaceTimeSplit takes two arguments: a tensor on M4M_{4} (possibly containing free indices) and a list of replacement rules, which assigns to each free index in a bundle over M4M_{4} either an index over the corresponding bundle over S3S_{3} or the label index LI[0] (possibly dressed with a minus sign to indicate a lower index). For example, for an expression of the form AαβA^{\alpha}{}_{\beta} with free indices T4\textalpha, -T4\textbeta, the second argument may be any of the following:

  1. 1.

    {T4\textalpha \to\lst@whitespacefalse LI[0], -T4\textbeta \to\lst@whitespacefalse -LI[0]}

  2. 2.

    {T4\textalpha \to\lst@whitespacefalse T3a, -T4\textbeta \to\lst@whitespacefalse -LI[0]}

  3. 3.

    {T4\textalpha \to\lst@whitespacefalse LI[0], -T4\textbeta \to\lst@whitespacefalse -T3b}

  4. 4.

    {T4\textalpha \to\lst@whitespacefalse T3a, -T4\textbeta \to\lst@whitespacefalse -T3b}

Of course, other names than a,ba,b may be used for the indices on S3S_{3}, but their position must remain the same; their role is to specify how the free indices in the resulting expression will be named. The function SpaceTimeSplit then calculates the component of the expression where each free index on M4M_{4} is replaced by the specified indices of the 3+13+1 decomposition. For example, for a tensor AαβA^{\alpha}{}_{\beta} defined by

In[]:= DefTensor[A[T4\textalpha, -T4\textbeta], MfSpacetime]

one may use

In[]:= SpaceTimeSplit[A[T4\textalpha, -T4\textbeta], {T4\textalpha \to\lst@whitespacefalse T3a, -T4\textbeta \to\lst@whitespacefalse -LI[0]}]
Out[]= Aa0A^{a}{}_{0}
In[]:= % == PPN[A][T3a, -LI[0]]
Out[]= True

to obtain the component Aa0A^{a}{}_{0}. In contrast to the function PPN, which yields the 3+13+1 decomposed component of a single tensor only, any tensorial expression may be decomposed by SpaceTimeSplit instead of a single tensor. For example, to decompose the expression AαAγγβA^{\alpha}{}_{\gamma}A^{\gamma}{}_{\beta} one may use

In[]:= SpaceTimeSplit[A[T4\textalpha, -T4\textgamma] A[T4\textgamma, -T4\textbeta], {T4\textalpha \to\lst@whitespacefalse T3a, -T4\textbeta \to\lst@whitespacefalse -LI[0]}]
Out[]= AaA00+0AaAbb0A^{a}{}_{0}A^{0}{}_{0}+A^{a}{}_{b}A^{b}{}_{0}

Observe that also the dummy index γ\gamma has been split into a sum over dummy indices in the 3+13+1 decomposition.

The function SpaceTimeSplits is similar, but in its second argument only indices of S3S_{3} (and hence no LI[0]) are allowed as the right hand sides of the rules. The function then returns an array in which the free indices of the original expression are replaced either by the specified spatial indices or the time index 0, as shown in the following example:

In[]:= SpaceTimeSplits[A[T4\textalpha, -T4\textbeta], {T4\textalpha \to\lst@whitespacefalse T3a, -T4\textbeta \to\lst@whitespacefalse -T3b}]
Out[]= {{A00A^{0}{}_{0}, A0bA^{0}{}_{b}}, {Aa0A^{a}{}_{0}, AabA^{a}{}_{b}}}

The order of the rules in the replacement list corresponds to the order of the dimensions of the resulting array. In the example above, the first dimension corresponds to α\alpha, while the second dimension corresponds to β\beta. Hence,

In[]:= %[[1, 2]]
Out[]= A0bA^{0}{}_{b}

selects the component where α\alpha is replaced by 0 (the first element of (0,a)(0,a)), while β\beta is replaced by bb (the second element of (0,b)(0,b)). Similarly,

In[]:= SpaceTimeSplits[A[T4\textalpha, -T4\textbeta], {-T4\textbeta \to\lst@whitespacefalse -T3b, T4\textalpha \to\lst@whitespacefalse T3a}]
Out[]= {{A00A^{0}{}_{0}, Aa0A^{a}{}_{0}}, {A0bA^{0}{}_{b}, AabA^{a}{}_{b}}}

yields the transposed array.

Finally, we remark that both SpaceTimeSplit and SpaceTimeSplits also operate on partial derivatives PD[-T4\textalpha] with respect to spacetime coordinates. These are converted as follows:

In[]:= DefTensor[A[], MfSpacetime]
In[]:= PD[-T4\textalpha][A[]]
Out[]= αA\partial_{\alpha}A
In[]:= SpaceTimeSplits[%, {-T4\textalpha \to\lst@whitespacefalse -T3a}]
Out[]= {0A,aA}\{\partial_{0}A,\partial_{a}A\}
In[]:= % == {ParamD[TimePar][PPN[A][]], PD[-T3a][PPN[A][]]}
Out[]= True

Observe that the time derivative is not represented as a partial derivative, but as a parameter derivative with respect to the time parameter TimePar. Finally, we remark that the automatic split is implemented only for partial derivatives PD[-T4\textalpha]; any other derivatives most be converted with ChangeCovD or LieDToCovD, as appropriate.

V.4 Decomposition into velocity orders

As explained in section III.2, an important part of the PPN formalism is the series expansion of expressions in velocity orders. In order to select a single term X𝑛𝒪(n)\accentset{n}{X}\sim\mathcal{O}(n) from an expression XX, xPPN provides the function VelocityOrder. The term X𝑛\accentset{n}{X} is then expressed as VelocityOrder[XX, nn]. Here nn must be a non-negative integer, while XX can be any tensorial expression on S3S_{3}, which may in addition depend on TimePar. It makes use of a number of standard relations for the velocity order in the PPN formalism: orders are distributed over products, and time derivatives are weighted with an additional velocity order. This is illustrated in the following example:

In[]:= DefTensor[A[T4\textalpha], MfSpacetime]
In[]:= VelocityOrder[PPN[A][T3a] PPN[A][-T3a], 2]
Out[]= A0aA2a+A1aA1a+A2aA0a\accentset{0}{A}^{a}\accentset{2}{A}_{a}+\accentset{1}{A}^{a}\accentset{1}{A}_{a}+\accentset{2}{A}^{a}\accentset{0}{A}_{a}
In[]:= VelocityOrder[ParamD[TimePar][PPN[A][-T3a]] + PD[-T3a][PPN[A][-LI[0]]], 3]
Out[]= 0A2a+aA30\partial_{0}\accentset{2}{A}_{a}+\partial_{a}\accentset{3}{A}_{0}

The function VelocityOrder supports the boolean option UsePPNRules. If it is set to True (the default case), any rules assigned to PPNTensor objects are applied immediately as soon as they are encountered. If it is set to False, no PPN rules are applied. For example, for the energy-momentum tensor this yields the following results:

In[]:= VelocityOrder[PPN[EnergyMomentum][-LI[0], -LI[0]], 2, UsePPNRules \to\lst@whitespacefalse True]
Out[]= ρ\rho
In[]:= % == Density[]
Out[]= True
In[]:= VelocityOrder[PPN[EnergyMomentum][-LI[0], -LI[0]], 2, UsePPNRules \to\lst@whitespacefalse False]
Out[]= Θ200\accentset{2}{\Theta}_{00}
In[]:= % == PPN[EnergyMomentum, 2][-LI[0], -LI[0]]
Out[]= True

Observe that in the first case the rule Θ200ρ\accentset{2}{\Theta}_{00}\to\rho is applied, but not in the second case. For large expressions the default setting UsePPNRules \to\lst@whitespacefalse True is significantly faster, since the PPN rules imply the vanishing of many terms in the post-Newtonian expansion, which are thus immediately discarded when the rules are applied.

V.5 Euler equations

An important assumption of the PPN formalism is that the energy-momentum tensor Θαβ\Theta_{\alpha\beta} introduced in section IV.5 satisfies the covariant conservation equation αΘαβ=0\accentset{\circ}{\nabla}_{\alpha}\Theta^{\alpha\beta}=0. Expanding this equation into velocity orders and performing a 3+13+1 split into space and time components, one obtains the Euler equations, which govern the dynamics of the fluid. These equations are implemented in xPPN in three different functions, which perform the following substitutions on all matching subexpressions of their arguments:

  1. 1.

    TimeRhoToEuler[XX] applies the replacement

    ρ,0(ρva),a.\rho_{,0}\to-(\rho v_{a})_{,a}\,. (51)
  2. 2.

    TimeVelToEuler[XX] applies the replacement

    va,012g200,avbva,bp,aρ.v_{a,0}\to\frac{1}{2}\accentset{2}{g}_{00,a}-v_{b}v_{a,b}-\frac{p_{,a}}{\rho}\,. (52)
  3. 3.

    TimePiToEuler[XX] applies the replacement

    Π,0va(p,aρΠ,a12g200,a12g2bb,a)pva,aρ12g2aa,0.\Pi_{,0}\to v_{a}\left(\frac{p_{,a}}{\rho}-\Pi_{,a}-\frac{1}{2}\accentset{2}{g}_{00,a}-\frac{1}{2}\accentset{2}{g}_{bb,a}\right)-\frac{pv_{a,a}}{\rho}-\frac{1}{2}\accentset{2}{g}_{aa,0}\,. (53)

The functions can be successively applied in order to transform terms involving higher order time derivatives.

V.6 Transformation of PPN potentials

The post-Newtonian potentials defined in section IV.6 and their derivatives satisfy a number of relations among each other and with the energy-momentum variables defined in section IV.5, some of which follow directly from the definition of the potentials, while others can be derived from the Euler equations discussed in the previous section. xPPN defines a number of utility functions in order to implement these relations and use them to turn PPN potentials and their derivatives into either other PPN potentials or terms constructed from the energy-momentum tensor. The most important of these is PotentialToSource[XX], which performs the following replacements on all subexpressions of XX:

χ8πρ,𝒜8π(ρvavb),ab4π(ρ|v|2),8π[p(U,aρ),a],\displaystyle\triangle\triangle\chi\to 8\pi\rho\,,\quad\triangle\triangle\mathcal{A}\to 8\pi(\rho v_{a}v_{b})_{,ab}-4\pi\triangle(\rho|v|^{2})\,,\quad\triangle\triangle\mathcal{B}\to 8\pi[\triangle p-(U_{,a}\rho)_{,a}]\,,
Φ14πρ|v|2,Φ24πρU,Φ34πρΠ,Φ44πp,\displaystyle\triangle\Phi_{1}\to-4\pi\rho|v|^{2}\,,\quad\triangle\Phi_{2}\to-4\pi\rho U\,,\quad\triangle\Phi_{3}\to-4\pi\rho\Pi\,,\quad\triangle\Phi_{4}\to-4\pi p\,, (54)
U4πρ,Va4πρva,ΦW4πρU4U,aU,a+2U,abχ,ab.\displaystyle\triangle U\to-4\pi\rho\,,\quad\triangle V_{a}\to-4\pi\rho v_{a}\,,\quad\triangle\Phi_{W}\to 4\pi\rho U-4U_{,a}U_{,a}+2U_{,ab}\chi_{,ab}\,.

The remaining functions act on specific PPN potentials or their derivatives. Their effects are listed in table 3.

Function Transformation
PotentialChiToU χ2U\triangle\chi\to-2U
PotentialUToChi U12χU\to-\frac{1}{2}\triangle\chi
PotentialUToUU UUaaU\to U_{aa}
PotentialUUToU UaaUU_{aa}\to U
PotentialUUToChi Uabχ,ab12χδabU_{ab}\to\chi_{,ab}-\frac{1}{2}\triangle\chi\delta_{ab}
PotentialUToV U,0Va,aU_{,0}\to-V_{a,a}
PotentialUToW U,0Wa,aU_{,0}\to W_{a,a}
PotentialVToU Va,aU,0V_{a,a}\to-U_{,0}
PotentialWToU Wa,aU,0W_{a,a}\to U_{,0}
PotentialVToW Va,aWa,aV_{a,a}\to-W_{a,a}
PotentialWToV Wa,aVa,aW_{a,a}\to-V_{a,a}
PotentialVToChiW VaWa+χ,0aV_{a}\to W_{a}+\chi_{,0a}
PotentialWToChiV WaVaχ,0aW_{a}\to V_{a}-\chi_{,0a}
PotentialChiToPhiAB χ,00𝒜+Φ1\chi_{,00}\to\mathcal{A}+\mathcal{B}-\Phi_{1}
PotentialUToPhiAB U,0012(𝒜+Φ1)U_{,00}\to-\frac{1}{2}\triangle(\mathcal{A}+\mathcal{B}-\Phi_{1})
Table 3: Functions to transform specific PPN potentials.

V.7 Sorting of derivatives

In xAct, derivatives are, in general, not sorted automatically. This poses two difficulties, which may lead to problems in simplifications:

  1. 1.

    Mathematica does not recognize terms which are mathematically equal if they contain derivatives in different order. For example, expressions of the form αβX\partial_{\alpha}\partial_{\beta}X and βαX\partial_{\beta}\partial_{\alpha}X are equal, since partial derivatives commute, but since they are represented differently, Mathematica does not recognize this.

  2. 2.

    In order to apply the transformations listed in section V.6, pattern matching is applied to find divergences, time derivatives and Laplace operators acting on tensors. However, due to the way how derivatives are represented in xTensor, Mathematica recognizes such terms only if they are not interspersed with other derivatives. For example, αAα\partial_{\alpha}A^{\alpha} is found in βαAα\partial_{\beta}\partial_{\alpha}A^{\alpha}, but not in αβAα\partial_{\alpha}\partial_{\beta}A^{\alpha}, even though these terms are mathematically equal.

The first of these problems can be solved by defining a canonical order for derivatives and keeping them always sorted in canonical order. Such a canonical ordering is implemented as part of the xTensor function ToCanonical, so that the following terms are recognized by Mathematica as equal and canceled:

In[]:= DefTensor[A[], MfSpacetime]
In[]:= PD[-T4\textalpha][PD[-T4\textbeta][A[]]] - PD[-T4\textbeta][PD[-T4\textalpha][A[]]]
Out[]= αβAβαA\partial_{\alpha}\partial_{\beta}A-\partial_{\beta}\partial_{\alpha}A
In[]:= ToCanonical[%]
Out[]= 0

However, this does not solve the second problem, since a different order of derivatives is required, depending on the type of pattern to be matched; for example, matching a time derivative would require the order α0Aα\partial_{\alpha}\partial_{0}A^{\alpha}, while matching a divergence would require the order 0αAα\partial_{0}\partial_{\alpha}A^{\alpha}. Hence, keeping all indices in a fixed, canonical order would not allow for such patterns to be found. Hence, xPPN implements a different method by defining different functions, which allow sorting derivatives on demand in any of the necessary orders. The following functions are defined:

  1. 1.

    SortPDs[XX] sorts all derivatives in canonical order by applying the following rules:

    1. (a)

      Spatial derivatives are applied before time derivatives, i.e., moved to the right.

    2. (b)

      Spatial derivatives are sorted in lexicographic order, i.e., indices which come earlier in lexicographic order, are applied first.

    3. (c)

      Derivatives with upper indices are applied before derivatives with otherwise identical lower indices.

  2. 2.

    SortPDsToTime[XX, hh] sorts derivatives acting on tensors with head hh such that time derivatives are applied first, i.e., moved to the right.

  3. 3.

    SortPDsToDiv[XX, hh] sorts derivatives acting on tensors with head hh such that divergences may be matched, i.e., such that derivatives are applied first, whose index is contracted with a corresponding index of the tensor expression.

  4. 4.

    SortPDsToBox[XX, hh] sorts derivatives acting on tensors with head hh such that Laplace operators are formed from spatial derivatives, if possible, and those are applied first.

The effect of these functions on an expression with multiple derivatives acting on a tensor is shown by the following code:

In[]:= DefTensor[A[T4\textalpha], MfSpacetime]
In[]:= expr = PD[T3b][ParamD[TimePar][PD[-T3a][PD[-T3c][PD[-T3b][PPN[A][T3c]]]]]]
Out[]= b0acbAc\partial^{b}\partial_{0}\partial_{a}\partial_{c}\partial_{b}A^{c}
In[]:= SortPDs[expr]
Out[]= 0cbbaAc\partial_{0}\partial_{c}\partial_{b}\partial^{b}\partial_{a}A^{c}
In[]:= SortPDsToTime[expr, A]
Out[]= bacb0Ac\partial^{b}\partial_{a}\partial_{c}\partial_{b}\partial_{0}A^{c}
In[]:= SortPDsToDiv[expr, A]
Out[]= b0abcAc\partial^{b}\partial_{0}\partial_{a}\partial_{b}\partial_{c}A^{c}
In[]:= SortPDsToBox[expr, A]
Out[]= 0acbbAc\partial_{0}\partial_{a}\partial_{c}\partial_{b}\partial^{b}A^{c}

The implementation of these functions is inspired by the field theory package xTras Nutma (2014), which defines a similar set of functions, which take into account also non-commuting derivatives by adding suitable correction terms. Also note that the replacement functions listed in section V.6 make use of these sorting functions automatically in order to establish the necessary order of indices before pattern matching is performed.

VI Example: scalar-tensor gravity

In order to demonstrate the use of the xPPN package, we provide a practical example in form of a complete, commented session, which calculates the PPN parameters of a scalar-tensor class of gravity theories, thereby showing the use of some of the functions detailed in the previous sections. The precise steps which are needed to determine the PPN parameters highly depend on the specific theory under consideration, and must be chosen accordingly. We briefly present the action and field equations of this class in section VI.1. A few preliminary commands, for loading the package and setup, are given in section VI.2. In section VI.3, the necessary tensors and constants for the calculation are defined. These are used in the definition of the field equations in section VI.4. Their post-Newtonian expansion is derived in section VI.5. In section VI.6, the perturbative solution of the resulting equations is obtained. Finally, in section VI.7, the PPN metric and parameters are calculated.

VI.1 Action and field equations

In the following we discuss a class of scalar-tensor theories of gravity, whose action is given by Nordtvedt (1970)

S=12κ2M4d4xg(ψRω(ψ)ψρψρψ)+Sm[gμν,χ]S=\frac{1}{2\kappa^{2}}\int_{M_{4}}\mathrm{d}^{4}x\sqrt{-g}\left(\psi R-\frac{\omega(\psi)}{\psi}\partial_{\rho}\psi\partial^{\rho}\psi\right)+S_{m}[g_{\mu\nu},\chi] (55)

in Brans-Dicke like parametrization in the Jordan conformal frame. Here SmS_{m} denotes the matter part of the action, where we collectively denoted by χ\chi the set of matter fields. The gravitational part contains a free function ω\omega of the scalar field ψ\psi. Each theory of this class is defined by a particular choice of this free function ω\omega. By variation of this action with respect to the metric and the scalar field as well as subtraction of a suitable multiple of the trace of the metric field equation one obtains the field equations

ψRμνμνψωψμψνψ+gμν4ω+6dωdψρψρψ\displaystyle\psi R_{\mu\nu}-\accentset{\circ}{\nabla}_{\mu}\partial_{\nu}\psi-\frac{\omega}{\psi}\partial_{\mu}\psi\partial_{\nu}\psi+\frac{g_{\mu\nu}}{4\omega+6}\frac{d\omega}{d\psi}\partial_{\rho}\psi\partial^{\rho}\psi =κ2(Θμνω+12ω+3gμνΘ),\displaystyle=\kappa^{2}\left(\Theta_{\mu\nu}-\frac{\omega+1}{2\omega+3}g_{\mu\nu}\Theta\right)\,, (56a)
(2ω+3)ψ+dωdψρψρψ\displaystyle(2\omega+3)\accentset{\circ}{\square}\psi+\frac{d\omega}{d\psi}\partial_{\rho}\psi\partial^{\rho}\psi =κ2Θ,\displaystyle=\kappa^{2}\Theta\,, (56b)

where =gμνμν\accentset{\circ}{\square}=g^{\mu\nu}\accentset{\circ}{\nabla}_{\mu}\accentset{\circ}{\nabla}_{\nu} is the d’Alembert operator on the physical spacetime M4M_{4}.

VI.2 Package loading and preliminaries

In order to load and use xPPN, as the first prerequisite a working installation of xAct Martín-García (2002) is needed. The files provided by xAct then reside in a directory named xAct in the Mathematica package search path. The xPPN package comes as a directory named xPPN, which must be placed inside the xAct directory. If both packages are installed correctly, xPPN can be loaded with the command

In[]:= << xActxPPN

This should load xPPN and its dependencies from the xAct package suite. Note that loading may take some time, since xPPN calculates the perturbative expansion of the pre-defined tensor fields upon package loading. To suppress $ symbols in the index notation, it is useful to set the following xAct printing option:

In[]:= $PrePrint = ScreenDollarIndices;

Finally, we define two utility functions which help to create rules from equations; this functionality, which is simply a shorthand notation for the versatile function MakeRule from the xTensor package, are not specific to xPPN, and are defined here only to shorten the notation in the later course of this example:

In[]:= mkrg[eq_Equal] := MakeRule[Evaluate[List @@ eq],
MetricOn \to\lst@whitespacefalse All, ContractMetrics \to\lst@whitespacefalse True]
In[]:= mkr0[eq_Equal] := MakeRule[Evaluate[List @@ eq],
MetricOn \to\lst@whitespacefalse None, ContractMetrics \to\lst@whitespacefalse False]

VI.3 Object definitions

We continue by defining the xAct objects which we will be using for the calculation and their notation. We start with the scalar field ψ\psi, which is a tensor without any indices.

In[]:= DefTensor[psi[], MfSpacetime, PrintAs \to\lst@whitespacefalse "ψ\psi"]

We then continue with the cosmological background value Ψ\Psi of the scalar field. This is a constant.

In[]:= DefConstantSymbol[psi0, PrintAs \to\lst@whitespacefalse "Ψ\Psi"]

Another constant which we will need is the gravitational constant κ\kappa.

In[]:= DefConstantSymbol[kappa, PrintAs \to\lst@whitespacefalse "κ\kappa"]

The action (55) also depends on a free function ω\omega. This is defined as a scalar function.

In[]:= DefScalarFunction[omega, PrintAs \to\lst@whitespacefalse "ω\omega"]

We then come to the field equations (56), which we write in the form αβ=0\mathcal{E}_{\alpha\beta}=0 and =0\mathcal{E}=0, by moving the energy-momentum tensor to the left hand side. The two tensors representing these field equations are then defined as follows.

In[]:= DefTensor[MetEq[-T4\textalpha, -T4\textbeta], MfSpacetime, Symmetric[{1, 2}], PrintAs \to\lst@whitespacefalse "\mathcal{E}"]
In[]:= DefTensor[ScalEq[], MfSpacetime, PrintAs \to\lst@whitespacefalse "\mathcal{E}"]

Finally, in this example we will solve the field equations by making an ansatz for the solution in terms of PPN potentials and unknown, constant coefficients, which we will then determine. For this purpose, we define a function which creates such constant coefficients on demand as follows.

In[]:= aa[i_] := Module[{sym = Symbol["a" <> ToString[i]]},
If[!ConstantSymbolQ[sym],
DefConstantSymbol[sym, PrintAs \to\lst@whitespacefalse StringJoin["\!\(a\_", ToString[i], "\)"]]
];
Return[sym]]

VI.4 Field equations

In the next step, we enter the field equations (56). As mentioned before, we must pay attention to explicitly use the inverse metric gαβg^{\alpha\beta} for terms such as the kinetic term ρψρψ\partial_{\rho}\psi\partial^{\rho}\psi of the scalar field or the trace Θρρ\Theta^{\rho}{}_{\rho} of the energy-momentum tensor. Taking these into account, we can enter the metric field equation (56a) as follows.

In[]:= psi[] * RicciCD[-T4\textalpha, -T4\textbeta] - CD[-T4\textalpha][CD[-T4\textbeta][psi[]]] -
PD[-T4\textalpha][psi[]] * PD[-T4\textbeta][psi[]] * omega[psi[]] / psi[] +
InvMet[T4\textgamma, T4\textdelta] * PD[-T4\textgamma][psi[]] * PD[-T4\textdelta][psi[]] * Met[-T4\textalpha, -T4\textbeta] *
omega’[psi[]] / (4 omega[psi[]] + 6) -
(EnergyMomentum[-T4\textalpha, -T4\textbeta] - InvMet[T4\textgamma, T4\textdelta] * EnergyMomentum[-T4\textgamma, -T4\textdelta] *
Met[-T4\textalpha, -T4\textbeta] * (omega[psi[]] + 1) / (2 omega[psi[]] + 3)) * kappa^2;
In[]:= meteqdef = MetEq[-T4\textalpha, -T4\textbeta] == %;
In[]:= meteqru = mkr0[meteqdef];

Similarly, we continue with the scalar field equation (56b):

In[]:= (2 omega[psi[]] + 3) * InvMet[T4\textalpha, T4\textbeta] * CD[-T4\textalpha][CD[-T4\textbeta][psi[]]] +
omega’[psi[]] * InvMet[T4\textalpha, T4\textbeta] * PD[-T4\textalpha][psi[]] * PD[-T4\textbeta][psi[]] -
kappa^2 * InvMet[T4\textalpha, T4\textbeta] * EnergyMomentum[-T4\textalpha, -T4\textbeta];
In[]:= scaleqdef = ScalEq[] == %;
In[]:= scaleqru = mkr0[scaleqdef];

VI.5 Post-Newtonian expansion

The most crucial and resource intensive part of the calculation is the derivation of the post-Newtonian expansion of the field equations. For this purpose, we must first define the expansion of the scalar field. Here we impose the relations

ψ0=Ψ,ψ1=0,ψ3=0.\accentset{0}{\psi}=\Psi\,,\quad\accentset{1}{\psi}=0\,,\quad\accentset{3}{\psi}=0\,. (57)

In xPPN, they are implemented as follows:

In[]:= OrderSet[PPN[psi, 0][], psi0];
In[]:= OrderSet[PPN[psi, 1][], 0];
In[]:= OrderSet[PPN[psi, 3][], 0];

With these definitions in place, we can continue with the calculation. We will do so in two steps. First, we perform a 3+13+1 decomposition of the field equations. For this purpose, we convert the Levi-Civita covariant derivatives to partial derivatives and Christoffel symbols. Also we perform a number of simplifications. Again we start with the metric field equations.

In[]:= {#, # /. meteqru} &[MetEq[-T4\textalpha, -T4\textbeta]];
In[]:= ChangeCovD[%, CD, PD];
In[]:= Expand[%];
In[]:= SpaceTimeSplits[#, {-T4\textalpha \to\lst@whitespacefalse -T3a, -T4\textbeta \to\lst@whitespacefalse -T3b}] & /@ %;
In[]:= Expand[%];
In[]:= Map[ToCanonical, %, {3}];
In[]:= Map[SortPDs, %, {3}];
In[]:= meteq31list = %;
In[]:= meteq31def = Union[Flatten[MapThread[Equal, %, 2]]];
In[]:= meteq31ru = Flatten[mkrg /@ %];

We proceed similarly with the scalar field equations:

In[]:= {#, # /. scaleqru} &[ScalEq[]];
In[]:= ChangeCovD[%, CD, PD];
In[]:= Expand[%];
In[]:= SpaceTimeSplit[#, {}] & /@ %;
In[]:= Expand[%];
In[]:= ToCanonical /@ %;
In[]:= SortPDs /@ %;
In[]:= scaleq31list = %;
In[]:= scaleq31def = Equal @@ %;
In[]:= scaleq31ru = Flatten[mkrg[%]];

In the second step, we further decompose the equations obtained in the previous step into velocity orders 𝒪(0),,𝒪(4)\mathcal{O}(0),\ldots,\mathcal{O}(4). Also here we perform a few tensor simplifications alongside the calculation, starting again with the metric equation.

In[]:= Outer[VelocityOrder, meteq31list, Range[0, 4]];
In[]:= Map[NoScalar, %, {4}];
In[]:= Expand[%];
In[]:= Map[ContractMetric[#, OverDerivatives \to\lst@whitespacefalse True,
AllowUpperDerivatives \to\lst@whitespacefalse True] &, %, {4}];
In[]:= Map[ToCanonical, %, {4}];
In[]:= Map[SortPDs, %, {4}];
In[]:= meteqvlist = Simplify[%];
In[]:= meteqvdef = Union[Flatten[MapThread[Equal, %, 3]]]
In[]:= meteqvru = Flatten[mkrg /@ %];

Finally, we apply the same step also to the scalar field equation.

In[]:= Outer[VelocityOrder, scaleq31list, Range[0, 4]];
In[]:= Map[NoScalar, %, {2}];
In[]:= Expand[%];
In[]:= Map[ContractMetric[#, OverDerivatives \to\lst@whitespacefalse True,
AllowUpperDerivatives \to\lst@whitespacefalse True] &, %, {2}];
In[]:= Map[ToCanonical, %, {2}];
In[]:= Map[SortPDs, %, {2}];
In[]:= scaleqvlist = Simplify[%];
In[]:= scaleqvdef = Flatten[MapThread[Equal, %, 1]]
In[]:= scaleqvru = Flatten[mkrg /@ %];

VI.6 Perturbative solution

We can now use the post-Newtonian expansion of the field equations and solve them order by order. For this purpose we make use of prior knowledge that the field equations of the theory at hand can be solved by a particular ansatz for the metric and scalar field, so that at every step of the calculation we are left with solving for a number of constant coefficients; this ansatz and solution method must be adapted if the package is applied to other theories. We show the zeroth velocity order (the background vacuum solution) in section VI.6.1, the second velocity order in section VI.6.2, the third velocity order in section VI.6.3 and the fourth velocity order in section VI.6.4.

VI.6.1 Zeroth velocity order

First, we verify that the background vacuum equations are solved identically by the background geometry. This can be checked as follows.

In[]:= PPN[MetEq, 0][-LI[0], -LI[0]] /. meteqvru
Out[]= 0
In[]:= PPN[MetEq, 0][-T3a, -T3b] /. meteqvru
Out[]= 0
In[]:= PPN[ScalEq, 0][] /. scaleqvru
Out[]= 0

VI.6.2 Second velocity order

We then continue with the second velocity order. First, we gather the equations 200,2ab,2\accentset{2}{\mathcal{E}}_{00},\accentset{2}{\mathcal{E}}_{ab},\accentset{2}{\mathcal{E}} to be solved:

In[]:= eqs2 = FullSimplify[{PPN[MetEq, 2][-LI[0], -LI[0]],
PPN[MetEq, 2][-T3a, -T3b], PPN[ScalEq, 2][]} /. meteqvru /. scaleqvru];

These equations take the form

2=κ2ρ+(2ω(Ψ)+3)ψ2,200=κ2ρω(Ψ)+22ω(Ψ)+3Ψ2g200,\displaystyle\accentset{2}{\mathcal{E}}=\kappa^{2}\rho+(2\omega(\Psi)+3)\triangle\accentset{2}{\psi}\,,\quad\accentset{2}{\mathcal{E}}_{00}=-\kappa^{2}\rho\frac{\omega(\Psi)+2}{2\omega(\Psi)+3}-\frac{\Psi}{2}\triangle\accentset{2}{g}_{00}\,,
2ab=κ2ρω(Ψ)+12ω(Ψ)+3δab+Ψ2(g200,abg2cc,ab+2g2c(a,b)cg2ab)ψ2,ab.\displaystyle\accentset{2}{\mathcal{E}}_{ab}=-\kappa^{2}\rho\frac{\omega(\Psi)+1}{2\omega(\Psi)+3}\delta_{ab}+\frac{\Psi}{2}\left(\accentset{2}{g}_{00,ab}-\accentset{2}{g}_{cc,ab}+2\accentset{2}{g}_{c(a,b)c}-\triangle\accentset{2}{g}_{ab}\right)-\accentset{2}{\psi}_{,ab}\,. (58)

The easiest way to solve these equations is using an ansatz for the metric and scalar field perturbations in terms of the post-Newtonian potentials, with arbitrary, constant coefficients. This ansatz can be defined as follows:

In[]:= ans2def = {PPN[Met, 2][-LI[0], -LI[0]] == aa[1] * PotentialU[],
PPN[Met, 2][-T3a, -T3b] == aa[2] * PotentialU[] * BkgMetricS3[-T3a, -T3b] +
aa[3] * PotentialUU[-T3a, -T3b],
PPN[psi, 2][] == aa[4] * PotentialU[]}
Out[]= {g200=a1U,g2ab=a2Uδab+a3Uab,ψ2=a4U}\big{\{}\accentset{2}{g}_{00}=a_{1}U\,,\quad\accentset{2}{g}_{ab}=a_{2}U\delta_{ab}+a_{3}U_{ab}\,,\quad\accentset{2}{\psi}=a_{4}U\big{\}}
In[]:= ans2ru = Flatten[mkrg /@ ans2def];

To obtain the equations to be solved, one inserts this ansatz into the field equations. Since the field equations contain derivatives of the metric and scalar field perturbations, this will yield derivatives of the post-Newtonian potentials UU and UabU_{ab}. These must be matched with the terms arising from the energy-momentum tensor Θαβ\Theta_{\alpha\beta}. For this purpose, one applies the functions listed in section V.6. For the potentials at hand it is most convenient to first convert them to derivatives of the superpotential χ\chi, before transforming them to terms involving the matter density ρ\rho.

In[]:= eqs2 /. ans2ru;
In[]:= PotentialUToChi /@ %;
In[]:= PotentialUUToChi /@ %;
In[]:= Expand[%];
In[]:= ToCanonical /@ %;
In[]:= ContractMetric[#, OverDerivatives \to\lst@whitespacefalse True, AllowUpperDerivatives \to\lst@whitespacefalse True] & /@ %;
In[]:= PotentialToSource /@ %;
In[]:= Expand[%];
In[]:= ToCanonical /@ %;
In[]:= SortPDs /@ %;
In[]:= eqsa2 = FullSimplify[%];

Inspecting the obtained equations shows that they are given by

2=κ2ρ4πa4(2ω(Ψ)+3)ρ,200=2πΨa1ρκ2ρω(Ψ)+22ω(Ψ)+3,\displaystyle\accentset{2}{\mathcal{E}}=\kappa^{2}\rho-4\pi a_{4}(2\omega(\Psi)+3)\rho\,,\quad\accentset{2}{\mathcal{E}}_{00}=2\pi\Psi a_{1}\rho-\kappa^{2}\rho\frac{\omega(\Psi)+2}{2\omega(\Psi)+3}\,,
2ab=(a42+a2+a3a14Ψ)χ,ab+[2πΨ(a2+a3)κ2ω(Ψ)+12ω(Ψ)+3]ρδab.\displaystyle\accentset{2}{\mathcal{E}}_{ab}=\left(\frac{a_{4}}{2}+\frac{a_{2}+a_{3}-a_{1}}{4}\Psi\right)\triangle\chi_{,ab}+\left[2\pi\Psi(a_{2}+a_{3})-\kappa^{2}\frac{\omega(\Psi)+1}{2\omega(\Psi)+3}\right]\rho\delta_{ab}\,. (59)

These equations are solved if and only if the coefficients of each of the terms ρ\rho, ρδab\rho\delta_{ab} and χ,ab\triangle\chi_{,ab} vanishes individually. This yields four equations for the four coefficients a1,,a4a_{1},\ldots,a_{4}. However, one finds that these are not linearly independent, due to the gauge freedom arising from the diffeomorphism invariance of the theory. Hence, they must be supplemented with an additional, gauge fixing equation. The common choice in the PPN formalism is to eliminate the term UabU_{ab} from the component g2ab\accentset{2}{g}_{ab}, thus setting a3=0a_{3}=0. We can thus determine the component equations:

In[]:= eqsc2 = FullSimplify[{
Coefficient[eqsa2[[1]], Density[]], Coefficient[eqsa2[[3]], Density[]],
Coefficient[eqsa2[[2]], Density[] * BkgMetricS3[-T3a, -T3b]], aa[3]}];

We can then solve the equations:

In[]:= sola2 = FullSimplify[First[Solve[# == 0 & /@ eqsc2, aa /@ Range[1, 4]]]];

This yields the solution

a1=κ2ω(Ψ)+22πΨ(2ω(Ψ)+3),a2=κ2ω(Ψ)+12πΨ(2ω(Ψ)+3),a3=0,a4=κ24π(2ω(Ψ)+3).a_{1}=\kappa^{2}\frac{\omega(\Psi)+2}{2\pi\Psi(2\omega(\Psi)+3)}\,,\quad a_{2}=\kappa^{2}\frac{\omega(\Psi)+1}{2\pi\Psi(2\omega(\Psi)+3)}\,,\quad a_{3}=0\,,\quad a_{4}=\frac{\kappa^{2}}{4\pi(2\omega(\Psi)+3)}\,. (60)

We may check that this indeed solves the equations:

In[]:= Simplify[eqsa2 /. sola2]
Out[]= {0, 0, 0}

Together with the ansatz we defined, this solution now yields the solution for the perturbations g200,g2ab,ψ2\accentset{2}{g}_{00},\accentset{2}{g}_{ab},\accentset{2}{\psi}:

In[]:= sol2def = ans2def /. sola2;
In[]:= sol2ru = Flatten[mkrg /@ sol2def];

Finally, we also check that this result solves the second-order field equations:

In[]:= eqs2 /. sol2ru;
In[]:= Expand[%];
In[]:= PotentialToSource /@ %;
In[]:= ToCanonical /@ %;
In[]:= SortPDs /@ %;
In[]:= Simplify[%]
Out[]= {0, 0, 0}

VI.6.3 Third velocity order

We then come to the third velocity order. Also here we proceed in full analogy to the second velocity order shown above. First, we isolate the field equation 30a\accentset{3}{\mathcal{E}}_{0a} which we will solve:

In[]:= eqs3 = FullSimplify[PPN[MetEq, 3][-LI[0], -T3a] /. meteqvru];

This equation takes the form

30a=κ2ρvaψ2,0a+Ψ2(g30b,abg30a+g2ab,0bg2bb,0a).\accentset{3}{\mathcal{E}}_{0a}=\kappa^{2}\rho v_{a}-\accentset{2}{\psi}_{,0a}+\frac{\Psi}{2}\left(\accentset{3}{g}_{0b,ab}-\triangle\accentset{3}{g}_{0a}+\accentset{2}{g}_{ab,0b}-\accentset{2}{g}_{bb,0a}\right)\,. (61)

We then choose an ansatz for the third-order metric perturbation g30a\accentset{3}{g}_{0a}. This now involves the post-Newtonian vector potentials VaV_{a} and WaW_{a} with constant coefficients:

In[]:= ans3def = PPN[Met, 3][-LI[0], -T3a] ==
aa[5] * PotentialV[-T3a] + aa[6] * PotentialW[-T3a]
Out[]= g30a=a5Va+a6Wa\accentset{3}{g}_{0a}=a_{5}V_{a}+a_{6}W_{a}
In[]:= ans3ru = mkrg[ans3def];

To obtain the equation to be solved, we insert this ansatz into the field equation, together with the second-order solution obtained in the previous step. Also here we obtain derivatives acting on the post-Newtonian potentials, which we can simplify by using their interrelations, and finally convert them to terms matching the energy-momentum source. Here it is most useful to first eliminate the potential WaW_{a}. The resulting terms can then be converted to source terms and terms involving derivatives acting on UU only:

In[]:= eqs3 /. ans3ru /. sol2ru;
In[]:= PotentialWToChiV[%];
In[]:= Expand[%];
In[]:= ContractMetric[%, OverDerivatives \to\lst@whitespacefalse True, AllowUpperDerivatives \to\lst@whitespacefalse True];
In[]:= PotentialChiToU[%];
In[]:= PotentialVToU[%];
In[]:= PotentialToSource[%];
In[]:= ToCanonical[%];
In[]:= SortPDs[%];
In[]:= eqsa3 = FullSimplify[%];

Inspecting this equation shows the following form:

30a=[κ2+2πΨ(a5+a6)](ρvaU,0a4π).\accentset{3}{\mathcal{E}}_{0a}=[\kappa^{2}+2\pi\Psi(a_{5}+a_{6})]\left(\rho v_{a}-\frac{U_{,0a}}{4\pi}\right)\,. (62)

This equation only determines the sum a5+a6a_{5}+a_{6} of the coefficients we introduced. Here we leave their difference as an undetermined parameter, which we will solve for when we come to the fourth velocity order, which will fix the post-Newtonian gauge. We thus determine the solution:

In[]:= sola3 = FullSimplify[
First[Solve[{eqsa3 == 0, aa[6] - aa[5] == aa[0]}, {aa[5], aa[6]}]]];

The solution is given by

a5=a02κ24πΨ,a6=a02κ24πΨ.a_{5}=-\frac{a_{0}}{2}-\frac{\kappa^{2}}{4\pi\Psi}\,,\quad a_{6}=\frac{a_{0}}{2}-\frac{\kappa^{2}}{4\pi\Psi}\,. (63)

We check that this solves the equations:

In[]:= Simplify[eqsa3 /. sola3]
Out[]= 0

Together with the ansatz for the third-order metric component g30a\accentset{3}{g}_{0a} we obtain the solution:

In[]:= sol3def = ans3def /. sola3;
In[]:= sol3ru = mkrg[sol3def];

Finally, we also check that this solves the third-order field equation we started with:

In[]:= eqs3 /. sol2ru /. sol3ru;
In[]:= PotentialWToChiV[%];
In[]:= Expand[%];
In[]:= ContractMetric[%, OverDerivatives \to\lst@whitespacefalse True, AllowUpperDerivatives \to\lst@whitespacefalse True];
In[]:= PotentialChiToU[%];
In[]:= PotentialVToU[%];
In[]:= PotentialToSource[%];
In[]:= ToCanonical[%];
In[]:= SortPDs[%];
In[]:= Simplify[%]
Out[]= 0

VI.6.4 Fourth velocity order

Finally, we come to the fourth velocity order, which is the most involved. For the theory under consideration, it is sufficient to solve the field equation 400\accentset{4}{\mathcal{E}}_{00}, as it determines the necessary component g400\accentset{4}{g}_{00}. We hence isolate this equation:

In[]:= eqs4 = PPN[MetEq, 4][-LI[0], -LI[0]] /. meteqvru;

We find that it takes the following form:

400=Ψ4(2g4004g30a,0a+2g2aa,00+g200,ag200,a+g200,ag2bb,a2g200,ag2ab,bg200,abg2ab)ω(Ψ)4ω(Ψ)+6ψ2,aψ2,a+κ2ω(Ψ)(2ω(Ψ)+3)2ρψ2+κ2ω(Ψ)+22ω(Ψ)+3ρg20012ψ2,ag200,a12ψ2g200ψ2,00κ2ρ|v|2κ2ω(Ψ)+22ω(Ψ)+3ρΠ3κ2ω(Ψ)+32ω(Ψ)+3p.\accentset{4}{\mathcal{E}}_{00}=-\frac{\Psi}{4}\left(2\triangle\accentset{4}{g}_{00}-4\accentset{3}{g}_{0a,0a}+2\accentset{2}{g}_{aa,00}+\accentset{2}{g}_{00,a}\accentset{2}{g}_{00,a}+\accentset{2}{g}_{00,a}\accentset{2}{g}_{bb,a}-2\accentset{2}{g}_{00,a}\accentset{2}{g}_{ab,b}-\accentset{2}{g}_{00,ab}\accentset{2}{g}_{ab}\right)\\ -\frac{\omega^{\prime}(\Psi)}{4\omega(\Psi)+6}\accentset{2}{\psi}_{,a}\accentset{2}{\psi}_{,a}+\frac{\kappa^{2}\omega^{\prime}(\Psi)}{(2\omega(\Psi)+3)^{2}}\rho\accentset{2}{\psi}+\kappa^{2}\frac{\omega(\Psi)+2}{2\omega(\Psi)+3}\rho\accentset{2}{g}_{00}-\frac{1}{2}\accentset{2}{\psi}_{,a}\accentset{2}{g}_{00,a}-\frac{1}{2}\accentset{2}{\psi}\triangle\accentset{2}{g}_{00}-\accentset{2}{\psi}_{,00}\\ -\kappa^{2}\rho|v|^{2}-\kappa^{2}\frac{\omega(\Psi)+2}{2\omega(\Psi)+3}\rho\Pi-3\kappa^{2}\frac{\omega(\Psi)+3}{2\omega(\Psi)+3}p\,. (64)

As we shall see below, this equation can be solved by the following ansatz:

In[]:= ans4def = PPN[Met, 4][-LI[0], -LI[0]] == aa[11] * PotentialU[]^2 +
aa[7] * PotentialPhi1[] + aa[8] * PotentialPhi2[] +
aa[9] * PotentialPhi3[] + aa[10] * PotentialPhi4[]
Out[]= g400=a7Φ1+a8Φ2+a9Φ3+a10Φ4+a11U2\accentset{4}{g}_{00}=a_{7}\Phi_{1}+a_{8}\Phi_{2}+a_{9}\Phi_{3}+a_{10}\Phi_{4}+a_{11}U^{2}
In[]:= ans4ru = mkrg[ans4def];

We then insert this ansatz into the fourth-order field equation, alongside the previously determined solutions at lower velocity order. In order to convert the post-Newtonian potentials to a unified form, from which we can read off the independent equations for the constant coefficients in the ansatz, it is sufficient to replace the divergence terms Va,aV_{a,a} and Wa,aW_{a,a} by time derivatives of UU, before replacing all potentials by source terms. This is done as follows:

In[]:= eqs4 /. ans4ru /. sol2ru /. sol3ru;
In[]:= Expand[%];
In[]:= ContractMetric[%, OverDerivatives \to\lst@whitespacefalse True, AllowUpperDerivatives \to\lst@whitespacefalse True];
In[]:= PotentialVToU[%];
In[]:= PotentialWToU[%];
In[]:= PotentialToSource[%];
In[]:= ToCanonical[%];
In[]:= SortPDs[%];
In[]:= Expand[%];
In[]:= eqsa4 = Simplify[ScreenDollarIndices[%]];

The resulting equation 400\accentset{4}{\mathcal{E}}_{00}, which we do not display here for brevity, involves the six independent terms pp, ρΠ\rho\Pi, ρU\rho U, U,00U_{,00}, ρ|v|2\rho|v|^{2}, U,aU,aU_{,a}U_{,a}, whose constant coefficients must vanish. We thus isolate these constant coefficients:

In[]:= eq1 = Simplify[Coefficient[eqsa4, Pressure[]]];
In[]:= eq2 = Simplify[Coefficient[eqsa4, Density[] * InternalEnergy[]]];
In[]:= eq3 = Simplify[Coefficient[eqsa4, Density[] * PotentialU[]]];
In[]:= eq4 = Simplify[Coefficient[eqsa4, ParamD[TimePar, TimePar][PotentialU[]]]];
In[]:= eq5 = Simplify[Coefficient[eqsa4, Density[] * Velocity[-T3a] * Velocity[T3a]]];
In[]:= eq6 = Simplify[Coefficient[eqsa4, PD[-T3a][PotentialU[]] * PD[T3a][PotentialU[]]]];

For consistency, it is useful to check the completeness of this decomposition:

In[]:= Simplify[Pressure[] * eq1 + Density[] * InternalEnergy[] * eq2 +
Density[] * PotentialU[] * eq3 + ParamD[TimePar, TimePar][PotentialU[]] * eq4 +
Density[] * Velocity[-T3a] * Velocity[T3a] * eq5 +
PD[-T3a][PotentialU[]] * PD[T3a][PotentialU[]] * eq6 - eqsa4]
Out[]= 0

We have thus obtained six equations for the six remaining unknowns a0,a6,,a11a_{0},a_{6},\ldots,a_{11}. It turns out that these equations are linearly independent, so that we can solve for all missing constants:

In[]:= sola4 = Simplify[First[Solve[# == 0 & /@ {eq1, eq2, eq3, eq4, eq5, eq6},
aa /@ Prepend[Range[7, 11], 0]]]];

This yields the solution

a0=κ24πΨ3ω(Ψ)+42ω(Ψ)+3,a9=κ22πΨω(Ψ)+22ω(Ψ)+3,a8=κ416π2Ψ212+38ω(Ψ)+32ω2(Ψ)+8ω3(Ψ)Ψω(Ψ)(2ω(Ψ)+3)3,\displaystyle a_{0}=\frac{\kappa^{2}}{4\pi\Psi}\frac{3\omega(\Psi)+4}{2\omega(\Psi)+3}\,,\quad a_{9}=\frac{\kappa^{2}}{2\pi\Psi}\frac{\omega(\Psi)+2}{2\omega(\Psi)+3}\,,\quad a_{8}=\frac{\kappa^{4}}{16\pi^{2}\Psi^{2}}\frac{12+38\omega(\Psi)+32\omega^{2}(\Psi)+8\omega^{3}(\Psi)-\Psi\omega^{\prime}(\Psi)}{(2\omega(\Psi)+3)^{3}}\,,
a7=κ22πΨ,a10=3κ22πΨω(Ψ)+12ω(Ψ)+3,a11=κ432π2Ψ248+80ω(Ψ)+44ω2(Ψ)+8ω3(Ψ)+Ψω(Ψ)(2ω(Ψ)+3)3.\displaystyle a_{7}=\frac{\kappa^{2}}{2\pi\Psi}\,,\quad a_{10}=\frac{3\kappa^{2}}{2\pi\Psi}\frac{\omega(\Psi)+1}{2\omega(\Psi)+3}\,,\quad a_{11}=-\frac{\kappa^{4}}{32\pi^{2}\Psi^{2}}\frac{48+80\omega(\Psi)+44\omega^{2}(\Psi)+8\omega^{3}(\Psi)+\Psi\omega^{\prime}(\Psi)}{(2\omega(\Psi)+3)^{3}}\,. (65)

We check that it is indeed a solution:

In[]:= Simplify[eqsa4 /. sola4]
Out[]= 0

Since we have now determined a0a_{0}, we can complete the partial third-order solution we obtained earlier:

In[]:= sol3def = ans3def /. Simplify[sola3 /. sola4];
In[]:= sol3ru = mkrg[sol3def];

Using the remaining constants a6,,a11a_{6},\ldots,a_{11}, we obtain the solution for g400\accentset{4}{g}_{00}:

In[]:= sol4def = ans4def /. sola4;
In[]:= sol4ru = mkrg[sol4def];

Again, we check for consistency that this solves the fourth-order field equation:

In[]:= eqs4 /. sol2ru /. sol3ru /. sol4ru;
In[]:= Expand[%];
In[]:= ContractMetric[%, OverDerivatives \to\lst@whitespacefalse True, AllowUpperDerivatives \to\lst@whitespacefalse True];
In[]:= PotentialVToU[%];
In[]:= PotentialWToU[%];
In[]:= PotentialToSource[%];
In[]:= ToCanonical[%];
In[]:= SortPDs[%];
In[]:= Expand[%];
In[]:= Simplify[%]
Out[]= 0

VI.7 PPN metric and parameters

Using the solution we determined so far, we can now calculate the post-Newtonian metric and parameters. For this purpose, we first isolate the metric components to be determined.

In[]:= metcomp = {PPN[Met, 2][-LI[0], -LI[0]], PPN[Met, 2][-T3a, -T3b],
PPN[Met, 3][-LI[0], -T3a], PPN[Met, 4][-LI[0], -LI[0]]}
Out[]= {g200,g2ab,g30a,g400}\big{\{}\accentset{2}{g}_{00},\accentset{2}{g}_{ab},\accentset{3}{g}_{0a},\accentset{4}{g}_{00}\big{\}}

We then insert the solution we have found.

In[]:= metcomp /. sol2ru /. sol3ru /. sol4ru;
In[]:= ToCanonical[%];
In[]:= Expand[%];
In[]:= ppnmet = Simplify[%];

We will compare this to the standard PPN metric.

In[]:= stamet = Simplify[MetricToStandard /@ metcomp];

This can be done in two steps. First, we choose the normalization constant κ\kappa, which corresponds to the effective Newtonian constant, such that g200=2U\accentset{2}{g}_{00}=2U. We define the following equation:

In[]:= kappaeq = First[ppnmet] == First[stamet];

This takes the form

2U=κ22πΨω(Ψ)+22ω(Ψ)+3U.2U=\frac{\kappa^{2}}{2\pi\Psi}\frac{\omega(\Psi)+2}{2\omega(\Psi)+3}U\,. (66)

To solve this equation, we take its positive root:

In[]:= First[Sqrt[FullSimplify[k2 /. Solve[kappaeq /. kappa \to\lst@whitespacefalse Sqrt[k2], k2]]]];
In[]:= kappadef = kappa == %;
In[]:= kapparu = mkrg[kappadef];

This yields the solution

κ=4πΨ2ω(Ψ)+3ω(Ψ)+2.\kappa=\sqrt{4\pi\Psi\frac{2\omega(\Psi)+3}{\omega(\Psi)+2}}\,. (67)

With this solution, we can now determine the PPN parameters. These are the equations to be solved.

In[]:= pareqs = Simplify[ToCanonical[stamet - ppnmet /. kapparu]];

To determine the PPN parameters, we isolate the constant coefficients in front of the post-Newtonian potentials Uδab,Va,Wa,𝒜,U2,ΦW,Φ1,Φ2,Φ3,Φ4U\delta_{ab},V_{a},W_{a},\mathcal{A},U^{2},\Phi_{W},\Phi_{1},\Phi_{2},\Phi_{3},\Phi_{4}.

In[]:= pots = {PotentialU[] BkgMetricS3[-T3a, -T3b], PotentialV[-T3a], PotentialW[-T3a],
PotentialA[], PotentialU[]^2, PotentialPhiW[],
PotentialPhi1[], PotentialPhi2[], PotentialPhi3[], PotentialPhi4[]};
In[]:= eqs = DeleteCases[Flatten[Simplify[Outer[Coefficient, pareqs, pots]]], 0];

Finally, we can solve for the full set of PPN parameters.

In[]:= pars = {ParameterBeta, ParameterGamma, ParameterXi,
ParameterAlpha1, ParameterAlpha2, ParameterAlpha3,
ParameterZeta1, ParameterZeta2, ParameterZeta3, ParameterZeta4};
In[]:= parsol = FullSimplify[Solve[# == 0 & /@ eqs, pars][[1]]];

This finally yields the solution

γ=ω(Ψ)+1ω(Ψ)+2,β=1+Ψω(Ψ)4(2ω(Ψ)+3)(ω(Ψ)+2)2,α1=α2=α3=ζ1=ζ2=ζ3=ζ4=ξ=0.\gamma=\frac{\omega(\Psi)+1}{\omega(\Psi)+2}\,,\quad\beta=1+\frac{\Psi\omega^{\prime}(\Psi)}{4(2\omega(\Psi)+3)(\omega(\Psi)+2)^{2}}\,,\quad\alpha_{1}=\alpha_{2}=\alpha_{3}=\zeta_{1}=\zeta_{2}=\zeta_{3}=\zeta_{4}=\xi=0\,. (68)

This is of course the well-known post-Newtonian limit of scalar-tensor gravity with a massless scalar field Nordtvedt (1970).

VII Summary and outlook

We have presented the Mathematica package xPPN, which is based on the tensor algebra suite xAct and which implements the PPN formalism in its formulation presented in Will (1993), with extensions to adapt it to the geometries employed in the three formulations of general relativity Jiménez et al. (2019) and modifications thereof. Besides discussing its underlying mathematical concepts and giving a detailed account on its usage, we provided an example application to a simple scalar-tensor theory of gravity. We believe that this package will find wide application to assess the viability of gravity theories by comparing their post-Newtonian limit to observations in the solar system.

Despite the generality of xPPN, being applicable to gravity theories based on different geometric foundations, various extensions and modifications are possible and may be implemented in future versions. For example, one may consider the following types of extensions:

  1. 1.

    Alternative formulations of the PPN formalism: A newer approach towards the PPN formalism employs a different density variable (Will, 2018, Sec. 4), which has the advantage that it simplifies the gauge transformation of the PPN potentials compared to the original formulation. Another approach to simplify the issue of gauge transformations is to resort to a formulation which makes use of gauge-invariant perturbation theory, thereby resolving the necessity of gauge considerations and simplifying the application of the PPN procedure Hohmann (2020b). Such modifications may be included by changing the expansion of the metric in terms of PPN potentials.

  2. 2.

    Additional post-Newtonian potentials and parameters: Various theories of gravity exhibit a post-Newtonian limit in which the metric perturbation cannot be expressed only in terms of the post-Newtonian potentials used in the standard formalisms, and so more general potentials and corresponding parameters have been introduced. The presence of massive fields leads to the appearance of Yukawa-type potentials Zaglauer (1990); Helbig (1991), while higher-order derivatives can be accommodated by further integrals in the post-Newtonian potentials Gladchenko et al. (1990); Gladchenko and Zhytnikov (1994). Another class of terms arises from theories which include parity-violating contributions Alexander and Yunes (2007a, b, 2009), or by violation of diffeomorphism invariance Lin et al. (2012); Lin and Wang (2013); Lin et al. (2014). Further, one may introduce also fourth-order tensor potentials to expand the term g4ab\accentset{4}{g}_{ab}, which is neglected in the standard PPN formalism, but may be used to describe higher-order corrections to light propagation Richter and Matzner (1982a, b). Such additional potentials may easily be included by defining the corresponding tensor fields and the equations which relate them to the corresponding source terms, in full analogy to the standard PPN potentials.

  3. 3.

    Higher than fourth order in the post-Newtonian expansion: While in the standard PPN formalism implemented in the present version of xPPN the metric (and possible other fields present in the theory) are expanded only up to the fourth velocity order, one may also consider higher order terms, and address problems such as the post-Newtonian dynamics of systems involved in the generation of gravitational waves Blanchet (2014); Will (2018). Care must be taken since the Euler equations governing the dynamics of the source matter attain dissipative terms at higher orders, and also the gravitational field exhibits dissipative behavior due to the loss of energy by emitted gravitational waves. Further, such as extension requires the definition of higher-order post-Newtonian potentials, along with corresponding post-Newtonian parameters, whose relation to observations and associated observables must be defined, so that such an extension would be a major task.

  4. 4.

    Generalized post-Newtonian expansion: The standard PPN formalism assumes the validity of a post-Newtonian expansion around a flat Minkowski background. This assumption may be generalized, by allowing for a time-dependent Friedmann-Lemaître-Robertson-Walker background Sanghai and Clifton (2017), or by including non-perturbative effects arising from the Vainshtein screening mechanism Avilez-Lopez et al. (2015).

  5. 5.

    More general geometric frameworks: Another assumption of the standard PPN formalism states that the motion of test masses is governed by a single metric, and so the observable effects on test masses are fully covered by a post-Newtonian expansion of this single metric. This assumption may be relaxed if there are several dynamical metrics present in the considered gravity theory, which lead to more complex test matter dynamics and generalized sources of gravity Clifton et al. (2010); Hohmann and Wohlfarth (2010); Hohmann (2014). Also more general connections may be considered, such as a general teleparallel connection Beltrán Jiménez et al. (2020), as well as Riemann-Cartan Smalley (1980); Castagnino et al. (1985); Castagnino and Levinas (1987); Gladchenko et al. (1990); Gladchenko and Zhytnikov (1994) or metric-affine geometry Hehl et al. (1995). In theories of this class additional matter currents may appear from a coupling of spin to gravity, which gives rise to additional source terms, which must be accommodated for by further PPN potentials, together with their respective equations of motion and conservation laws generalizing the Euler equations Weyssenhoff and Raabe (1947); Ray and Smalley (1983); Kopczynski (1986); Obukhov and Korotkii (1987); Obukhov and Tresguerres (1993); Obukhov (1996); Puetzfeld and Obukhov (2014); Iosifidis (2020).

Acknowledgements.
The author thanks Yuri Obukhov and Dirk Puetzfeld for helpful comments on the manuscript and pointing out related work. He gratefully acknowledges the full support by the Estonian Research Council through the Personal Research Funding project PRG356, as well as the European Regional Development Fund through the Center of Excellence TK133 “The Dark Side of the Universe”.

Appendix A Implementation notes

Although xTensor offers a possibility to split tensor indices for product manifolds and to project tensors to submanifolds, while xPert provides an implementation of a perturbative expansion of tensor fields, these approaches are not the most well-adapted to the mathematical concepts discussed in section III. While it may still be possible to use these packages for the task at hand, xPPN provides its own implementations of these concepts, in order to match as closely as possible with the PPN formalism, and to simplify the different perturbative treatment of space and time components of tensors and in particular their derivatives. This appendix contains a few notes how the functions detailed in the main part of this article are implemented. The internal representation of split tensor fields is shown in section A.1. In section A.2, we give an overview of the algorithm used to obtain this decomposition for arbitrary tensor fields. Finally, in section A.3 we give a few notes on the implementation of the perturbative expansion in velocity orders. The aim of this technical appendix is to give an insight to the internal data structures and algorithms used by xPPN, which is not necessary for its use, but may be helpful for readers who intend to develop extensions to xPPN or similar packages based on xAct in other areas of physics.

A.1 Internal representation of decomposed tensors

As detailed in section III.1, we adhere to the following mathematical interpretation of the 3+13+1 split of tensor fields, which turns out to be convenient for the PPN formalism:

  1. 1.

    The spacetime manifold is regarded as a product manifold M4T1×S3M_{4}\cong T_{1}\times S_{3}.

  2. 2.

    The components of any tensor defined on the spacetime manifold M4M_{4} with respect to adapted coordinates (t,xa)(t,x^{a}) are split into time and space components. For example, given a vector AαA^{\alpha}, one has a decomposition into a time component A0A^{0} and spatial components AaA^{a}.

  3. 3.

    The decomposed parts of a tensor on M4M_{4} are regarded as tensors on S3S_{3}, obtained as a time slice in a foliation of spacetime, carrying an additional dependence on time tt, where time is treated not as a coordinate, but as a parameter.

  4. 4.

    The decomposition simplifies in the presence of tensor symmetries. For example, given an antisymmetric tensor Aαβ=A[αβ]A_{\alpha\beta}=A_{[\alpha\beta]}, the component A00A_{00} vanishes, indices in Aa0A_{a0} may equivalently be sorted in canonical (lexicographic) order to yield A0a-A_{0a} and AabA_{ab} is a tensor which inherits the antisymmetry in its two indices.

The two mentioned approaches implemented in xTensor do not match these criteria:

  1. 1.

    The projection approach using normal vector fields and induced metrics does not perform any decomposition of indices; the equivalent of the time component A0A^{0} retains its tensor rank, and is hence represented by a vector, although being projected onto (and hence tangent to) a one-dimensional manifold. One may obtain a scalar by contracting with the normal vector field, at the cost of computational complexity for carrying this contracted factor through all calculations333This approach is used in xPand Pitrou et al. (2013), and such contractions are then replaced by tensors of lower rank which are pre-defined for the space and time components of metric perturbations. Here we aim to avoid manually defining such a decomposition, in favor of an algorithm which performs the decomposition automatically whenever a tensor field is defined..

  2. 2.

    The split along product manifolds also retains the tensor rank. Instead of the inert time index 0 and thus being treated as scalar, time components carry a coordinate index associated to the time manifold, which therefore must satisfy the rules imposed by xTensor on such indices (such as the restriction on the number of occurrences, uniqueness in expressions, summation over dummy indices etc.).

Furthermore, in both approaches time retains its nature of a coordinate. Therefore, xPPN uses the following approach to decomposing tensor fields instead. The components of the 3+13+1 split of tensors are represented by the inert function PPNTensor in xPPN, which resides in the private context xActxPPNPrivate. It may be used in the following two forms:

  1. 1.

    PPNTensor[hh, {s1s_{1}, s2s_{2}, \ldots, sks_{k}}], where hh is a valid tensor head belonging to a tensor on the spacetime manifold M4M_{4} and s1,s2,,sks_{1},s_{2},\ldots,s_{k} is a list of index slots, represents a component in the 3+13+1 decomposition of the tensor with head hh. The particular component is selected by the list of tensor slots; see the list below for valid values and their interpretation.

  2. 2.

    PPNTensor[hh, {s1s_{1}, s2s_{2}, \ldots, sks_{k}}, nn], where nn is a non-negative integer and h,s1,s2,,skh,s_{1},s_{2},\ldots,s_{k} are as above, represents the term of velocity order 𝒪(n)\mathcal{O}(n) in the perturbative expansion of the aforementioned component represented by PPNTensor[hh, {s1s_{1}, s2s_{2}, \ldots, sks_{k}}].

The valid values for the slots s1,s2,,sks_{1},s_{2},\ldots,s_{k} depends on the slots S1,S2,,SkS_{1},S_{2},\ldots,S_{k} of hh. The number kk of slots given (i.e., the length of the list) must match the number of slots of hh. Further, for every slot SiS_{i} of hh the following rules must be satisfied:

  1. 1.

    The character of the slots must match, i.e., if SiS_{i} is an upper (lower) index, then also sis_{i} must be an upper (lower) index.

  2. 2.

    If SiS_{i} is ±\pmTangentMfSpacetime, then sis_{i} must be one of ±\pmLabels or ±\pmTangentMfSpace.

  3. 3.

    If SiS_{i} is ±\pmLorentzMfSpacetime, then sis_{i} must be one of ±\pmLabels or ±\pmLorentzMfSpace.

  4. 4.

    If SiS_{i} is any other slot and hence does not belong to a vector bundle over M4M_{4}, then sis_{i} must be the same as SiS_{i}.

The interpretation should be evident: every tangent or Lorentz index associated to the spacetime manifold M4M_{4} is replaced either by a corresponding index on the space manifold or the special inert value LI[0], belonging to Labels, which represents the time component. xPPN defines upvalues for the following xTensor functions applied to PPNTensor objects obeying any of the two forms listed above:

  1. 1.

    xTensorQ yields True if hh is a valid tensor head on the spacetime manifold and the slots satisfy the conditions listed above, and False otherwise.

  2. 2.

    SlotsOfTensor returns the list {s1s_{1}, s2s_{2}, \ldots, sks_{k}} of tensor slots.

  3. 3.

    DependenciesOfTensor gives the dependencies of hh, but with MfSpacetime replaced by MfSpace and TimePar. If the tensor depends on any other parameters or manifolds, then these dependencies are preserved.

  4. 4.

    SymmetryGroupOfTensor returns the remaining symmetry group of the 3+13+1 decomposed tensor.

  5. 5.

    PrintAs yields the same symbol PrintAs[hh] which is used for printing hh if no velocity order is given, and otherwise adds the velocity order nn as an overscript h𝑛\accentset{n}{h}.

Further, PPNTensor automatically applies rules which are obtained from index symmetries. These are calculated whenever a tensor field is defined, as explained below.

A.2 3+13+1 spacetime split algorithm

In order to retain only independent components in the 3+13+1 split of a tensor, xPPNexamines tensor symmetries whenever a new tensor on the spacetime manifold is defined. It does so by extending the xTensor function DefTensor, using the extensibility framework implemented in xAct, to perform the following steps:

  1. 1.

    Determine which index slots of the tensor are associated to the spacetime manifold. If a tensor carries additional, internal indices, then they will be treated separately and ignored in the following steps.

  2. 2.

    Calculate the symmetry group acting on the spacetime indices only, i.e., factor out any possible symmetries acting on internal indices and also ignore them in the following steps.

  3. 3.

    Create a list of all possible ways to split the spacetime indices into space and time components.

  4. 4.

    Consider the action of the symmetry group on the splits from the previous step and determine the orbits of this action. For example, if a tensor carries a symmetry (or antisymmetry) in two indices, then there is no difference between choosing the first index to be temporal and the second index spatial or vice versa, and so these two possible splits belong to the same orbit; these two possible ways to arrange the indices of the split tensor are equivalent.

  5. 5.

    For each orbit, perform the following steps:

    1. (a)

      Pick a representative, i.e., from all equivalent ways to arrange the indices, choose the one which comes first in canonical (lexicographic) order.

    2. (b)

      Check whether any of the elements of the subgroup which permutes only the temporal indices comes with an antisymmetry, i.e., changes the sign of the tensor. If this is the case, this component must vanish identically, since permuting only temporal indices must leave the tensor invariant, and so it must be equal to its negative. In this case, define all index combinations in this orbit to be an alias for the zero tensor Zero.

    3. (c)

      If the chosen representative does not vanish, conclude with the following steps:

      1. i.

        Determine the remaining symmetry group acting on the spatial indices only.

      2. ii.

        Define a tensor on a purely spatial manifold, whose temporal and spatial indices match with the representative, which carries the symmetry determined in the previous step in the spacetime indices and any inherit symmetry in internal indices, and which in addition depends on a time parameter.

      3. iii.

        Define all other arrangements of temporal and spatial indices which are equivalent to the representative as alias for the previously defined tensor or its negative, taking into account possible sign changes when indices are permuted.

To illustrate these steps, consider the case of defining an antisymmetric tensor Aαβ=A[αβ]A_{\alpha\beta}=A_{[\alpha\beta]} on the spacetime manifold, by invoking

In[]:= DefTensor[A[-T4\textalpha, -T4\textbeta], MfSpacetime, Antisymmetric[{1, 2}]]

Then the following steps are carried out automatically by xPPN:

  1. 1.

    There are no internal indices, and so the spacetime related symmetry operations acting on the tensor indices are the identity and the swapping of the two indices, where the latter also changes the sign of the tensor.

  2. 2.

    Each of the two indices of AαβA_{\alpha\beta} splits into time and space. Hence, there are four possible decomposed tensor fields: A00,A0a,Aa0,AabA_{00},A_{0a},A_{a0},A_{ab}.

  3. 3.

    The two components A0aA_{0a} and Aa0A_{a0} are transformed into each other under the index symmetry of the original tensor fields; hence, they belong to the same orbit of the action of the symmetry group. The remaining components are the sole elements in their respective orbits.

  4. 4.

    The three orbits are examined separately:

    1. (a)

      For A00A_{00} one finds that the swap operation acts on temporal indices only, but also changes the sign of the tensor. Hence, A00=A00=0A_{00}=-A_{00}=0 and the tensor is defined as an alias of Zero:

      A /: PPNTensor[A, {-Labels, -Labels}] := Zero;
      A /: PPNTensor[A, {-Labels, -Labels}, _] := Zero;
    2. (b)

      For A0aA_{0a} and Aa0A_{a0} the former arrangement of indices is chosen as a representative, since the indices are in canonical (lexicographic) order. A purely spatial tensor A0aA_{0a} is defined, which has one free index slot. Aa0A_{a0} is defined as an alias for A0a-A_{0a}:

      A /: PPNTensor[A, {-TangentMfSpace, -Labels}] :=
      (-PPNTensor[A, {-Labels, -TangentMfSpace}][#2, #1] &);
    3. (c)

      Another spatial tensor AabA_{ab} is defined, which is antisymmetric in its two index slots. The tensor symmetry is again associated to the symbol A.

Note that all properties of these tensors, such as their symmetries and tensor slots, are associated with the symbol (tensor head) which is used in the original call to DefTensor to define the tensor on the spacetime manifold, and no further symbols are introduced.

A.3 Velocity order decomposition algorithm

In order to implement the rules for the perturbative expansion in velocity orders detailed in section III.2, a few special cases have been defined for the function VelocityOrder shown in section V.4. For the product rule (29), it is most convenient to rely on Mathematica’s pattern matching and recursive function application functionality. Given a product A=A1ANA=A_{1}\cdots A_{N} of NN tensors, one may split off the first factor,

A=A1A~,A~=A2AN,A=A_{1}\tilde{A}\,,\quad\tilde{A}=A_{2}\cdots A_{N}\,, (69)

and then recursively apply the rule

A𝑛=k=0nA𝑘1A~nk.\accentset{n}{A}=\sum_{k=0}^{n}\accentset{k}{A}_{1}\accentset{n-k}{\tilde{A}}\,. (70)

This is repeated until only a single factor is left. The implementation then takes the following simple form.

VelocityOrder[Times[ex0_, ex1__], n_, opt : OptionsPattern[]] :=
Module[{k}, Sum[VelocityOrder[ex0, k, opt] *
VelocityOrder[Times[ex1], n - k, opt], {k, 0, n}]];

Next, we come to the relation (31) for the perturbative expansion of expressions which are given as functions of an arbitrary number of arguments. To evaluate this formula, it is useful to define the formal series

A~i(ϵ)=k=0ϵkA𝑘i\tilde{A}_{i}(\epsilon)=\sum_{k=0}^{\infty}\epsilon^{k}\accentset{k}{A}_{i} (71)

for the tensor fields A1,,ANA_{1},\ldots,A_{N}. Observe that the nn’th order series coefficient

1n!dndϵnf(A~1(ϵ),,A~N(ϵ))|ϵ=0=pikf(p11++p1n,,pN1++pNn)(A01,,A0N)i=1Nk=1nA𝑘ipikpik!,\frac{1}{n!}\left.\frac{\mathrm{d}^{n}}{\mathrm{d}\epsilon^{n}}f(\tilde{A}_{1}(\epsilon),\ldots,\tilde{A}_{N}(\epsilon))\right|_{\epsilon=0}=\sum_{p_{ik}}f^{(p_{11}+\ldots+p_{1n},\ldots,p_{N1}+\ldots+p_{Nn})}\left(\accentset{0}{A}_{1},\ldots,\accentset{0}{A}_{N}\right)\prod_{i=1}^{N}\prod_{k=1}^{n}\frac{\accentset{k}{A}_{i}^{p_{ik}}}{p_{ik}!}\,, (72)

where the sum runs over

pik{0,,qk},i=1Npik=qk;i{1,,N}p_{ik}\in\{0,\ldots,q_{k}\}\,,\quad\sum_{i=1}^{N}p_{ik}=q_{k}\,;\quad i\in\{1,\ldots,N\} (73)

and

qk{1,,n},k=1nkqk=n,q_{k}\in\{1,\ldots,n\}\,,\quad\sum_{k=1}^{n}kq_{k}=n\,, (74)

is exactly the term of nn’th velocity order in the expansion (31). Hence, it can be obtained as follows.

VelocityOrder[fkt_ ? ScalarFunctionQ[args__], n_, opt : OptionsPattern[]] :=
Module[{t, i}, SeriesCoefficient[
fkt @@ (Sum[t^i * VelocityOrder[#, i, opt], {i, 0, n}] & /@ {args}),
{t, 0, n}]];

Finally, we have encountered the rule (32) that time derivatives are weighted with an additional velocity order. Since time derivatives are represented by parameter derivatives with respect to TimePar, this behavior is achieved by counting time derivatives as follows.

VelocityOrder[ParamD[t : TimePar ..][expr_], n_, opt : OptionsPattern[]] :=
ParamD[t][VelocityOrder[expr, n - Length[{t}], opt]];

Note that partial derivatives with respect to spatial coordinates do not incur additional velocity orders.

VelocityOrder[PD[i_][expr_], n_, opt : OptionsPattern[]] :=
PD[i][VelocityOrder[expr, n, opt]];

References