---
title: "Constructing and Accessing Braid Groups"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/BraidGroups/braid-groups-construction.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/BraidGroups/braid-groups-construction.md"
part: "Finitely Presented Groups"
chapter: "Braid Groups"
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": "Braid Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/BraidGroups/index-braid-groups.md"}
prev: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/BraidGroups/braid-groups-introduction.md"}
next: {"title": "Creating Elements of a Braid Group", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/BraidGroups/braid-groups-element-creation.md"}
intrinsics:
  - {"name": "BraidGroup", "signature": "BraidGroup(n: parameters): RngIntElt -> GrpBrd"}
  - {"name": "BraidGroup", "signature": "BraidGroup(GrpBrd, n: parameters): Cat, RngIntElt -> GrpBrd"}
  - {"name": "GetPresentation", "signature": "GetPresentation(B): GrpBrd -> MonStgElt"}
  - {"name": "SetPresentation", "signature": "SetPresentation(~B, s): GrpBrd, MonStgElt"}
  - {"name": "GetForceCFP", "signature": "GetForceCFP(B): GrpBrd -> BoolElt"}
  - {"name": "SetForceCFP", "signature": "SetForceCFP(~B, b): GrpBrd, BoolElt"}
  - {"name": "GetElementPrintFormat", "signature": "GetElementPrintFormat(B): GrpBrd -> MonStgElt"}
  - {"name": "SetElementPrintFormat", "signature": "SetElementPrintFormat(~B, s): GrpBrd, MonStgElt"}
  - {"name": "NumberOfStrings", "signature": "NumberOfStrings(B): GrpBrd -> RngIntElt"}
  - {"name": "NumberOfGenerators", "signature": "NumberOfGenerators(B): GrpBrd -> RngIntElt"}
  - {"name": "Ngens", "signature": "Ngens(B): GrpBrd -> RngIntElt"}
---

<a id="braid-groups-construction"></a>
<a id="grpbrd-sectconstruct"></a>
# Constructing and Accessing Braid Groups

This section describes the facilities for creating a braid group and for accessing and changing its basic properties.

<a id="function-grpbrd-braidgroup"></a>
## `BraidGroup(n: parameters): RngIntElt -> GrpBrd`

<a id="function-braidgroup-cat-rngintelt"></a>
## `BraidGroup(GrpBrd, n: parameters): Cat, RngIntElt -> GrpBrd`

```magma
Presentation: MonStgElt                    Default: "Artin"
```

Given a small integer $n>0$, return the braid group on $n$ strings, that is, $n-1$ Artin generators.

The presentation can be selected using the parameter `Presentation`. Possible values for this parameter are `"Artin"` (default) and `"BKL"`.

<a id="function-grpbrd-getpresentation"></a>
## `GetPresentation(B): GrpBrd -> MonStgElt`

Returns a string $s$, either `"Artin"` or `"BKL"`, indicating the presentation currently used for $B$.

<a id="procedure-grpbrd-setpresentation"></a>
## `SetPresentation(~B, s): GrpBrd, MonStgElt`

Set the presentation used for $B$ to the presentation indicated by $s$. Possible values for $s$ are `"Artin"` and `"BKL"`.

<a id="function-grpbrd-getforcecfp"></a>
## `GetForceCFP(B): GrpBrd -> BoolElt`

Returns whether arithmetic operations with elements of $B$ are always done using representations of the elements as products of simple elements.

<a id="procedure-grpbrd-setforcecfp"></a>
## `SetForceCFP(~B, b): GrpBrd, BoolElt`

By default, arithmetic operations with elements of $B$ are always done using representations of the elements as products of simple elements. If necessary, such representations are computed. Experienced users can turn this feature off for a braid group $B$ using the procedure `SetForceCFP` with $b$ set to `false`.

<a id="function-grpbrd-getelementprintformat"></a>
## `GetElementPrintFormat(B): GrpBrd -> MonStgElt`

Returns a string $s$ indicating the format currently used for printing elements of $B$. $s$ is one of `"Word"`, `"CFP"`, or `"Both"`.

<a id="procedure-grpbrd-setelementprintformat"></a>
## `SetElementPrintFormat(~B, s): GrpBrd, MonStgElt`

When printing an element of a braid group $B$, by default both the representation as word in the generators and the representation as product of simple elements in the presentation selected for $B$ are printed. Experienced users can use the procedure `SetElementPrintFormat` for changing the print format. Possible values for $s$ are `"Word"`, `"CFP"`, and `"Both"`.

<a id="function-numberofstrings-grpbrd"></a>
## `NumberOfStrings(B): GrpBrd -> RngIntElt`

Given a braid group $B$, return the number of strings on which $B$ is defined.

<a id="function-numberofgenerators-grpbrd"></a>
## `NumberOfGenerators(B): GrpBrd -> RngIntElt`

<a id="function-ngens-grpbrd"></a>
## `Ngens(B): GrpBrd -> RngIntElt`

Given a braid group $B$, return the number of Artin generators of $B$. Note that the number of Artin generators is returned regardless of the presentation selected for $B$.
