Wolfram Research

Function Repository Resource:

ColumnSpaceBasis

Source Notebook

Return a basis for the subspace spanned by the columns of a matrix

Contributed by: Dennis M Schneider

ResourceFunction["ColumnSpaceBasis"][mat]

returns a basis for the column space of mat.

Details and Options

The basis returned is comprised of the pivot columns of the matrix.

Examples

Basic Examples

Compute the column space basis of a matrix:

In[1]:=
(mat = {{1, 3, -2, 1}, {2, 6, -2, 8}, {-1, -3, 8, 17}}) // MatrixForm
Out[1]=

The first and third columns of the matrix are pivot columns:

In[2]:=
RowReduce[mat] // MatrixForm
Out[2]=

The first and third columns of the matrix form a basis for the column space:

In[3]:=
ResourceFunction["ColumnSpaceBasis"][mat]
Out[3]=

Find a column space basis for a complex matrix:

In[4]:=
(mat = {{2, 1, 1 - I, 1 + I, 1 + I, 2 + 2 I}, {I, -I, 2 + 2 I, 1 + 2 I, 1 + I, 2 - I}, {-I, 1, -1 + I, -I, -1 + I, 2 - I}, {13 + 5 I, -1 + 6 I, 14 - 18 I, 5 - 3 I, 5 + I, -15 + 9 I}}) // MatrixForm
Out[4]=

The first three columns are pivot columns:

In[5]:=
RowReduce[mat] // MatrixForm
Out[5]=

The first three columns of the matrix form a basis for its column space:

In[6]:=
ResourceFunction["ColumnSpaceBasis"][mat]
Out[6]=

Resource History

Related Resources

License Information