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 by ResourceFunction["ColumnSpaceBasis"][mat] is comprised of the pivot columns of mat.

Examples

Basic Examples (2) 

Define 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]=

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

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

Define 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 all pivot columns:

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

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

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

Publisher

Dennis M Schneider

Version History

  • 1.0.0 – 08 August 2019

Related Resources

License Information