DifferentialGeometry Lessons - Maple Programming Help

Home : Support : Online Help : Mathematics : DifferentialGeometry : Lessons and Tutorials : DifferentialGeometry : DifferentialGeometry/LessonsAndTutorials/DifferentialGeometry/Utilities

DifferentialGeometry Lessons

Lesson 3: Some DifferentialGeometry Utilities

Overview

DifferentialGeometry includes a powerful set of utilities for performing linear algebra computations on spaces of vectors, differential forms, and tensors (VFT).

In this lesson, you will learn to do the following:

 – Extract the set of coefficients of a DifferentialGeometry VFT.
 – Extract specific coefficients of a DifferentialGeometry VFT.
 – Determine if a given VFT is a linear combination of a set of VFT.
 – Create a spanning list of independent VFT (a basis) from a list of VFT.
 – Generate a basis for the space of p-forms.
 – Generate a collection of tensors.
 – Extend a given set of independent VFT to a basis for a subspace.
 – Find the dual basis for the cotangent space from a basis for the tangent space.
 – Find the annihilator subspace for a given set of vectors or forms.

DGinfo/CoefficientSet, DGinfo/CoefficientList

The command DGinfo can be used to extract all or some of the coefficients of a vector, differential form or tensor.  Exercises 11 illustrates the use of these commands in programming differential geometry applications.

 > with(DifferentialGeometry): with(Tools):
 > DGsetup([x, y ,z], "M");
 ${\mathrm{frame name: M}}$ (2.1)

Define a vector X = aD_x + bD_y + bD_z

 M > X := evalDG(a*D_x + b*D_y + b*D_z);
 ${X}{:=}{a}{}{\mathrm{D_x}}{+}{b}{}{\mathrm{D_y}}{+}{b}{}{\mathrm{D_z}}$ (2.2)

Find the set of coefficients of X.

 M > DGinfo(X, "CoefficientSet");
 $\left\{{a}{,}{b}\right\}$ (2.3)

Find the list of all coefficients of X.

 M > DGinfo(X, "CoefficientList", "all");
 $\left[{a}{,}{b}{,}{b}\right]$ (2.4)

Find the coefficients of D_x and D_y in X (Method 1).

 M > DGinfo(X, "CoefficientList", [[1], [2]]);
 $\left[{a}{,}{b}\right]$ (2.5)

Find the coefficients of D_x and D_y in X (Method 2).

 M > DGinfo(X, "CoefficientList", [D_x, D_y]);
 $\left[{a}{,}{b}\right]$ (2.6)

Define a type (1,1) tensor T.

 M > T := evalDG(a*dx &t D_x + b*dy &t D_z + c*dz &t D_x);
 ${T}{:=}{a}{}{\mathrm{dx}}{}{\mathrm{D_x}}{+}{b}{}{\mathrm{dy}}{}{\mathrm{D_z}}{+}{c}{}{\mathrm{dz}}{}{\mathrm{D_x}}$ (2.7)

Find the coefficient of dx D_x in T.

 M > DGinfo(T, "CoefficientList", [[1, 1]]);
 $\left[{a}\right]$ (2.8)

Find the coefficients of dy D_z and dz D_z in T.

 M > DGinfo(alpha, "CoefficientList", [dy &tensor D_z, dz &tensor D_z]);
 $\left[{\mathrm{α}}\right]$ (2.9)

GetComponents

The command GetComponents provides a very useful set of procedures for determining if a given VFT or list of VFT can be expressed as a linear combination of a set of VFT.

 M > with(DifferentialGeometry): with(Tools):
 M > DGsetup([x, y ,z], "M"):

Example 1.  Express the vector X as a linear combination of the vectors in the list B.  Check the result with DGzip.

 M > X := evalDG(2*D_x + D_y - D_z);
 ${X}{:=}{2}{}{\mathrm{D_x}}{+}{\mathrm{D_y}}{-}{\mathrm{D_z}}$ (3.1)
 M > B := evalDG([D_x - D_y, D_y - D_z, D_z + D_x]);
 ${B}{:=}\left[{\mathrm{D_x}}{-}{\mathrm{D_y}}{,}{\mathrm{D_y}}{-}{\mathrm{D_z}}{,}{\mathrm{D_x}}{+}{\mathrm{D_z}}\right]$ (3.2)
 M > C := GetComponents(X, B);
 ${C}{:=}\left[{1}{,}{2}{,}{1}\right]$ (3.3)
 M > DGzip(C, B, "plus");
 ${2}{}{\mathrm{D_x}}{+}{\mathrm{D_y}}{-}{\mathrm{D_z}}$ (3.4)

Example 2.  GetComponents returns an empty list if the VFT is not a linear combination of the given list of VFT.  For example, the 2-form alpha is not a linear combination of the 2-forms in the list S.

 M > alpha := dy &wedge dz;
 ${\mathrm{α}}{:=}{\mathrm{dy}}{}{\bigwedge }{}{\mathrm{dz}}$ (3.5)
 M > S := [dx &wedge dy, dx &wedge dz];
 ${S}{:=}\left[{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}{,}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dz}}\right]$ (3.6)
 M > GetComponents(alpha, S);
 $\left[{}\right]$ (3.7)

Example 3.  The first argument to GetComponents can also be a list of VFTs, in which case the list of lists of components is returned.  In this example, we find all the components C of all the vectors in the basis A as linear combinations of the vectors in the basis B.  We find the change of basis Matrix P relating the two bases A and B.

 M > A := evalDG([D_x + D_y + 2*D_z, D_y + D_z, 2*D_z]);
 ${A}{:=}\left[{\mathrm{D_x}}{+}{\mathrm{D_y}}{+}{2}{}{\mathrm{D_z}}{,}{\mathrm{D_y}}{+}{\mathrm{D_z}}{,}{2}{}{\mathrm{D_z}}\right]$ (3.8)
 M > B := evalDG([D_x - D_y, D_y - D_z, D_z + D_x]);
 ${B}{:=}\left[{\mathrm{D_x}}{-}{\mathrm{D_y}}{,}{\mathrm{D_y}}{-}{\mathrm{D_z}}{,}{\mathrm{D_x}}{+}{\mathrm{D_z}}\right]$ (3.9)
 M > C := GetComponents(A, B);
 ${C}{:=}\left[\left[{-}{1}{,}{0}{,}{2}\right]{,}\left[{-}{1}{,}{0}{,}{1}\right]{,}\left[{-}{1}{,}{-}{1}{,}{1}\right]\right]$ (3.10)
 M > P := LinearAlgebra[Transpose](Matrix(C));
 ${P}{:=}\left[\begin{array}{rrr}{-}{1}& {-}{1}& {-}{1}\\ {0}& {0}& {-}{1}\\ {2}& {1}& {1}\end{array}\right]$ (3.11)

Example 4.  With the optional argument method = "real", the GetComponents command will determine if the linear combination can be found with real numbers as coefficients -- (no functions allowed).  Compare the results of the following commands.

 M > GetComponents(x &mult D_x, [D_x]);
 $\left[{x}\right]$ (3.12)
 M > GetComponents(x &mult D_x, [D_x], method = "real");
 $\left[{}\right]$ (3.13)
 M > GetComponents(x &mult D_x, [D_x, x &mult D_x, (x^2) &mult D_x], method = "real");
 $\left[{0}{,}{1}{,}{0}\right]$ (3.14)

GenerateForms, GenerateTensors, GenerateSymmetricTensors

The utilities GenerateForms, GenerateTensors, GenerateSymmetricTensors are used to generate bases for different spaces of differential forms and tensors.

 M > with(DifferentialGeometry): with(Tools): with(Tensor):
 M > DGsetup([u, v, w, x, y], E5);
 ${\mathrm{frame name: E5}}$ (4.1)

Example 1. Define a list Omega of four 1-forms.

 E5 > Omega := [du, dv, dw, dx];
 ${\mathrm{Ω}}{:=}\left[{\mathrm{du}}{,}{\mathrm{dv}}{,}{\mathrm{dw}}{,}{\mathrm{dx}}\right]$ (4.2)

Find a basis for the space of all 2-forms generated by Omega.

 E5 > GenerateForms(Omega, 2);
 $\left[{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dv}}{,}{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dw}}{,}{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dx}}{,}{\mathrm{dv}}{}{\bigwedge }{}{\mathrm{dw}}{,}{\mathrm{dv}}{}{\bigwedge }{}{\mathrm{dx}}{,}{\mathrm{dw}}{}{\bigwedge }{}{\mathrm{dx}}\right]$ (4.3)

Find a basis for the space of all 4-forms generated by Omega.

 E5 > GenerateForms(Omega, 4);
 $\left[{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dv}}{}{\bigwedge }{}{\mathrm{dw}}{}{\bigwedge }{}{\mathrm{dx}}\right]$ (4.4)

Example 2.  Find a basis for the space of all rank 3 tensors whose first components are taken from the list S1, whose second components come from S2 and whose third components come from S3.

 E5 > S1 := [D_x, D_y];
 ${\mathrm{S1}}{:=}\left[{\mathrm{D_x}}{,}{\mathrm{D_y}}\right]$ (4.5)
 E5 > S2 := [du, dv];
 ${\mathrm{S2}}{:=}\left[{\mathrm{du}}{,}{\mathrm{dv}}\right]$ (4.6)
 E5 > S3 := [dw, dx];
 ${\mathrm{S3}}{:=}$