Note: this is a work-in-progress. Source code, when considered to be sufficiently stable, will be provided through the open-source Maxima project at maxima.sourceforge.net.

One of the common problems in general relativity concerns the equivalence of two metrics. Because the same manifold can be mapped using drastically different coordinate systems, it is usually not at all that evident whether or not two metrics describe the same manifold. One tool often used to determine if two metrics might be equivalent is an algebraic classification method of the Weyl-tensor, the so-called Petrov-classification.

There are several packages that can do Petrov classification, including the tensor and grTensorII packages in Maple, or the dedicated computer algebra package SHEEP. No such tools existed in Maxima, however. Well, not quite. There was a code fragment in the Maxima tensor package that implemented the Petrov classification algorithm, but it was not supported by any tools; most importantly, no tools were available to perform computations in a rigid frame and to obtain a null tetrad.

Until now, that is. Although this is still considered a work-in-progress, I have put together a set of subroutines that can do all of the above. The following Maxima session demonstrates how these functions can be used to derive the Petrov class of the Kerr metric:

 (%i1) batch("petrov.dem"); batching #p/home/vttoth/dev/maxima/maxima/share/tensor/petrov.dem (%i2)                       Attempt to compute the Petrov classification of the Kerr metric. (%i3)                            First, we need to load modules and define the metric: (%i4)                                                load(ctensor) (%o4)                           /home/vttoth/dev/maxima/maxima/share/tensor/ctensor.mac (%i5)                                                init_ctensor() (%o5)                                                     done (%i6)                                                 gcd : spmod (%o6)                                                    spmod (%i7)                                           ct_coords : [t, r, h, p] (%i8)                                          declare([a, m], constant)                                                                    2    2 (%i9)                                         s(r, h) := (a cos(h))  + r                                                          2            2 (%i10)                                          d(r) := r  - 2 m r + a (%i11)                                                  dim : 4                            d(r)                   d(r)         2               s(r, h) (%i12) fri : matrix([sqrt(-------), 0, 0, - sqrt(-------) a sin (h)], [0, sqrt(-------), 0, 0],                            s(r, h)                s(r, h)                        d(r)                                                                                                    2                                                                    (- a) sin(h)         ((a sin(h))  + s(r, h)) sin(h)                                         [0, 0, sqrt(s(r, h)), 0], [-------------, 0, 0, ------------------------------])                                                                    sqrt(s(r, h))                sqrt(s(r, h))        [        2            2                                                           2          2            2    ]        [  sqrt(r  - 2 m r + a )                                                     a sin (h) sqrt(r  - 2 m r + a )   ]        [  ---------------------             0                      0              - -------------------------------   ]        [        2    2    2                                                                    2    2    2            ]        [  sqrt(r  + a  cos (h))                                                          sqrt(r  + a  cos (h))        ]        [                                                                                                              ]        [                                2    2    2                                                                   ]        [                          sqrt(r  + a  cos (h))                                                               ]        [            0             ---------------------            0                              0                   ] (%o12) [                                2            2                                                                ]        [                          sqrt(r  - 2 m r + a )                                                               ]        [                                                                                                              ]        [                                                       2    2    2                                            ]        [            0                       0            sqrt(r  + a  cos (h))                    0                   ]        [                                                                                                              ]        [                                                                                 2    2    2       2    2     ]        [         a sin(h)                                                       sin(h) (r  + a  sin (h) + a  cos (h)) ]        [ - ---------------------            0                      0            ------------------------------------- ]        [         2    2    2                                                                  2    2    2             ]        [   sqrt(r  + a  cos (h))                                                        sqrt(r  + a  cos (h))         ] (%i13)                  We need aggressive simplification to ensure that the result is correct. (%i14)                                              ctrgsimp : true (%o14)                                                    true (%i15)                                               ratfac : true (%o15)                                                    true (%i16)                                             cframe_flag : true (%o16)                                                    true (%i17)                                               cmetric(false) (%o17)                                                   false (%i18)                                              ug : invert(lg) (%i19)                                              nptetrad(false) (%o19)                                                    done (%i20)                                              christof(false) (%o20)                                                    done (%i21)                                              lriemann(false) (%o21)                                                    done (%i22)                                                ricci(false) (%o22)                                                    done (%i23)                                                weyl(false) (%o23)                                                    done (%i24)                        Now we're ready to compute the Newman-Penrose coefficients: (%i25)                                                 psi(true) (%t25)                                                  psi  = 0                                                            0 (%t26)                                                  psi  = 0                                                            1                                                               m (%t27)                                         psi  = ------------------                                                   2                    3                                                       (r + %i a cos(h)) (%t28)                                                  psi  = 0                                                            3 (%t29)                                                  psi  = 0                                                            4 (%o29)                                                    done (%i29)                                                  petrov() (%o29)                                                 Type is D

By way of explanation, after initialization and setting up an orthonormal tetrad base using the cframe_flag option, the next step is to compute the metric. A Newman-Penrose null tetrad is also computed using the nptetrad function. With the metric computed, it is possible to use functions from the ctensor package to compute the Ricci and the Weyl tensors.

With the null tetrad and the Weyl tensor, we can compute the Newman-Penrose coefficients which, in turn, are simplified and then used to compute the Petrov class. The Petrov class of the Kerr metric is D, which this script correctly obtains.