---
title: "Operations on Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/elements.html"
source: "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/elements.md"
part: "Lie Theory"
chapter: "Lie Algebras"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Lie Theory", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/index-lie-theory.md"}
  - {"title": "Lie Algebras", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/index-lie-algebras.md"}
prev: {"title": "Properties of Lie Algebras and Ideals", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/property.md"}
next: {"title": "The Natural Module", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/natural-module.md"}
intrinsics:
  - {"name": "+", "signature": "x + y: AlgLieElt, AlgLieElt -> AlgLieElt"}
  - {"name": "+", "signature": "x + y: AlgMatLieElt, AlgMatLieElt -> AlgMatLieElt"}
  - {"name": "-", "signature": "x - y: AlgLieElt, AlgLieElt -> AlgLieElt"}
  - {"name": "-", "signature": "x - y: AlgMatLieElt, AlgMatLieElt -> AlgMatLieElt"}
  - {"name": "*", "signature": "x * y: AlgLieElt, AlgLieElt -> AlgLieElt"}
  - {"name": "*", "signature": "x * y: AlgMatLieElt, AlgMatLieElt -> AlgMatLieElt"}
  - {"name": "IsCentral", "signature": "IsCentral(L, M): AlgLie, AlgLieElt -> BoolElt"}
  - {"name": "IsCentral", "signature": "IsCentral(L, M): AlgMatLie, AlgMatLieElt -> BoolElt"}
  - {"name": "NonNilpotentElement", "signature": "NonNilpotentElement(L): AlgLie -> AlgLieElt"}
  - {"name": "AdjointMatrix", "signature": "AdjointMatrix(L, x): AlgLie, AlgLieElt -> AlgMatLieElt"}
  - {"name": "RightAdjointMatrix", "signature": "RightAdjointMatrix(L, x): AlgLie, AlgLieElt -> AlgMatLieElt"}
  - {"name": "a", "signature": "a[i]: AlgLieElt, RngIntElt -> RngElt"}
  - {"name": "a[i]", "signature": "a[i]: AlgMatLieElt, RngIntElt -> ModTupRngElt"}
  - {"name": "a[i] := r", "signature": "a[i] := r: AlgLieElt, RngIntElt, RngElt -> AlgLieElt"}
  - {"name": "a[i] := r", "signature": "a[i] := r: AlgMatLieElt, RngIntElt, ModTupRngElt -> AlgMatLieElt"}
  - {"name": "a", "signature": "a[i, j]: AlgMatLieElt, RngIntElt, RngIntElt -> RngElt"}
  - {"name": "a[i, j] := r", "signature": "a[i, j] := r: AlgMatLieElt, RngIntElt, RngIntElt, RngElt -> AlgMatLieElt"}
examples:
  - "ex-a38e8a"
  - "ex-c4c36f"
---

<a id="elements-2"></a>
<a id="sectalglieelt"></a>
# Operations on Elements

<a id="operation-op-plus-alglieelt-alglieelt"></a>
## `x + y: AlgLieElt, AlgLieElt -> AlgLieElt`

<a id="operation-op-plus-algmatlieelt-algmatlieelt"></a>
## `x + y: AlgMatLieElt, AlgMatLieElt -> AlgMatLieElt`

<a id="operation-op-minus-alglieelt-alglieelt"></a>
## `x - y: AlgLieElt, AlgLieElt -> AlgLieElt`

<a id="operation-op-minus-algmatlieelt-algmatlieelt"></a>
## `x - y: AlgMatLieElt, AlgMatLieElt -> AlgMatLieElt`

<a id="operation-op-times-alglieelt-alglieelt"></a>
## `x * y: AlgLieElt, AlgLieElt -> AlgLieElt`

<a id="operation-op-times-algmatlieelt-algmatlieelt"></a>
## `x * y: AlgMatLieElt, AlgMatLieElt -> AlgMatLieElt`

<a id="function-iscentral-alglie-alglieelt"></a>
## `IsCentral(L, M): AlgLie, AlgLieElt -> BoolElt`

<a id="function-iscentral-algmatlie-algmatlieelt"></a>
## `IsCentral(L, M): AlgMatLie, AlgMatLieElt -> BoolElt`

Given an element $x$ of the Lie algebra $L$, return `true` if $x$ is central in $L$.

<a id="function-nonnilpotentelement-alglie"></a>
## `NonNilpotentElement(L): AlgLie -> AlgLieElt`

Given a (structure constant) Lie algebra $L$, this function returns an element of $L$ that is *not* nilpotent, or the zero element of $L$ if no such element exists.

The algorithm follows [[dG00](https://docs.magma-maths.org/v2.30-1/references.md#cite-wdg-lie-alg)], §2.7.

<a id="example-ex-a38e8a"></a>
## `Example: Non-Nilpotent Element (ex-a38e8a)`

We construct a non-nilpotent element of a Lie algebra.

```magma
> L:=LieAlgebra("G2",RationalField());
> NonNilpotentElement(L);
(0 0 0 0 0 1 0 0 0 0 0 0 0 0)
```

<a id="function-adjointmatrix-alglie-alglieelt"></a>
## `AdjointMatrix(L, x): AlgLie, AlgLieElt -> AlgMatLieElt`

<a id="function-rightadjointmatrix-alglie-alglieelt"></a>
## `RightAdjointMatrix(L, x): AlgLie, AlgLieElt -> AlgMatLieElt`

Given a (structure constant) Lie algebra $L$ and an element $x$ of a subalgebra or ideal of $L$, return the matrix of ${\rm ad} x$ as an element of a matrix Lie algebra.

<a id="example-ex-c4c36f"></a>
## `Example: Adjoint Matrix of an Element (ex-c4c36f)`

```magma
> L:=LieAlgebra("B2",RationalField());
> AdjointMatrix(L, L.1);
[ 0  0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0  0]
[ 1  0  0  0  0  0  0  0  0  0]
[ 2  0  0  0  0  0  0  0  0  0]
[ 0  0  0  0  0  0  0  0  0  0]
[ 0 -1  0  0  0  0  0  0  0  0]
[ 0  0  1  0  0  0  0  0  0  0]
[ 0  0  0  0  0 -1  0  0  0  0]
```

<a id="index-elt-oper"></a>
<a id="subsectalglieeltindex"></a>
## Indexing

<a id="indexed-indexed-a-alglieelt-rngintelt-rngelt"></a>
### `a[i]: AlgLieElt, RngIntElt -> RngElt`

<a id="literal-literal-a-i-algmatlieelt-rngintelt-modtuprngelt"></a>
### `a[i]: AlgMatLieElt, RngIntElt -> ModTupRngElt`

If $a$ is an element of a structure constant Lie algebra $L$ of dimension $n$ and $1 \leq i\leq n$ is a positive integer, then the $i$-th component of the element $a$ is returned (as an element of the base ring $R$ of $L$).

If $a$ is an element of a matrix Lie algebra $L$ of degree $n$ and $1 \leq i \leq n$ then the $i$th row of the matrix $a$ is returned.

<a id="literal-literal-a-i-r-alglieelt-rngintelt-rngelt-alglieelt"></a>
### `a[i] := r: AlgLieElt, RngIntElt, RngElt -> AlgLieElt`

<a id="literal-literal-a-i-r-algmatlieelt-rngintelt-modtuprngelt-algmatlieelt"></a>
### `a[i] := r: AlgMatLieElt, RngIntElt, ModTupRngElt -> AlgMatLieElt`

Given an element $a$ belonging to a structure constant Lie algebra of dimension $n$ over $R$, a positive integer $1 \leq i\leq n$, and an element $r \in R$, the $i$-th component of the element $a$ is redefined to be $r$.

If $a$ is an element of a matrix Lie algebra $L$ of degree $n$ over $R$ and $1 \leq i \leq n$, the $i$th row of the matrix $a$ is redefined to be the vector $r$ over $R$.

<a id="indexed-indexed-a-algmatlieelt-rngintelt-rngintelt-rngelt"></a>
### `a[i, j]: AlgMatLieElt, RngIntElt, RngIntElt -> RngElt`

<a id="literal-literal-a-i-j-r-algmatlieelt-rngintelt-rngintelt-rngelt-algmatlieelt"></a>
### `a[i, j] := r: AlgMatLieElt, RngIntElt, RngIntElt, RngElt -> AlgMatLieElt`

For an element $a$ of a matrix Lie algebra $L$ of degree $n$ and integers $1 \leq i, j \leq n$ return the element in the $i$th row and $j$th column of $a$ or set this element to be $r$ where $r$ is an element of the coefficient ring of $L$.
