transform the coordinates in a tensorial expression - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Physics : Physics/TransformCoordinates

Physics[TransformCoordinates] - transform the coordinates in a tensorial expression

Calling Sequence

TransformCoordinates(tr, expression, X_new, X_old, ...)

Parameters

tr

-

the transformation equations with the old variables on the left-hand-sides and algebraic expressions involving the new variables X_new on the right-hand-sides, or the other way around

expression

-

any algebraic expression that can also tensorial, having free indices

X_new

-

optional, an ordered list with the new coordinates, it is however required when they are not related to a system of coordinates set with Coordinates or there is ambiguity regarding the transformation being from old to new or the other way around

X_old

-

optional, same as X_new; if given, then X_new must also be given before

output = line_element

-

optional, to request the output to be the spacetime line element when expression is the spacetime metric

performsumoverrepeatedindices

-

optional, can be true (default) or false, to perform the sum over repeated tensor indices in the returned result

setcoordinates = ...

-

optional - can be true or false (default), to automatically set the X_new as a coordinate system and also as the differentiation variables for d_, D_ and others

setmetric = ...

-

optional - can be true or false (default), when expression is the metric, to automatically set the transformed metric as the new metric

simplifier = ...

-

optional - indicates the simplifier to be used instead of the default simplify/size@simplify

Description

• 

The TransformCoordinates, performs a transformation of coordinates in an algebraic expression that is also tensorial, i.e. one that has free and/or repeated spacetime indices that are either covariant or contravariant (see Check to determine the indices).

• 

The transformation performed with TransformCoordinates is the standard one for tensors. Consider for instance a transformation from one coordinate system, x0,x1,x2,x3 to another y0,y1,y2,y3

xμ=fμy0,y1,y2,y3

  

where the fμ are certain functions. When you transform the coordinates, every contravariant tensor of one index, say Aμx, a vector, transforms into a contravariant Aμy in the new system of coordinates according to

Aμy=yμxνAνx

  

and every covariant vector transforms according to

Aμy=xνyμAνx

  

and in the case of more than one index, for each contravariant or covariant index there is a factor as in the corresponding right-hand-sides of these formulas.

• 

CAVEAT: in curvilinear coordinates, none of the Christoffel symbols, the noncovariant d_ operator and the SpaceTimeVector Xμ are tensors, even when the algebraic manipulation of their indices is done as if they were. This version of TransformCoordinates does not transform coordinates on these objects.

• 

When the given tr is from the old variables - say xμ - on the left-hand-sides of the transformation equations to the new variables - say yμ - on the right-hand-sides, as in the previous item, the output is entirely expressed in terms of the new coordinates yμ. This is accomplished in two steps:

1. 

in the given expression, change variables from the old ones x to the new ones y to get everything expressed in terms of y (see dchange)

2. 

transform the resulting tensorial expression expressed in terms of y regarding each of its free indices (i.e.: multiply by the appropriate factors mentioned, yμxν or xνyμ and sum over the corresponding repeated indices)

  

The result represents the tensorial expression in the new coordinate system, expressed in terms of the new coordinates.

• 

It frequently happens, however, that the transformation can only be expressed in simple form if it is from the new variables on the left-hand-sides to the old variables on the right-hand-sides. You can pass the transformation tr in this way too, in which case you need to also pass the two lists X_new and X_old respectively as third and fourth arguments. The result will then be the tensor in the new coordinate system, entirely expressed in terms of the coordinates xμ of the old system, .

• 

The output of TransformCoordinates is an Array with dimension equal to the number of free indices of expression. In the special cases where the number of indices is 2 or 1, instead of an Array, the result is respectively expressed as a Matrix or a column Vector. In all cases, giving values to these indices you retrieve each of the components of the tensorial expression in the new coordinate system, entirely expressed in terms of the new coordinates X_new whenever the given transformation is from the old to the new variables (see the two previous paragraphs).

• 

The transformation can be given as an equation or a set or list of them, and does not need to include equations for all the coordinates - for instance: some may not be changing. Also, because the transformation of coordinates is equivalent to a change of the system of reference, it is possible to continue using the same geometrical coordinates (same names representing the coordinates in both systems) so that the right-hand-sides of the transformation equations can involve the list of X_new variables, even if they are the same as the old ones, for instance as in transforming [t = -t], performed by TransformCoordinates in two steps: transform t=τ then evaluate at τ=t.

• 

You can retrieve all the nonzero components of the transformed expression at once by passing the output of TransformCoordinates to the ArrayElems command.

• 

When expression is the spacetime metric g_[mu,nu], you can optionally request the output to be the corresponding line element passing output = line_element instead of a Matrix.

• 

By default, when change variables in the metric (i.e. expression is the metric itself), the transformed metric is not automatically set as the new metric. To change this behavior, pass the optional argument setmetric, in which case a call to Setup with metric = ... transformed metric ..., coordinates = ... new coordinates ... will be automatically performed before returning the result.

• 

By default, the new variables are not set as a coordinate system (when they are not already) nor they are set as the differentiation variables. To change this behavior, pass the optional argument setcoordinates. If not given, the default value of this option is false, unless you pass the option setmetric in which case the new variables are set as a coordinate system and as new differentiation variables together with the metric g_. When the new variables are not already set as a coordinate system, the label used for the new variables will always be the label originally used for the old variables.

• 

By default, in the returned result, summation is explicitly performed over all the repeated indices found in expression, taking into account the covariant/contravariant character of each index. To avoid performing this summation and keep repeated indices not summed pass the optional argument performsumoverrepeatedindices = false.

• 

By default, all the components of the returned result are simplified as in u -> simplify(simplify(u), size). This frequently results in a desired form. You can change the simplifier to be any other one by indicating it on the right-hand-side of the optional argument simplifier = ....

Examples

withPhysics:

Setupmathematicalnotation=true

mathematicalnotation=true

(1)

Consider the general form of a transformation of coordinates tr, from X to Y, and its inverse itr from Y to X, expressed in terms of 8 arbitrary functions X1y1,y2,y3,y4,...,Y4x1,x2,x3,x4

CoordinatesX,Y

Default differentiation variables for d_, D_ and dAlembertian are:X=x1,x2,x3,x4

Systems of spacetime coordinates are:X=x1,x2,x3,x4,Y=y1,y2,y3,y4

X,Y

(2)

trx1=X1Y,x2=X2Y,x3=X3Y,x4=X4Y

trx1=X1Y,x2=X2Y,x3=X3Y,x4=X4Y

(3)

itry1=Y1X,y2=Y2X,y3=Y3X,y4=Y4X

itry1=Y1X,y2=Y2X,y3=Y3X,y4=Y4X

(4)

For readability, suppress the display of functionality in these 8 functions

Typesetting:-Suppressmaprhs,tr

Typesetting:-Suppressmaprhs,itr

The covariant components of a vector A transform  according to

DefineA

Defined objects with tensor properties

A,γμ,σμ,Xμ,Yμ,μ,gμ,ν,εα,β,μ,ν

(5)

Aμ

Aμ

(6)

TransformCoordinatestr,

y1X1y1,y2,y3,y4A1+y1X2y1,y2,y3,y4A2+y1X3y1,y2,y3,y4A3+y1X4y1,y2,y3,y4A4y2X1y1,y2,y3,y4A1+y2X2y1,y2,y3,y4A2+y2X3y1,y2,y3,y4A3+y2X4y1,y2,y3,y4A4y3X1y1,y2,y3,y4A1+y3X2y1,y2,y3,y4A2+y3X3y1,y2,y3,y4A3+y3X4y1,y2,y3,y4A4y4X1y1,y2,y3,y4A1+y4X2y1,y2,y3,y4A2+y4X3y1,y2,y3,y4A3+y4X4y1,y2,y3,y4A4

(7)

For the contravariant components of A one can replace A[mu] by A[~mu] in the above. In that way, however, the new components will involve the inverse of the Jacobian of the transformation, resulting in a correct but rather large algebraic expression, due to the generality of the transformation tr. In such a case it is more convenient to use a transformation from the new to the old variables, as itr:

A`~mu`

Aμμ

(8)

TransformCoordinatesitr,

x1Y1x1,x2,x3,x4A~1+x2Y1x1,x2,x3,x4A~2+x3Y1x1,x2,x3,x4A~3+x4Y1x1,x2,x3,x4A~4x1Y2x1,x2,x3,x4A~1+x2Y2x1,x2,x3,x4A~2+x3Y2x1,x2,x3,x4A~3+x4Y2x1,x2,x3,x4A~4x1Y3x1,x2,x3,x4A~1+x2Y3x1,x2,x3,x4A~2+x3Y3x1,x2,x3,x4A~3+x4Y3x1,x2,x3,x4A~4x1Y4x1,x2,x3,x4A~1+x2Y4x1,x2,x3,x4A~2+x3Y4x1,x2,x3,x4A~3+x4Y4x1,x2,x3,x4A~4

(9)

Verify that the transformation

TRr=1+m2ρ2ρ

TRr=1+m2ρ2ρ

(10)

transforms the line element of the Schwarzschild metric into one where the line element of spatial distance has conformal euclidean form, i.e.: it is proportional to the euclidean spatial line element in spherical coordinates, ρ2+ρ2θ2+sinθ2φ2.

Set first the metric to be the Schwarzschild metric and the coordinates to be spherical. For that purpose you can use Setup, Coordinates or because Schwarzschild's metric is known to the system you can directly pass the keyword or an abbreviation of it to the metric g_ itself to do all in one step

g_sc

_______________________________________________________

Systems of spacetime coordinates are:X=r,θ,φ,t,Y=y1,y2,y3,y4

Default differentiation variables for d_, D_ and dAlembertian are:X=r,θ,φ,t

The Schwarzschild metric in coordinates r,θ,φ,t

Parameters: m

_______________________________________________________

g_μ,ν=rr+2m0000r20000r2sinθ20000r2mr

(11)

Transform the coordinates in this metric using the transformation TR. Because the new variables were not set using Coordinates, indicate them as ρ,θ,φ,t; request the output to be the corresponding line element:

TransformCoordinatesTR,g_μ,ν,ρ,θ,φ,t,output=lineelement

1162ρ+m4%d_ρ2+sinθ2%d_φ2+%d_θ2ρ2ρ4+m2ρ2%d_t22ρ+m2

(12)

By inspection, the spatial part of this result is proportional to the euclidean spatial line element mentioned. Compare with the line element of the Schwarzschild metric,

g_line_element

rⅆr2r+2mr2ⅆθ2r2sinθ2ⅆφ2+r2mⅆt2r

(13)

Remark: this transformed metric (12) is not automatically set as the metric. It is for that reason that the line above shows the line element of the original metric, not the changed metric. To set the new metric use Setup(g_ = **(12)**), or use the optional argument setmetric, in which case both the metric and the new coordinates will be set. For example, adding the keyword setmetric to the input that resulted in (12),

TransformCoordinatesTR,g_μ,ν,ρ,θ,φ,t,output=lineelement,setmetric

Changing the differentiation variables used to compute the Christoffel symbols from r,θ,φ,t to ρ,θ,φ,t while the spacetime metric depends on ρ,θ,m

Default differentiation variables for d_, D_ and dAlembertian are:X=ρ,θ,φ,t

Systems of spacetime coordinates are:X=ρ,θ,φ,t,Y=y1,y2,y3,y4

Default differentiation variables for d_, D_ and dAlembertian are:X=ρ,θ,φ,t

1162ρ+m4%d_ρ2+sinθ2%d_φ2+%d_θ2ρ2ρ4+m2ρ2%d_t22ρ+m2

(14)

so that now you see X as a label to the new coordinates ρ,θ,φ,t and the line element as the new line element

Coordinates

Systems of spacetime coordinates are:X=ρ,θ,φ,t,Y=y1,y2,y3,y4

X,Y

(15)

g_line_element

2ρ+m4ⅆρ2+sinθ2ⅆφ2+ⅆθ2ρ216ρ4+m2ρ2ⅆt22ρ+m2

(16)

Set the metric and coordinates again to be Schwarzschild and spherical

g_sc

_______________________________________________________

Systems of spacetime coordinates are:X=r,θ,φ,t,Y=y1,y2,y3,y4

Default differentiation variables for d_, D_ and dAlembertian are:X=r,θ,φ,t

The Schwarzschild metric in coordinates r,θ,φ,t

Parameters: m

_______________________________________________________

g_μ,ν=rr+2m0000r20000r2sinθ20000r2mr

(17)

Transform the Schwarzschild metric to Kruskal coordinates. The new coordinates are

CoordinatesK=U,θ,φ,V

Systems of spacetime coordinates are:K=U,θ,φ,V,X=r,θ,φ,t,Y=y1,y2,y3,y4

K,X,Y

(18)

The transformation is

trV=ⅇv4m,U=ⅇu4m

trV=ⅇv4m,U=ⅇu4m

(19)

vt+r+2mlnr2m

vt+r+2mlnr2m

(20)

utr2mlnr2m

utr2mlnr2m

(21)

Note this is a transformation from new to old variables. The line element of the transformed metric is

TransformCoordinatestr,g_i,j,output=lineelement

r2ⅆθ2r2sinθ2ⅆφ232ⅆUm2ⅆVr2+mⅇ2mlnr2m+r2mr

(22)

collectexpand,d_,simplify

16m2ⅇr2mⅆVⅆUrr2sinθ2ⅆφ2r2ⅆθ2

(23)

By default, repeated indices in expression are returned explicitly summed. For example, consider this expression with free indices μ and ν

g_μ,ρA`~rho`Aν

gμ,ρAρρAν

(24)

To perceive the difference with and without the option performsumoverrepeatedindices, perform an identity transformation on (24)

MTransformCoordinatesr=r,

A1A~1rr+2mA2A~1rr+2mA3A~1rr+2mA4A~1rr+2mA1r2A~2A2r2A~2A3r2A~2A4r2A~2A1A~3r2sinθ2A2A~3r2sinθ2A3A~3r2sinθ2A4A~3r2sinθ2r2mA1A~4rr2mA2A~4rr2mA3A~4rr2mA4A~4r

(25)

In the above, the sum over ρ is performed. With performsumoverrepeatedindices = false the sum is not performed:

TransformCoordinatesr=r,,performsumoverrepeatedindices=false

g_1,ρA~rhoA1g_1,ρA~rhoA2g_1,ρA~rhoA3g_1,ρA~rhoA4g_2,ρA~rhoA1g_2,ρA~rhoA2g_2,ρA~rhoA3g_2,ρA~rhoA4g_3,ρA~rhoA1g_3,ρA~rhoA2g_3,ρA~rhoA3g_3,ρA~rhoA4g_4,ρA~rhoA1g_4,ρA~rhoA2g_4,ρA~rhoA3g_4,ρA~rhoA4

(26)

Note that the Matrix M assigned in (25) can effectively be used to retrieve the value of (24) for given values of its free indices μ and ν. Similar functionality is available using TensorArray.

M1,1

A1A11rr+2m

(27)

M4,1

r2mA1A44r

(28)

You can as well transform tensorial expressions that have no free indices; in that case only a change of variables in the scalar expression using PDEtools:-dchange is performed, although in the returned result the repeated indices will appear explicitly summed. To perform only the summation use SumOverRepeatedIndices.

See Also

Array, ArrayElems, Check, Coordinates, d_, dchange, Define, DifferentialGeometry[Tensor][PushPullTensor], g_, Matrix, PDEtools:-dchange, Physics, Physics conventions, Physics examples, Physics Updates, Tensors - a complete guide, Mini-Course Computer Algebra for Physicists, Setup, SumOverRepeatedIndices, TensorArray

References

  

Landau, L.D., and Lifshitz, E.M. The Classical Theory of Fields, Course of Theoretical Physics Volume 2, fourth revised English edition. Elsevier, 1975.

Compatibility

• 

The Physics[TransformCoordinates] command was introduced in Maple 16.

• 

For more information on Maple 16 changes, see Updates in Maple 16.

• 

The Physics[TransformCoordinates] command was updated in Maple 2017.