tensor(deprecated)/change_basis - Help

tensor

 change_basis
 transform a tensor from the natural basis to a non-coordinate basis

 Calling Sequence change_basis( T, h, hinv)

Parameters

 T - tensor_type to be transformed h - rank-2 tensor_type of character [1,-1] representing the covariant transformation matrix of the change of basis hinv - rank-2 tensor_type of character [-1,1] representing the contravariant matrix of the change of basis

Description

Important: The tensor package has been deprecated. Use the superseding commands DifferentialGeometry[Tensor][PushPullTensor] and Physics[TransformCoordinates] instead.

 • This routine performs the following operation on the given tensor_type, T:

${\mathrm{Result}}_{pqr\mathrm{...}}^{\left(abc\mathrm{...}\right)}={h}_{i}^{a}{h}_{j}^{b}{h}_{k}^{c}\mathrm{...}{h}_{p}^{s}{h}_{q}^{t}{h}_{r}^{u}{T}_{stu\mathrm{...}}^{\left(ijk\mathrm{...}\right)}$

 • Note of course that the new tensor_type result is the transformation of T provided T is indeed a tensor.  Thus, inputing the Christoffel symbols and a tetrad transformation would not yield the connection coefficients in a rigid frame, for example.
 • If the original tensor_type has an indexing function in its component array, it will be preserved under the transformation.
 • Simplification:  This routine uses the routine tensor/raise/simp for simplification purposes.  The contractions of T with the h's are done iteratively starting with the first index of T, and for each component of the final resultant, the simplifier is applied once to every summation over one summation index. By default, tensor/raise/simp is initialized to the {tensor/simp} routine.  It is recommended, however, that tensor/raise/simp be customized to suit the needs of the particular problem.
 • This function is part of the tensor package, and can be used in the form change_basis(..) only after performing the command with(tensor), or with(tensor, change_basis).  The function can always be accessed in the long form tensor[change_basis].

Examples

Important: The tensor package has been deprecated. Use the superseding commands DifferentialGeometry[Tensor][PushPullTensor] and Physics[TransformCoordinates] instead.

 > $\mathrm{with}\left(\mathrm{tensor}\right):$
 > $\mathrm{T_compts}≔\mathrm{array}\left(1..2,1..2,\left[\left[\mathrm{T11},\mathrm{T12}\right],\left[\mathrm{T21},\mathrm{T22}\right]\right]\right):$
 > $T≔\mathrm{create}\left(\left[1,-1\right],\mathrm{op}\left(\mathrm{T_compts}\right)\right)$
 ${T}{≔}{\mathrm{table}}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{\mathrm{T11}}& {\mathrm{T12}}\\ {\mathrm{T21}}& {\mathrm{T22}}\end{array}\right]\right]\right)$ (1)
 > $h≔\mathrm{create}\left(\left[1,-1\right],\mathrm{array}\left(1..2,1..2,\left[\left[\mathrm{H11},\mathrm{H12}\right],\left[\mathrm{H21},\mathrm{H22}\right]\right]\right)\right)$
 ${h}{≔}{\mathrm{table}}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{\mathrm{H11}}& {\mathrm{H12}}\\ {\mathrm{H21}}& {\mathrm{H22}}\end{array}\right]\right]\right)$ (2)
 > $\mathrm{hinv}≔\mathrm{create}\left(\left[-1,1\right],\mathrm{array}\left(1..2,1..2,\left[\left[\mathrm{h11},\mathrm{h12}\right],\left[\mathrm{h21},\mathrm{h22}\right]\right]\right)\right)$
 ${\mathrm{hinv}}{≔}{\mathrm{table}}\left(\left[{\mathrm{index_char}}{=}\left[{-}{1}{,}{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{\mathrm{h11}}& {\mathrm{h12}}\\ {\mathrm{h21}}& {\mathrm{h22}}\end{array}\right]\right]\right)$ (3)
 > $\mathrm{NewT}≔\mathrm{change_basis}\left(T,h,\mathrm{hinv}\right)$
 ${\mathrm{NewT}}{≔}{\mathrm{table}}\left(\left[{\mathrm{index_char}}{=}\left[{1}{,}{-}{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{cc}{\mathrm{H11}}{}{\mathrm{T11}}{}{\mathrm{h11}}{+}{\mathrm{H11}}{}{\mathrm{T12}}{}{\mathrm{h12}}{+}{\mathrm{H12}}{}{\mathrm{T21}}{}{\mathrm{h11}}{+}{\mathrm{H12}}{}{\mathrm{T22}}{}{\mathrm{h12}}& {\mathrm{H11}}{}{\mathrm{T11}}{}{\mathrm{h21}}{+}{\mathrm{H11}}{}{\mathrm{T12}}{}{\mathrm{h22}}{+}{\mathrm{H12}}{}{\mathrm{T21}}{}{\mathrm{h21}}{+}{\mathrm{H12}}{}{\mathrm{T22}}{}{\mathrm{h22}}\\ {\mathrm{H21}}{}{\mathrm{T11}}{}{\mathrm{h11}}{+}{\mathrm{H21}}{}{\mathrm{T12}}{}{\mathrm{h12}}{+}{\mathrm{H22}}{}{\mathrm{T21}}{}{\mathrm{h11}}{+}{\mathrm{H22}}{}{\mathrm{T22}}{}{\mathrm{h12}}& {\mathrm{H21}}{}{\mathrm{T11}}{}{\mathrm{h21}}{+}{\mathrm{H21}}{}{\mathrm{T12}}{}{\mathrm{h22}}{+}{\mathrm{H22}}{}{\mathrm{T21}}{}{\mathrm{h21}}{+}{\mathrm{H22}}{}{\mathrm{T22}}{}{\mathrm{h22}}\end{array}\right]\right]\right)$ (4)