The Lie algebra L and its subalgebras can be provided either from their structure constants or their infinitesimal generator representation. When providing the Lie algebra L with its structure constants denote the elements of the subspaces by using the symbol X, e.g. {X[1], X[4]}.
Let V be a subset of L. Then the set CL(V)={xL[x, v]=0 vV} is called the centralizer of V in L.
Centralizer returns the span of elements of L that make up the centralizer. Depending on the input, this can be given as a list of infinitesimal generators or by indexing the initial algebra using the symbol X.
The centralizer of the Lie algebra L is the center of L.