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

Parameters

Description

Examples

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

withDifferentialGeometry:

 

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

DGsetupx,y,z,M:

T1evalDGD_z&tD_x+D_x&tD_y

T1D_xD_y+D_zD_x

(1)

T2evalDG2dx&tD_x&tdy+dz&tD_z&tdx

T22dxD_xdy+dzD_zdx

(2)

A1convertT1,DGArray

A1

(3)

A2convertT2,DGArray

A21,1,2

2

(4)

convert/DGvector

withDifferentialGeometry:withTensor:

 

Example 1.

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

DGsetupx,y,z,M:

AMatrix1,0,1,0,2,0,0,3,0

A

(5)

convertA,DGvector

x+zD_x+2yD_y+3yD_z

(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.

DGsetupx,y,z,M:

T1evalDG2dx&tD_x&tdy+dz&tD_z&tdx

T12dxD_xdy+dzD_zdx

(7)

T2evalDGD_z&tD_x+D_x&tD_y

T2D_xD_y+D_zD_x

(8)

SContractIndicesT1,T2,1,1,3,2

S2D_x+D_z

(9)

XconvertS,DGvector

X2D_x+D_z

(10)

Tools:-DGinfoS,ObjectType,Tools:-DGinfoX,ObjectType

tensor,vector

(11)

lprintS,lprintX

_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.

DEdiffux,y,x,y=vx,y2,diffvx,y,`$`x,2=ux,y

DE2xyux,y=vx,y2,2x2vx,y=ux,y

(12)

SymPDEtools:-InfinitesimalsDE,u,v

Sym_ξxx,y,u,v=0,_ξyx,y,u,v=1,_ηux,y,u,v=0,_ηvx,y,u,v=0,_ξxx,y,u,v=1,_ξyx,y,u,v=0,_ηux,y,u,v=0,_ηvx,y,u,v=0,_ξxx,y,u,v=0,_ξyx,y,u,v=y,_ηux,y,u,v=u,_ηvx,y,u,v=v,_ξxx,y,u,v=x,_ξyx,y,u,v=0,_ηux,y,u,v=5u,_ηvx,y,u,v=3v

(13)

DGsetupx,y,u,v,J,2

frame name: J

(14)

convertSym,DGvector

D_y,D_x,yD_yuD_uvD_v,xD_x5uD_u3vD_v

(15)

convert/DGform

withDifferentialGeometry:withTensor:

 

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.

DGsetupx,y,z,M:

T1evalDG2dx&tD_x&tdy+dz&tD_z&tdx

T12dxD_xdy+dzD_zdx

(16)

SContractIndicesT1,1,2

Sdx+2dy

(17)

XconvertS,DGform

Xdx+2dy

(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.

Tools:-DGinfoS,ObjectType,Tools:-DGinfoX,ObjectType

tensor,form

(19)

lprintS,lprintX

_DG([["tensor", M, [["cov_bas"], []]], [[[1], 1], [[2], 2]]])
_DG([["form", M, 1], [[[1], 1], [[2], 2]]])

 

Example 2.

DGsetupx,y,u,Jet,2:

θ1,θ2,θ3Cu,Cu1,Cu2

θ1,θ2,θ3Cu,Cu1,Cu2

(20)

convertθ1,DGform

u1dxu2dy+du

(21)

convertθ2,DGform

u1,1dxu1,2dy+du1

(22)

convertθ3,DGform

u1,2dxu2,2dy+du2

(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.

withDifferentialGeometry:withTensor:

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].

DGsetupt,x,y,z,z1,z2,w1,w2,M

frame name: M

(24)

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

gevalDGdt&tdtdx&tdxdy&tdydz&tdz

gdtdtdxdxdydydzdz

(25)

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

FD_t,D_x,D_y,D_z

FD_t,D_x,D_y,D_z

(26)

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

σSolderFormF

σ2dt2D_z1D_w1+2dt2D_z2D_w2+2dx2D_z1D_w2+2dx2D_z2D_w1I22dyD_z1D_w2+I22dyD_z2D_w1+2dz2D_z1D_w12dz2D_z2D_w2

(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.

XevalDGaD_t+bD_y

XaD_t+bD_y

(28)

ψconvertX,DGspinor,σ,1

ψ2aD_z12D_w1I22bD_z1D_w2+I22bD_z2D_w1+2aD_z22D_w2

(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.

TevalDGD_x&tD_y&tdz

TD_xD_ydz

(30)

χconvertT,DGspinor,σ,1,3

χD_y2D_z1D_w2dz1dw1D_y2D_z1D_w2dz2dw2+D_y2D_z2D_w1dz1dw1D_y2D_z2D_w1dz2dw2

(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.

convertψ,DGtensor,σ,1,2

aD_t+bD_y

(32)

convertχ,DGtensor,σ,2,3,4,5

D_yD_xdz

(33)

convert/DGtensor

withDifferentialGeometry:withTensor:

 

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

DGsetupx,y,z,M:

 

Example 1.

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

A1Matrix1,0,2,0,2,4,1,0,0

A1

(34)

convertA1,DGtensor,con_bas,con_bas,

D_xD_x+2D_xD_z+2D_yD_y+4D_yD_z+D_zD_x

(35)

convertA1,DGtensor,cov_bas,con_bas,

dxD_x+2dxD_z+2dyD_y+4dyD_z+dzD_x

(36)

convertA1,DGtensor,con_bas,cov_bas,

D_xdx+2D_xdz+2D_ydy+4D_ydz+D_zdx

(37)

convertA1,DGtensor,cov_bas,cov_bas,

dxdx+2dxdz+2dydy+4dydz+dzdx

(38)

Example 2.

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

A2Array1..3,1..3,1..3,1..3:

A21,2,2,3m

A21,2,2,3m

(39)

A21,3,2,1n

A21,3,2,1n

(40)

convertA2,DGtensor,con_bas,cov_bas,cov_bas,cov_bas,

mD_xdydydz+nD_xdzdydx

(41)

Example 3.

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

XevalDGx2D_yy2D_z

Xx2D_yy2D_z

(42)

TconvertX,DGtensor

Tx2D_yy2D_z

(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.

Tools:-DGinfoX,ObjectType,Tools:-DGinfoT,ObjectType

vector,tensor

(44)

lprintX,lprintT

_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.

ωevalDGydx&wdyzdy&wdz

ωydxdyzdydz

(45)

convertω,DGtensor

ydxdyydydxzdydz+zdzdy

(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].

DGsetupt,x,y,z,z1,z2,w1,w2,M

frame name: M

(47)

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

gevalDGdt&tdtdx&tdxdy&tdydz&tdz

gdtdtdxdxdydydzdz

(48)

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

FD_t,D_x,D_y,D_z

FD_t,D_x,D_y,D_z

(49)

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

σSolderFormF

σ2dt2D_z1D_w1+2dt2D_z2D_w2+2dx2D_z1D_w2+2dx2D_z2D_w1I22dyD_z1D_w2+I22dyD_z2D_w1+2dz2D_z1D_w12dz2D_z2D_w2

(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.

ψevalDG12I212D_z1&tD_w2+12I212D_z2&tD_w1

ψI22D_z1D_w2+I22D_z2D_w1

(51)

Xconvertψ,DGtensor,σ,1,2

XD_y

(52)

Example 6.

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

ψevalDG212dz2&tdw2

ψ2dz2dw2

(53)

ωconvertψ,DGtensor,σ,1,2

ωdtdz

(54)

Example 7.

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

ψevalDGdz1&tdw1&tdz2&tdw2dz1&tdw2&tdz2&tdw1dz2&tdw1&tdz1&tdw2+dz2&tdw2&tdz1&tdw1

ψdz1dw1dz2dw2dz1dw2dz2dw1dz2dw1dz1dw2+dz2dw2dz1dw1

(55)

Gconvertψ,DGtensor,σ,1,2,3,4

Gdtdtdxdxdydydzdz

(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.)

ψevalDG12I212D_t&tD_z1&t&tD_z1&tD_w2+12I212D_x&tD_z2&tD_z2&tD_w1

ψI22D_tD_z1D_z1D_w2+I22D_xD_z2D_z2D_w1

(57)

T1convertψ,DGtensor,σ,2,4

T1I2D_tD_xD_z1+D_t2D_yD_z1+I2D_xD_xD_z2+D_x2D_yD_z2

(58)

T2convertψ,DGtensor,σ,3,4

T2I2D_tD_xD_z1+D_t2D_yD_z1+I2D_xD_xD_z2+D_x2D_yD_z2

(59)

convert/DGjet, convert/DGdiff

withDifferentialGeometry:withLibrary:

 

Example 1.

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

DGsetupx,y,u,Jet,2:

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

Ldiffux,y,x,x+diffux,y,y,y

L2x2ux,y+2y2ux,y

(60)

convertL,DGjet

u1,1+u2,2

(61)

Example 2.

• 

We retrieve a 4th order ODE from Kamke and rewrite it in standard index notation for coordinates on jet spaces.

DGsetupx,y,J,4

frame name: J

(62)

ODERetrieveKamke,1,4,8,variables=x,y

ODEⅆ4ⅆx4yx+ax2+bλ+cⅆ2ⅆx2yx+αx2+βλ+γyx

(63)

convertODE,DGjet

y1,1,1,1+ax2+bλ+cy1,1+αx2+βλ+γy

(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.

DGsetupt,x,u,J,3:

Δu1=u2,2,2+uu2

Δu1=uu2+u2,2,2

(65)

convertΔ,DGdiff

tut,x=ut,xxut,x+3x3ut,x

(66)

convert/DGbiform

withDifferentialGeometry:

 

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].

DGsetupx,y,u,Jet,2:

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

ωevalDGdu1&wdu2

ωdu1du2

(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.

convertω,DGbiform,2,0

u1,1u2,2u1,22DxDy

(68)

convertω,DGbiform,1,1

u1,2DxCu1+u1,1DxCu2u2,2DyCu1+u1,2DyCu2

(69)

convertω,DGbiform,0,2

Cu1Cu2

(70)

convertω,DGbiform

Cu1Cu2,u1,2DxCu1+u1,1DxCu2u2,2DyCu1+u1,2DyCu2,u1,1u2,2u1,22DxDy

(71)

See Also

DifferentialGeometry