---
title: "Lie Algebras and Bilinear Forms"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/PolarSpaces/liealg.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/PolarSpaces/liealg.md"
part: "Matrices and Linear Algebra"
chapter: "Polar Spaces"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Matrices and Linear Algebra", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/index-matrices-linear-algebra.md"}
  - {"title": "Polar Spaces", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/PolarSpaces/index-polar-spaces.md"}
prev: {"title": "Classical Groups", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/PolarSpaces/classical.md"}
next: {"title": "Wall Forms", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/PolarSpaces/wallform.md"}
intrinsics:
  - {"name": "DerivationAlgebra", "signature": "DerivationAlgebra(J): AlgMatElt -> AlgLie"}
  - {"name": "HeisenbergAlgebra", "signature": "HeisenbergAlgebra(J): AlgMatElt -> AlgLie"}
examples:
  - "ex-3caa04"
  - "ex-196405"
  - "ex-aa6842"
---

<a id="liealg"></a>
<a id="sectliealg"></a>
# Lie Algebras and Bilinear Forms

If $J$ is the matrix of a bilinear form, the Lie algebra of derivations of $J$ consists of the matrices $X$ such that $XJ + JX^\mathrm{tr}= 0$.

<a id="function-derivationalgebra-algmatelt"></a>
## `DerivationAlgebra(J): AlgMatElt -> AlgLie`

```magma
Rep  : MonStgElt                    Default: "Sparse"
Check: BoolElt                      Default: false
```

The Lie algebra of derivations of the bilinear form with matrix $J$. The possible values for `Rep` are `"Dense"`, `"Sparse"`, and `"Partial"` with the default being `"Sparse"`.

<a id="example-ex-3caa04"></a>
## `Example: Lie Algebra of Type C3 (ex-3caa04)`

Construct the Lie algebra preserving the standard alternating form of rank 6 over the field of 7 elements and check that it is a simple algebra of type $C_3$.

```magma
> J := StandardAlternatingForm(6,7);
> L := DerivationAlgebra(J);
> IsSimple(L);
true
> SemisimpleType(L);
C3
```

<a id="example-ex-196405"></a>
## `Example: G2 Ideal in Characteristic 2 (ex-196405)`

Over a field of characteristic 2, the Lie algebra of an alternating form is no longer simple. In this example the Lie algebra $L$ of the standard alternating form of rank 6 over ${\bf F}_{8}$ is of symplectic type $C_3$ but has an ideal $I$ of type $G_2$. The dimension of the centre of $L$ is 1 and so the ideal $I$ will appear as either the first or second composition factor.

```magma
> J := StandardAlternatingForm(6,8);
> L := DerivationAlgebra(J);
> SemisimpleType(L);
C3
> Dimension(Centre(L));
1
> CF := CompositionFactors(L);
> CF;
[
    Lie Algebra of dimension 1 with base ring GF(2^3),
    Lie Algebra of dimension 14 with base ring GF(2^3),
    Lie Algebra of dimension 1 with base ring GF(2^3),
    Lie Algebra of dimension 1 with base ring GF(2^3),
    Lie Algebra of dimension 1 with base ring GF(2^3),
    Lie Algebra of dimension 1 with base ring GF(2^3),
    Lie Algebra of dimension 1 with base ring GF(2^3),
    Lie Algebra of dimension 1 with base ring GF(2^3)
]
> exists(I){I : I in CF | Dimension(I) eq 14 };
true
> IsSimple(I);
true
> SemisimpleType(I);
G2
```

Another way to construct a Lie algebra from an alternating form $\beta$ with matrix $J$ defined on a vector space $V$ of dimension $n$ over a field $F$ is to set $L = V\oplus F$ and define the multiplication by $[e_i,e_j] = \beta(e_i,e_j)$, where $e_1$, $e_2$, …, $e_n$ is a basis for $V$. (All other structure constants are 0.) This is the (generalised) Heisenberg algebra.

<a id="function-heisenbergalgebra-algmatelt"></a>
## `HeisenbergAlgebra(J): AlgMatElt -> AlgLie`

```magma
Rep  : MonStgElt                    Default: "Sparse"
Check: BoolElt                      Default: false
```

The nilpotent Lie algebra whose structure constants are obtained from the alternating form with matrix $J$ as described above. The possible values for `Rep` are `"Dense"`, `"Sparse"`, and `"Partial"` with the default being `"Sparse"`.

<a id="example-ex-aa6842"></a>
## `Example: Heisenberg Algebra of a Form (ex-aa6842)`

Continuing the previous example we construct an explicit isomorphism between the quotient of $L$ by its $G_2$ ideal and the Heisenberg algebra of the form.

```magma
> Q := CS[1];
> W := L/Q;
> W;
Lie Algebra of dimension 7 with base ring GF(2^3)
> Z := Centre(W);
> z := Z.1;
> exists(u1,v1){ <u,v> : u,v in W | u*v ne 0 and u*v eq z };
true
> W1 := Centraliser(W,sub<W|u1,v1>);
true
> exists(u2,v2){ <u,v> : u,v in W1 | u*v ne 0 and u*v eq z };
true
> W2:= Centraliser(W1,sub<W1|u2,v2>);
> exists(u3,v3){ <u,v> : u,v in W2 | u*v ne 0 and u*v eq z };
> H := HeisenbergAlgebra(J);
> f := hom< H -> W | u1,u2,u3,v3,v2,v1,z >;
> forall{ <u,v> : u,v in Basis(H) | f(u*v) eq f(u)*f(v) };
true
> Kernel(f);
Lie Algebra of dimension 0 with base ring GF(2^3)
> Image(f) eq W;
true
```
