Tensor[DGGramSchmidt] - calculate an orthonormal basis with respect to a metric
Calling Sequences
DGGramSchmidt(S, g, method, signature)
Parameters
S - a list of differential forms, vectors or tensors
g - a metric tensor
method - (optional) keyword argument method = "normalized" or method = "un-normalized"
signature - (optional) keyword argument signature = pm, where pm is a list of +1 or -1
|
Description
|
|
•
|
The command DGGramSchmidt applies the usual Gram-Schmidt procedure to a list S = [X1, X2, ... Xm], of m independent vectors, forms or tensors (the forms or tensors must all be of the same type). The procedure returns a list orthogonal vectors, forms or tensors [Y1, Y2, ... Ym] such that
|
span(Y1, Y2, ..., Yk) =span(X1, X2, ..., Xk) for k = 1, 2, ... m
•
|
The inner products of differential forms and tensors are calculated using TensorInnerProduct.
|
•
|
The default assumption is that the metric g is positive-definite, that is, the signature is [+1, +1, ... +1]. In this case the length of each Yk is normalized to 1. With method = "un-normalized" the Yk are left un-normalized.
|
•
|
If, for example, the signature is [+1, -1, -1, -1], then the length of Y1 normalized to 1 and the lengths of Y2, Y3, Y4 are normalized to -1.
|
•
|
If, for example, the signature is [+1, -1, -1, -1] and the vectors X1, X2 are both null, then the usual Gram-Schmidt procedure will fail. In this case one can set signature = [[1,-1], 1, 1] and DGGramSchmidt will take Y1 to be a vector of non-zero length in the span of X1, X2.
|
•
|
This command is part of the DifferentialGeometry:-Tensor package, and so can be used in the form DGGramSchmidt(...) only after executing the command with(DifferentialGeometry); with(Tensor); in that order. It can always be used in the long form DifferentialGeometry:-Tensor:-DGGramSchmidt.
|
|
|
Examples
|
|
>
|
|
Example 1.
First define a 4 dimensional manifold with coordinates [x, y, u, v].
>
|
|
| (2.1) |
Define a metric g on M.
M >
|
|
| (2.2) |
Define a list of vectors S1.
M >
|
|
| (2.3) |
M >
|
|
| (2.4) |
We use the command TensorInnerProduct. to check this result.
M >
|
|
| (2.5) |
We repeat the same computation with method = "un-normalized". The result is free of square roots but now the vectors are not unit vectors.
M >
|
|
| (2.6) |
M >
|
|
| (2.7) |
Example 2.
We continue with the metric from Example 1 but now apply the Gram-Schmidt procedure to a list of 2-forms.
M >
|
|
| (2.8) |
M >
|
|
| (2.9) |
M >
|
|
| (2.10) |
Example 3.
Consider now an indefinite metric.
M >
|
|
| (2.11) |
M >
|
|
| (2.12) |
A direct application of the GramSchmidt process yields complex-valued forms.
M >
|
|
| (2.13) |
We can adjust the normalization of the last two 1-forms to have length -1 to obtain a real basis:
M >
|
|
| (2.14) |
Example 4.
Consider another indefinite metric.
M >
|
|
| (2.15) |
M >
|
|
| (2.16) |
A direct application of the GramSchmidt process fails since the first two vectors are null vectors. We can work around this problem by changing the initial basis.
M >
|
|
| (2.17) |
M >
|
|
| (2.18) |
Alternatively, we can adjust the signature option.
M >
|
|
| (2.19) |
M >
|
|
|
|