DifferentialGeometry/LieAlgebras/Query/MatrixAlgebra - Maple Help

Query[MatrixAlgebra] - check if each matrix in a list of matrices belongs to a specified classical matrix algebra

Calling Sequences

Query("MatrixAlgebra")

Parameters

A        - a  list of square matrices, or a matrix representation of a Lie algebra

alg      - a string, specifying a classical matrix algebra

options  - (optional) keyword arguments output, quadraticform, skewform

Description

 • This query checks if a given list of matrices belongs to one of the following matrix algebras :

 • For the definitions of all these matrix algebras see, SimpleLieAlgebraData.

Examples

 > $\mathrm{with}\left(\mathrm{DifferentialGeometry}\right):$$\mathrm{with}\left(\mathrm{LieAlgebras}\right):$

Example 1.

We check if each matrix in a list of matrices belongs to $\mathrm{sl}\left(2\right).$

 > $\mathrm{A1}≔\left[\mathrm{Matrix}\left(\left[\left[1,0\right],\left[0,-1\right]\right]\right),\mathrm{Matrix}\left(\left[\left[0,1\right],\left[0,0\right]\right]\right),\mathrm{Matrix}\left(\left[\left[0,0\right],\left[1,0\right]\right]\right)\right]$
 ${\mathrm{A1}}{:=}\left[\left[\begin{array}{rr}{1}& {0}\\ {0}& {-}{1}\end{array}\right]{,}\left[\begin{array}{rr}{0}& {1}\\ {0}& {0}\end{array}\right]{,}\left[\begin{array}{rr}{0}& {0}\\ {1}& {0}\end{array}\right]\right]$ (2.1)
 > $\mathrm{Query}\left(\mathrm{A1},"sl\left(2\right)","MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.2)
 > $\mathrm{A2}≔\left[\mathrm{Matrix}\left(\left[\left[1,0\right],\left[0,-1\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,1\right],\left[0,0\right]\right]\right),\mathrm{Matrix}\left(\left[\left[0,0\right],\left[1,0\right]\right]\right)\right]$
 ${\mathrm{A2}}{:=}\left[\left[\begin{array}{rr}{1}& {0}\\ {0}& {-}{1}\end{array}\right]{,}\left[\begin{array}{rr}{1}& {1}\\ {0}& {0}\end{array}\right]{,}\left[\begin{array}{rr}{0}& {0}\\ {1}& {0}\end{array}\right]\right]$ (2.3)
 > $\mathrm{Query}\left(\mathrm{A2},"sl\left(2\right)","MatrixAlgebra"\right)$
 ${\mathrm{false}}$ (2.4)

With the keyword argument output  = 'integer' , 0 is returned if all the matrices belong to the specified matrix algebra, otherwise the position of the first matrix which does not belong to the specified matrix algebra is returned.

 > $\mathrm{Query}\left(\mathrm{A1},"sl\left(2\right)",\mathrm{output}='\mathrm{integer}',"MatrixAlgebra"\right)$
 ${0}$ (2.5)
 > $\mathrm{Query}\left(\mathrm{A2},"sl\left(2\right)",\mathrm{output}='\mathrm{integer}',"MatrixAlgebra"\right)$
 ${2}$ (2.6)

Example 2.

We check if each matrix in list of matrices belong to $\mathrm{so}\left(2,2\right)$. This is the Lie algebra of 4×4 matrices which are skew-symmetric with respect to a quadratic form of signature [2,2]. The default choice for the quadratic form is .  With the keyword argument version  = 2, the quadratic form  is used. With the keyword argument quadraticform  = $M$, the quadratic form (a 4×4 symmetric matrix with signature [2, 2]) is used.

1. Default option.

 > $\mathrm{B1}≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[1,0,0,0\right],\left[0,0,0,0\right],\left[0,0,-1,0\right],\left[0,0,0,0\right]\right],\left[\left[0,1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,-1,0\right]\right],\left[\left[0,0,0,0\right],\left[1,0,0,0\right],\left[0,0,0,-1\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,-1\right]\right],\left[\left[0,0,0,-1\right],\left[0,0,1,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,-1,0,0\right],\left[1,0,0,0\right]\right]\right]\right)$
 ${\mathrm{B1}}{:=}\left[\left[\begin{array}{rrrr}{1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {-}{1}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {-}{1}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {-}{1}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {-}{1}& {0}& {0}\\ {1}& {0}& {0}& {0}\end{array}\right]\right]$ (2.7)
 > $\mathrm{Query}\left(\mathrm{B1},"so\left(2, 2\right)","MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.8)

2. with version = 2.

 > $\mathrm{B2}≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[0,-1,0,0\right],\left[1,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,1,0\right],\left[0,0,0,0\right],\left[1,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,1\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[1,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,1,0\right],\left[0,1,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,1\right],\left[0,0,0,0\right],\left[0,1,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,-1\right],\left[0,0,1,0\right]\right]\right]\right)$
 ${\mathrm{B2}}{:=}\left[\left[\begin{array}{rrrr}{0}& {-}{1}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {1}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\\ {0}& {0}& {1}& {0}\end{array}\right]\right]$ (2.9)
 > $\mathrm{Query}\left(\mathrm{B2},"so\left(2,2\right)",\mathrm{version}=2,"MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.10)

 > $\mathrm{B3}≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[1,0,0,0\right],\left[0,-1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,1,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,-1,0,0\right]\right],\left[\left[0,0,0,1\right],\left[0,0,0,0\right],\left[0,-1,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,1,0\right],\left[0,0,0,0\right],\left[-1,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,1\right],\left[-1,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,1,0\right],\left[0,0,0,-1\right]\right]\right]\right)$
 ${\mathrm{B3}}{:=}\left[\left[\begin{array}{rrrr}{1}& {0}& {0}& {0}\\ {0}& {-}{1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {-}{1}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {1}\\ {0}& {0}& {0}& {0}\\ {0}& {-}{1}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {-}{1}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {-}{1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {-}{1}\end{array}\right]\right]$ (2.11)
 > $M≔\mathrm{Matrix}\left(\left[\left[0,1,0,0\right],\left[1,0,0,0\right],\left[0,0,0,1\right],\left[0,0,1,0\right]\right]\right)$
 ${M}{:=}\left[\begin{array}{rrrr}{0}& {1}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {0}& {0}& {1}& {0}\end{array}\right]$ (2.12)
 > $\mathrm{Query}\left(\mathrm{B3},"so\left(2, 2\right)",\mathrm{quadraticform}=M,"MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.13)



Example 3.

We check if the members of a list of matrices belong to This is the real Lie algebra of matrices which are skew-symmetric with respect to a skew-symmetric matrix $J$.  The default choice is .  Other forms for can be specified with the keyword argument skewform = $J$

Here is the standard form of the matrices for .

 > $\mathrm{C1}≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[1,0,0,0\right],\left[0,0,0,0\right],\left[0,0,-1,0\right],\left[0,0,0,0\right]\right],\left[\left[0,1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,-1,0\right]\right],\left[\left[0,0,0,0\right],\left[1,0,0,0\right],\left[0,0,0,-1\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,-1\right]\right],\left[\left[0,0,1,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,1\right],\left[0,0,1,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,1\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[1,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,1,0,0\right],\left[1,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,1,0,0\right]\right]\right]\right)$
 ${\mathrm{C1}}{:=}\left[\left[\begin{array}{rrrr}{1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {-}{1}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {-}{1}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {1}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {1}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\end{array}\right]\right]$ (2.14)
 > $\mathrm{Query}\left(\mathrm{C1},"sp\left(4, R\right)","MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.15)

Define a skew-symmetric matrix $J$.

 > $J≔\mathrm{Matrix}\left(\left[\left[0,-1,0,0\right],\left[1,0,0,0\right],\left[0,0,0,1\right],\left[0,0,-1,0\right]\right]\right)$
 ${J}{:=}\left[\begin{array}{rrrr}{0}& {-}{1}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {0}& {0}& {-}{1}& {0}\end{array}\right]$ (2.16)

Here is the form of the matrices for with respect to $J.$



 > $\mathrm{C2}≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[-1,0,0,0\right],\left[0,1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,1,0\right],\left[0,0,0,0\right],\left[-1,0,0,0\right]\right],\left[\left[0,0,0,-1\right],\left[0,0,0,0\right],\left[0,1,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,1,0\right],\left[0,0,0,-1\right]\right],\left[\left[0,0,0,0\right],\left[1,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,1\right],\left[1,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,1\right],\left[0,0,0,0\right]\right],\left[\left[0,1,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,1,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,1,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,1,0\right]\right]\right]\right)$
 ${\mathrm{C2}}{:=}\left[\left[\begin{array}{rrrr}{-}{1}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {-}{1}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {-}{1}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {-}{1}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {1}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {1}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {1}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {1}& {0}\end{array}\right]\right]$ (2.17)
 > $\mathrm{Query}\left(\mathrm{C2},"sp\left(4, R\right)",\mathrm{skewform}=J,"MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.18)

Example 4.

Check that a list of matrices consists of  upper triangular matrices.

 > $\mathrm{D1}≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[1,0,0\right],\left[0,0,0\right],\left[0,0,0\right]\right],\left[\left[0,1,0\right],\left[0,0,0\right],\left[0,0,0\right]\right],\left[\left[0,0,1\right],\left[0,0,0\right],\left[0,0,0\right]\right],\left[\left[0,0,0\right],\left[0,1,0\right],\left[0,0,0\right]\right],\left[\left[0,0,0\right],\left[0,0,1\right],\left[0,0,0\right]\right],\left[\left[0,0,0\right],\left[0,0,0\right],\left[0,0,1\right]\right]\right]\right)$
 ${\mathrm{D1}}{:=}\left[\left[\begin{array}{rrr}{1}& {0}& {0}\\ {0}& {0}& {0}\\ {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrr}{0}& {1}& {0}\\ {0}& {0}& {0}\\ {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrr}{0}& {0}& {1}\\ {0}& {0}& {0}\\ {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrr}{0}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrr}{0}& {0}& {0}\\ {0}& {0}& {1}\\ {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrr}{0}& {0}& {0}\\ {0}& {0}& {0}\\ {0}& {0}& {1}\end{array}\right]\right]$ (2.19)
 > $\mathrm{Query}\left(\mathrm{D1},"sol\left(3\right)","MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.20)

Example 5.

Check that a list of matrices consists of nilpotent matrices.

 alg > $E≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[-1,2,1,3\right],\left[-1,2,1,3\right],\left[1,-2,-1,-3\right],\left[0,0,0,0\right]\right],\left[\left[-1,3,2,4\right],\left[-1,2,1,2\right],\left[1,-4,-3,-6\right],\left[0,1,1,2\right]\right],\left[\left[0,1,1,0\right],\left[0,1,1,0\right],\left[0,-1,-1,0\right],\left[0,0,0,0\right]\right]\right]\right)$
 ${E}{:=}\left[\left[\begin{array}{rrrr}{-}{1}& {2}& {1}& {3}\\ {-}{1}& {2}& {1}& {3}\\ {1}& {-}{2}& {-}{1}& {-}{3}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{rrrr}{-}{1}& {3}& {2}& {4}\\ {-}{1}& {2}& {1}& {2}\\ {1}& {-}{4}& {-}{3}& {-}{6}\\ {0}& {1}& {1}& {2}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {1}& {1}& {0}\\ {0}& {1}& {1}& {0}\\ {0}& {-}{1}& {-}{1}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]\right]$ (2.21)
 > $\mathrm{Query}\left(E,"nil\left(4\right)","MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.22)
 > $\mathrm{LieAlgebraData}\left(\mathrm{D1},\mathrm{NN}\right)$
 $\left[\left[{\mathrm{e1}}{,}{\mathrm{e2}}\right]{=}{\mathrm{e2}}{,}\left[{\mathrm{e1}}{,}{\mathrm{e3}}\right]{=}{\mathrm{e3}}{,}\left[{\mathrm{e2}}{,}{\mathrm{e4}}\right]{=}{\mathrm{e2}}{,}\left[{\mathrm{e2}}{,}{\mathrm{e5}}\right]{=}{\mathrm{e3}}{,}\left[{\mathrm{e3}}{,}{\mathrm{e6}}\right]{=}{\mathrm{e3}}{,}\left[{\mathrm{e4}}{,}{\mathrm{e5}}\right]{=}{\mathrm{e5}}{,}\left[{\mathrm{e5}}{,}{\mathrm{e6}}\right]{=}{\mathrm{e5}}\right]$ (2.23)

Example 6.

Check that the following matrices define a Lie algebra and that this representation is unitary.

 u3 > $F≔\mathrm{map}\left(\mathrm{Matrix},\left[\left[\left[0,0,0,0\right],\left[0,I,0,0\right],\left[0,0,-I,0\right],\left[0,0,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,0\right],\left[0,0,I,0\right],\left[0,0,0,-I\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,-1\right],\left[0,0,0,0\right],\left[0,1,0,0\right]\right],\left[\left[0,0,0,0\right],\left[0,0,0,I\right],\left[0,0,0,0\right],\left[0,I,0,0\right]\right]\right]\right)$
 ${F}{:=}\left[\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {I}& {0}& {0}\\ {0}& {0}& {-}{I}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {I}& {0}\\ {0}& {0}& {0}& {-}{I}\end{array}\right]{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\end{array}\right]{,}\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {I}\\ {0}& {0}& {0}& {0}\\ {0}& {I}& {0}& {0}\end{array}\right]\right]$ (2.24)
 u3 > $\mathrm{LD}≔\mathrm{LieAlgebraData}\left(F,\mathrm{alg}\right)$
 ${\mathrm{LD}}{:=}\left[\left[{\mathrm{e1}}{,}{\mathrm{e3}}\right]{=}{-}{\mathrm{e4}}{,}\left[{\mathrm{e1}}{,}{\mathrm{e4}}\right]{=}{\mathrm{e3}}{,}\left[{\mathrm{e2}}{,}{\mathrm{e3}}\right]{=}{-}{\mathrm{e4}}{,}\left[{\mathrm{e2}}{,}{\mathrm{e4}}\right]{=}{\mathrm{e3}}{,}\left[{\mathrm{e3}}{,}{\mathrm{e4}}\right]{=}{-}{2}{}{\mathrm{e2}}{-}{2}{}{\mathrm{e1}}\right]$ (2.25)
 u3 > $\mathrm{DGsetup}\left(\mathrm{LD}\right)$
 ${\mathrm{Lie algebra: alg}}$ (2.26)
 u3 > $\mathrm{DGsetup}\left(\left[\mathrm{x1},\mathrm{x2},\mathrm{x3}\right],V\right)$
 ${\mathrm{frame name: V}}$ (2.27)
 alg > $\mathrm{\rho }≔\mathrm{Representation}\left(\mathrm{alg},V,F\right)$
 ${\mathrm{ρ}}{:=}\left[\left[{\mathrm{e1}}{,}\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {I}& {0}& {0}\\ {0}& {0}& {-}{I}& {0}\\ {0}& {0}& {0}& {0}\end{array}\right]\right]{,}\left[{\mathrm{e2}}{,}\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {0}\\ {0}& {0}& {I}& {0}\\ {0}& {0}& {0}& {-}{I}\end{array}\right]\right]{,}\left[{\mathrm{e3}}{,}\left[\begin{array}{rrrr}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {-}{1}\\ {0}& {0}& {0}& {0}\\ {0}& {1}& {0}& {0}\end{array}\right]\right]{,}\left[{\mathrm{e4}}{,}\left[\begin{array}{cccc}{0}& {0}& {0}& {0}\\ {0}& {0}& {0}& {I}\\ {0}& {0}& {0}& {0}\\ {0}& {I}& {0}& {0}\end{array}\right]\right]\right]$ (2.28)
 alg > $\mathrm{Query}\left(\mathrm{\rho },"u\left(4\right)","MatrixAlgebra"\right)$
 ${\mathrm{true}}$ (2.29)