---
title: "Arithmetic with Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/operation.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/operation.md"
part: "Finitely Presented Groups"
chapter: "Groups of Straight-Line Programs"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Finitely Presented Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/index-finitely-presented-groups.md"}
  - {"title": "Groups of Straight-Line Programs", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/index-groups-of-straight-line-programs.md"}
prev: {"title": "Construction of an SLP-Group and its Elements", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/creation.md"}
next: {"title": "Addition of Extra Generators", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/extra-generators.md"}
intrinsics:
  - {"name": "*", "signature": "u * v: GrpSLPElt, GrpSLPElt -> GrpSLPElt"}
  - {"name": "^", "signature": "u ^ m: GrpSLPElt, RngIntElt -> GrpSLPElt"}
  - {"name": "^", "signature": "u ^ v: GrpSLPElt, GrpSLPElt -> GrpSLPElt"}
  - {"name": "#", "signature": "# u: GrpSLPElt -> RngIntElt"}
  - {"name": ".", "signature": "G . i: GrpSLP, RngIntElt -> GrpSLPElt"}
  - {"name": "Generators", "signature": "Generators(G): GrpSLP -> { GrpSLPElt}"}
  - {"name": "NumberOfGenerators", "signature": "NumberOfGenerators(G): GrpSLP -> RngIntElt"}
  - {"name": "Ngens", "signature": "Ngens(G): GrpSLP -> RngIntElt"}
  - {"name": "Parent", "signature": "Parent(u): GrpSLPElt -> GrpSLP"}
---

# Arithmetic with Elements

<a id="operation-op-times-grpslpelt-grpslpelt"></a>
## `u * v: GrpSLPElt, GrpSLPElt -> GrpSLPElt`

Given straight-line programs $u = [u_1, \ldots, u_m]$ and $v = [v_1, \ldots, v_n]$ belonging to the same SLP-group $G$, return a straight-line program corresponding to the product of $u$ and $v$. It is clear that the straight-line program $[u_1, \ldots, u_m, v_1, \ldots, v_n, u_m v_n]$ satisfies the formal definition. In practice, the $u_i$ and $v_i$ need not be distinct, so the resulting program may be shorter.

<a id="operation-op-pow-grpslpelt-rngintelt"></a>
## `u ^ m: GrpSLPElt, RngIntElt -> GrpSLPElt`

Given an integer $m$ and a straight-line program $u$, return the straight-line program corresponding to the $m$-th power of $u$.

<a id="operation-op-pow-grpslpelt-grpslpelt"></a>
## `u ^ v: GrpSLPElt, GrpSLPElt -> GrpSLPElt`

Given straight-line programs $u$ and $v$, return the straight-line program corresponding to the conjugate of $u$ by $v$.

<a id="operation-operation-grpslpelt-rngintelt"></a>
## `# u: GrpSLPElt -> RngIntElt`

Given a straight-line program $u$, return the number of multiplication, power, or conjugate operations required to evaluate a homomorphism on $u$.

## Accessing the Defining Generators and Relations

The functions described here provide access to basic information stored for an SLP-group $G$.

<a id="operation-operation-grpslp-rngintelt-grpslpelt"></a>
### `G . i: GrpSLP, RngIntElt -> GrpSLPElt`

The $i$-th generator for $G$.

<a id="function-generators-grpslp"></a>
### `Generators(G): GrpSLP -> { GrpSLPElt}`

A set containing the generators for $G$.

<a id="function-numberofgenerators-grpslp"></a>
### `NumberOfGenerators(G): GrpSLP -> RngIntElt`

<a id="function-ngens-grpslp"></a>
### `Ngens(G): GrpSLP -> RngIntElt`

The number of generators for $B$.

<a id="function-parent-grpslpelt"></a>
### `Parent(u): GrpSLPElt -> GrpSLP`

The parent group $G$ of the straight-line program $u$.
