Question: How can I get the correct inverse metric with Physics?

I am looking to do some gravitational perturbations around a generic background spacetime. But before doing that, I wanted to look at just linearized gravity, and make sure all the standard calculations work with Physics before throwing something a little more complicated at it. I went to ?Physics,Library and found the Linearize command, and I thought this was great! When I was reading through it however, I found that the sign infront of the perturbation in the inverse metric is incorrect. Now, this does not give any invalid results for the Ricci tensor as displayed in the worksheet, since we are only going to linear order, but if we want to go beyond linear order, this will start to cause issues. 

Is there a way that Maple can handle this? Or do I have to do some sort of double Define for the metric: one with all downstairs indices, and one with all upstairs indices? If so, how do I do that? 

Any help would be greatly appreciated!

restart: with(Physics): with(Library):

Setup(coordinates = cartesian,signature=`-+++`):

`Systems of spacetime coordinates are:`*{X = (t, x, y, z)}

 

_______________________________________________________

(1)

g_[];

g_[mu, nu] = (Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(2)
  

 

Define(h[mu, nu],symmetric)

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(3)
  

 

Define(eta[mu,nu]=rhs((2)))

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(4)

g_[mu,nu]=eta[mu,nu]+epsilon*h[mu,nu]

Physics:-g_[mu, nu] = epsilon*h[mu, nu]+eta[mu, nu]

(5)

Lets "define" the inverse metric as it appears from the Library:-Linearize worksheet.

g_[~mu,~alpha]=eta[~mu,~alpha]+epsilon*h[~mu,~alpha]

Physics:-g_[`~alpha`, `~mu`] = epsilon*h[`~mu`, `~alpha`]+eta[`~alpha`, `~mu`]

(6)

If we multiply the metric and its inverse together, we should expact that we return the KroneckerDelta by definition -- if we consider only to linear order.  

(5)*(6)

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = (epsilon*h[mu, nu]+eta[mu, nu])*(epsilon*h[`~mu`, `~alpha`]+eta[`~alpha`, `~mu`])

(7)

expand((7))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = epsilon^2*h[mu, nu]*h[`~mu`, `~alpha`]+epsilon*eta[mu, nu]*h[`~mu`, `~alpha`]+epsilon*eta[`~alpha`, `~mu`]*h[mu, nu]+eta[mu, nu]*eta[`~alpha`, `~mu`]

(8)

Substitute(eta=g_,(8))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = epsilon^2*h[mu, nu]*h[`~mu`, `~alpha`]+epsilon*Physics:-g_[mu, nu]*h[`~mu`, `~alpha`]+epsilon*Physics:-g_[`~alpha`, `~mu`]*h[mu, nu]+Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`]

(9)

subs(epsilon^2=0,(9))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = epsilon*Physics:-g_[mu, nu]*h[`~mu`, `~alpha`]+epsilon*Physics:-g_[`~alpha`, `~mu`]*h[mu, nu]+Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`]

(10)

Simplify(%)

Physics:-g_[nu, `~alpha`] = 2*epsilon*h[nu, `~alpha`]+Physics:-g_[nu, `~alpha`]

(11)

 

As we can see, we do not get delta alone on the right-hand-side, but instead we still have the perturbation still.

If we instead, use the proper way the inverse should look, which of course comes from the definition of the inverse, it should have minus sign.

g_[~mu,~alpha]=eta[~mu,~alpha]-epsilon*h[~mu,~alpha]

Physics:-g_[`~alpha`, `~mu`] = -epsilon*h[`~mu`, `~alpha`]+eta[`~alpha`, `~mu`]

(12)

subs(epsilon^2=0,expand((5)*(12)))

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = -epsilon*eta[mu, nu]*h[`~mu`, `~alpha`]+epsilon*eta[`~alpha`, `~mu`]*h[mu, nu]+eta[mu, nu]*eta[`~alpha`, `~mu`]

(13)

Simplify(Substitute(eta=g_,(13)))

Physics:-g_[nu, `~alpha`] = Physics:-g_[nu, `~alpha`]

(14)

Which is the desired result we want. So, my question: is there a way that Maple can produce the correct inverse metric not only to linear order, but to say quadratic, without explicitly deriving it ourselves?

Here is the Physics:-Library(Linearize) Worksheet/Example with some comments

restart: with(Physics): with(Library):

Setup(coordinates = cartesian);

`Systems of spacetime coordinates are:`*{X = (x, y, z, t)}

 

_______________________________________________________

 

[coordinatesystems = {X}]

(1)
  

The default metric when Physics is loaded is the Minkowski metric, representing a flat (no curvature) spacetime

g_[];

g_[mu, nu] = (Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(2)
  

Suppose you want to define a small perturbation around this metric. For that purpose, define a perturbation tensor h[mu, nu], that in the general case depends on the coordinates and is not diagonal, the only requirement is that it is symmetric (to have it diagonal, change symmetric by diagonal; to have it constant, change delta[i, j](X) by delta[i, j])

h[mu, nu] = Matrix(4, (i, j) -> delta[i, j](X), shape = symmetric);

h[mu, nu] = (Matrix(4, 4, {(1, 1) = delta[1, 1](x, y, z, t), (1, 2) = delta[1, 2](x, y, z, t), (1, 3) = delta[1, 3](x, y, z, t), (1, 4) = delta[1, 4](x, y, z, t), (2, 1) = delta[1, 2](x, y, z, t), (2, 2) = delta[2, 2](x, y, z, t), (2, 3) = delta[2, 3](x, y, z, t), (2, 4) = delta[2, 4](x, y, z, t), (3, 1) = delta[1, 3](x, y, z, t), (3, 2) = delta[2, 3](x, y, z, t), (3, 3) = delta[3, 3](x, y, z, t), (3, 4) = delta[3, 4](x, y, z, t), (4, 1) = delta[1, 4](x, y, z, t), (4, 2) = delta[2, 4](x, y, z, t), (4, 3) = delta[3, 4](x, y, z, t), (4, 4) = delta[4, 4](x, y, z, t)}))

(3)
  

In the above it is understood that delta[i, j] are small quantities, so that quadratic or higher powers of it can be approximated to 0 (i.e., discarded). Define the components of h[mu, nu] accordingly

Define((3));

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(4)
  

Define also a tensor eta[mu, nu] representing the unperturbed Minkowski metric

eta[mu, nu] = rhs((2));

eta[mu, nu] = (Matrix(4, 4, {(1, 1) = -1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -1, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -1, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1}))

(5)

Define((5));

`Defined objects with tensor properties`

 

{Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], h[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(6)
  

The weakly perturbed metric is given by

g_[mu, nu] = eta[mu, nu] + h[mu, nu];

Physics:-g_[mu, nu] = eta[mu, nu]+h[mu, nu]

(7)
  

Make this be the definition of the metric

Define((7));

_______________________________________________________

 

`Coordinates: `[x, y, z, t]*`. Signature: `(`- - - +`)

 

_______________________________________________________

 

Physics:-g_[mu, nu] = Matrix(%id = 36893488152142178892)

 

_______________________________________________________

 

`Setting `*lowercaselatin_is*` letters to represent `*space*` indices`

 

`Defined objects with tensor properties`

 

{Physics:-D_[mu], Physics:-Dgamma[mu], Physics:-Psigma[mu], Physics:-Ricci[mu, nu], Physics:-Riemann[mu, nu, alpha, beta], Physics:-Weyl[mu, nu, alpha, beta], Physics:-d_[mu], eta[mu, nu], Physics:-g_[mu, nu], Physics:-gamma_[i, j], h[mu, nu], Physics:-Christoffel[mu, nu, alpha], Physics:-Einstein[mu, nu], Physics:-LeviCivita[alpha, beta, mu, nu], Physics:-SpaceTimeVector[mu](X)}

(8)
  

The linearized form of the Ricci tensor is computed by introducing this weakly perturbed metric in the expression of the Ricci  tensor as a function of the metric. This can be accomplished in different ways, the simpler being to use the conversion network between tensors, but for illustration purposes, showing steps one at time, a substitution of definitions one into the other one is used

Ricci[definition];

Physics:-Ricci[mu, nu] = Physics:-d_[alpha](Physics:-Christoffel[`~alpha`, mu, nu], [X])-Physics:-d_[nu](Physics:-Christoffel[`~alpha`, mu, alpha], [X])+Physics:-Christoffel[`~beta`, mu, nu]*Physics:-Christoffel[`~alpha`, beta, alpha]-Physics:-Christoffel[`~beta`, mu, alpha]*Physics:-Christoffel[`~alpha`, nu, beta]

(9)

Christoffel[~alpha, mu, nu, definition];

Physics:-Christoffel[`~alpha`, mu, nu] = (1/2)*Physics:-g_[`~alpha`, `~beta`]*(Physics:-d_[nu](Physics:-g_[beta, mu], [X])+Physics:-d_[mu](Physics:-g_[beta, nu], [X])-Physics:-d_[beta](Physics:-g_[mu, nu], [X]))

(10)

Substitute((10), (9));

Physics:-Ricci[mu, nu] = Physics:-d_[alpha]((1/2)*Physics:-g_[`~alpha`, `~kappa`]*(Physics:-d_[nu](Physics:-g_[kappa, mu], [X])+Physics:-d_[mu](Physics:-g_[kappa, nu], [X])-Physics:-d_[kappa](Physics:-g_[mu, nu], [X])), [X])-Physics:-d_[nu]((1/2)*Physics:-g_[`~alpha`, `~tau`]*(Physics:-d_[mu](Physics:-g_[tau, alpha], [X])+Physics:-d_[alpha](Physics:-g_[tau, mu], [X])-Physics:-d_[tau](Physics:-g_[alpha, mu], [X])), [X])+(1/4)*Physics:-g_[`~beta`, `~iota`]*(Physics:-d_[nu](Physics:-g_[iota, mu], [X])+Physics:-d_[mu](Physics:-g_[iota, nu], [X])-Physics:-d_[iota](Physics:-g_[mu, nu], [X]))*Physics:-g_[`~alpha`, `~lambda`]*(Physics:-d_[beta](Physics:-g_[lambda, alpha], [X])+Physics:-d_[alpha](Physics:-g_[lambda, beta], [X])-Physics:-d_[lambda](Physics:-g_[alpha, beta], [X]))-(1/4)*Physics:-g_[`~beta`, `~omega`]*(Physics:-d_[mu](Physics:-g_[omega, alpha], [X])+Physics:-d_[alpha](Physics:-g_[omega, mu], [X])-Physics:-d_[omega](Physics:-g_[alpha, mu], [X]))*Physics:-g_[`~alpha`, `~chi`]*(Physics:-d_[nu](Physics:-g_[chi, beta], [X])+Physics:-d_[beta](Physics:-g_[chi, nu], [X])-Physics:-d_[chi](Physics:-g_[beta, nu], [X]))

(11)
  

Introducing the perturbed metric, and the inert form of Ricci for simplification purposes

Substitute((7), Ricci = %Ricci, (11));

%Ricci[mu, nu] = (1/2)*Physics:-d_[alpha](eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`], [X])*(Physics:-d_[nu](eta[kappa, mu]+h[kappa, mu], [X])+Physics:-d_[mu](eta[kappa, nu]+h[kappa, nu], [X])-Physics:-d_[kappa](eta[mu, nu]+h[mu, nu], [X]))+(1/2)*(eta[`~alpha`, `~kappa`]+h[`~alpha`, `~kappa`])*(Physics:-d_[alpha](Physics:-d_[nu](eta[kappa, mu]+h[kappa, mu], [X]), [X])+Physics:-d_[alpha](Physics:-d_[mu](eta[kappa, nu]+h[kappa, nu], [X]), [X])-Physics:-d_[alpha](Physics:-d_[kappa](eta[mu, nu]+h[mu, nu], [X]), [X]))-(1/2)*Physics:-d_[nu](eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`], [X])*(Physics:-d_[mu](eta[alpha, tau]+h[alpha, tau], [X])+Physics:-d_[alpha](eta[mu, tau]+h[mu, tau], [X])-Physics:-d_[tau](eta[alpha, mu]+h[alpha, mu], [X]))-(1/2)*(eta[`~alpha`, `~tau`]+h[`~alpha`, `~tau`])*(Physics:-d_[mu](Physics:-d_[nu](eta[alpha, tau]+h[alpha, tau], [X]), [X])+Physics:-d_[alpha](Physics:-d_[nu](eta[mu, tau]+h[mu, tau], [X]), [X])-Physics:-d_[nu](Physics:-d_[tau](eta[alpha, mu]+h[alpha, mu], [X]), [X]))+(1/4)*(eta[`~beta`, `~iota`]+h[`~beta`, `~iota`])*(Physics:-d_[nu](eta[iota, mu]+h[iota, mu], [X])+Physics:-d_[mu](eta[iota, nu]+h[iota, nu], [X])-Physics:-d_[iota](eta[mu, nu]+h[mu, nu], [X]))*(eta[`~alpha`, `~lambda`]+h[`~alpha`, `~lambda`])*(Physics:-d_[beta](eta[alpha, lambda]+h[alpha, lambda], [X])+Physics:-d_[alpha](eta[beta, lambda]+h[beta, lambda], [X])-Physics:-d_[lambda](eta[alpha, beta]+h[alpha, beta], [X]))-(1/4)*(eta[`~beta`, `~omega`]+h[`~beta`, `~omega`])*(Physics:-d_[mu](eta[alpha, omega]+h[alpha, omega], [X])+Physics:-d_[alpha](eta[mu, omega]+h[mu, omega], [X])-Physics:-d_[omega](eta[alpha, mu]+h[alpha, mu], [X]))*(eta[`~alpha`, `~chi`]+h[`~alpha`, `~chi`])*(Physics:-d_[nu](eta[beta, chi]+h[beta, chi], [X])+Physics:-d_[beta](eta[chi, nu]+h[chi, nu], [X])-Physics:-d_[chi](eta[beta, nu]+h[beta, nu], [X]))

(12)
  

The sign infront of the perturbation in the inverse metric is wrong, it should be minus.

  

This expression contains several terms quadratic in the small perturbation h[mu, nu]. The routine to filter out those terms is Linearize, that takes as second argument the symbol representing the small quantities (perturbation)

Lets look at the metric times inverse in this setup

g_[mu,nu,definition]*g_[~mu,~alpha,definition]

Physics:-g_[mu, nu]*Physics:-g_[`~mu`, `~alpha`] = (eta[mu, nu]+h[mu, nu])*(eta[`~mu`, `~alpha`]+h[`~mu`, `~alpha`])

(13)

Linearize((13),h)

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = eta[mu, nu]*eta[`~alpha`, `~mu`]+eta[mu, nu]*h[`~alpha`, `~mu`]+eta[`~alpha`, `~mu`]*h[mu, nu]

(14)

Simplify(subs(eta=g_,(14)))

Physics:-g_[nu, `~alpha`] = Physics:-g_[nu, `~alpha`]+2*h[nu, `~alpha`]

(15)

The result is not correct, left-hand-side does not match right-hand-side, this is because the inverse metric has the wrong. If it were a minus, we would get:

g_[mu, nu]*g_[~alpha, ~mu] = eta[mu, nu]*eta[~alpha, ~mu] - eta[mu, nu]*h[~alpha, ~mu] + eta[~alpha, ~mu]*h[mu, nu]

Physics:-g_[mu, nu]*Physics:-g_[`~alpha`, `~mu`] = eta[mu, nu]*eta[`~alpha`, `~mu`]-eta[mu, nu]*h[`~alpha`, `~mu`]+eta[`~alpha`, `~mu`]*h[mu, nu]

(16)

Simplify(subs(eta=g_,(16)))

Physics:-g_[nu, `~alpha`] = Physics:-g_[nu, `~alpha`]

(17)

Which is correct. The continued calculation from the Help page is below.

 

Linearize((12), h);

%Ricci[mu, nu] = (1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[nu](Physics:-d_[tau](h[alpha, mu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[mu](Physics:-d_[nu](h[alpha, tau], [X]), [X])-(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[kappa](h[mu, nu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[nu](h[kappa, mu], [X]), [X])+(1/2)*eta[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[mu](h[kappa, nu], [X]), [X])-(1/2)*eta[`~alpha`, `~tau`]*Physics:-d_[alpha](Physics:-d_[nu](h[mu, tau], [X]), [X])

(18)
 
  

In this result, eta[mu, nu] is the flat Minkowski metric. To further simplify this expression using the internal algorithms for a flat metric it is practical to reintroduce g[mu, nu] representing that Minkowski metric

g_[min];

_______________________________________________________

 

`The Minkowski metric in coordinates `*[x, y, z, t]

 

`Signature: `(`- - - +`)

 

_______________________________________________________

 

Physics:-g_[mu, nu] = Matrix(%id = 36893488152069364060)

(19)
  

Replace in the expression for the Ricci tensor the intermediate Minkowski eta[mu, nu]by g[mu, nu]

subs(eta = g_, (18));

%Ricci[mu, nu] = (1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[nu](Physics:-d_[tau](h[alpha, mu], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[mu](Physics:-d_[nu](h[alpha, tau], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[kappa](h[mu, nu], [X]), [X])+(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[nu](h[kappa, mu], [X]), [X])+(1/2)*Physics:-g_[`~alpha`, `~kappa`]*Physics:-d_[alpha](Physics:-d_[mu](h[kappa, nu], [X]), [X])-(1/2)*Physics:-g_[`~alpha`, `~tau`]*Physics:-d_[alpha](Physics:-d_[nu](h[mu, tau], [X]), [X])

(20)
  

Simplifying, results in the linearized form of the Ricci tensor

Simplify((20));

%Ricci[mu, nu] = -(1/2)*Physics:-d_[mu](Physics:-d_[nu](h[tau, `~tau`], [X]), [X])-(1/2)*Physics:-dAlembertian(h[mu, nu], [X])+(1/2)*Physics:-d_[nu](Physics:-d_[tau](h[mu, `~tau`], [X]), [X])+(1/2)*Physics:-d_[mu](Physics:-d_[tau](h[nu, `~tau`], [X]), [X])

(21)

This is correct result, because we are going to linear order only the +/- does not have an effect on the end result.

Download LinearizedWorksheet-Comments.mw

Download LinearQuestion.mw

Please Wait...