Is there an error in the Maple 13 'tensor' package algorithm?

In summary, there is an error in the Maple 13 'tensor' package algorithm that can cause incorrect computations and results. The error is related to the handling of indices, specifically when dealing with repeated indices. This issue has been identified and a patch has been released by MapleSoft to fix the problem. Users are advised to update their software to the latest version to avoid encountering this error.
  • #1
Orion1
973
3

I attempted to use the Maple 13 'tensor' package to solve the [itex]G_{rr}[/tex] component of the Einstein_tensor for a General Relativity generic metric for which the solution is already known.

General Relativity generic metric: (reference 2 - eq. 1)
[tex]c^{2} d\tau^{2} = e^{\nu(r)} dt^{2} - e^{\lambda(r)} dr^{2} - r^2 d\theta^{2} - r^2 \sin^2 \theta d\phi^2[/tex]

I used the exact same source code listed in the Maple 13 software help index and reference 1, except the definitions of the [tex]g_{11}[/tex] and [tex]g_{22}[/tex] matrix elements.
Code:
> with(tensor); coord := [t, r, th, ph];
g_compts := array(symmetric, sparse, 1 .. 4, 1 .. 4);
g_compts[1, 1] := exp(nu(r));
g_compts[2, 2] := -exp(lambda(r));
g_compts[3, 3] := -r^2;
g_compts[4, 4] := -r^2*sin(th)^2;
g := create([-1, -1], eval(g_compts));
ginv := invert(g, 'detg');
D1g := d1metric(g, coord);
D2g := d2metric(D1g, coord);
Cf1 := Christoffel1(D1g);
RMN := Riemann(ginv, D2g, Cf1);
RICCI := Ricci(ginv, RMN);
RS := Ricciscalar(ginv, RICCI);
Estn := Einstein(g, RICCI, RS)

The Maple 13 'tensor' package generated this solution for the [itex]G_{rr}[/itex] component:
[tex]G_{rr} = \frac{- r \nu'(r) + e^{\lambda(r)} - 1}{r^2}[/tex]

However, the correct solution is: (reference 2 - eq. 4)
[tex]G_{rr} = \frac{e^{-\lambda(r)} (-r \nu'(r) + e^{\lambda(r)} - 1)}{r^2}[/tex]

Can anyone here identify any algorithmic error in my source code?

Reference:
http://www.maplesoft.com/support/help/AddOns/view.aspx?path=tensor/Einstein"
"www.new.dli.ernet.in/rawdataupload/upload/insa/INSA_2/20005a87_195.pdf"[/URL]
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
Mathematica Einsteintensor package...


Schwarzschild metric: (reference 2 - eq. 1)
[tex]c^{2} d\tau^{2} = e^{\nu(r)} dt^{2} - e^{\lambda(r)} dr^{2} - r^2 d\theta^{2} - r^2 \sin^2 \theta d\phi^2[/tex]

Mathematica 'Einsteintensor' package source code:
Code:
ToFileName[{$TopDirectory, "AddOns", "Applications"}]
<< einsteintensor.m
x = {t, r, \[Theta], \[Phi]}
(metric = {{\[ExponentialE]^\[Nu][r]*c^2, 0, 0, 
     0}, {0, -\[ExponentialE]^\[Lambda][r], 0, 0}, {0, 0, -r^2, 
     0}, {0, 0, 0, -r^2*Sin[\[Theta]]^2}}) // MatrixForm
Simplify[(Einstein = 
    Inverse[metric].Simplify[EinsteinTensor[metric, x]]) // 
  MatrixForm]

Mathematica 6 'Einsteintensorr' package generated this solution for the [itex]G_{11}[/itex] component:
[tex]G_{11} = \frac{e^{-\lambda} (-r \nu' + e^{\lambda} - 1)}{r^2}[/tex]

According to reference 2 - eq. 4, the solution solution for the [itex]G_{11}[/itex] component:
[tex]G_{11} = \frac{e^{-\lambda} (r \nu' - e^{\lambda} + 1)}{r^2}[/tex]

Which package is generating the correct solution?

Reference:
http://library.wolfram.com/infocenter/MathSource/162/"
http://www.new.dli.ernet.in/rawdataupload/upload/insa/INSA_2/20005a87_195.pdf"
 
Last edited by a moderator:
  • #3
Mathematica 6 Einstein Tensor package...



Code:
(* Package written by 
      Pekka Janhunen
      Finnish Meteorological Institute
      Geophysics Dept. *)

BeginPackage["EinsteinTensor`"]

EinsteinTensor::usage = "EinsteinTensor[g,x] with g a nxn-matrix
  (the metric with lower indices) and x n-vector (the coordinates)
  gives the Einstein tensor (a nxn-matrix) with lower indices."

Begin["`Private`"]

EinsteinTensor[metric_,x_]:=
  Block[ {Dim,Metric, PreChristoffel, Christoffel, Riemann,
          PreRiemann, Ricci, CurvatureScalar,
          sigma, mu, nu, alpha, beta, gamma},
          Dim = Length[x];
          Metric = Simplify[Inverse[metric]];
            (* Metric with upper indices *)
          PreChristoffel =
            Table[ D[metric[[gamma,alpha]],x[[beta]]]
                 + D[metric[[beta,gamma]],x[[alpha]]]
           		    - D[metric[[alpha,beta]],x[[gamma]]],
           	   	 {gamma,Dim}, {alpha,Dim}, {beta,Dim} ];
           	 (* The "lower index part" of Christoffel symbols *)
          PreChristoffel = Simplify[PreChristoffel];
          Christoffel = (1/2) Metric . PreChristoffel;
             (* The full Christoffel symbols *)
          Christoffel = Simplify[Christoffel];
          PreRiemann = 
             Table[ D[Christoffel[[sigma,alpha,nu]],x[[mu]]]
                    + Sum[Christoffel[[gamma,alpha,nu]]
                            Christoffel[[sigma,gamma,mu]],
                          {gamma,Dim} ],
                    {sigma,Dim}, {alpha,Dim}, {mu,Dim}, {nu,Dim} ];
           	(* PreRiemann has to be antisymmetrized to yield
           	   Riemann tensor: *)
          Riemann = Table[ PreRiemann[[sigma,alpha,mu,nu]]
                         - PreRiemann[[sigma,alpha,nu,mu]],
                           {sigma,Dim}, {alpha,Dim},
                           {mu,Dim}, {nu,Dim} ];
          Ricci = Table[ Sum[Riemann[[sigma,alpha,sigma,beta]],
                             {sigma,Dim}],
                         {alpha,Dim}, {beta,Dim} ];
          CurvatureScalar = Sum[ Metric[[alpha,beta]]
                                 Ricci[[alpha,beta]],
                                 {alpha,Dim}, {beta,Dim} ];
          (* Return Einstein tensor: *)
          Ricci - (1/2) CurvatureScalar metric ]

End[]

EndPackage[]

Print[{EinsteinTensor}]
The output appears to be in the form:
[tex]G^i_j[/tex]

[tex]G^1_1 = g^{1i}G_{1i} = g^{11}G_{11}[/tex]

The Mathematica 6 'Einstein Tensor' package generated this solution for the [itex]G^i_j[/itex] component:
[tex]G^1_1} = \frac{e^{-\lambda} (-r \nu' + e^{\lambda} - 1)}{r^2}[/tex]

The correct [itex]G^1_1[/itex] component is:
[tex]G^1_1} = - \frac{e^{- \lambda} (-r {\nu}' + e^{\lambda} - 1)}{r^2}[/tex]

Reference:
http://library.wolfram.com/infocenter/MathSource/162/"
 
Last edited by a moderator:
  • #4

Mathematica Ricci tensor:
[tex]R_{ab} = R^c_{acb}[/tex]

Maple Ricci tensor:
[tex]R_{ac} = R^b_{acb}[/tex]

Package criteria:
[tex]R^{Mathematica} = -R^{Maple}[/tex]

[tex]G^{Mathematica}_{ij} = - G^{Maple}_{ij}[/tex]

The different signs are due to the use of different Ricci tensors.

Mathematica generated output:
[tex]G^1_1 = g^{1i}G_{1i}=g^{11}G_{11} = -e^{-\lambda}\frac{ r{\nu}' - e^{\lambda} + 1}{r^2} = \frac{e^{-\lambda} (-r{\nu}'+ e^{\lambda} - 1)}{r^2}[/tex]

Maple generated output:
[tex]G_{11} = \frac{- r \nu' + e^{\lambda} - 1}{r^2}[/tex]
 

FAQ: Is there an error in the Maple 13 'tensor' package algorithm?

1. What is the Maple 13 tensor package used for?

The Maple 13 tensor package is a specialized tool used for working with tensors, which are mathematical objects that describe the relationships between multiple variables. It allows scientists to manipulate and solve equations involving tensors, which are commonly used in fields such as physics, engineering, and mathematics.

2. How does the Maple 13 tensor package differ from other tensor software?

The Maple 13 tensor package stands out for its user-friendly interface and its ability to handle both symbolic and numerical calculations. It also offers a wide range of advanced features, such as tensor simplification and automated index notation, making it a powerful tool for tensor analysis.

3. Can the Maple 13 tensor package handle tensors of any rank?

Yes, the Maple 13 tensor package has the capability to work with tensors of any rank, including higher-order tensors. This allows for more complex calculations and analyses in a variety of scientific fields.

4. Is the Maple 13 tensor package suitable for beginners?

While the Maple 13 tensor package offers a user-friendly interface, it is still a specialized tool and may require some background knowledge in tensor mathematics to fully utilize its capabilities. However, there are plenty of resources and tutorials available to help beginners learn how to use the package effectively.

5. Can the Maple 13 tensor package handle tensors in different coordinate systems?

Yes, the Maple 13 tensor package has the ability to work with tensors in different coordinate systems, including Cartesian, spherical, and cylindrical coordinates. This allows for more flexibility and applicability in various scientific applications.

Similar threads

Back
Top