DifferentialGeometry/Tensor/DGGramSchmidt - Maple Help

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=\left[{X}_{1},{X}_{2},...,{X}_{m}\right]$, 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 such that

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 $\left(1,1,...,1\right)$. In this case the length of each ${Y}_{k}$ is normalized to 1.  With method = "un-normalized" the ${Y}_{k}$ are left un-normalized.
 • If, for example, the signature of $g$ is $\left(1,-1,-1,-1\right)$, use the keyword signature = [+1, -1, -1, -1]. The length of ${Y}_{1}$ is normalized to 1 and the lengths of ${Y}_{2},{Y}_{3},{Y}_{4}$ are normalized to $-1$.
 • If, for example, the signature of $g$ is $\left(1,-1,-1,-1\right)$ and the vectors ${X}_{1},{X}_{2}$ are both null, then the usual Gram-Schmidt procedure will fail. In this case set signature = [[1,-1], 1, 1] and DGGramSchmidt will take ${Y}_{1}$ to be a vector of non-zero length in the span of ${X}_{1},{X}_{2}.$
 • 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

 > $\mathrm{with}\left(\mathrm{DifferentialGeometry}\right):$$\mathrm{with}\left(\mathrm{Tensor}\right):$

Example 1.

First define a 4 dimensional manifold $M$ with coordinates $\left(x,y,u,v\right)$.

 > $\mathrm{DGsetup}\left(\left[x,y,u,v\right],M\right)$
 ${\mathrm{frame name: M}}$ (2.1)

Define a metric $g$ on $M$.

 M > $g≔\mathrm{evalDG}\left(\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}+\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}+\mathrm{du}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{du}+\mathrm{dv}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv}\right)$
 ${g}{:=}{\mathrm{dx}}{}{\mathrm{dx}}{+}{\mathrm{dy}}{}{\mathrm{dy}}{+}{\mathrm{du}}{}{\mathrm{du}}{+}{\mathrm{dv}}{}{\mathrm{dv}}$ (2.2)

Define a list of vectors S1.

 M > $\mathrm{S1}≔\left[\mathrm{D_x}+\mathrm{D_y},\mathrm{D_y}+2\mathrm{D_u},\mathrm{D_u}-\mathrm{D_v},\mathrm{D_v}\right]$
 ${\mathrm{S1}}{:=}\left[{\mathrm{D_x}}{+}{\mathrm{D_y}}{,}{\mathrm{D_y}}{+}{2}{}{\mathrm{D_u}}{,}{\mathrm{D_u}}{-}{\mathrm{D_v}}{,}{\mathrm{D_v}}\right]$ (2.3)
 M > $\mathrm{T1}≔\mathrm{DGGramSchmidt}\left(\mathrm{S1},g\right)$
 ${\mathrm{T1}}{:=}\left[\frac{\sqrt{{2}}}{{2}}{}{\mathrm{D_x}}{+}\frac{\sqrt{{2}}}{{2}}{}{\mathrm{D_y}}{,}{-}\frac{\sqrt{{2}}}{{6}}{}{\mathrm{D_x}}{+}\frac{\sqrt{{2}}}{{6}}{}{\mathrm{D_y}}{+}\frac{{2}{}\sqrt{{2}}}{{3}}{}{\mathrm{D_u}}{,}\frac{\sqrt{{10}}}{{15}}{}{\mathrm{D_x}}{-}\frac{\sqrt{{10}}}{{15}}{}{\mathrm{D_y}}{+}\frac{\sqrt{{10}}}{{30}}{}{\mathrm{D_u}}{-}\frac{{3}{}\sqrt{{10}}}{{10}}{}{\mathrm{D_v}}{,}\frac{\sqrt{{10}}}{{5}}{}{\mathrm{D_x}}{-}\frac{\sqrt{{10}}}{{5}}{}{\mathrm{D_y}}{+}\frac{\sqrt{{10}}}{{10}}{}{\mathrm{D_u}}{+}\frac{\sqrt{{10}}}{{10}}{}{\mathrm{D_v}}\right]$ (2.4)

We use the command TensorInnerProduct. to check this result.

 M > $\mathrm{TensorInnerProduct}\left(g,\mathrm{T1},\mathrm{T1}\right)$

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 > $\mathrm{T1u}≔\mathrm{DGGramSchmidt}\left(\mathrm{S1},g,\mathrm{method}="unnormalized"\right)$
 ${\mathrm{T1u}}{:=}\left[{\mathrm{D_x}}{+}{\mathrm{D_y}}{,}{-}\frac{{1}}{{2}}{}{\mathrm{D_x}}{+}\frac{{1}}{{2}}{}{\mathrm{D_y}}{+}{2}{}{\mathrm{D_u}}{,}\frac{{2}}{{9}}{}{\mathrm{D_x}}{-}\frac{{2}}{{9}}{}{\mathrm{D_y}}{+}\frac{{1}}{{9}}{}{\mathrm{D_u}}{-}{\mathrm{D_v}}{,}\frac{{1}}{{5}}{}{\mathrm{D_x}}{-}\frac{{1}}{{5}}{}{\mathrm{D_y}}{+}\frac{{1}}{{10}}{}{\mathrm{D_u}}{+}\frac{{1}}{{10}}{}{\mathrm{D_v}}\right]$ (2.5)
 M > $\mathrm{TensorInnerProduct}\left(g,\mathrm{T1u},\mathrm{T1u}\right)$

Example 2.

We continue with the metric from Example 1 but now apply the Gram-Schmidt procedure to a list of 2-forms.

 M > $\mathrm{S2}≔\mathrm{evalDG}\left(\left[\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{du}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv},\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy},\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv}-\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv},\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv},\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{du}+\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&w\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv}\right]\right)$
 ${\mathrm{S2}}{:=}\left[{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}{-}{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dv}}{,}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}{,}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dv}}{-}{\mathrm{dy}}{}{\bigwedge }{}{\mathrm{dv}}{,}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dv}}{,}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{du}}{+}{\mathrm{dy}}{}{\bigwedge }{}{\mathrm{dv}}\right]$ (2.6)
 M > $\mathrm{T2}≔\mathrm{DGGramSchmidt}\left(\mathrm{S2},g\right)$
 ${\mathrm{T2}}{:=}\left[\frac{{1}}{{2}}{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}{-}\frac{{1}}{{2}}{}{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dv}}{,}\frac{{1}}{{2}}{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dy}}{+}\frac{{1}}{{2}}{}{\mathrm{du}}{}{\bigwedge }{}{\mathrm{dv}}{,}\frac{{1}}{{2}}{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dv}}{-}\frac{{1}}{{2}}{}{\mathrm{dy}}{}{\bigwedge }{}{\mathrm{dv}}{,}\frac{{1}}{{2}}{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{dv}}{+}\frac{{1}}{{2}}{}{\mathrm{dy}}{}{\bigwedge }{}{\mathrm{dv}}{,}\frac{\sqrt{{2}}}{{2}}{}{\mathrm{dx}}{}{\bigwedge }{}{\mathrm{du}}\right]$ (2.7)
 M > $\mathrm{TensorInnerProduct}\left(g,\mathrm{T2},\mathrm{T2}\right)$

Example 3.

Consider now an indefinite metric.

 M > $\mathrm{g3}≔\mathrm{evalDG}\left(\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dx}+\mathrm{dy}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}-\mathrm{du}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{du}-\mathrm{dv}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv}\right)$
 ${\mathrm{g3}}{:=}{\mathrm{dx}}{}{\mathrm{dx}}{+}{\mathrm{dy}}{}{\mathrm{dy}}{-}{\mathrm{du}}{}{\mathrm{du}}{-}{\mathrm{dv}}{}{\mathrm{dv}}$ (2.8)
 M > $\mathrm{S3}≔\left[\mathrm{dx},\mathrm{dy},\mathrm{du},\mathrm{dv}\right]$
 ${\mathrm{S3}}{:=}\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}{\mathrm{du}}{,}{\mathrm{dv}}\right]$ (2.9)

A direct application of the GramSchmidt process yields complex-valued forms.

 M > $\mathrm{DGGramSchmidt}\left(\mathrm{S3},\mathrm{g3}\right)$
 $\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}{-}{I}{}{\mathrm{du}}{,}{-}{I}{}{\mathrm{dv}}\right]$ (2.10)

We can adjust the normalization of the last two 1-forms to have length -1 to obtain a real basis:

 M > $\mathrm{DGGramSchmidt}\left(\mathrm{S3},\mathrm{g3},\mathrm{signature}=\left[1,1,-1,-1\right]\right)$
 $\left[{\mathrm{dx}}{,}{\mathrm{dy}}{,}{\mathrm{du}}{,}{\mathrm{dv}}\right]$ (2.11)

Example 4.

Consider another indefinite metric.

 M > $\mathrm{g4}≔\mathrm{evalDG}\left(\mathrm{dx}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&s\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dy}+\mathrm{du}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{du}+\mathrm{dv}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&t\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{dv}\right)$
 ${\mathrm{g4}}{:=}\frac{{1}}{{2}}{}{\mathrm{dx}}{}{\mathrm{dy}}{+}\frac{{1}}{{2}}{}{\mathrm{dy}}{}{\mathrm{dx}}{+}{\mathrm{du}}{}{\mathrm{du}}{+}{\mathrm{dv}}{}{\mathrm{dv}}$ (2.12)
 M > $\mathrm{S4}≔\left[\mathrm{D_x},\mathrm{D_y},\mathrm{D_u},\mathrm{D_v}\right]$
 ${\mathrm{S4}}{:=}\left[{\mathrm{D_x}}{,}{\mathrm{D_y}}{,}{\mathrm{D_u}}{,}{\mathrm{D_v}}\right]$ (2.13)

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 > $\mathrm{S4a}≔\mathrm{evalDG}\left(\left[\mathrm{D_x}+\mathrm{D_u},\mathrm{D_y},\mathrm{D_u},\mathrm{D_v}\right]\right)$
 ${\mathrm{S4a}}{:=}\left[{\mathrm{D_x}}{+}{\mathrm{D_u}}{,}{\mathrm{D_y}}{,}{\mathrm{D_u}}{,}{\mathrm{D_v}}\right]$ (2.14)
 M > $\mathrm{DGGramSchmidt}\left(\mathrm{S4a},\mathrm{g4},\mathrm{signature}=\left[1,-1,1,1\right]\right)$
 $\left[{\mathrm{D_x}}{+}{\mathrm{D_u}}{,}{-}{\mathrm{D_x}}{+}{2}{}{\mathrm{D_y}}{-}{\mathrm{D_u}}{,}{-}{2}{}{\mathrm{D_y}}{+}{\mathrm{D_u}}{,}{\mathrm{D_v}}\right]$ (2.15)

Alternatively, we can adjust the signature option.

 M > $\mathrm{DGGramSchmidt}\left(\mathrm{S4},\mathrm{g4},\mathrm{signature}=\left[\left[1,-1\right],1,1\right]\right)$
 $\left[{\mathrm{D_x}}{+}{\mathrm{D_y}}{,}{\mathrm{D_x}}{-}{\mathrm{D_y}}{,}{\mathrm{D_u}}{,}{\mathrm{D_v}}\right]$ (2.16)