GramSchmidt - Maple Help

LinearAlgebra

 GramSchmidt
 compute an orthogonal set of Vectors

 Calling Sequence GramSchmidt(V, c, n, options)

Parameters

 V - list or set of Vector(s) c - (optional) equation of the form conjugate=true or false n - (optional) equation of the form normalized=true or false options - (optional); constructor options for the result object

Description

 • The GramSchmidt(V) function computes a list or set of orthogonal Vectors by using the Gram-Schmidt orthogonalization process. If V is an empty list or set, GramSchmidt(V) returns an empty list or set, respectively.
 • The number of Vectors returned is the dimension of the vector space spanned by V.  In particular, if the Vectors in V are not linearly independent, fewer Vectors than the number in V are returned.
 • The dimension and orientation of all Vectors in V must be the same.
 • The conjugate option (c) is true by default. If conjugate=false is included in the calling sequence, the elements of the second Vector are not conjugated in the dot product calculations.
 The condition conjugate=true can be abbreviated to conjugate.
 • The normalized option (n) is false by default.  If normalized=true is included in the calling sequence, this function returns an orthonormal list or set of Vectors.
 The condition normalized=true can be abbreviated to normalized.
 • The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Vector constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).  If constructor options are specified in the calling sequence, each resulting Vector has the same specified options.
 • This function is part of the LinearAlgebra package, and so it can be used in the form GramSchmidt(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[GramSchmidt](..).

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $\mathrm{w1}≔⟨2,1,0,-1⟩:$
 > $\mathrm{w2}≔⟨1,0,2,-1⟩:$
 > $\mathrm{w3}≔⟨0,-2,1,0⟩:$
 > $\mathrm{ord}≔\mathrm{GramSchmidt}\left(\left[\mathrm{w1},\mathrm{w2},\mathrm{w3}\right]\right)$
 ${\mathrm{ord}}{≔}\left[\left[\begin{array}{c}{2}\\ {1}\\ {0}\\ {-1}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-}\frac{{1}}{{2}}\\ {2}\\ {-}\frac{{1}}{{2}}\end{array}\right]{,}\left[\begin{array}{c}\frac{{2}}{{3}}\\ {-}\frac{{4}}{{3}}\\ {-}\frac{{1}}{{3}}\\ {0}\end{array}\right]\right]$ (1)
 > $\mathrm{DotProduct}\left(\mathrm{ord}\left[2\right],\mathrm{ord}\left[3\right]\right)$
 ${0}$ (2)
 > $\mathrm{DotProduct}\left(\mathrm{ord}\left[1\right],\mathrm{ord}\left[3\right]\right)$
 ${0}$ (3)
 > $\mathrm{GramSchmidt}\left(\left\{\mathrm{w1},\mathrm{w2},\mathrm{w3}\right\},\mathrm{normalized}\right)$
 $\left\{\left[\begin{array}{c}\frac{\sqrt{{6}}}{{3}}\\ \frac{\sqrt{{6}}}{{6}}\\ {0}\\ {-}\frac{\sqrt{{6}}}{{6}}\end{array}\right]{,}\left[\begin{array}{c}{0}\\ {-}\frac{\sqrt{{2}}}{{6}}\\ \frac{{2}{}\sqrt{{2}}}{{3}}\\ {-}\frac{\sqrt{{2}}}{{6}}\end{array}\right]{,}\left[\begin{array}{c}\frac{{2}{}\sqrt{{21}}}{{21}}\\ {-}\frac{{4}{}\sqrt{{21}}}{{21}}\\ {-}\frac{\sqrt{{21}}}{{21}}\\ {0}\end{array}\right]\right\}$ (4)
 > $\mathrm{GramSchmidt}\left(\left[⟨1|b⟩,⟨1|0⟩\right]\right)$
 $\left[\left[\begin{array}{cc}{1}& {b}\end{array}\right]{,}\left[\begin{array}{cc}{-}\frac{{1}}{{1}{+}{b}{}\stackrel{{&conjugate0;}}{{b}}}{+}{1}& {-}\frac{{b}}{{1}{+}{b}{}\stackrel{{&conjugate0;}}{{b}}}\end{array}\right]\right]$ (5)
 > $\mathrm{GramSchmidt}\left(\left[⟨1|b⟩,⟨1|0⟩\right],\mathrm{conjugate}=\mathrm{false}\right)$
 $\left[\left[\begin{array}{cc}{1}& {b}\end{array}\right]{,}\left[\begin{array}{cc}{-}\frac{{1}}{{{b}}^{{2}}{+}{1}}{+}{1}& {-}\frac{{b}}{{{b}}^{{2}}{+}{1}}\end{array}\right]\right]$ (6)