DifferentialGeometry/Tensor/DGGramSchmidt - Maple Help

Home : Support : Online Help : DifferentialGeometry/Tensor/DGGramSchmidt

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{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{1}\right]\right]\right]\right)$ (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{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){+}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){+}{2}{}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){-}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.3)
 M > $\mathrm{T1}≔\mathrm{DGGramSchmidt}\left(\mathrm{S1},g\right)$
 ${\mathrm{T1}}{:=}\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{\sqrt{{2}}}{{2}}\right]{,}\left[\left[{2}\right]{,}\frac{\sqrt{{2}}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{\sqrt{{2}}}{{2}}\right]{,}\left[\left[{2}\right]{,}\frac{\sqrt{{2}}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{-}\frac{\sqrt{{2}}}{{6}}\right]{,}\left[\left[{2}\right]{,}\frac{\sqrt{{2}}}{{6}}\right]{,}\left[\left[{3}\right]{,}\frac{{2}{}\sqrt{{2}}}{{3}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{-}\frac{\sqrt{{2}}}{{6}}\right]{,}\left[\left[{2}\right]{,}\frac{\sqrt{{2}}}{{6}}\right]{,}\left[\left[{3}\right]{,}\frac{{2}{}\sqrt{{2}}}{{3}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{\sqrt{{10}}}{{15}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{\sqrt{{10}}}{{15}}\right]{,}\left[\left[{3}\right]{,}\frac{\sqrt{{10}}}{{30}}\right]{,}\left[\left[{4}\right]{,}{-}\frac{{3}{}\sqrt{{10}}}{{10}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{\sqrt{{10}}}{{15}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{\sqrt{{10}}}{{15}}\right]{,}\left[\left[{3}\right]{,}\frac{\sqrt{{10}}}{{30}}\right]{,}\left[\left[{4}\right]{,}{-}\frac{{3}{}\sqrt{{10}}}{{10}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{\sqrt{{10}}}{{5}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{\sqrt{{10}}}{{5}}\right]{,}\left[\left[{3}\right]{,}\frac{\sqrt{{10}}}{{10}}\right]{,}\left[\left[{4}\right]{,}\frac{\sqrt{{10}}}{{10}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{\sqrt{{10}}}{{5}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{\sqrt{{10}}}{{5}}\right]{,}\left[\left[{3}\right]{,}\frac{\sqrt{{10}}}{{10}}\right]{,}\left[\left[{4}\right]{,}\frac{\sqrt{{10}}}{{10}}\right]\right]\right]\right)\right]$ (2.4)

We use the command TensorInnerProduct. to check this result.

 M > $\mathrm{TensorInnerProduct}\left(g,\mathrm{T1},\mathrm{T1}\right)$
 $\left[\begin{array}{rrrr}{1}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {1}\end{array}\right]$ (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 > $\mathrm{T1u}≔\mathrm{DGGramSchmidt}\left(\mathrm{S1},g,\mathrm{method}="unnormalized"\right)$
 ${\mathrm{T1u}}{:=}\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{-}\frac{{1}}{{2}}\right]{,}\left[\left[{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}\right]{,}{2}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{-}\frac{{1}}{{2}}\right]{,}\left[\left[{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}\right]{,}{2}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{{2}}{{9}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{{2}}{{9}}\right]{,}\left[\left[{3}\right]{,}\frac{{1}}{{9}}\right]{,}\left[\left[{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{{2}}{{9}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{{2}}{{9}}\right]{,}\left[\left[{3}\right]{,}\frac{{1}}{{9}}\right]{,}\left[\left[{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{{1}}{{5}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{{1}}{{5}}\right]{,}\left[\left[{3}\right]{,}\frac{{1}}{{10}}\right]{,}\left[\left[{4}\right]{,}\frac{{1}}{{10}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}\frac{{1}}{{5}}\right]{,}\left[\left[{2}\right]{,}{-}\frac{{1}}{{5}}\right]{,}\left[\left[{3}\right]{,}\frac{{1}}{{10}}\right]{,}\left[\left[{4}\right]{,}\frac{{1}}{{10}}\right]\right]\right]\right)\right]$ (2.6)
 M > $\mathrm{TensorInnerProduct}\left(g,\mathrm{T1u},\mathrm{T1u}\right)$
 $\left[\begin{array}{cccc}{2}& {0}& {0}& {0}\\ {0}& \frac{{9}}{{2}}& {0}& {0}\\ {0}& {0}& \frac{{10}}{{9}}& {0}\\ {0}& {0}& {0}& \frac{{1}}{{10}}\end{array}\right]$ (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 > $\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{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}{1}\right]{,}\left[\left[{2}{,}{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}{1}\right]{,}\left[\left[{2}{,}{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{3}\right]{,}{1}\right]{,}\left[\left[{2}{,}{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{3}\right]{,}{1}\right]{,}\left[\left[{2}{,}{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.8)
 M > $\mathrm{T2}≔\mathrm{DGGramSchmidt}\left(\mathrm{S2},g\right)$
 ${\mathrm{T2}}{:=}\left[{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{4}\right]{,}{-}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{4}\right]{,}{-}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{4}\right]{,}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{4}\right]{,}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{4}\right]{,}{-}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{4}\right]{,}{-}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{4}\right]{,}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{4}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{4}\right]{,}\frac{{1}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{3}\right]{,}\frac{\sqrt{{2}}}{{2}}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{2}\right]{,}\left[\left[\left[{1}{,}{3}\right]{,}\frac{\sqrt{{2}}}{{2}}\right]\right]\right]\right)\right]$ (2.9)
 M > $\mathrm{TensorInnerProduct}\left(g,\mathrm{T2},\mathrm{T2}\right)$
 $\left[\begin{array}{rrrrr}{1}& {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}& {1}\end{array}\right]$ (2.10)

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{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{-1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[\right]\right]\right]{,}\left[\left[\left[{1}{,}{1}\right]{,}{1}\right]{,}\left[\left[{2}{,}{2}\right]{,}{1}\right]{,}\left[\left[{3}{,}{3}\right]{,}{-1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{-1}\right]\right]\right]\right)$ (2.11)
 M > $\mathrm{S3}≔\left[\mathrm{dx},\mathrm{dy},\mathrm{du},\mathrm{dv}\right]$
 ${\mathrm{S3}}{:=}\left[{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.12)

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

 M > $\mathrm{DGGramSchmidt}\left(\mathrm{S3},\mathrm{g3}\right)$
 $\left[{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{3}\right]{,}{-I}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{3}\right]{,}{-I}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{4}\right]{,}{-I}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{4}\right]{,}{-I}\right]\right]\right]\right)\right]$ (2.13)

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{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"form"}{,}{M}{,}{1}\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.14)

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}}{:=}{\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{1}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{3}\right]{,}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"tensor"}{,}{M}{,}\left[\left[{"cov_bas"}{,}{"cov_bas"}\right]{,}\left[\right]\right]\right]{,}\left[\left[\left[{1}{,}{2}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{2}{,}{1}\right]{,}\frac{{1}}{{2}}\right]{,}\left[\left[{3}{,}{3}\right]{,}{1}\right]{,}\left[\left[{4}{,}{4}\right]{,}{1}\right]\right]\right]\right)$ (2.15)
 M > $\mathrm{S4}≔\left[\mathrm{D_x},\mathrm{D_y},\mathrm{D_u},\mathrm{D_v}\right]$
 ${\mathrm{S4}}{:=}\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (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 > $\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{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.17)
 M > $\mathrm{DGGramSchmidt}\left(\mathrm{S4a},\mathrm{g4},\mathrm{signature}=\left[1,-1,1,1\right]\right)$
 $\left[{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{-1}\right]{,}\left[\left[{2}\right]{,}{2}\right]{,}\left[\left[{3}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{-1}\right]{,}\left[\left[{2}\right]{,}{2}\right]{,}\left[\left[{3}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{-2}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{2}\right]{,}{-2}\right]{,}\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.18)

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{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{1}\right]{,}{1}\right]{,}\left[\left[{2}\right]{,}{-1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{3}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right){,}{\mathrm{_DG}}{}\left(\left[\left[{"vector"}{,}{M}{,}\left[\right]\right]{,}\left[\left[\left[{4}\right]{,}{1}\right]\right]\right]\right)\right]$ (2.19)