Function Repository Resource:

CanonicalBasis

Source Notebook

Obtain the canonical bases for selected spaces of matrices and functions

Contributed by: Dennis M Schneider

ResourceFunction["CanonicalBasis"][type,var,degree]

returns the canonical basis for polynomials or trigonometric polynomials of degree at most degree in the variable var.

ResourceFunction["CanonicalBasis"][type,size]

returns the canonical basis for the space of matrices of type type and size size.

Details and Options

The basis returned by ResourceFunction["CanonicalBasis"] is a basis for the given vector space over the real numbers, not the complex numbers.
The value for type can be any of the following:
"DiagonalMatrices"
"HermitianMatrices"
"Matrices"
"Polynomials"
"SkewHermitianMatrices"
"SkewSymmetricMatrices"
"SymmetricMatrices"
"TraceZeroMatrices"
"TrigonometricPolynomials"

Examples

Basic Examples (2) 

The canonical basis for the space of polynomials in x of degree 5 or less:

In[1]:=
ResourceFunction["CanonicalBasis"]["Polynomials", x, 5]
Out[1]=

The canonical basis for the space of 2×3 matrices:

In[2]:=
MatrixForm /@ ResourceFunction["CanonicalBasis"]["Matrices", {2, 3}]
Out[2]=

Scope (6) 

Function spaces (1) 

The canonical basis for the space of trigonometric polynomials in x of degree 5 or less:

In[3]:=
ResourceFunction["CanonicalBasis"]["TrigonometricPolynomials", x, 5]
Out[3]=

Matrix spaces (5) 

The canonical basis for the space of 3×3 square matrices:

In[4]:=
MatrixForm /@ ResourceFunction["CanonicalBasis"]["Matrices", 3]
Out[4]=

The canonical basis for the space of 3×3 symmetric matrices:

In[5]:=
MatrixForm /@ ResourceFunction["CanonicalBasis"]["SymmetricMatrices", 3]
Out[5]=

The canonical basis for the space of 3×3 skew-symmetric matrices:

In[6]:=
MatrixForm /@ ResourceFunction["CanonicalBasis"]["SkewSymmetricMatrices", 3]
Out[6]=

The Hermitian matrices of given degree do not form a vector space over the complex numbers, but they do form a vector space over the real numbers:

In[7]:=
MatrixForm /@ ResourceFunction["CanonicalBasis"]["HermitianMatrices", 3]
Out[7]=

As with Hermitian matrices, the skew-Hermitian matrices of given degree form a vector space over the real numbers:

In[8]:=
MatrixForm /@ ResourceFunction["CanonicalBasis"]["SkewHermitianMatrices", 3]
Out[8]=

Applications (2) 

A Manipulate illustrating an array of function-related examples:

In[9]:=
Manipulate[
 ResourceFunction["CanonicalBasis"][type, x, degree], {type, {Polynomials, "TrigonometricPolynomials"}}, {degree,
   Table[j, {j, 1, 10}]}]
Out[9]=

A Manipulate illustrating an array of matrix-theoretic examples:

In[10]:=
Manipulate[
 MatrixForm /@ ResourceFunction["CanonicalBasis"][type, size], {type, {"DiagonalMatrices", "HermitianMatrices", "SkewHermitianMatrices", "Matrices", "SymmetricMatrices", "SkewSymmetricMatrices", "TraceZeroMatrices"}}, {size, Range[2, 6]}]
Out[10]=

Publisher

Dennis M Schneider

Version History

  • 1.0.0 – 04 October 2019

Related Resources

License Information