 tensor(deprecated)/commutator - Help

tensor

 commutator
 compute the commutator of two contravariant vector fields

 Calling Sequence commutator( U, V, coord)

Parameters

 U, V - contravariant vector fields coord - list of coordinate names

Description

Important: The tensor package has been deprecated. Use the superseding commands DifferentialGeometry[LieBracket] and Physics[Commutator] instead.

 • Given the coordinate variables, coord, and two contravariant vector fields, U and V, commutator( U, V, coord ) computes the commutator of U and V using the usual partial derivative with respect to the coordinates using the formula:

${\left[U,V\right]}^{i}={U}^{j}{V}^{i},j-{V}^{j}{U}^{i},j$

 where ${\left[U,V\right]}^{i}$ denotes the i'th component of the commutator of $U$ and $V$, and ${U}^{i},j$ and ${V}^{i},j$ denote the partial derivatives of the i'th components of $U$ and $V$, respectively, with respect to the j'th coordinate.
 • It is required that U and V be tensor_types with character:  (that is, U and V are contravariant vector fields)
 • Note that the result is a tensor_type of rank 1 with character .
 • Simplification:  This routine uses the routine tensor/commutator/simp routine for simplification purposes.  The simplification routine is applied to each component once it has been computed. By default, this routine is initialized to the tensor/simp routine. It is recommended that the tensor/commutator/simp routine be customized to suit the needs of the particular problem.
 • This function is part of the tensor package, and so can be used in the form commutator(..) only after performing the command with(tensor) or with(tensor, commutator).  The function can always be accessed in the long form tensor[commutator](..).

Examples

Important: The tensor package has been deprecated. Use the superseding commands DifferentialGeometry[LieBracket] and Physics[Commutator] instead.

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

Define U and V -- two contravariant vector fields:

 > $U≔\mathrm{create}\left(\left[1\right],\mathrm{array}\left(\left[{x}^{2},y+\mathrm{ln}\left(xz\right),\frac{z}{3}\right]\right)\right)$
 ${U}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{ccc}{{x}}^{{2}}& {y}{+}{\mathrm{ln}}{}\left({x}{}{z}\right)& \frac{{z}}{{3}}\end{array}\right]\right]\right)$ (1)
 > $V≔\mathrm{create}\left(\left[1\right],\mathrm{array}\left(\left[y-z,z+\mathrm{ln}\left({x}^{3}\right),\mathrm{ln}\left(\frac{z}{y}\right)\right]\right)\right)$
 ${V}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{ccc}{y}{-}{z}& {z}{+}{\mathrm{ln}}{}\left({{x}}^{{3}}\right)& {\mathrm{ln}}{}\left(\frac{{z}}{{y}}\right)\end{array}\right]\right]\right)$ (2)

Define the coordinates:

 > $\mathrm{coord}≔\left[x,y,z\right]$
 ${\mathrm{coord}}{≔}\left[{x}{,}{y}{,}{z}\right]$ (3)

Because the components of U and V contain expressions involving ln, define tensor/commutator/simp to apply simplify( ... , ln) to each computed component:

 > tensor/commutator/simp:=proc(x) simplify(x,ln) end proc;
 ${\mathrm{tensor/commutator/simp}}{:=}{\mathbf{proc}}\left({x}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{simplify}}{}\left({x}{,}{\mathrm{ln}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (4)

Now compute the commutator of U and V:

 > $\mathrm{comUV}≔\mathrm{commutator}\left(U,V,\mathrm{coord}\right)$
 ${\mathrm{comUV}}{≔}{table}{}\left(\left[{\mathrm{index_char}}{=}\left[{1}\right]{,}{\mathrm{compts}}{=}\left[\begin{array}{ccc}{\mathrm{ln}}{}\left({x}{}{z}\right){+}\frac{\left({-}{6}{}{y}{+}{6}{}{z}\right){}{x}}{{3}}{+}{y}{-}\frac{{z}}{{3}}& {-}\frac{{2}{}{z}}{{3}}{-}\frac{{\mathrm{ln}}{}\left(\frac{{z}}{{y}}\right)}{{z}}{-}{\mathrm{ln}}{}\left({{x}}^{{3}}\right){+}{3}{}{x}{+}\frac{{-}{y}{+}{z}}{{x}}& \frac{{-}{\mathrm{ln}}{}\left(\frac{{z}}{{y}}\right){}{y}{-}{3}{}{\mathrm{ln}}{}\left({x}{}{z}\right){-}{2}{}{y}}{{3}{}{y}}\end{array}\right]\right]\right)$ (5)