---
title: "Construction of Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/element-construct.html"
source: "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/element-construct.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": "Families of Lie Algebras", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/family-construct.md"}
next: {"title": "Construction of Subalgebras, Ideals, and Quotients", "source": "https://docs.magma-maths.org/v2.30-1/LieTheory/LieAlgebras/sub-construct.md"}
intrinsics:
  - {"name": "Zero", "signature": "Zero(L): AlgLie -> AlgLieElt"}
  - {"name": "Zero", "signature": "Zero(L): AlgMatLie -> AlgMatLieElt"}
  - {"name": "!", "signature": "L ! 0: AlgLie, RngIntElt -> AlgLieElt"}
  - {"name": "!", "signature": "L ! 0: AlgMatLie, RngIntElt -> AlgMatLieElt"}
  - {"name": "Random", "signature": "Random(L): AlgLie -> AlgLieElt"}
  - {"name": "Random", "signature": "Random(L): AlgMatLie -> AlgMatLieElt"}
  - {"name": "elt", "signature": "elt<L | r₁, r₂, ..., rₙ>: AlgLie, RngElt, RngElt, ..., RngElt -> AlgLieElt"}
  - {"name": "!", "signature": "L ! Q: AlgLie, SeqEnum[RngElt] -> AlgLieElt"}
  - {"name": "BasisProduct", "signature": "BasisProduct(L, i, j): AlgLie, RngIntElt, RngIntElt -> AlgLieElt"}
  - {"name": "BasisProducts", "signature": "BasisProducts(L): AlgLie -> SeqEnum"}
  - {"name": "elt", "signature": "elt<R | L>: AlgMatLie, [ RngElt ] -> AlgMatLieElt"}
  - {"name": "elt", "signature": "elt<R | L>: AlgMatLie, RngElt, ..., RngElt -> AlgMatLieElt"}
  - {"name": "!", "signature": "R ! L: AlgMatLie, [RngElt] -> AlgMatLieElt"}
  - {"name": "DiagonalMatrix", "signature": "DiagonalMatrix(L, Q): AlgMatLie, [RngElt] -> AlgMatLieElt"}
  - {"name": "ScalarMatrix", "signature": "ScalarMatrix(L, r): AlgMatLie, RngElt -> AlgMatLieElt"}
---

<a id="element-construct"></a>
<a id="sectalglieeltconstr"></a>
# Construction of Elements

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

<a id="function-zero-algmatlie"></a>
## `Zero(L): AlgMatLie -> AlgMatLieElt`

<a id="operation-op-alglie-rngintelt"></a>
## `L ! 0: AlgLie, RngIntElt -> AlgLieElt`

<a id="operation-op-algmatlie-rngintelt"></a>
## `L ! 0: AlgMatLie, RngIntElt -> AlgMatLieElt`

The zero element of the Lie algebra $L$.

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

<a id="function-random-algmatlie"></a>
## `Random(L): AlgMatLie -> AlgMatLieElt`

Given a Lie algebra $L$ defined over a finite ring, a random element is returned.

## Construction of Elements of Structure Constant Algebras

<a id="constructor-constructor-elt-alglie-rngelt-rngelt-rngelt-alglieelt"></a>
### `elt<L | r₁, r₂, ..., rₙ>: AlgLie, RngElt, RngElt, ..., RngElt -> AlgLieElt`

Given a Lie algebra $L$ of dimension $n$ over a ring $R$, and ring elements $r_1, r_2, \ldots, r_n \in R$ construct the element $r_1 * e_1 + r_2 * e_2 + \ldots + r_n * e_n$ of $L$.

<a id="operation-op-alglie-seqenum-rngelt"></a>
### `L ! Q: AlgLie, SeqEnum[RngElt] -> AlgLieElt`

Given a Lie algebra $L$ of dimension $n$ and a sequence $Q = [r_1, r_2, \ldots, r_n]$ of elements of the base ring $R$ of $L$, the element $r_1 * e_1 + r_2 * e_2 + \ldots + r_n * e_n$ of $L$ is constructed.

<a id="function-basisproduct-alglie-rngintelt-rngintelt"></a>
### `BasisProduct(L, i, j): AlgLie, RngIntElt, RngIntElt -> AlgLieElt`

Returns the product of the $i$-th and $j$-th basis element of the Lie algebra $L$.

<a id="function-basisproducts-alglie"></a>
### `BasisProducts(L): AlgLie -> SeqEnum`

```magma
Rep: MonStgElt                    Default: "Dense"
```

Returns the products of all basis elements of the Lie algebra $L$.

The optional parameter `Rep` may be used to specify the format of the result. If `Rep` is set to “Dense”, the products are returned as a sequence $Q$ of $n$ sequences of $n$ elements of $L$, where $n$ is the dimension of $L$. The element $Q[i][j]$ is the product of the $i$-th and $j$-th basis elements.

If `Rep` is set to “Sparse”, the products are returned as a sequence $Q$ containing quadruples $(i,j,k,a_{ijk})$ signifying that the product of the $i$-th and $j$-th basis elements is $\sum_{k=1}^n a_{ijk} b_k$, where $b_k$ is the $k$-th basis element and $n =$ dim($L$).

## Construction of Matrix Elements

Matrix Lie elements can be constructed using the functions below. For more information on constructing matrices see Section [Construction of a Matrix](https://docs.magma-maths.org/v2.30-1/Algebras/MatrixAlgebras/creation.md#algmat-elt-constr).

<a id="constructor-constructor-elt-algmatlie-rngelt-algmatlieelt"></a>
### `elt<R | L>: AlgMatLie, [ RngElt ] -> AlgMatLieElt`

<a id="constructor-constructor-elt-algmatlie-rngelt-rngelt-algmatlieelt"></a>
### `elt<R | L>: AlgMatLie, RngElt, ..., RngElt -> AlgMatLieElt`

<a id="operation-op-algmatlie-rngelt"></a>
### `R ! L: AlgMatLie, [RngElt] -> AlgMatLieElt`

Create the element of the matrix Lie algebra $R$ of degree $n$ whose entries are the $n^2$ elements of the sequence $L$.

<a id="function-diagonalmatrix-algmatlie-rngelt"></a>
### `DiagonalMatrix(L, Q): AlgMatLie, [RngElt] -> AlgMatLieElt`

Diagonal matrix in the matrix Lie algebra $L$, given by the sequence $Q$ of ring elements.

<a id="function-scalarmatrix-algmatlie-rngelt"></a>
### `ScalarMatrix(L, r): AlgMatLie, RngElt -> AlgMatLieElt`

Scalar matrix in the matrix Lie algebra $L$, defined by the ring element $r$.
