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
Examples
See Also
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
spanY1,Y2,...,Yk = spanX1,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 of g is 1,−1,−1,−1, use the keyword signature = [+1, -1, -1, -1]. The length of Y1 is normalized to 1 and the lengths of Y2,Y3,Y4 are normalized to −1.
If, for example, the signature of g is 1,−1,−1,−1 and the vectors X1,X2 are both null, then the usual Gram-Schmidt procedure will fail. In this case 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.
with⁡DifferentialGeometry:with⁡Tensor:
Example 1.
First define a 4 dimensional manifold M with coordinates x,y,u,v.
DGsetup⁡x,y,u,v,M
frame name: M
Define a metric g on M.
g≔evalDG⁡dx&tdx+dy&tdy+du&tdu+dv&tdv
g:=dx⁢dx+dy⁢dy+du⁢du+dv⁢dv
Define a list of vectors S1.
S1≔D_x+D_y,D_y+2⁢D_u,D_u−D_v,D_v
S1:=D_x+D_y,D_y+2⁢D_u,D_u−D_v,D_v
T1≔DGGramSchmidt⁡S1,g
T1:=22⁢D_x+22⁢D_y,−26⁢D_x+26⁢D_y+2⁢23⁢D_u,1015⁢D_x−1015⁢D_y+1030⁢D_u−3⁢1010⁢D_v,105⁢D_x−105⁢D_y+1010⁢D_u+1010⁢D_v
We use the command TensorInnerProduct. to check this result.
TensorInnerProduct⁡g,T1,T1
We repeat the same computation with method = "un-normalized". The result is free of square roots but now the vectors are not unit vectors.
T1u≔DGGramSchmidt⁡S1,g,method=unnormalized
T1u:=D_x+D_y,−12⁢D_x+12⁢D_y+2⁢D_u,29⁢D_x−29⁢D_y+19⁢D_u−D_v,15⁢D_x−15⁢D_y+110⁢D_u+110⁢D_v
TensorInnerProduct⁡g,T1u,T1u
Example 2.
We continue with the metric from Example 1 but now apply the Gram-Schmidt procedure to a list of 2-forms.
S2≔evalDG⁡dx&wdy−du&wdv,dx&wdy,dx&wdv−dy&wdv,dx&wdv,dx&wdu+dy&wdv
S2:=dx⁢⋀⁢dy−du⁢⋀⁢dv,dx⁢⋀⁢dy,dx⁢⋀⁢dv−dy⁢⋀⁢dv,dx⁢⋀⁢dv,dx⁢⋀⁢du+dy⁢⋀⁢dv
T2≔DGGramSchmidt⁡S2,g
T2:=12⁢dx⁢⋀⁢dy−12⁢du⁢⋀⁢dv,12⁢dx⁢⋀⁢dy+12⁢du⁢⋀⁢dv,12⁢dx⁢⋀⁢dv−12⁢dy⁢⋀⁢dv,12⁢dx⁢⋀⁢dv+12⁢dy⁢⋀⁢dv,22⁢dx⁢⋀⁢du
TensorInnerProduct⁡g,T2,T2
Example 3.
Consider now an indefinite metric.
g3≔evalDG⁡dx&tdx+dy&tdy−du&tdu−dv&tdv
g3:=dx⁢dx+dy⁢dy−du⁢du−dv⁢dv
S3≔dx,dy,du,dv
S3:=dx,dy,du,dv
A direct application of the GramSchmidt process yields complex-valued forms.
DGGramSchmidt⁡S3,g3
dx,dy,−I⁢du,−I⁢dv
We can adjust the normalization of the last two 1-forms to have length -1 to obtain a real basis:
DGGramSchmidt⁡S3,g3,signature=1,1,−1,−1
dx,dy,du,dv
Example 4.
Consider another indefinite metric.
g4≔evalDG⁡dx&sdy+du&tdu+dv&tdv
g4:=12⁢dx⁢dy+12⁢dy⁢dx+du⁢du+dv⁢dv
S4≔D_x,D_y,D_u,D_v
S4:=D_x,D_y,D_u,D_v
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.
S4a≔evalDG⁡D_x+D_u,D_y,D_u,D_v
S4a:=D_x+D_u,D_y,D_u,D_v
DGGramSchmidt⁡S4a,g4,signature=1,−1,1,1
D_x+D_u,−D_x+2⁢D_y−D_u,−2⁢D_y+D_u,D_v
Alternatively, we can adjust the signature option.
DGGramSchmidt⁡S4,g4,signature=1,−1,1,1
D_x+D_y,D_x−D_y,D_u,D_v
DifferentialGeometry, Tensor, TensorInnerProduct
Download Help Document