Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find a basis for the subspace spanned by a list of vectors
ResourceFunction["SubspaceBasis"][vecs] returns a basis for the subspace spanned by vecs. | |
ResourceFunction["SubspaceBasis"][polys,x,"Polynomial"] returns a basis for the subspace spanned by a list of polynomials in x. | |
ResourceFunction["SubspaceBasis"][funcs,x] returns a basis for the subspace spanned by a list of functions of x. |
A basis for the subspace spanned by a dependent list of vectors in ℝ4:
| In[1]:= |
|
| Out[1]= |
|
If the vectors in the list are independent, then SubspaceBasis[list] returns a list:
| In[2]:= |
|
| Out[2]= |
|
Test whether a list of vectors is independent (compare with ResourceFunction["LinearlyIndependent"]):
| In[3]:= |
|
| Out[4]= |
|
A basis for the subspace spanned by a dependent list of three 2×2 matrices:
| In[5]:= |
|
| Out[5]= |
|
The 2×2 symmetric matrices together with the 2×2 trace zero matrices do not form an independent list of matrices:
| In[6]:= |
|
| Out[6]= |
|
| In[7]:= |
|
| Out[7]= |
|
A basis for the span of this list of matrices:
| In[8]:= |
|
| Out[8]= |
|
A basis for the subspace spanned by a dependent list of polynomials in x:
| In[9]:= |
|
| Out[9]= |
|
A basis for the subspace spanned by a dependent list of trig functions:
| In[10]:= |
|
| Out[10]= |
|
Test that a list of trigonometric polynomials is linearly independent:
| In[11]:= |
|
| Out[12]= |
|
When the input is a set of functions, SubspaceBasis uses a method that may be ill-conditioned:
| In[13]:= |
|
| Out[13]= |
|
| In[14]:= |
|
| Out[14]= |
|
Specifying polynomial inputs gives a better result:
| In[15]:= |
|
| Out[15]= |
|
This work is licensed under a Creative Commons Attribution 4.0 International License