---
title: "Cohomology"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/cohomology.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/cohomology.md"
part: "Finitely Presented Groups"
chapter: "Abelian 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": "Abelian Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/index-abelian-groups.md"}
prev: {"title": "Automorphism Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/autgp.md"}
next: {"title": "Homomorphisms", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/AbelianGroups/homomorphisms.md"}
intrinsics:
  - {"name": "Dual", "signature": "Dual(G): GrpAb -> GrpAb, Map"}
  - {"name": "H2_G_QmodZ", "signature": "H2_G_QmodZ(G): GrpAb -> GrpAb, Map"}
  - {"name": "Res_H2_G_QmodZ", "signature": "Res_H2_G_QmodZ(U, H2): GrpAb, GrpAb -> GrpAb, Map"}
---

# Cohomology

<a id="function-dual-grpab"></a>
## `Dual(G): GrpAb -> GrpAb, Map`

Computes the dual group $G^*$ of $G$ and a map $M$ from $G\times G^* \to {\mathbb{Z}}/m{\mathbb{Z}}$ for $m$ the exponent of $G$ that allows $G^*$ to act on $G$. The group $G$ must be finite.

<a id="function-h2-g-qmodz-grpab"></a>
## `H2_G_QmodZ(G): GrpAb -> GrpAb, Map`

Computes $H := H^2(G, {\mathbb{Q}}/{\mathbb{Z}})$ and a map $f : H \to (G\times G \to {\mathbb{Z}}/m{\mathbb{Z}})$ that will give the cocycles as maps from $G\times G \to {\mathbb{Z}}/m{\mathbb{Z}}$, $m := \#G$.

<a id="function-res-h2-g-qmodz-grpab-grpab"></a>
## `Res_H2_G_QmodZ(U, H2): GrpAb, GrpAb -> GrpAb, Map`

For a subgroup $U$ of $G$ and $H2 = H^2(G, {\mathbb{Q}}/{\mathbb{Z}})$ computes $H^2(U, {\mathbb{Q}}/{\mathbb{Z}})$ in a compatible way together with the restriction map into $H2$.

The abelian group $H2$ must be the result of `H2_G_QmodZ` as this function relies on the attributes stored in there.
