linalg(deprecated)/GramSchmidt - Help

linalg(deprecated)

 GramSchmidt
 compute orthogonal vectors

 Calling Sequence GramSchmidt([v1, v2, ... , vn], opt) GramSchmidt({v1, v2, ... , vn}, opt)

Parameters

 v[1], v[2], ..., v[n] - linearly independent vectors opt - (optional) the word 'normalized'

Description

 • Important: The linalg package has been deprecated. Use the superseding command, LinearAlgebra[GramSchmidt], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The function GramSchmidt computes a list or set of orthogonal vectors from a given list or set of linearly independent vectors, using the Gram-Schmidt orthogonalization process.
 • The vectors given must be linearly independent, otherwise the vectors returned will also be dependent.
 • The vectors returned are normalized only if 'normalized' is specified.
 • The command with(linalg,GramSchmidt) allows the use of the abbreviated form of this command.

Examples

Important: The linalg package has been deprecated. Use the superseding command, LinearAlgebra[GramSchmidt], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $\mathrm{v1}≔\left[\begin{array}{ccc}1& 0& 0\end{array}\right]$
 ${\mathrm{v1}}{≔}\left[\begin{array}{ccc}{1}& {0}& {0}\end{array}\right]$ (1)
 > $\mathrm{v2}≔\left[\begin{array}{ccc}1& 1& 0\end{array}\right]$
 ${\mathrm{v2}}{≔}\left[\begin{array}{ccc}{1}& {1}& {0}\end{array}\right]$ (2)
 > $\mathrm{v3}≔\left[\begin{array}{ccc}1& 1& 1\end{array}\right]$
 ${\mathrm{v3}}{≔}\left[\begin{array}{ccc}{1}& {1}& {1}\end{array}\right]$ (3)
 > $\mathrm{GramSchmidt}\left(\left\{\mathrm{v1},\mathrm{v2},\mathrm{v3}\right\}\right)$
 $\left\{\left[{0}{,}{0}{,}{1}\right]{,}\left[{0}{,}{1}{,}{0}\right]{,}\left[{1}{,}{0}{,}{0}\right]\right\}$ (4)
 > $\mathrm{u1}≔\left[\begin{array}{ccc}2& 2& 2\end{array}\right]$
 ${\mathrm{u1}}{≔}\left[\begin{array}{ccc}{2}& {2}& {2}\end{array}\right]$ (5)
 > $\mathrm{u2}≔\left[\begin{array}{ccc}0& 2& 2\end{array}\right]$
 ${\mathrm{u2}}{≔}\left[\begin{array}{ccc}{0}& {2}& {2}\end{array}\right]$ (6)
 > $\mathrm{u3}≔\left[\begin{array}{ccc}0& 0& 2\end{array}\right]$
 ${\mathrm{u3}}{≔}\left[\begin{array}{ccc}{0}& {0}& {2}\end{array}\right]$ (7)
 > $\mathrm{GramSchmidt}\left(\left[\mathrm{u1},\mathrm{u2},\mathrm{u3}\right]\right)$
 $\left[\left[{2}{,}{2}{,}{2}\right]{,}\left[{-}\frac{{4}}{{3}}{,}\frac{{2}}{{3}}{,}\frac{{2}}{{3}}\right]{,}\left[{0}{,}{-1}{,}{1}\right]\right]$ (8)
 > $\mathrm{GramSchmidt}\left(\left[\mathrm{u1},\mathrm{u2},\mathrm{u3}\right],\mathrm{normalized}\right)$
 $\left[\left[\begin{array}{ccc}\frac{\sqrt{{3}}}{{3}}& \frac{\sqrt{{3}}}{{3}}& \frac{\sqrt{{3}}}{{3}}\end{array}\right]{,}\left[\begin{array}{ccc}{-}\frac{\sqrt{{8}}{}\sqrt{{3}}}{{6}}& \frac{\sqrt{{8}}{}\sqrt{{3}}}{{12}}& \frac{\sqrt{{8}}{}\sqrt{{3}}}{{12}}\end{array}\right]{,}\left[\begin{array}{ccc}{0}& {-}\frac{\sqrt{{2}}}{{2}}& \frac{\sqrt{{2}}}{{2}}\end{array}\right]\right]$ (9)