# commutator -- the commutator of a collection of vector fields

## Synopsis

• Usage:
N=commutator(M)
n=commutator(m)
• Inputs:
• M, , of vector fields
• m, , of vector fields
• Outputs:
• N, , with columns containing the brackets of pairs of columns of M
• n, , the module generated by brackets of elements of m

## Description

When given a Matrix, this returns a Matrix with columns containing the brackets of pairs of columns of M.

When given a Module, this returns the Module generated by $[X,Y]$, for $X$ and $Y$ in the module m. This is a superset of the module generated by the brackets of generators of m; see bracket for more details.

In either case, commutator computes much the same thing as calling bracket with repeated parameters, but is more efficient because it takes advantage of skew-symmetry.

 i1 : R=QQ[x,y]; i2 : D=derlog(ideal (x*y*(x-y))) o2 = image | x 0 | | y xy-y2 | 2 o2 : R-module, submodule of R i3 : commutator(gens D) o3 = | 0 | | xy-y2 | 2 1 o3 : Matrix R <--- R i4 : bracket(gens D,gens D) o4 = | 0 0 0 0 | | 0 xy-y2 -xy+y2 0 | 2 4 o4 : Matrix R <--- R i5 : commutator(D) o5 = image | 0 x2 0 0 0 xy 0 x2y-xy2 0 | | xy-y2 xy x2y-xy2 0 0 y2 xy2-y3 xy2-y3 x2y2-2xy3+y4 | 2 o5 : R-module, submodule of R i6 : bracket(D,D) o6 = image | 0 0 0 0 x2 0 0 0 xy 0 x2y-xy2 0 x2 0 0 0 xy 0 x2y-xy2 0 | | 0 xy-y2 -xy+y2 0 xy x2y-xy2 0 0 y2 xy2-y3 xy2-y3 x2y2-2xy3+y4 xy x2y-xy2 0 0 y2 xy2-y3 xy2-y3 x2y2-2xy3+y4 | 2 o6 : R-module, submodule of R

## Caveat

The Matrix and Module versions of this routine compute different things; see differences between certain bracketing functions.