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 &t D_x+D_x &t D_y
_DG⁡tensor,M,con_bas,con_bas,,1,2,1,3,1,1
T2 ≔ evalDG⁡2⁢dx &t D_x &t dy+dz &t D_z &t dx
_DG⁡tensor,M,cov_bas,con_bas,cov_bas,,1,1,2,2,3,3,1,1
A1 ≔ convert⁡T1,DGArray
010000100
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
101020030
convert⁡A,DGvector
_DG⁡vector,M,,1,x+z,2,2⁢y,3,3⁢y
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 &t D_x &t dy+dz &t D_z &t dx
T2 ≔ evalDG⁡D_z &t D_x+D_x &t D_y
S ≔ ContractIndices⁡T1,T2,1,1,3,2
_DG⁡tensor,M,con_bas,,1,2,3,1
X ≔ convert⁡S,DGvector
_DG⁡vector,M,,1,2,3,1
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 ≔ ∂2∂y⁢∂x⁢u⁡x,y=v⁡x,y2,∂2∂x2⁢v⁡x,y=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
_DG⁡vector,J,,2,1,_DG⁡vector,J,,1,1,_DG⁡vector,J,,2,y,3,−u[],4,−v[],_DG⁡vector,J,,1,x,3,−5⁢u[],4,−3⁢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
_DG⁡tensor,M,cov_bas,,1,1,2,2
X ≔ convert⁡S,DGform
_DG⁡form,M,1,1,1,2,2
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
θ1,θ2,θ3≔_DG⁡biform,Jet,0,1,3,1,_DG⁡biform,Jet,0,1,4,1,_DG⁡biform,Jet,0,1,5,1
convert⁡θ1,DGform
_DG⁡form,Jet,1,1,−u1,2,−u2,3,1
convert⁡θ2,DGform
_DG⁡form,Jet,1,1,−u1,1,2,−u1,2,4,1
convert⁡θ3,DGform
_DG⁡form,Jet,1,1,−u1,2,2,−u2,2,5,1
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 &t dt−dx &t dx−dy &t dy−dz &t dz
_DG⁡tensor,M,cov_bas,cov_bas,,1,1,1,2,2,−1,3,3,−1,4,4,−1
Define an orthonormal frame on M with respect to the metric g.
F ≔ D_t,D_x,D_y,D_z
_DG⁡vector,M,,1,1,_DG⁡vector,M,,2,1,_DG⁡vector,M,,3,1,_DG⁡vector,M,,4,1
Calculate the solder form sigma from the frame F. See Spinor, SolderForm.
σ ≔ SolderForm⁡F
_DG⁡tensor,M,cov_bas,con_vrt,con_vrt,,1,5,7,12⁢2,1,6,8,12⁢2,2,5,8,12⁢2,2,6,7,12⁢2,3,5,8,−12⁢I⁢2,3,6,7,12⁢I⁢2,4,5,7,12⁢2,4,6,8,−12⁢2
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
_DG⁡vector,M,,1,a,3,b
ψ ≔ convert⁡X,DGspinor,σ,1
_DG⁡tensor,M,con_vrt,con_vrt,,5,7,12⁢2⁢a,5,8,−12⁢I⁢2⁢b,6,7,12⁢I⁢2⁢b,6,8,12⁢2⁢a
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 &t D_y &t dz
_DG⁡tensor,M,con_bas,con_bas,cov_bas,,2,3,4,1
χ ≔ convert⁡T,DGspinor,σ,1,3
_DG⁡tensor,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
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
_DG⁡tensor,M,con_bas,,1,a,3,b
convert⁡χ,DGtensor,σ,2,3,4,5
_DG⁡tensor,M,con_bas,con_bas,cov_bas,,3,2,4,1
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
102024100
convert⁡A1,DGtensor,con_bas,con_bas,
_DG⁡tensor,M,con_bas,con_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1
convert⁡A1,DGtensor,cov_bas,con_bas,
_DG⁡tensor,M,cov_bas,con_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1
convert⁡A1,DGtensor,con_bas,cov_bas,
_DG⁡tensor,M,con_bas,cov_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1
convert⁡A1,DGtensor,cov_bas,cov_bas,
_DG⁡tensor,M,cov_bas,cov_bas,,1,1,1,1,3,2,2,2,2,2,3,4,3,1,1
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,2,2,3≔m
A21,3,2,1 ≔ n
A21,3,2,1≔n
convert⁡A2,DGtensor,con_bas,cov_bas,cov_bas,cov_bas,
_DG⁡tensor,M,con_bas,cov_bas,cov_bas,cov_bas,,1,2,2,3,m,1,3,2,1,n
We define a vector field and convert it to a rank 1 contravariant tensor field.
X ≔ evalDG⁡x2⁢D_y−y2⁢D_z
_DG⁡vector,M,,2,x2,3,−y2
T ≔ convert⁡X,DGtensor
_DG⁡tensor,M,con_bas,,2,x2,3,−y2
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 &w dy−z⁢dy &w dz
_DG⁡form,M,2,1,2,y,2,3,−z
convert⁡ω,DGtensor
_DG⁡tensor,M,cov_bas,cov_bas,,1,2,y,2,1,−y,2,3,−z,3,2,z
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⁡−1⁢I⁢212⁢D_z1 &t D_w22+1⁢I⁢212⁢D_z2 &t D_w12
_DG⁡tensor,M,con_vrt,con_vrt,,5,8,−12⁢I⁢2,6,7,12⁢I⁢2
X ≔ convert⁡ψ,DGtensor,σ,1,2
_DG⁡tensor,M,con_bas,,3,1
Example 6.
Define a covariant rank 2 spinor psi and convert it to a rank 1 covariant tensor omega.
ψ ≔ evalDG⁡212⁢dz2 &t dw2
_DG⁡tensor,M,cov_vrt,cov_vrt,,6,8,2
ω ≔ convert⁡ψ,DGtensor,σ,1,2
_DG⁡tensor,M,cov_bas,,1,1,4,−1
Example 7.
Define a covariant rank 4 spinor psi and convert it to a rank 2 covariant tensor G.
ψ ≔ evalDG⁡dz1 &t dw1 &t dz2 &t dw2−dz1 &t dw2 &t dz2 &t dw1−dz2 &t dw1 &t dz1 &t dw2+dz2 &t dw2 &t dz1 &t dw1
_DG⁡tensor,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
G ≔ convert⁡ψ,DGtensor,σ,1,2,3,4
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⁡−1⁢I⁢212⁢D_t &t D_z1 &t `&t`⁡D_z1 &t D_w22+1⁢I⁢212⁢D_x &t D_z2 &t D_z2 &t D_w12
_DG⁡tensor,M,con_bas,con_vrt,con_vrt,con_vrt,,1,5,5,8,−12⁢I⁢2,2,6,6,7,12⁢I⁢2
T1 ≔ convert⁡ψ,DGtensor,σ,2,4
_DG⁡tensor,M,con_bas,con_bas,con_vrt,,1,2,5,−12⁢I,1,3,5,12,2,2,6,12⁢I,2,3,6,12
T2 ≔ convert⁡ψ,DGtensor,σ,3,4
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 ≔ ∂2∂x2⁢u⁡x,y+∂2∂y2⁢u⁡x,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 &w du2
_DG⁡form,Jet,2,4,5,1
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
_DG⁡biform,Jet,2,0,1,2,u1,1⁢u2,2−u1,22
convert⁡ω,DGbiform,1,1
_DG⁡biform,Jet,1,1,1,4,−u1,2,1,5,u1,1,2,4,−u2,2,2,5,u1,2
convert⁡ω,DGbiform,0,2
_DG⁡biform,Jet,0,2,4,5,1
convert⁡ω,DGbiform
_DG⁡biform,Jet,0,2,4,5,1,_DG⁡biform,Jet,1,1,1,4,−u1,2,1,5,u1,1,2,4,−u2,2,2,5,u1,2,_DG⁡biform,Jet,2,0,1,2,u1,1⁢u2,2−u1,22
See Also
DifferentialGeometry
Download Help Document