linalg(deprecated)/basis - Help

linalg(deprecated)

 basis
 find a basis for a vector space

 Calling Sequence basis(V, crspace)

Parameters

 V - vector, set of vectors or list of vectors, a matrix crspace - (optional) name, either 'rowspace' or 'colspace'

Description

 • Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[Basis], instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • If the argument V is a single vector, then this vector is returned as a set {V}.
 • If V is a set of vectors, then basis will return a basis for the vector space spanned by those vectors in terms of the original vectors.
 • If V is a matrix, then the routine computes a basis of the column space of V if the second optional argument is 'colspace', and it returns a basis of the row space of V if the second argument is 'rowspace'.
 • For an ordered basis, use a list of vectors rather than a set.
 • A basis for the zero-dimensional space is an empty set or list.
 • The command with(linalg,basis) allows the use of the abbreviated form of this command.

Examples

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

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $\mathrm{v1}≔\mathrm{vector}\left(\left[1,0,0\right]\right):$
 > $\mathrm{v2}≔\mathrm{vector}\left(\left[0,1,0\right]\right):$
 > $\mathrm{v3}≔\mathrm{vector}\left(\left[0,0,1\right]\right):$
 > $\mathrm{v4}≔\mathrm{vector}\left(\left[1,1,1\right]\right):$
 > $\mathrm{basis}\left(\left\{\mathrm{v1},\mathrm{v2},\mathrm{v3}\right\}\right)$
 $\left\{{\mathrm{v1}}{,}{\mathrm{v2}}{,}{\mathrm{v3}}\right\}$ (1)
 > $\mathrm{basis}\left(\left[\mathrm{v3},\mathrm{v2},\mathrm{v1}\right]\right)$
 $\left[{\mathrm{v3}}{,}{\mathrm{v2}}{,}{\mathrm{v1}}\right]$ (2)
 > $\mathrm{basis}\left(\left\{\mathrm{v1},\mathrm{v2},\mathrm{v3},\mathrm{v4}\right\}\right)$
 $\left\{{\mathrm{v1}}{,}{\mathrm{v2}}{,}{\mathrm{v3}}\right\}$ (3)
 > $\mathrm{basis}\left(\left\{\mathrm{vector}\left(\left[0,1,1\right]\right),\mathrm{vector}\left(\left[1,0,1\right]\right),\mathrm{vector}\left(\left[1,1,1\right]\right),\mathrm{vector}\left(\left[1,-1,1\right]\right),\mathrm{vector}\left(\left[2,2,2\right]\right),\mathrm{vector}\left(\left[2,-2,2\right]\right)\right\}\right)$
 $\left\{\left[\begin{array}{ccc}{1}& {1}& {1}\end{array}\right]{,}\left[\begin{array}{ccc}{2}& {-2}& {2}\end{array}\right]{,}\left[\begin{array}{ccc}{0}& {1}& {1}\end{array}\right]\right\}$ (4)
 > $A≔\mathrm{array}\left(\left[\left[1,0,0\right],\left[0,1,0\right],\left[0,0,1\right],\left[1,1,1\right]\right]\right):$
 > $\mathrm{basis}\left(A,'\mathrm{rowspace}'\right)$
 $\left[\left[\begin{array}{ccc}{1}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{ccc}{0}& {1}& {0}\end{array}\right]{,}\left[\begin{array}{ccc}{0}& {0}& {1}\end{array}\right]\right]$ (5)