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 &t D_x+D_x &t D_y

_DGtensor,M,con_bas,con_bas,,1,2,1,3,1,1

(1)

T2evalDG2dx &t D_x &t dy+dz &t D_z &t dx

_DGtensor,M,cov_bas,con_bas,cov_bas,,1,1,2,2,3,3,1,1

(2)

A1convertT1,DGArray

010000100

(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

101020030

(5)

convertA,DGvector

_DGvector,M,,1,x+z,2,2y,3,3y

(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 &t D_x &t dy+dz &t D_z &t dx

_DGtensor,M,cov_bas,con_bas,cov_bas,,1,1,2,2,3,3,1,1

(7)

T2evalDGD_z &t D_x+D_x &t D_y

_DGtensor,M,con_bas,con_bas,,1,2,1,3,1,1

(8)

SContractIndicesT1,T2,1,1,3,2

_DGtensor,M,con_bas,,1,2,3,1

(9)

XconvertS,DGvector

_DGvector,M,,1,2,3,1

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

DE2yxux,y=vx,y2,2x2vx,y=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

_DGvector,J,,2,1,_DGvector,J,,1,1,_DGvector,J,,2,y,3,u[],4,v[],_DGvector,J,,1,x,3,5u[],4,3v[]

(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 &t D_x &t dy+dz &t D_z &t dx

_DGtensor,M,cov_bas,con_bas,cov_bas,,1,1,2,2,3,3,1,1

(16)

SContractIndicesT1,1,2

_DGtensor,M,cov_bas,,1,1,2,2

(17)

XconvertS,DGform

_DGform,M,1,1,1,2,2

(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,θ3_DGbiform,Jet,0,1,3,1,_DGbiform,Jet,0,1,4,1,_DGbiform,Jet,0,1,5,1

(20)

convertθ1,DGform

_DGform,Jet,1,1,u1,2,u2,3,1

(21)

convertθ2,DGform

_DGform,Jet,1,1,u1,1,2,u1,2,4,1

(22)

convertθ3,DGform

_DGform,Jet,1,1,u1,2,2,u2,2,5,1

(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 &t dtdx &t dxdy &t dydz &t dz

_DGtensor,M,cov_bas,cov_bas,,1,1,1,2,2,1,3,3,1,4,4,1

(25)

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

FD_t,D_x,D_y,D_z

_DGvector,M,,1,1,_DGvector,M,,2,1,_DGvector,M,,3,1,_DGvector,M,,4,1

(26)

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

σSolderFormF

_DGtensor,M,cov_bas,con_vrt,con_vrt,,1,5,7,122,1,6,8,122,2,5,8,122,2,6,7,122,3,5,8,12I2,3,6,7,12I2,4,5,7,122,4,6,8,122

(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

_DGvector,M,,1,a,3,b

(28)

ψconvertX,DGspinor,σ,1

_DGtensor,M,con_vrt,con_vrt,,5,7,122a,5,8,12I2b,6,7,12I2b,6,8,122a

(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 &t D_y &t dz

_DGtensor,M,con_bas,con_bas,cov_bas,,2,3,4,1

(30)

χconvertT,DGspinor,σ,1,3

_DGtensor,M,con_bas,con_vrt,con_vrt,cov_vrt,cov_vrt,,3,5,8,5,7,12,3,5,8,6,8,12,3,6,7,5,7,12,3,6,7,6,8,12

(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

_DGtensor,M,con_bas,,1,a,3,b

(32)

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

_DGtensor,M,con_bas,con_bas,cov_bas,,3,2,4,1

(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

102024100

(34)

convertA1,DGtensor,con_bas,con_bas,

_DGtensor,M,con_bas,con_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1

(35)

convertA1,DGtensor,cov_bas,con_bas,

_DGtensor,M,cov_bas,con_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1

(36)

convertA1,DGtensor,con_bas,cov_bas,

_DGtensor,M,con_bas,cov_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1

(37)

convertA1,DGtensor,cov_bas,cov_bas,

_DGtensor,M,cov_bas,cov_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1

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

_DGtensor,M,con_bas,cov_bas,cov_bas,cov_bas,,1,2,2,3,m,1,3,2,1,n

(41)

Example 3.

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

XevalDGx2D_yy2D_z

_DGvector,M,,2,x2,3,y2

(42)

TconvertX,DGtensor

_DGtensor,M,con_bas,,2,x2,3,y2

(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 &w dyzdy &w dz

_DGform,M,2,1,2,y,2,3,z

(45)

convertω,DGtensor

_DGtensor,M,cov_bas,cov_bas,,1,2,y,2,1,y,2,3,z,3,2,z

(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 &t dtdx &t dxdy &t dydz &t dz

_DGtensor,M,cov_bas,cov_bas,,1,1,1,2,2,1,3,3,1,4,4,1

(48)

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

FD_t,D_x,D_y,D_z

_DGvector,M,,1,1,_DGvector,M,,2,1,_DGvector,M,,3,1,_DGvector,M,,4,1

(49)

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

σSolderFormF

_DGtensor,M,cov_bas,con_vrt,con_vrt,,1,5,7,122,1,6,8,122,2,5,8,122,2,6,7,122,3,5,8,12I2,3,6,7,12I2,4,5,7,122,4,6,8,122

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

ψevalDG1I212D_z1 &t D_w22+1I212D_z2 &t D_w12

_DGtensor,M,con_vrt,con_vrt,,5,8,12I2,6,7,12I2

(51)

Xconvertψ,DGtensor,σ,1,2

_DGtensor,M,con_bas,,3,1

(52)

Example 6.

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

ψevalDG212dz2 &t dw2

_DGtensor,M,cov_vrt,cov_vrt,,6,8,2

(53)

ωconvertψ,DGtensor,σ,1,2

_DGtensor,M,cov_bas,,1,1,4,1

(54)

Example 7.

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

ψevalDGdz1 &t dw1 &t dz2 &t dw2dz1 &t dw2 &t dz2 &t dw1dz2 &t dw1 &t dz1 &t dw2+dz2 &t dw2 &t dz1 &t dw1

_DGtensor,M,cov_vrt,cov_vrt,cov_vrt,cov_vrt,,5,7,6,8,1,5,8,6,7,1,6,7,5,8,1,6,8,5,7,1

(55)

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

_DGtensor,M,cov_bas,cov_bas,,1,1,1,2,2,1,3,3,1,4,4,1

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

ψevalDG1I212D_t &t D_z1 &t `&t`D_z1 &t D_w22+1I212D_x &t D_z2 &t D_z2 &t D_w12

_DGtensor,M,con_bas,con_vrt,con_vrt,con_vrt,,1,5,5,8,12I2,2,6,6,7,12I2

(57)

T1convertψ,DGtensor,σ,2,4

_DGtensor,M,con_bas,con_bas,con_vrt,,1,2,5,12I,1,3,5,12,2,2,6,12I,2,3,6,12

(58)

T2convertψ,DGtensor,σ,3,4

_DGtensor,M,con_bas,con_bas,con_vrt,,1,2,5,12I,1,3,5,12,2,2,6,12I,2,3,6,12

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

L2x2ux,y+2y2ux,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+u[]u2

Δ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 &w du2

_DGform,Jet,2,4,5,1

(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

_DGbiform,Jet,2,0,1,2,u1,1u2,2u1,22

(68)

convertω,DGbiform,1,1

_DGbiform,Jet,1,1,1,4,u1,2,1,5,u1,1,2,4,u2,2,2,5,u1,2

(69)

convertω,DGbiform,0,2

_DGbiform,Jet,0,2,4,5,1

(70)

convertω,DGbiform

_DGbiform,Jet,0,2,4,5,1,_DGbiform,Jet,1,1,1,4,u1,2,1,5,u1,1,2,4,u2,2,2,5,u1,2,_DGbiform,Jet,2,0,1,2,u1,1u2,2u1,22

(71)

See Also

DifferentialGeometry