convert routines of the DifferentialGeometry package
Calling Sequence
Parameters
Description
Examples
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)
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
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.
convert/DGArray
with⁡DifferentialGeometry:
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
DGsetup⁡x,y,z,M:
T1≔evalDG⁡D_z&tD_x+D_x&tD_y
T1≔D_x⁢D_y+D_z⁢D_x
T2≔evalDG⁡2⁢dx&tD_x&tdy+dz&tD_z&tdx
T2≔2⁢dx⁢D_x⁢dy+dz⁢D_z⁢dx
A1≔convert⁡T1,DGArray
A1≔
A2≔convert⁡T2,DGArray
A21,1,2
2
convert/DGvector
with⁡DifferentialGeometry:with⁡Tensor:
We define a manifold M with coordinates [x, y, z]. We convert a matrix to a linear vector field.
A≔Matrix⁡1,0,1,0,2,0,0,3,0
A≔
convert⁡A,DGvector
x+z⁢D_x+2⁢y⁢D_y+3⁢y⁢D_z
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.
T1≔evalDG⁡2⁢dx&tD_x&tdy+dz&tD_z&tdx
T1≔2⁢dx⁢D_x⁢dy+dz⁢D_z⁢dx
T2≔evalDG⁡D_z&tD_x+D_x&tD_y
T2≔D_x⁢D_y+D_z⁢D_x
S≔ContractIndices⁡T1,T2,1,1,3,2
S≔2⁢D_x+D_z
X≔convert⁡S,DGvector
X≔2⁢D_x+D_z
Tools:-DGinfo⁡S,ObjectType,Tools:-DGinfo⁡X,ObjectType
tensor,vector
lprint⁡S,lprint⁡X
_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.
DE≔diff⁡u⁡x,y,x,y=v⁡x,y2,diff⁡v⁡x,y,`$`⁡x,2=u⁡x,y
DE≔∂2∂x∂yu⁡x,y=v⁡x,y2,∂2∂x2v⁡x,y=u⁡x,y
Sym≔PDEtools:-Infinitesimals⁡DE,u,v
Sym≔_ξx⁡x,y,u,v=0,_ξy⁡x,y,u,v=1,_ηu⁡x,y,u,v=0,_ηv⁡x,y,u,v=0,_ξx⁡x,y,u,v=1,_ξy⁡x,y,u,v=0,_ηu⁡x,y,u,v=0,_ηv⁡x,y,u,v=0,_ξx⁡x,y,u,v=0,_ξy⁡x,y,u,v=y,_ηu⁡x,y,u,v=−u,_ηv⁡x,y,u,v=−v,_ξx⁡x,y,u,v=x,_ξy⁡x,y,u,v=0,_ηu⁡x,y,u,v=−5⁢u,_ηv⁡x,y,u,v=−3⁢v
DGsetup⁡x,y,u,v,J,2
frame name: J
convert⁡Sym,DGvector
D_y,D_x,y⁢D_y−u⁢D_u−v⁢D_v,x⁢D_x−5⁢u⁢D_u−3⁢v⁢D_v
convert/DGform
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.
S≔ContractIndices⁡T1,1,2
S≔dx+2⁢dy
X≔convert⁡S,DGform
X≔dx+2⁢dy
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.
tensor,form
_DG([["tensor", M, [["cov_bas"], []]], [[[1], 1], [[2], 2]]]) _DG([["form", M, 1], [[[1], 1], [[2], 2]]])
DGsetup⁡x,y,u,Jet,2:
θ1,θ2,θ3≔Cu,Cu1,Cu2
convert⁡θ1,DGform
−u1⁢dx−u2⁢dy+du
convert⁡θ2,DGform
−u1,1⁢dx−u1,2⁢dy+du1
convert⁡θ3,DGform
−u1,2⁢dx−u2,2⁢dy+du2
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.
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].
DGsetup⁡t,x,y,z,z1,z2,w1,w2,M
frame name: M
Define a spacetime metric g on M. Our spinor conventions assume the metric has signature [1, -1, -1, -1].
g≔evalDG⁡dt&tdt−dx&tdx−dy&tdy−dz&tdz
g≔dt⁢dt−dx⁢dx−dy⁢dy−dz⁢dz
Define an orthonormal frame on M with respect to the metric g.
F≔D_t,D_x,D_y,D_z
Calculate the solder form sigma from the frame F. See Spinor, SolderForm.
σ≔SolderForm⁡F
σ≔2⁢dt2⁢D_z1⁢D_w1+2⁢dt2⁢D_z2⁢D_w2+2⁢dx2⁢D_z1⁢D_w2+2⁢dx2⁢D_z2⁢D_w1−I2⁢2⁢dy⁢D_z1⁢D_w2+I2⁢2⁢dy⁢D_z2⁢D_w1+2⁢dz2⁢D_z1⁢D_w1−2⁢dz2⁢D_z2⁢D_w2
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≔evalDG⁡a⁢D_t+b⁢D_y
X≔a⁢D_t+b⁢D_y
ψ≔convert⁡X,DGspinor,σ,1
ψ≔2⁢a⁢D_z12⁢D_w1−I2⁢2⁢b⁢D_z1⁢D_w2+I2⁢2⁢b⁢D_z2⁢D_w1+2⁢a⁢D_z22⁢D_w2
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≔evalDG⁡D_x&tD_y&tdz
T≔D_x⁢D_y⁢dz
χ≔convert⁡T,DGspinor,σ,1,3
χ≔D_y2⁢D_z1⁢D_w2⁢dz1⁢dw1−D_y2⁢D_z1⁢D_w2⁢dz2⁢dw2+D_y2⁢D_z2⁢D_w1⁢dz1⁢dw1−D_y2⁢D_z2⁢D_w1⁢dz2⁢dw2
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
a⁢D_t+b⁢D_y
convert⁡χ,DGtensor,σ,2,3,4,5
D_y⁢D_x⁢dz
convert/DGtensor
We define a manifold M with coordinates [x, y, z].
We define a Matrix' A1 and convert it to a rank 2 tensor in 4 different ways:
A1≔Matrix⁡1,0,2,0,2,4,1,0,0
convert⁡A1,DGtensor,con_bas,con_bas,
D_x⁢D_x+2⁢D_x⁢D_z+2⁢D_y⁢D_y+4⁢D_y⁢D_z+D_z⁢D_x
convert⁡A1,DGtensor,cov_bas,con_bas,
dx⁢D_x+2⁢dx⁢D_z+2⁢dy⁢D_y+4⁢dy⁢D_z+dz⁢D_x
convert⁡A1,DGtensor,con_bas,cov_bas,
D_x⁢dx+2⁢D_x⁢dz+2⁢D_y⁢dy+4⁢D_y⁢dz+D_z⁢dx
convert⁡A1,DGtensor,cov_bas,cov_bas,
dx⁢dx+2⁢dx⁢dz+2⁢dy⁢dy+4⁢dy⁢dz+dz⁢dx
We define a four-dimensional array and convert it to a rank 4 covariant tensor.
A2≔Array⁡1..3,1..3,1..3,1..3:
A21,2,2,3≔m
A21,3,2,1≔n
convert⁡A2,DGtensor,con_bas,cov_bas,cov_bas,cov_bas,
m⁢D_x⁢dy⁢dy⁢dz+n⁢D_x⁢dz⁢dy⁢dx
We define a vector field and convert it to a rank 1 contravariant tensor field.
X≔evalDG⁡x2⁢D_y−y2⁢D_z
X≔x2⁢D_y−y2⁢D_z
T≔convert⁡X,DGtensor
T≔x2⁢D_y−y2⁢D_z
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:-DGinfo⁡X,ObjectType,Tools:-DGinfo⁡T,ObjectType
vector,tensor
lprint⁡X,lprint⁡T
_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.
ω≔evalDG⁡y⁢dx&wdy−z⁢dy&wdz
ω≔y⁢dx⁢⋀⁢dy−z⁢dy⁢⋀⁢dz
convert⁡ω,DGtensor
y⁢dx⁢dy−y⁢dy⁢dx−z⁢dy⁢dz+z⁢dz⁢dy
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].
Define a spacetime metric g on M. Our spinor convention require that the metric has signature [1, -1,-1,-1].
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.
ψ≔evalDG⁡−12⁢I⁢212⁢D_z1&tD_w2+12⁢I⁢212⁢D_z2&tD_w1
ψ≔−I2⁢2⁢D_z1⁢D_w2+I2⁢2⁢D_z2⁢D_w1
X≔convert⁡ψ,DGtensor,σ,1,2
X≔D_y
Example 6.
Define a covariant rank 2 spinor psi and convert it to a rank 1 covariant tensor omega.
ψ≔evalDG⁡212⁢dz2&tdw2
ψ≔2⁢dz2⁢dw2
ω≔convert⁡ψ,DGtensor,σ,1,2
ω≔dt−dz
Example 7.
Define a covariant rank 4 spinor psi and convert it to a rank 2 covariant tensor G.
ψ≔evalDG⁡dz1&tdw1&tdz2&tdw2−dz1&tdw2&tdz2&tdw1−dz2&tdw1&tdz1&tdw2+dz2&tdw2&tdz1&tdw1
ψ≔dz1⁢dw1⁢dz2⁢dw2−dz1⁢dw2⁢dz2⁢dw1−dz2⁢dw1⁢dz1⁢dw2+dz2⁢dw2⁢dz1⁢dw1
G≔convert⁡ψ,DGtensor,σ,1,2,3,4
G≔dt⁢dt−dx⁢dx−dy⁢dy−dz⁢dz
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.)
ψ≔evalDG⁡−12⁢I⁢212⁢D_t&tD_z1&t&t⁡D_z1&tD_w2+12⁢I⁢212⁢D_x&tD_z2&tD_z2&tD_w1
ψ≔−I2⁢2⁢D_t⁢D_z1⁢D_z1⁢D_w2+I2⁢2⁢D_x⁢D_z2⁢D_z2⁢D_w1
T1≔convert⁡ψ,DGtensor,σ,2,4
T1≔−I2⁢D_t⁢D_x⁢D_z1+D_t2⁢D_y⁢D_z1+I2⁢D_x⁢D_x⁢D_z2+D_x2⁢D_y⁢D_z2
T2≔convert⁡ψ,DGtensor,σ,3,4
T2≔−I2⁢D_t⁢D_x⁢D_z1+D_t2⁢D_y⁢D_z1+I2⁢D_x⁢D_x⁢D_z2+D_x2⁢D_y⁢D_z2
convert/DGjet, convert/DGdiff
with⁡DifferentialGeometry:with⁡Library:
We define the 2nd order jet space J^2(R^2, R) for one function u of two independent variables [x, y].
We convert the Laplace of a function, defined using the Maple diff command into a standard index notation for coordinates on jet spaces.
L≔diff⁡u⁡x,y,x,x+diff⁡u⁡x,y,y,y
L≔∂2∂x2u⁡x,y+∂2∂y2u⁡x,y
convert⁡L,DGjet
u1,1+u2,2
We retrieve a 4th order ODE from Kamke and rewrite it in standard index notation for coordinates on jet spaces.
DGsetup⁡x,y,J,4
ODE≔Retrieve⁡Kamke,1,4,8,variables=x,y
ODE≔ⅆ4ⅆx4y⁡x+a⁢x2+b⁢λ+c⁢ⅆ2ⅆx2y⁡x+α⁢x2+β⁢λ+γ⁢y⁡x
convert⁡ODE,DGjet
y1,1,1,1+a⁢x2+b⁢λ+c⁢y1,1+α⁢x2+β⁢λ+γ⁢y
Define a 2-form on J^2(R^2, R). We convert the KdV equation, given in jet notation, to ordinary derivative notation.
DGsetup⁡t,x,u,J,3:
Δ≔u1=u2,2,2+u⁢u2
Δ≔u1=u⁢u2+u2,2,2
convert⁡Δ,DGdiff
∂∂tu⁡t,x=u⁡t,x⁢∂∂xu⁡t,x+∂3∂x3u⁡t,x
convert/DGbiform
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].
Define a 2-form on J^2(R^2, R).
ω≔evalDG⁡du1&wdu2
ω≔du1⁢⋀⁢du2
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,1⁢u2,2−u1,22⁢Dx⁢⋀⁢Dy
convert⁡ω,DGbiform,1,1
−u1,2⁢Dx⁢⋀⁢Cu1+u1,1⁢Dx⁢⋀⁢Cu2−u2,2⁢Dy⁢⋀⁢Cu1+u1,2⁢Dy⁢⋀⁢Cu2
convert⁡ω,DGbiform,0,2
Cu1⁢⋀⁢Cu2
convert⁡ω,DGbiform
Cu1⁢⋀⁢Cu2,−u1,2⁢Dx⁢⋀⁢Cu1+u1,1⁢Dx⁢⋀⁢Cu2−u2,2⁢Dy⁢⋀⁢Cu1+u1,2⁢Dy⁢⋀⁢Cu2,u1,1⁢u2,2−u1,22⁢Dx⁢⋀⁢Dy
See Also
DifferentialGeometry
Download Help Document