1 /* Copyright (C) 2004 Viktor T. Toth <http://www.vttoth.com/>
3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License as
5 * published by the Free Software Foundation; either version 2 of
6 * the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be
9 * useful, but WITHOUT ANY WARRANTY; without even the implied
10 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
13 * MAXIMA CTENSOR demo: The Petrov classification of the Kerr metric.
17 ("Attempt to compute the Petrov classification of the Kerr metric.")$
18 ("First, we need to load modules and define the metric:")$
19 if get('ctensor,'version)=false then load(ctensor);
23 declare([a,m],constant)$
24 s(r,h):=r^2+(a*cos(h))^2$
28 [sqrt(d(r)/s(r,h)), 0, 0, -sqrt(d(r)/s(r,h))*a*sin(h)^2],
29 [0, sqrt(s(r,h)/d(r)), 0, 0],
30 [0, 0, sqrt(s(r,h)), 0 ],
31 [-a/sqrt(s(r,h))*sin(h), 0, 0, (s(r,h)+(a*sin(h))^2)*sin(h)/sqrt(s(r,h))]);
32 ("We need aggressive simplification to ensure that the result is correct.")$
39 ("Verify the tetrad")$
40 trigsimp(np.transpose(npi));
46 ("Since we use a tetrad frame, the Weyl tensor was computed in the tetrad
47 base. We need the Weyl tensor in the coordinate base to compute the
48 Newman-Penrose coefficients, so we must do a conversion first. Please
49 be patient; this is not very efficient and will take a while:")$
50 for i thru dim do for j thru dim do for k thru dim do for l thru dim do
51 w2[i,j,k,l]:weyl[i,j,k,l];
52 for i thru dim do for j thru dim do for k thru dim do for l thru dim do
53 weyl[i,j,k,l]:sum(sum(sum(sum(w2[ii,jj,kk,ll]*fri[ii,i]*fri[jj,j]*
54 fri[kk,k]*fri[ll,l],ii,1,dim),jj,1,dim),kk,1,dim),ll,1,dim);
56 ("Now we are ready to compute the Newman-Penrose coefficients:")$
60 /* End of demo -- comment line needed by MAXIMA to resume demo menu */