DifferentialGeometry Lessons
Lesson 2: Arithmetic Operations and Special Input Commands
|
Overview
|
|
In this lesson, you will learn to do the following:
–
|
Add, subtract, and scalar multiply vectors, forms and tensors.
|
–
|
Calculate the wedge product of forms.
|
–
|
Calculate the tensor product of two tensors.
|
–
|
Use the DifferentialGeometry parser evalDG.
|
–
|
Calculate the inner product of a vector and a form.
|
–
|
Use the DGzip command to form linear combinations of vectors, forms, and tensors.
|
–
|
Work with matrices of differential forms.
|
–
|
Create zero forms of a given degree, and volume forms.
|
–
|
Convert an array to a tensor.
|
–
|
Convert a differential form to a tensor.
|
|
|
&plus, &minus, &mult
|
|
When using these algebraic commands, it is important to use parentheses to indicate the order of operation.
>
|
with(DifferentialGeometry): DGsetup([x, y, z], E3);
|
| (2.1) |
Enter the vector field D_x + 3D_y - 2xyD_z.
E3 >
|
D_x &plus (3 &mult D_y) &minus ((2*x*y) &mult D_z);
|
| (2.2) |
Enter the vector field dx + 3dy - 2xydz.
E3 >
|
dx &plus (3 &mult dy) &minus ((2*x*y) &mult dz);
|
| (2.3) |
|
|
&wedge, &tensor
|
|
E3 >
|
with(DifferentialGeometry): DGsetup([x, y, z], E3);
|
| (3.1) |
Enter the wedge product of the 1-forms dx, dy, dz.
E3 >
|
dx &wedge dy &wedge dz;
|
| (3.2) |
Enter the tensor product of the 1-forms dx, dy, dz.
E3 >
|
dx &tensor dy &tensor dz;
|
| (3.3) |
Enter the tensor product of the vector fields D_x, D_y, D_z.
E3 >
|
D_x &tensor D_y &tensor D_z;
|
| (3.4) |
Enter the 2 form 3dx^dy + xdy^dz.
E3 >
|
(3 &mult (dx &wedge dy)) &plus ( x &mult (dy &wedge dz));
|
| (3.5) |
|
|
evalDG
|
|
The DifferentialGeometry parser evalDG provides an easier way to perform arithmetic operations.
–
|
Use +, -, and * for addition, subtraction, and scalar multiplication.
|
–
|
Use &w for wedge product.
|
–
|
Use &t for tensor product.
|
E3 >
|
restart: with(DifferentialGeometry): DGsetup([x, y, z], E3):
|
Enter the vector field 2D_x - xD_y + yD_z.
E3 >
|
evalDG(2*D_x - x*D_y + y*D_z);
|
| (4.1) |
Enter the rank 2 tensor 2D_x dy - xD_y - xD_y dz.
E3 >
|
evalDG(2*D_x &t dy - x*D_y &t dz);
|
| (4.2) |
Enter the 2-form 2dx^dy - xdy^dz.
E3 >
|
evalDG(2*dx &w dy - x*dy &w dz );
|
| (4.3) |
|
|
Hook
|
|
The command Hook calculates the interior product of a vector and a differential p-form.
E3 >
|
with(DifferentialGeometry): DGsetup([x, y, z], E3):
|
Define vectors X, Y and a 2-form alpha.
| (5.1) |
| (5.2) |
E3 >
|
alpha := evalDG(3*dx &w dy - 4*dy &w dz + 2*dx &w dz);
|
| (5.3) |
Calculate the interior product of X and alpha.
E3 >
|
beta1 := Hook(X, alpha);
|
| (5.4) |
Calculate the interior product of Y and beta1.
E3 >
|
beta2 := Hook(Y, beta1);
|
| (5.5) |
Note that multiple interior products can also be evaluated with a single call to Hook.
E3 >
|
Hook([X, Y], alpha) = Hook(Y, Hook(X,alpha));
|
| (5.6) |
|
|
DGzip, FrameBaseVectors, FrameBaseForms
|
|
DGzip is a handy command that gets used a lot.
E3 >
|
with(DifferentialGeometry): DGsetup([x, y, z], E3):
|
Create the 1-form 4dx + 5dy + 6dz.
E3 >
|
DGzip([4, 5, 6], [dx, dy, dz], "plus");
|
| (6.1) |
Create the 3-form dx^dy^dz.
E3 >
|
DGzip([dx, dy, dz], "wedge");
|
| (6.2) |
Create the tensor dx D_y dz.
E3 >
|
DGzip([dx, D_y, dz], "tensor");
|
| (6.3) |
The coordinate basis for the tangent and cotangent spaces can be obtained from the command DGinfo.
This command is often used in conjunction with DGzip.
E3 >
|
Fr := Tools:-DGinfo("FrameBaseVectors");
|
| (6.4) |
E3 >
|
Omega := Tools:-DGinfo("FrameBaseForms");
|
| (6.5) |
Create the 1-form dx + 2dy + 3dz.
E3 >
|
alpha := DGzip([1, 2, 3], Fr, "plus");
|
| (6.6) |
|
|
&MatrixMinus, &MatrixPlus, &MatrixMult, &MatrixWedge
|
|
Use these commands for working with matrices of differential forms. They are found in the Tools package.
E3 >
|
with(DifferentialGeometry): with(Tools):
|
E3 >
|
DGsetup([x, y, z], E3):
|
Define a matrix A of scalars.
E3 >
|
A := Matrix([[1, 2], [3, 4]]);
|
| (7.1) |
Define a matrix Omega1 of 1-forms.
E3 >
|
Omega1 := Matrix([[dx, dy], [dz, dx]]);
|
| (7.2) |
Scalar multiply the matrix of 1-forms Omega1 by 3.
E3 >
|
3 &MatrixMult Omega1;
|
| (7.3) |
Matrix multiply the matrix of scalars A and the matrix of 1-forms Omega1.
E3 >
|
Omega2 := A &MatrixMult Omega1;
|
| (7.4) |
Add the two matrices of 1-forms Omega1 and Omega2.
E3 >
|
Omega1 &MatrixPlus Omega2;
|
| (7.5) |
Matrix multiply the two matrices of 1-forms Omega1 and Omega2.
E3 >
|
Omega1 &MatrixWedge Omega1;
|
| (7.6) |
|
|
DGzero, DGvolume
|
|
Use the command DGzero to create the zero vector, or the zero differential p-form. Use the command DGvolume to create a differential n-form, where n is the dimension of the active coordinate system. These commands are found in the Tools package.
E3 >
|
with(DifferentialGeometry): DGsetup([x, y, z], E3):
|
Create the zero vector.
E3 >
|
Tools:-DGzero("vector");
|
| (8.1) |
Create the zero 2-form.
E3 >
|
Tools:-DGzero("form", 2);
|
| (8.2) |
Create the volume form with a coefficient of k.
E3 >
|
Tools:-DGvolume("form", k);
|
| (8.3) |
|
|
DGvector, DGform
|
|
The commands DGvector and DGform provide an alternative way of defining the coordinate vector fields and differential 1-forms and are useful when writing new programs for differential geometry applications. These commands are found in the Tools package.
E3 >
|
with(DifferentialGeometry): DGsetup([x, y, z], E3):
|
Create the vector D_x.
| (9.1) |
Create the vector D_y.
| (9.2) |
Create the 1-form dz.
| (9.3) |
|
|
convert/DGtensor, convert/DGArray
|
|
The DifferentialGeometry package provides a number of extensions to the Maple convert facility.
The convert/DGtensor command enables one to convert
–
|
a vector to a rank 1 covariant tensor;
|
–
|
a differential p-form to a rank p covariant tensor field;
|
–
|
a p-dimensional Maple Array to a rank p tensor field.
|
See DifferentialGeometry, Convert for details.
>
|
with(DifferentialGeometry):
|
>
|
DGsetup([x, y, z], E3);
|
| (10.1) |
Define a differential 2-form omega and convert it to a tensor.
E3 >
|
omega := evalDG(dx &w dy - 3*dy &w dz);
|
| (10.2) |
E3 >
|
convert(omega, DGtensor);
|
| (10.3) |
Define a 3-dimensional array A and convert it to a type (2, 1) tensor.
E3 >
|
A := Array(1..3, 1..3, 1..3);
|
| (10.4) |
| (10.5) |
| (10.6) |
The last argument must specify the index type of the tensor being defined by the Array.
E3 >
|
T := convert(A, DGtensor, [["cov_bas", "cov_bas", "con_bas"], []]);
|
| (10.7) |
The command convert/DGArray will convert a tensor to an Array.
E3 >
|
B := convert(T, DGArray);
|
| (10.8) |
| (10.9) |
| (10.10) |
| (10.11) |
|
|
Copy and Paste DifferentialGeometry output
|
|
The results of a DifferentialGeometry computation are displayed in a format consistent with standard mathematical usage. The displayed format for vector fields and differential 1-forms can be copied and pasted into other parts of the worksheet or even other worksheets and the result passed directly to the DifferentialGeometry parser evalDG.
Unfortunately, differential forms of higher degree and tensors cannot be copied and pasted without editing. In this section, we describe some possible workarounds.
E3 >
|
with(DifferentialGeometry): DGsetup([x, y, z], M):
|
M >
|
alpha := evalDG(dx &w dy + (1/x) *dy &w dz);
|
| (11.1) |
Copy and paste this output here to see the problem.
M >
|
alpha := dx*`^`*dy+1/x*dy*`^`*dz:
|
To make this readable by evalDG, the string *`^`* must be replaced by &w.
To simplify this editing, we can use the Preferences program to change the way the wedge product is displayed. With the WedgeDisplay value = 2, the wedge symbol is suppressed; with the WedgeDisplay value = 3, the wedge symbol is changed to &w. In either case, the editing of the result of a copy and paste is slightly easier.
M >
|
Preferences("WedgeDisplay", 2);
|
| (11.2) |
| (11.3) |
Copy and paste this line to get
| (11.4) |
Here we need only replace the appropriate * by &w.
M >
|
Preferences("WedgeDisplay",3);
|
| (11.5) |
| (11.6) |
Copy and paste this line to get
M >
|
dx*` &w `*dy+1/x*dy*` &w `*dz:
|
Here we need only remove the strings `*`.
Change the WedgeDisplay back to its default value.
Preferences("WedgeDisplay", 1);
Finally, another alternative is to use lprint to display the internal representation of the form alpha. This can always be copied and pasted.
_DG([["form", M, 1], [[[1], 1]]])*`^`*_DG([["form", M, 1], [[[2], 1]]])+1/x*_DG([["form", M, 1], [[[2], 1]]])*`^`*_DG([["form", M, 1], [[[3], 1]]])
| |
Copy and paste this.
M >
|
beta := _DG([["form", M, 2], [[[1, 2], 1], [[2, 3], 1/x]]]);
|
| (11.7) |
|
|
Exercises
|
|
|
Exercise 1
|
|
Check, by example, that the inner product of a vector with a form is an anti-derivation.
|
Solution
|
|
M >
|
with(DifferentialGeometry): DGsetup([x, y, z], E3):
|
Define a vector.
E3 >
|
X := evalDG(D_x - 2*D_y + 3*D_z);
|
| (12.1.1.1) |
Define a pair of 1-forms.
E3 >
|
alpha := evalDG(dx + 3*dy - 2*dz);
|
| (12.1.1.2) |
E3 >
|
beta := evalDG(-dx + 4*dy + dz);
|
| (12.1.1.3) |
E3 >
|
LHS := Hook(X, alpha &w beta);
|
| (12.1.1.4) |
E3 >
|
RHS := evalDG(Hook(X, alpha) &w beta - alpha &w Hook(X, beta));
|
| (12.1.1.5) |
| (12.1.1.6) |
|
|
|
Exercise 2
|
|
Write a program which takes an integer r for its input and returns the 2-form dx1^dx2 + dx3^dx4 + ..., where there are r summands.
|
Solution
|
|
>
|
with(DifferentialGeometry):
|
>
|
local n, ans, Omega, i;
|
>
|
n := min(r, iquo(Tools:-DGinfo("FrameBaseDimension"),2));
|
>
|
Omega := Tools:-DGinfo("FrameBaseForms");
|
>
|
evalDG(add(Omega[2*i-1] &wedge Omega[2*i], i = 1 .. n));
|
>
|
DGsetup([x1, x2, x3, x4, x5, x6], E6);
|
| (12.2.1.1) |
| (12.2.1.2) |
| (12.2.1.3) |
|
|
|
Exercise 3
|
|
Write a program which takes as input an n x n matrix A, where n is the dimension of the active coordinate system, and returns the 2-form dx^t A dx, where dx is a column vector of coordinate differentials.
|
Solution
|
|
>
|
with(DifferentialGeometry):
|
>
|
local Omega1, Omega2, n, Fr, ans;
|
>
|
n := LinearAlgebra:-RowDimension(A);
|
>
|
Fr := DifferentialGeometry:-Tools:-DGinfo("FrameBaseForms");
|
>
|
Omega1 := Matrix(n, 1, Fr);
|
>
|
Omega2 := LinearAlgebra:-Transpose(Omega1);
|
>
|
use DifferentialGeometry:-Tools in
|
>
|
ans := Omega2 &MatrixWedge (A &MatrixMult Omega1);
|
>
|
DGsetup([x, y, z, w], E4);
|
| (12.3.1.1) |
E4 >
|
A := Matrix([[0, 1, 2, 3],[-1, 0, 4, 5], [-2, -4, 0, 6], [-3, -5, -6, 0]]);
|
| (12.3.1.2) |
| (12.3.1.3) |
|
|
|
Exercise 4
|
|
Write a program which will return a list of 2-forms which define a basis for the vector space of all 2-forms for a given manifold M.
|
Solution
|
|
E4 >
|
TwoFormBasis := proc(M)
|
E4 >
|
local n ,i, j, alpha, beta, Basis;
|
E4 >
|
n := DifferentialGeometry:-Tools:-DGinfo(M, "FrameBaseDimension");
|
E4 >
|
alpha := DifferentialGeometry:-Tools:-DGform(i);
|
E4 >
|
for j from i + 1 to n do
|
E4 >
|
beta := DifferentialGeometry:-Tools:-DGform(j);
|
E4 >
|
Basis := [op(Basis), alpha &wedge beta];
|
E4 >
|
with(DifferentialGeometry):
|
E6 >
|
DGsetup([x1, x2, x3, x4], M);
|
| (12.4.1.1) |
| (12.4.1.2) |
It is very inefficient to define the Basis to be a list. It is highly recommended that 1 dimensional Arrays be used in place of lists. Thus,the above program becomes
M >
|
TwoFormBasis2 := proc(M)
|
E4 >
|
local n ,i, j, alpha, beta, Basis, k;
|
E4 >
|
n := DifferentialGeometry:-Tools:-DGinfo(M, "FrameBaseDimension");
|
E4 >
|
Basis := Array(1 .. n*(n - 1)/2):
|
E4 >
|
alpha := DifferentialGeometry:-Tools:-DGform(i);
|
E4 >
|
for j from i + 1 to n do
|
E4 >
|
beta := DifferentialGeometry:-Tools:-DGform(j);
|
E4 >
|
Basis[k] := alpha &wedge beta;
|
E4 >
|
convert(Basis, list);
|
| (12.4.1.3) |
|
|
|
Exercise 5
|
|
Let M be a manifold and recall that a type (1, 1) tensor T defined at a point p in M can be viewed as a linear transformation from T_pM to T_pM, that is, as an element of Hom(T_pM, T_pM). Write a program that will compute the k-th power of a type (1, 1) tensor.
Hint: Use DGinfo to obtain the tensor type.
|
Solution
|
|
M >
|
TensorPower := proc(T, k)
|
E4 >
|
local IndexType, A, B, C;
|
E4 >
|
IndexType := DifferentialGeometry:-Tools:-DGinfo(T, "TensorType");
|
M >
|
A := convert(T, DGArray);
|
M >
|
B := convert(A, Matrix):
|
M >
|
convert(C,DGtensor, IndexType);
|
M >
|
with(DifferentialGeometry): with(Tensor): DGsetup([x, y, z], V):
|
V >
|
T1 := evalDG(dx &t D_y + 3*dy &t D_y - 2*dy &t D_z);
|
| (12.5.1.1) |
| (12.5.1.2) |
| (12.5.1.3) |
|
|
|
�Ian M. Anderson 2006
|