tensor(deprecated)/frame - Help

tensor

 frame
 compute the contravariant frame components  which reduce given metric components to a diagonal matrix of positive and negative ones.

 Calling Sequence frame(g, hinv, const_g, coords, params, coord_vals, param_vals)

Parameters

 g - metric in the natural basis hinv - output: "contravariant" frame const_g - output: constant metric in the new basis coords - list of coordinate variable names params - (optional) list of parameter variable names coord_vals - (optional) list of numbers to evaluate coordinates at a point param_vals - (optional) list of numbers to evaluate parameters with

Description

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 • The function frame(g, hinv, const_g, coords, params, coord_vals, param_vals) computes the frame hinv which reduces the metric g to a diagonal metric of positive and negative ones (const_g is congruent to g with const_g = h*g*h-transpose).  It uses the lists of numbers coord_vals and param_vals to evaluate the variables listed in coords and params in determining the signs of matrix entries while performing the reduction.  The return value of the procedure is NULL.  It is important to note that frame is not uniquely determined by the metric, and hence this routine computes only one such frame.
 • g must be a symmetric covariant tensor_type of rank 2 -- the component array of g must use the symmetric indexing function.
 • The parameters hinv and const_g must be unassigned names. The "contravariant" frame (tensor_type with character [-1,1]) is assigned to hinv and the diagonal constant metric (tensor_type with character [-1,-1]) is assigned to const_g.
 • coords is the list of coordinate variables of which the components of g are functions.  params is the list of names which are parameters in the metric components.  Note that the size of the list coords must match the dimension of the metric tensor.  If there are no parameters involved, then the params argument may be left out.
 • In the last stage of reducing the metric to the final form, the metric has been reduced to a metric with non-constant diagonal entries and zeroes everywhere else.  The last step is to divide each diagonal entry by the square root of its absolute value once for columns and once for rows (the rows of the frame components are divided by this factor only once) so that each diagonal is reduced to a positive or negative one.  Because the metric components are functions of the coordinate variables and contain parameters, it is not in general possible to determine the sign of the non-constant diagonal entries.  However, if the metric component functions are known, then given the names of the coordinates and parameters, and a set of values to evaluate these with, it is possible to determine the sign of these components in a neighborhood of a point (the metric component functions are assumed to be continuous, of course).  Thus, you can specify what values to use for the coordinate and parameter variables when this evaluation takes place using the optional parameters coord_vals and param_vals. The number of values given in coord_vals must match the number of variables given in coords, and similarly for params and param_vals. If these last two options are left out, the default value of 1 will be used for each parameter and coordinate variable in the evaluations. For example if you pass the lists $\left[x,y,z\right]$, $\left[m,q\right]$, $\left[2,3,2\right]$, $\left[3,4\right]$ for these parameters, then the substitutions $x=2$, $y=3$, $z=2$, $m=3$, $q=4$ are made when attempting to determine the signs of the nonconstant diagonal entries.  In the cases where the procedure is still unable to determine the signs of these entries (for example, if the metric components are unknown functions of the coordinates, or if you do not specify enough information in the coordinate and parameter lists), then the result is written in terms of the inert forms of the function abs().
 • If you wish to specify any of the optional evaluation variables (that is, coord_vals and param_vals), then you must specify all seven of the arguments.  That is, the fifth parameter is always taken to be the parameter list, the sixth to be the list of coordinate values, and the seventh to be the list of parameter values.  If there are no parameters and you would like to specify evaluation constants for the coordinate variables, then an empty list should be passed for the parameters (fifth argument) and the parameter evaluation constants (seventh argument).
 • Simplification:  This routine uses the tensor/lin_com/simp routine for simplification purposes.  The simplification routine is applied to each component of result after it is computed.  By default, tensor/lin_com/simp is initialized to the tensor/simp routine.  It is recommended that the tensor/lin_com/simp routine be customized to suit the needs of the particular problem.  It should be noted that some expressions involving square roots may not come out as simplified as you would like.  Once the routine has computed a frame, you are free to modify the frame so that it is simpler but still able to transform the metric to a constant metric.
 • This command is part of the tensor package, so it can be used in the form frame(..) only after executing the command with(tensor). However, it can always be accessed through the long from of the command by using tensor[frame](..).

Examples

Important: The tensor package has been deprecated. Use the superseding packages DifferentialGeometry and Physics instead.

 > $\mathrm{with}\left(\mathrm{tensor}\right):$

Determine the frame which reduces the Schwarzschild metric to a constant metric:

 > $\mathrm{coord}≔\left[t,r,\mathrm{\theta },\mathrm{\phi }\right]:$
 > $\mathrm{g_compts}≔\mathrm{array}\left(\mathrm{symmetric},\mathrm{sparse},1..4,1..4\right):$
 > $\mathrm{g_compts}\left[1,1\right]≔1-\frac{2m}{r}:$$\mathrm{g_compts}\left[2,2\right]≔-\frac{1}{\mathrm{g_compts}\left[1,1\right]}:$
 > $\mathrm{g_compts}\left[3,3\right]≔-{r}^{2}:$$\mathrm{g_compts}\left[4,4\right]≔-{r}^{2}{\mathrm{sin}\left(\mathrm{\theta }\right)}^{2}:$
 > $g≔\mathrm{create}\left(\left[-1,-1\right],\mathrm{eval}\left(\mathrm{g_compts}\right)\right)$
 ${g}{≔}{table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}{-}\frac{{2}{}{m}}{{r}}& {0}& {0}& {0}\\ {0}& {-}\frac{{1}}{{1}{-}\frac{{2}{}{m}}{{r}}}& {0}& {0}\\ {0}& {0}& {-}{{r}}^{{2}}& {0}\\ {0}& {0}& {0}& {-}{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (1)

The metric involves trig functions, modify tensor/lin_com/simp:

 > tensor/lin_com/simp:= proc (x)     local y;     y:=simplify(x);     eval(subs( cos(theta)^2 = 1 - sin(theta)^2, y));  end proc;
 ${\mathrm{tensor/lin_com/simp}}{:=}{\mathbf{proc}}\left({x}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{local}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{y}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{y}{:=}{\mathrm{simplify}}{}\left({x}\right){;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{eval}}{}\left({\mathrm{subs}}{}\left({\mathrm{cos}}{}\left({\mathrm{theta}}\right){^}{2}{=}{1}{-}{\mathrm{sin}}{}\left({\mathrm{theta}}\right){^}{2}{,}{y}\right)\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (2)

Also, use the frame to carry out a change of basis, make sure that tensor[change_basis] returns things in a simplest form possible. Note that tensor[change_basis] uses tensor/raise/simp for simplification (see the help page tensor[simp] for a full list of simplifier routine names).

 > tensor/raise/simp := proc(a) simplify(a) end proc;
 ${\mathrm{tensor/raise/simp}}{:=}{\mathbf{proc}}\left({a}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{simplify}}{}\left({a}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (3)

Now find a frame (note that you are making any required evaluations at the point [t,r,theta,phi] = [3,3,3,3] with a value of 1 for `m' (that is, outside the Schwarzschild radius):

 > $\mathrm{frame}\left(g,\mathrm{hinv},\mathrm{const_g},\mathrm{coord},\left[m\right],\left[10,10,10,10\right],\left[1\right]\right)$
 > $\mathrm{eval}\left(\mathrm{hinv}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}\frac{{1}}{\sqrt{{-}\frac{{-}{r}{+}{2}{}{m}}{{r}}}}& {0}& {0}& {0}\\ {0}& \frac{{1}}{\sqrt{{-}\frac{{r}}{{-}{r}{+}{2}{}{m}}}}& {0}& {0}\\ {0}& {0}& \frac{{\mathrm{csgn}}{}\left({r}\right)}{{r}}& {0}\\ {0}& {0}& {0}& \frac{{1}}{\sqrt{{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{1}\right]\right]\right)$ (4)
 > $\mathrm{eval}\left(\mathrm{const_g}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {-1}& {0}& {0}\\ {0}& {0}& {-1}& {0}\\ {0}& {0}& {0}& {-1}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (5)

Note that you can replace the [3,3] and [4,4] components of the computed hinv with something a little simpler:

 > $\mathrm{hinv}\left[\mathrm{compts}\right]\left[3,3\right]≔\frac{1}{r}:$
 > $\mathrm{hinv}\left[\mathrm{compts}\right]\left[4,4\right]≔\frac{1}{r\mathrm{sin}\left(\mathrm{\theta }\right)}:$
 > $\mathrm{eval}\left(\mathrm{hinv}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}\frac{{1}}{\sqrt{{-}\frac{{-}{r}{+}{2}{}{m}}{{r}}}}& {0}& {0}& {0}\\ {0}& \frac{{1}}{\sqrt{{-}\frac{{r}}{{-}{r}{+}{2}{}{m}}}}& {0}& {0}\\ {0}& {0}& \frac{{1}}{{r}}& {0}\\ {0}& {0}& {0}& \frac{{1}}{{r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{1}\right]\right]\right)$ (6)

Does this hinv still transform g to const_g?

 > $h≔\mathrm{invert}\left(\mathrm{hinv},\mathrm{det_h}\right):$
 > $\mathrm{change_basis}\left(g,h,\mathrm{hinv}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {-1}& {0}& {0}\\ {0}& {0}& {-1}& {0}\\ {0}& {0}& {0}& {-1}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (7)

Now suppose a change to the more general spherically-symmetric geometry

 > $g\left[\mathrm{compts}\right]\left[1,1\right]≔\mathrm{f1}\left(r\right):$$g\left[\mathrm{compts}\right]\left[2,2\right]≔-\mathrm{f2}\left(r\right):$
 > $\mathrm{frame}\left(g,\mathrm{hinv},\mathrm{const_g},\mathrm{coord},\left[m\right],\left[3,3,3,3\right],\left[1\right]\right)$

Even though you gave values for all of the variables, there is no way to determine the signs of the entries since the functions f1 and f2 are not known:

 > $\mathrm{eval}\left(\mathrm{hinv}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}\frac{{1}}{\sqrt{\left|{\mathrm{f1}}{}\left({r}\right)\right|}}& {0}& {0}& {0}\\ {0}& \frac{{1}}{\sqrt{\left|{\mathrm{f2}}{}\left({r}\right)\right|}}& {0}& {0}\\ {0}& {0}& \frac{{\mathrm{csgn}}{}\left({r}\right)}{{r}}& {0}\\ {0}& {0}& {0}& \frac{{1}}{\sqrt{{{r}}^{{2}}{}{{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}^{{2}}}}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{1}\right]\right]\right)$ (8)
 > $\mathrm{eval}\left(\mathrm{const_g}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}\frac{{\mathrm{f1}}{}\left({r}\right)}{\left|{\mathrm{f1}}{}\left({r}\right)\right|}& {0}& {0}& {0}\\ {0}& {-}\frac{{\mathrm{f2}}{}\left({r}\right)}{\left|{\mathrm{f2}}{}\left({r}\right)\right|}& {0}& {0}\\ {0}& {0}& {-1}& {0}\\ {0}& {0}& {0}& {-1}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (9)

This is the best you can do without knowing more about f1 and f2.  However, the computed result does give us an indication of a simpler form to use:

 > $\mathrm{hinv}\left[\mathrm{compts}\right]≔\mathrm{array}\left(1..4,1..4,\mathrm{sparse},\left[\left(1,1\right)=\frac{1}{{\mathrm{f1}\left(r\right)}^{\frac{1}{2}}},\left(2,2\right)=\frac{1}{{\mathrm{f2}\left(r\right)}^{\frac{1}{2}}},\left(3,3\right)=\frac{1}{r},\left(4,4\right)=\frac{1}{r\mathrm{sin}\left(\mathrm{\theta }\right)}\right]\right)$
 ${{\mathrm{hinv}}}_{{\mathrm{compts}}}{≔}\left[\begin{array}{cccc}\frac{{1}}{\sqrt{{\mathrm{f1}}{}\left({r}\right)}}& {0}& {0}& {0}\\ {0}& \frac{{1}}{\sqrt{{\mathrm{f2}}{}\left({r}\right)}}& {0}& {0}\\ {0}& {0}& \frac{{1}}{{r}}& {0}\\ {0}& {0}& {0}& \frac{{1}}{{r}{}{\mathrm{sin}}{}\left({\mathrm{\theta }}\right)}\end{array}\right]$ (10)
 > $h≔\mathrm{invert}\left(\mathrm{hinv},'\mathrm{det_h}'\right):$
 > $\mathrm{change_basis}\left(g,h,\mathrm{hinv}\right)$
 ${table}{}\left(\left[{\mathrm{compts}}{=}\left[\begin{array}{cccc}{1}& {0}& {0}& {0}\\ {0}& {-1}& {0}& {0}\\ {0}& {0}& {-1}& {0}\\ {0}& {0}& {0}& {-1}\end{array}\right]{,}{\mathrm{index_char}}{=}\left[{-1}{,}{-1}\right]\right]\right)$ (11)