Convert - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

# Online Help

###### All Products    Maple    MapleSim

convert routines of the DifferentialGeometry package

 Calling Sequence convert(A, DGArray) convert(B, DGvector) convert(C, DGform) convert(C, DGspinor) convert(E, DGtensor) convert(F, DGjet) convert(F, DGdiff) convert(G, DGbiform, bidegree)

Parameters

 A - a tensor B - a Matrix, a tensor, or the infinitesimal symmetry generators for a system of differential equations, as calculated by PDEtools:-Infinitesimals C - a differential form or a differential biform E - an Array, a vector, a differential form, or a spinor-tensor F - a Maple expression G - a differential form

Description

 • convert(A, DGArray) converts a rank r tensor A to an r-dimensional array.  For example, if A= a * dx1 &t dx2 &t dx3 and T = convert(A, DGArray), then T[1, 2, 3] = a and all other entries of T are 0.
 • If B is a square matrix, then convert(B, DGvector) returns a linear vector field.
 • If B is a a rank 1 contravariant tensor, then convert(B, DGvector) returns the corresponding vector field.
 • If B is a list of infinitesimal symmetry generators for a system of differential equations, as calculated by PDEtools:-Infinitesimals, then convert(B, DGvector) returns a list of vector fields.
 • If C is a rank 1 covariant tensor, then convert(B, DGform) returns a differential 1-form.
 • If C is a differential biform, that is, a form expressed in terms of the contact forms on a jet space, then convert(C, DGform) returns the differential form on jet space obtained by replacing the contact forms by their coordinate formulas.
 • If E is a spin-tensor, then convert(E, DGspinor, sigma, indexlist) converts tensorial indices of E to pairs of spinorial indices.
 • If E is an Array, then convert(E, DGtensor, indextype) converts E to an r-dimensional array.
 • If E is a vector field, then convert(E, DGtensor) converts E to a rank 1 contravariant tensor.
 • If E is a differential p-form, then convert(E, DGtensor) converts E to a rank p contravariant tensor.
 • If E is a spinor-tensor, convert(E, DGtensor, sigma, indexlist) converts pairs of spinorial indices of E to tensorial indices.
 • convert(F, DGjet) converts a Maple expression F involving the Maple command diff, applied to functions u(x, y, z, ...), v(x, y, z, ...), ... to the standard indexed notation for derivatives, for example, diff(u(x, y, z), x) -> u[1], diff(u(x, y, z), x, y, z, z) -> u[1, 2, 3, 3] etc.
 • convert(F, DGdiff) performs the inverse to the conversion command convert/DGjet: it converts expressions F involving the indexed notation for derivatives to expressions containing the Maple diff command.
 • convert(G, DGbiform) converts a differential p-form G, defined on a jet space J^k(M, N) , into a list of (p + 1)-biforms, Theta = [theta_0, theta_1, theta_2, .. theta_p], where theta_k has contact degree k, and G = theta_0 + theta_1 + theta_2 + ... + theta_p.

Examples

convert/DGArray

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

Example 1.

We define a manifold M with coordinates [x, y, z]. On M we define two tensors T1 and T2.  We convert these tensors to a Maple Array

 > $\mathrm{DGsetup}\left(\left[x,y,z\right],M\right):$
 > $\mathrm{T1}≔\mathrm{evalDG}\left(\mathrm{D_z}&t\mathrm{D_x}+\mathrm{D_x}&t\mathrm{D_y}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (1)
 > $\mathrm{T2}≔\mathrm{evalDG}\left(2\left(\mathrm{dx}&t\mathrm{D_x}\right)&t\mathrm{dy}+\left(\mathrm{dz}&t\mathrm{D_z}\right)&t\mathrm{dx}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"con_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}{,}{2}\right]{,}{2}\right]{,}\left[\left[{3}{,}{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (2)
 > $\mathrm{A1}≔\mathrm{convert}\left(\mathrm{T1},\mathrm{DGArray}\right)$
 $\left[\begin{array}{rrr}0& 1& 0\\ 0& 0& 0\\ 1& 0& 0\end{array}\right]$ (3)
 > $\mathrm{A2}≔\mathrm{convert}\left(\mathrm{T2},\mathrm{DGArray}\right)$
 > ${\mathrm{A2}}_{1,1,2}$
 ${2}$ (4)

convert/DGvector

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

Example 1.

We define a manifold M with coordinates [x, y, z].  We convert a matrix to a linear vector field.

 > $\mathrm{DGsetup}\left(\left[x,y,z\right],M\right):$
 > $A≔\mathrm{Matrix}\left(\left[\left[1,0,1\right],\left[0,2,0\right],\left[0,3,0\right]\right]\right)$
 $\left[\begin{array}{rrr}1& 0& 1\\ 0& 2& 0\\ 0& 3& 0\end{array}\right]$ (5)
 > $\mathrm{convert}\left(A,\mathrm{DGvector}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{x}{+}{z}\right]{,}\left[\left[{2}\right]{,}{2}{}{y}\right]{,}\left[\left[{3}\right]{,}{3}{}{y}\right]\right]\right]\right)$ (6)

Example 2.

We define a manifold M with coordinates [x, y, z].  On M we define two tensors T1 and T2 and contract the 1st and 3rd indices of T1 against the 1st and second indices of T2.  The result is a contravariant rank 1 tensor S on M.  We then convert S to a vector field X.

 > $\mathrm{DGsetup}\left(\left[x,y,z\right],M\right):$
 > $\mathrm{T1}≔\mathrm{evalDG}\left(2\left(\mathrm{dx}&t\mathrm{D_x}\right)&t\mathrm{dy}+\left(\mathrm{dz}&t\mathrm{D_z}\right)&t\mathrm{dx}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"con_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}{,}{2}\right]{,}{2}\right]{,}\left[\left[{3}{,}{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (7)
 > $\mathrm{T2}≔\mathrm{evalDG}\left(\mathrm{D_z}&t\mathrm{D_x}+\mathrm{D_x}&t\mathrm{D_y}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (8)
 > $S≔\mathrm{ContractIndices}\left(\mathrm{T1},\mathrm{T2},\left[\left[1,1\right],\left[3,2\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}\right]{,}{2}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right)$ (9)
 > $X≔\mathrm{convert}\left(S,\mathrm{DGvector}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{2}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right)$ (10)
 > $\mathrm{Tools}:-\mathrm{DGinfo}\left(S,"ObjectType"\right),\mathrm{Tools}:-\mathrm{DGinfo}\left(X,"ObjectType"\right)$
 ${"tensor"}{,}{"vector"}$ (11)
 > $\mathrm{lprint}\left(S\right),\mathrm{lprint}\left(X\right)$
 _DG([["tensor", M, [["con_bas"], []]], [[[1], 2], [[3], 1]]]) _DG([["vector", M, []], [[[1], 2], [[3], 1]]])

Example 3.

We use the PDEtools:-Infinitesimals program to find the infinitesimals symmetries of a system of differential equations.  We convert the output of this program, which lists of the components of the infinitesimal symmetries, to a list of vector fields on the manifold of independent and dependent variables.

 > $\mathrm{DE}≔\left[\frac{{\partial }^{2}}{\partial y\partial x}u\left(x,y\right)={v\left(x,y\right)}^{2},\frac{{\partial }^{2}}{\partial {x}^{2}}v\left(x,y\right)=u\left(x,y\right)\right]$
 ${\mathrm{DE}}{≔}\left[\frac{{{\partial }}^{{2}}}{{\partial }{x}{\partial }{y}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{,}{y}\right){=}{{v}{}\left({x}{,}{y}\right)}^{{2}}{,}\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{v}{}\left({x}{,}{y}\right){=}{u}{}\left({x}{,}{y}\right)\right]$ (12)
 > $\mathrm{Sym}≔\mathrm{PDEtools}:-\mathrm{Infinitesimals}\left(\mathrm{DE},\left[u,v\right]\right)$
 ${\mathrm{Sym}}{≔}\left[{{\mathrm{_ξ}}}_{{x}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}{,}{{\mathrm{_ξ}}}_{{y}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{1}{,}{{\mathrm{_η}}}_{{u}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}{,}{{\mathrm{_η}}}_{{v}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}\right]{,}\left[{{\mathrm{_ξ}}}_{{x}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{1}{,}{{\mathrm{_ξ}}}_{{y}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}{,}{{\mathrm{_η}}}_{{u}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}{,}{{\mathrm{_η}}}_{{v}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}\right]{,}\left[{{\mathrm{_ξ}}}_{{x}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}{,}{{\mathrm{_ξ}}}_{{y}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{y}{,}{{\mathrm{_η}}}_{{u}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{-}{u}{,}{{\mathrm{_η}}}_{{v}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{-}{v}\right]{,}\left[{{\mathrm{_ξ}}}_{{x}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{x}{,}{{\mathrm{_ξ}}}_{{y}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{0}{,}{{\mathrm{_η}}}_{{u}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{-}{5}{}{u}{,}{{\mathrm{_η}}}_{{v}}{}\left({x}{,}{y}{,}{u}{,}{v}\right){=}{-}{3}{}{v}\right]$ (13)
 > $\mathrm{DGsetup}\left(\left[x,y\right],\left[u,v\right],J,2\right)$
 ${\mathrm{frame name: J}}$ (14)
 > $\mathrm{convert}\left(\left[\mathrm{Sym}\right],\mathrm{DGvector}\right)$
 $\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{J}{,}\left[{}\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{J}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{J}{,}\left[{}\right]\right]{,}\left[\left[\left[{2}\right]{,}{y}\right]{,}\left[\left[{3}\right]{,}{-}{{u}}_{{[}{]}}\right]{,}\left[\left[{4}\right]{,}{-}{{v}}_{{[}{]}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{J}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{x}\right]{,}\left[\left[{3}\right]{,}{-}{5}{}{{u}}_{{[}{]}}\right]{,}\left[\left[{4}\right]{,}{-}{3}{}{{v}}_{{[}{]}}\right]\right]\right]\right)\right]$ (15)

convert/DGform

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

Example 1.

We define a manifold M with coordinates [x, y, z].  On M we define a tensor T and contract the 1st and 3rd indices of T.  The result is a covariant rank 1 tensor S on M.  We then convert S to a differential 1-form alpha.

 > $\mathrm{DGsetup}\left(\left[x,y,z\right],M\right):$
 > $\mathrm{T1}≔\mathrm{evalDG}\left(2\left(\mathrm{dx}&t\mathrm{D_x}\right)&t\mathrm{dy}+\left(\mathrm{dz}&t\mathrm{D_z}\right)&t\mathrm{dx}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"con_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}{,}{2}\right]{,}{2}\right]{,}\left[\left[{3}{,}{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (16)
 > $S≔\mathrm{ContractIndices}\left(\mathrm{T1},\left[\left[1,2\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{2}\right]\right]\right]\right)$ (17)
 > $X≔\mathrm{convert}\left(S,\mathrm{DGform}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{2}\right]\right]\right]\right)$ (18)

The tensor S and the 1 form alpha both have the same external displays but are have different internal representations.  We can see this using DGinfo or lprint.

 > $\mathrm{Tools}:-\mathrm{DGinfo}\left(S,"ObjectType"\right),\mathrm{Tools}:-\mathrm{DGinfo}\left(X,"ObjectType"\right)$
 ${"tensor"}{,}{"form"}$ (19)
 > $\mathrm{lprint}\left(S\right),\mathrm{lprint}\left(X\right)$
 _DG([["tensor", M, [["cov_bas"], []]], [[[1], 1], [[2], 2]]]) _DG([["form", M, 1], [[[1], 1], [[2], 2]]])

Example 2.

 > $\mathrm{DGsetup}\left(\left[x,y\right],\left[u\right],\mathrm{Jet},2\right):$
 > $\mathrm{θ1},\mathrm{θ2},\mathrm{θ3}≔{\mathrm{Cu}}_{[]},{\mathrm{Cu}}_{1},{\mathrm{Cu}}_{2}$
 ${\mathrm{θ1}}{,}{\mathrm{θ2}}{,}{\mathrm{θ3}}{≔}{\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{0}{,}{1}\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{0}{,}{1}\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{0}{,}{1}\right]\right]{,}\left[\left[\left[{5}\right]{,}{1}\right]\right]\right]\right)$ (20)
 > $\mathrm{convert}\left(\mathrm{θ1},\mathrm{DGform}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{\mathrm{Jet}}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{-}{{u}}_{{1}}\right]{,}\left[\left[{2}\right]{,}{-}{{u}}_{{2}}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right)$ (21)
 > $\mathrm{convert}\left(\mathrm{θ2},\mathrm{DGform}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{\mathrm{Jet}}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{-}{{u}}_{{1}{,}{1}}\right]{,}\left[\left[{2}\right]{,}{-}{{u}}_{{1}{,}{2}}\right]{,}\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)$ (22)
 > $\mathrm{convert}\left(\mathrm{θ3},\mathrm{DGform}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{\mathrm{Jet}}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{-}{{u}}_{{1}{,}{2}}\right]{,}\left[\left[{2}\right]{,}{-}{{u}}_{{2}{,}{2}}\right]{,}\left[\left[{5}\right]{,}{1}\right]\right]\right]\right)$ (23)

convert/DGspinor

The solder form sigma is the fundamental spin-tensor in spinor algebra.  It provides for a 1-1 correspondence between vectors and rank 2 Hermitian spinors. The convert/DGspinor uses a user-specified solder form to convert tensor indices of a given spinor-tensor to pairs of spinor indices.

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

To illustrate this convert procedure we first construct a solder form. Define a vector bundle over M with base coordinates [x, y, z, t] and fiber coordinates [z1, z2, w1, w2].

 > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],\left[\mathrm{z1},\mathrm{z2},\mathrm{w1},\mathrm{w2}\right],M\right)$
 ${\mathrm{frame name: M}}$ (24)

Define a spacetime metric g on M. Our spinor conventions assume the metric has signature [1, -1, -1, -1].

 > $g≔\mathrm{evalDG}\left(\mathrm{dt}&t\mathrm{dt}-\mathrm{dx}&t\mathrm{dx}-\mathrm{dy}&t\mathrm{dy}-\mathrm{dz}&t\mathrm{dz}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{-}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{-}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{-}{1}\right]\right]\right]\right)$ (25)

Define an orthonormal frame on M with respect to the metric g.

 > $F≔\left[\mathrm{D_t},\mathrm{D_x},\mathrm{D_y},\mathrm{D_z}\right]$
 $\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (26)

Calculate the solder form sigma from the frame F.  See Spinor, SolderForm.

 > $\mathrm{σ}≔\mathrm{SolderForm}\left(F\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"con_vrt"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{5}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{1}{,}{6}{,}{8}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{2}{,}{5}{,}{8}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{2}{,}{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{3}{,}{5}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]{,}\left[\left[{3}{,}{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]{,}\left[\left[{4}{,}{5}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{4}{,}{6}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}\sqrt{{2}}\right]\right]\right]\right)$ (27)

Example 1.

Define a vector X and convert it to a contravariant rank 2 spinor psi.  The convert/DGspinor command requires the solder form as a 3rd argument and a list of tensorial indices to be converted to spinorial indices as a 4th argument.

 > $X≔\mathrm{evalDG}\left(a\mathrm{D_t}+b\mathrm{D_y}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{a}\right]{,}\left[\left[{3}\right]{,}{b}\right]\right]\right]\right)$ (28)
 > $\mathrm{ψ}≔\mathrm{convert}\left(X,\mathrm{DGspinor},\mathrm{σ},\left[1\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_vrt"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{5}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}{}{a}\right]{,}\left[\left[{5}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}{}{b}\right]{,}\left[\left[{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}{}{b}\right]{,}\left[\left[{6}{,}{8}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}{}{a}\right]\right]\right]\right)$ (29)

Example 2.

Define a rank 3 tensor and convert the 1st and 3rd indices to pairs of spinor indices to obtain a rank 5 spin-tensor chi. Note that the spinorial indices are moved to the right.

 > $T≔\mathrm{evalDG}\left(\left(\mathrm{D_x}&t\mathrm{D_y}\right)&t\mathrm{dz}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{2}{,}{3}{,}{4}\right]{,}{1}\right]\right]\right]\right)$ (30)
 > $\mathrm{χ}≔\mathrm{convert}\left(T,\mathrm{DGspinor},\mathrm{σ},\left[1,3\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_vrt"}{,}{"con_vrt"}{,}{"cov_vrt"}{,}{"cov_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{3}{,}{5}{,}{8}{,}{5}{,}{7}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{5}{,}{8}{,}{6}{,}{8}\right]{,}{-}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{6}{,}{7}{,}{5}{,}{7}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{6}{,}{7}{,}{6}{,}{8}\right]{,}{-}\frac{{1}}{{2}}\right]\right]\right]\right)$ (31)

Example 3.

With the convert/DGspinor command, the spinor psi. can be converted back to the vector X and the spin-tensor chi back to the tensor T.

 > $\mathrm{convert}\left(\mathrm{ψ},\mathrm{DGtensor},\mathrm{σ},\left[\left[1,2\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}\right]{,}{a}\right]{,}\left[\left[{3}\right]{,}{b}\right]\right]\right]\right)$ (32)
 > $\mathrm{convert}\left(\mathrm{χ},\mathrm{DGtensor},\mathrm{σ},\left[\left[2,3\right],\left[4,5\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{3}{,}{2}{,}{4}\right]{,}{1}\right]\right]\right]\right)$ (33)

convert/DGtensor

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

We define a manifold M with coordinates [x, y, z].

 > $\mathrm{DGsetup}\left(\left[x,y,z\right],M\right):$

Example 1.

We define a Matrix' A1 and convert it to a rank 2 tensor in 4 different ways:

 > $\mathrm{A1}≔\mathrm{Matrix}\left(\left[\left[1,0,2\right],\left[0,2,4\right],\left[1,0,0\right]\right]\right)$
 $\left[\begin{array}{rrr}1& 0& 2\\ 0& 2& 4\\ 1& 0& 0\end{array}\right]$ (34)
 > $\mathrm{convert}\left(\mathrm{A1},\mathrm{DGtensor},\left[\left["con_bas","con_bas"\right],\left[\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{1}{,}{3}\right]{,}{2}\right]{,}\left[\left[{2}{,}{2}\right]{,}{2}\right]{,}\left[\left[{2}{,}{3}\right]{,}{4}\right]{,}\left[\left[{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (35)
 > $\mathrm{convert}\left(\mathrm{A1},\mathrm{DGtensor},\left[\left["cov_bas","con_bas"\right],\left[\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{1}{,}{3}\right]{,}{2}\right]{,}\left[\left[{2}{,}{2}\right]{,}{2}\right]{,}\left[\left[{2}{,}{3}\right]{,}{4}\right]{,}\left[\left[{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (36)
 > $\mathrm{convert}\left(\mathrm{A1},\mathrm{DGtensor},\left[\left["con_bas","cov_bas"\right],\left[\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{1}{,}{3}\right]{,}{2}\right]{,}\left[\left[{2}{,}{2}\right]{,}{2}\right]{,}\left[\left[{2}{,}{3}\right]{,}{4}\right]{,}\left[\left[{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (37)
 > $\mathrm{convert}\left(\mathrm{A1},\mathrm{DGtensor},\left[\left["cov_bas","cov_bas"\right],\left[\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{1}{,}{3}\right]{,}{2}\right]{,}\left[\left[{2}{,}{2}\right]{,}{2}\right]{,}\left[\left[{2}{,}{3}\right]{,}{4}\right]{,}\left[\left[{3}{,}{1}\right]{,}{1}\right]\right]\right]\right)$ (38)

Example 2.

We define a four-dimensional array and convert it to a rank 4 covariant tensor.

 > $\mathrm{A2}≔\mathrm{Array}\left(1..3,1..3,1..3,1..3\right):$
 > ${\mathrm{A2}}_{1,2,2,3}≔m$
 ${{\mathrm{A2}}}_{{1}{,}{2}{,}{2}{,}{3}}{≔}{m}$ (39)
 > ${\mathrm{A2}}_{1,3,2,1}≔n$
 ${{\mathrm{A2}}}_{{1}{,}{3}{,}{2}{,}{1}}{≔}{n}$ (40)
 > $\mathrm{convert}\left(\mathrm{A2},\mathrm{DGtensor},\left[\left["con_bas","cov_bas","cov_bas","cov_bas"\right],\left[\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"cov_bas"}{,}{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}{,}{2}{,}{3}\right]{,}{m}\right]{,}\left[\left[{1}{,}{3}{,}{2}{,}{1}\right]{,}{n}\right]\right]\right]\right)$ (41)

Example 3.

We define a vector field and convert it to a rank 1 contravariant tensor field.

 > $X≔\mathrm{evalDG}\left({x}^{2}\mathrm{D_y}-{y}^{2}\mathrm{D_z}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{2}\right]{,}{{x}}^{{2}}\right]{,}\left[\left[{3}\right]{,}{-}{{y}}^{{2}}\right]\right]\right]\right)$ (42)
 > $T≔\mathrm{convert}\left(X,\mathrm{DGtensor}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{2}\right]{,}{{x}}^{{2}}\right]{,}\left[\left[{3}\right]{,}{-}{{y}}^{{2}}\right]\right]\right]\right)$ (43)

The tensor T and vector X both have the same external displays but have different internal representations.  We can see this using DGinfo or lprint.

 > $\mathrm{Tools}:-\mathrm{DGinfo}\left(X,"ObjectType"\right),\mathrm{Tools}:-\mathrm{DGinfo}\left(T,"ObjectType"\right)$
 ${"vector"}{,}{"tensor"}$ (44)
 > $\mathrm{lprint}\left(X\right),\mathrm{lprint}\left(T\right)$
 _DG([["vector", M, []], [[[2], x^2], [[3], -y^2]]]) _DG([["tensor", M, [["con_bas"], []]], [[[2], x^2], [[3], -y^2]]])

Example 4.

We define a differential 2-form and convert it to a rank 2 covariant tensor field.

 > $\mathrm{ω}≔\mathrm{evalDG}\left(y\mathrm{dx}&w\mathrm{dy}-z\mathrm{dy}&w\mathrm{dz}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{y}\right]{,}\left[\left[{2}{,}{3}\right]{,}{-}{z}\right]\right]\right]\right)$ (45)
 > $\mathrm{convert}\left(\mathrm{ω},\mathrm{DGtensor}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{y}\right]{,}\left[\left[{2}{,}{1}\right]{,}{-}{y}\right]{,}\left[\left[{2}{,}{3}\right]{,}{-}{z}\right]{,}\left[\left[{3}{,}{2}\right]{,}{z}\right]\right]\right]\right)$ (46)

Example 5.

A spinor or spinor-tensor can be converted to a tensor using a solder form sigma. To work with spinors, define a vector bundle over M with base coordinates [x, y, z, t] and fiber coordinates [z1, z2, w1, w2].

 > $\mathrm{DGsetup}\left(\left[t,x,y,z\right],\left[\mathrm{z1},\mathrm{z2},\mathrm{w1},\mathrm{w2}\right],M\right)$
 ${\mathrm{frame name: M}}$ (47)

Define a spacetime metric g on M. Our spinor convention require that the metric has signature [1, -1,-1,-1].

 > $g≔\mathrm{evalDG}\left(\mathrm{dt}&t\mathrm{dt}-\mathrm{dx}&t\mathrm{dx}-\mathrm{dy}&t\mathrm{dy}-\mathrm{dz}&t\mathrm{dz}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{-}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{-}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{-}{1}\right]\right]\right]\right)$ (48)

Define an orthonormal frame on M with respect to the metric g.

 > $F≔\left[\mathrm{D_t},\mathrm{D_x},\mathrm{D_y},\mathrm{D_z}\right]$
 $\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[{}\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (49)

Calculate the solder form sigma from the frame F.  See Spinor, SolderForm.

 > $\mathrm{σ}≔\mathrm{SolderForm}\left(F\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"con_vrt"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{5}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{1}{,}{6}{,}{8}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{2}{,}{5}{,}{8}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{2}{,}{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{3}{,}{5}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]{,}\left[\left[{3}{,}{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]{,}\left[\left[{4}{,}{5}{,}{7}\right]{,}\frac{{1}}{{2}}{}\sqrt{{2}}\right]{,}\left[\left[{4}{,}{6}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}\sqrt{{2}}\right]\right]\right]\right)$ (50)

Define a contravariant rank 2 spinor psi and convert it to a rank 1 contravariant tensor X.  In this situation, convert/DGtensor command requires the solder form as a 3rd argument and a list of pairs of spinorial indices to be converted to tensorial indices as a 4th argument.

 > $\mathrm{ψ}≔\mathrm{evalDG}\left(-\frac{1I{2}^{\frac{1}{2}}\mathrm{D_z1}&t\mathrm{D_w2}}{2}+\frac{1I{2}^{\frac{1}{2}}\mathrm{D_z2}&t\mathrm{D_w1}}{2}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_vrt"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{5}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]{,}\left[\left[{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]\right]\right]\right)$ (51)
 > $X≔\mathrm{convert}\left(\mathrm{ψ},\mathrm{DGtensor},\mathrm{σ},\left[\left[1,2\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right)$ (52)

Example 6.

Define a covariant rank 2 spinor psi and convert it to a rank 1 covariant tensor omega.

 > $\mathrm{ψ}≔\mathrm{evalDG}\left({2}^{\frac{1}{2}}\mathrm{dz2}&t\mathrm{dw2}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_vrt"}{,}{"cov_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{6}{,}{8}\right]{,}\sqrt{{2}}\right]\right]\right]\right)$ (53)
 > $\mathrm{ω}≔\mathrm{convert}\left(\mathrm{ψ},\mathrm{DGtensor},\mathrm{σ},\left[\left[1,2\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{4}\right]{,}{-}{1}\right]\right]\right]\right)$ (54)

Example 7.

Define a covariant rank 4 spinor psi and convert it to a rank 2 covariant tensor G.

 > $\mathrm{ψ}≔\mathrm{evalDG}\left(\left(\left(\mathrm{dz1}&t\mathrm{dw1}\right)&t\mathrm{dz2}\right)&t\mathrm{dw2}-\left(\left(\mathrm{dz1}&t\mathrm{dw2}\right)&t\mathrm{dz2}\right)&t\mathrm{dw1}-\left(\left(\mathrm{dz2}&t\mathrm{dw1}\right)&t\mathrm{dz1}\right)&t\mathrm{dw2}+\left(\left(\mathrm{dz2}&t\mathrm{dw2}\right)&t\mathrm{dz1}\right)&t\mathrm{dw1}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_vrt"}{,}{"cov_vrt"}{,}{"cov_vrt"}{,}{"cov_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{5}{,}{7}{,}{6}{,}{8}\right]{,}{1}\right]{,}\left[\left[{5}{,}{8}{,}{6}{,}{7}\right]{,}{-}{1}\right]{,}\left[\left[{6}{,}{7}{,}{5}{,}{8}\right]{,}{-}{1}\right]{,}\left[\left[{6}{,}{8}{,}{5}{,}{7}\right]{,}{1}\right]\right]\right]\right)$ (55)
 > $G≔\mathrm{convert}\left(\mathrm{ψ},\mathrm{DGtensor},\mathrm{σ},\left[\left[1,2\right],\left[3,4\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{-}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{-}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{-}{1}\right]\right]\right]\right)$ (56)

Example 8.

Define a mixed contravariant rank 5 spin-tensor psi and convert it to a rank 3 contravariant tensor in 2 different ways. (The tensors T1 and T2 are complex because psi is not Hermitian.)

 > $\mathrm{ψ}≔\mathrm{evalDG}\left(-\frac{1I{2}^{\frac{1}{2}}\left(\left(\mathrm{D_t}&t\mathrm{D_z1}\right)&t\left(\mathrm{&t}\left(\mathrm{D_z1}\right)\right)\right)&t\mathrm{D_w2}}{2}+\frac{1I{2}^{\frac{1}{2}}\left(\left(\mathrm{D_x}&t\mathrm{D_z2}\right)&t\mathrm{D_z2}\right)&t\mathrm{D_w1}}{2}\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_vrt"}{,}{"con_vrt"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{5}{,}{5}{,}{8}\right]{,}{-}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]{,}\left[\left[{2}{,}{6}{,}{6}{,}{7}\right]{,}\frac{{1}}{{2}}{}{I}{}\sqrt{{2}}\right]\right]\right]\right)$ (57)
 > $\mathrm{T1}≔\mathrm{convert}\left(\mathrm{ψ},\mathrm{DGtensor},\mathrm{σ},\left[\left[2,4\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}{,}{5}\right]{,}{-}\frac{{1}}{{2}}{}{I}\right]{,}\left[\left[{1}{,}{3}{,}{5}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{2}{,}{6}\right]{,}\frac{{1}}{{2}}{}{I}\right]{,}\left[\left[{2}{,}{3}{,}{6}\right]{,}\frac{{1}}{{2}}\right]\right]\right]\right)$ (58)
 > $\mathrm{T2}≔\mathrm{convert}\left(\mathrm{ψ},\mathrm{DGtensor},\mathrm{σ},\left[\left[3,4\right]\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"con_bas"}{,}{"con_bas"}{,}{"con_vrt"}\right]{,}\left[{}\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}{,}{5}\right]{,}{-}\frac{{1}}{{2}}{}{I}\right]{,}\left[\left[{1}{,}{3}{,}{5}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{2}{,}{6}\right]{,}\frac{{1}}{{2}}{}{I}\right]{,}\left[\left[{2}{,}{3}{,}{6}\right]{,}\frac{{1}}{{2}}\right]\right]\right]\right)$ (59)

convert/DGjet, convert/DGdiff

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

Example 1.

We define the 2nd order jet space J^2(R^2, R) for one function u of two independent variables [x, y].

 > $\mathrm{DGsetup}\left(\left[x,y\right],\left[u\right],\mathrm{Jet},2\right):$

We convert the Laplace of a function, defined using the Maple diff command into a standard index notation for coordinates on jet spaces.

 > $L≔\frac{{\partial }^{2}}{\partial {x}^{2}}u\left(x,y\right)+\frac{{\partial }^{2}}{\partial {y}^{2}}u\left(x,y\right)$
 ${L}{≔}\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{,}{y}\right){+}\frac{{{\partial }}^{{2}}}{{\partial }{{y}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({x}{,}{y}\right)$ (60)
 > $\mathrm{convert}\left(L,\mathrm{DGjet}\right)$
 ${{u}}_{{1}{,}{1}}{+}{{u}}_{{2}{,}{2}}$ (61)

Example 2.

 • We retrieve a 4th order ODE from Kamke and rewrite it in standard index notation for coordinates on jet spaces.
 > $\mathrm{DGsetup}\left(\left[x\right],\left[y\right],J,4\right)$
 ${\mathrm{frame name: J}}$ (62)
 > $\mathrm{ODE}≔\mathrm{Retrieve}\left("Kamke",1,\left[4,8\right],\mathrm{variables}=\left[x,y\right]\right)$
 ${\mathrm{ODE}}{≔}\frac{{{ⅆ}}^{{4}}}{{ⅆ}{{x}}^{{4}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right){+}\left({a}{}{{x}}^{{2}}{+}{b}{}{\mathrm{\lambda }}{+}{c}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({x}\right)\right){+}\left({\mathrm{\alpha }}{}{{x}}^{{2}}{+}{\mathrm{\beta }}{}{\mathrm{\lambda }}{+}{\mathrm{\gamma }}\right){}{y}{}\left({x}\right)$ (63)
 > $\mathrm{convert}\left(\mathrm{ODE},\mathrm{DGjet}\right)$
 ${{y}}_{{1}{,}{1}{,}{1}{,}{1}}{+}\left({a}{}{{x}}^{{2}}{+}{b}{}{\mathrm{\lambda }}{+}{c}\right){}{{y}}_{{1}{,}{1}}{+}\left({\mathrm{\alpha }}{}{{x}}^{{2}}{+}{\mathrm{\beta }}{}{\mathrm{\lambda }}{+}{\mathrm{\gamma }}\right){}{y}\left[\right]$ (64)

Example 3.

Define a 2-form on J^2(R^2, R). We convert the KdV equation, given in jet notation, to ordinary derivative notation.

 > $\mathrm{DGsetup}\left(\left[t,x\right],\left[u\right],J,3\right):$
 > $\mathrm{Δ}≔{u}_{1}={u}_{2,2,2}+{u}_{[]}{u}_{2}$
 ${\mathrm{\Delta }}{≔}{{u}}_{{1}}{=}{u}\left[\right]{}{{u}}_{{2}}{+}{{u}}_{{2}{,}{2}{,}{2}}$ (65)
 > $\mathrm{convert}\left(\mathrm{Δ},\mathrm{DGdiff}\right)$
 $\frac{{\partial }}{{\partial }{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}{,}{x}\right){=}{u}{}\left({t}{,}{x}\right){}\left(\frac{{\partial }}{{\partial }{x}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}{,}{x}\right)\right){+}\frac{{{\partial }}^{{3}}}{{\partial }{{x}}^{{3}}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{u}{}\left({t}{,}{x}\right)$ (66)

convert/DGbiform

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

Define a 2-form on J^2(R^2, R). We define the 2nd order jet space J^2(R^2, R) for one function u of two independent variables [x, y].

 > $\mathrm{DGsetup}\left(\left[x,y\right],\left[u\right],\mathrm{Jet},2\right):$

Define a 2-form on J^2(R^2, R).

 > $\mathrm{ω}≔\mathrm{evalDG}\left(\left({\mathrm{du}}_{1}\right)&w\left({\mathrm{du}}_{2}\right)\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{\mathrm{Jet}}{,}{2}\right]{,}\left[\left[\left[{4}{,}{5}\right]{,}{1}\right]\right]\right]\right)$ (67)

Define a 2-form on J^2(R^2, R). To obtain the representation of omega in terms of the contact forms Cu[1] = du[1] - u[1, 1]*dx - u[1, 2]*dy and Cu[2] = du[2] - u[1, 2]*dx - u[2, 2]*dy   (*) we solve the equations (*) for du[1] and du[2], substitute for du[1] and du[2] into omega, and then grade the terms according to their contact degree -- [2, 0] : not contact forms; [1,1] : linear in contact forms; [0, 2] : quadratic in contact forms.

 > $\mathrm{convert}\left(\mathrm{ω},\mathrm{DGbiform},\left[2,0\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{2}{,}{0}\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{{u}}_{{1}{,}{1}}{}{{u}}_{{2}{,}{2}}{-}{{u}}_{{1}{,}{2}}^{{2}}\right]\right]\right]\right)$ (68)
 > $\mathrm{convert}\left(\mathrm{ω},\mathrm{DGbiform},\left[1,1\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{1}{,}{1}\right]\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}{-}{{u}}_{{1}{,}{2}}\right]{,}\left[\left[{1}{,}{5}\right]{,}{{u}}_{{1}{,}{1}}\right]{,}\left[\left[{2}{,}{4}\right]{,}{-}{{u}}_{{2}{,}{2}}\right]{,}\left[\left[{2}{,}{5}\right]{,}{{u}}_{{1}{,}{2}}\right]\right]\right]\right)$ (69)
 > $\mathrm{convert}\left(\mathrm{ω},\mathrm{DGbiform},\left[0,2\right]\right)$
 ${\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{0}{,}{2}\right]\right]{,}\left[\left[\left[{4}{,}{5}\right]{,}{1}\right]\right]\right]\right)$ (70)
 > $\mathrm{convert}\left(\mathrm{ω},\mathrm{DGbiform}\right)$
 $\left[{\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{0}{,}{2}\right]\right]{,}\left[\left[\left[{4}{,}{5}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{1}{,}{1}\right]\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}{-}{{u}}_{{1}{,}{2}}\right]{,}\left[\left[{1}{,}{5}\right]{,}{{u}}_{{1}{,}{1}}\right]{,}\left[\left[{2}{,}{4}\right]{,}{-}{{u}}_{{2}{,}{2}}\right]{,}\left[\left[{2}{,}{5}\right]{,}{{u}}_{{1}{,}{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"biform"}{,}{\mathrm{Jet}}{,}\left[{2}{,}{0}\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{{u}}_{{1}{,}{1}}{}{{u}}_{{2}{,}{2}}{-}{{u}}_{{1}{,}{2}}^{{2}}\right]\right]\right]\right)\right]$ (71)

 See Also