I hope it isit's ok to advertize some GAP code on this site.
$R_*: \cdots \rightarrow R_4 \rightarrow R_3 \rightarrow R_2 \rightarrow R_1 \rightarrow R_0$$$R_*: \cdots \rightarrow R_4 \rightarrow R_3 \rightarrow R_2 \rightarrow R_1 \rightarrow R_0$$
A 3-cocycle with coefficients in $U(1)$ is a $\mathbb ZG$-linear homomorphism $f\colon R_3 \rightarrow U(1)$$c\colon R_3 \rightarrow U(1)$ such that the composite $R_4 \rightarrow R_3 \rightarrow U(1)$ is trivial. Using the Universal Coefficient Theorem I thinkand the divisibility of $U(1)$ we get isomorphisms $H^3(G,U(1)) \cong Hom(H_3(G,\mathbb Z),U(1)) \cong Hom(H_3(G,\mathbb Z),A)$ where $A$ is the cyclic group generated by an $m$-th root of unity with $m$ the exponent of $H_3(G,\mathbb Z)$. We thus get a surjection $H^3(G,A) \rightarrow H^3(G,U(1))$ with kernel of order $|Ext(H_2(G,\mathbb Z),A)|$. In short, we can represent such athe $\mathbb ZG$-linear homomorphism homomorphism $c$ by a $\mathbb ZG$-linear homomorphism $ f\colon R_3 \rightarrow \mathbb Z/m \mathbb Z$ where$ f\colon R_3 \rightarrow A$. Here $m$$f$ is the exponenta 3-cocycle of $G$ with coefficients in the third homologycyclic group $H_3(G,\mathbb Z$)$A$.
Let's call the cocycle3-cocycle $f\colon R_3 \rightarrow \mathbb Z/m$$f\colon R_3 \rightarrow A$ a "standard cocycle"3-cocycle" in the case where the resolution $R_*$ is the standard bar resolution. A standard cocycle3-cocycle can then be thought of as a function $F\colon G\times G\times G\rightarrow \mathbb Z/m \mathbb Z$$F\colon G\times G\times G\rightarrow A$ .
EXAMPLE
As anThe following example constructs, let's construct a random cocycle $f\colon R_3 \rightarrow \mathbb Z/m\mathbb Z$ for each of the symmetric group96 cohomology classes in $G=S_5$$H^3(S_6,A)$, a representative standard 3-cocycle with coefficients in the cyclic group $U(1)$$A$ of order 12 (since we know that $H_3(S_6,\mathbb Z)$ has exponent 12). We use a small resolutionTo run the example the HAP package $R$ constructed by(v 1.10.1 http://hamilton.nuigalway.ie/Hap/www) needs to be loaded into GAP.
EXAMPLE
gap> G:=SymmetricGroup(56);;
gap> mA:=Lcm=Group(GroupHomology(G11,312,13,14,15,16,17,18,19,20,21,22));
12;;
gap> RA:=ResolutionFiniteGroup=TrivialGModuleAsGOuterGroup(G,4A);; #This is the cyclic group of order 12 encoded as a trivial G-module
gap> MR:=CocycleCondition=ResolutionFiniteGroup(RG,34);;
gap> CocycleBasisMod4C:=NullspaceModQ(TransposedMat=HomToGModule(M)R,4A);;
gap> CocycleBasisMod3CH:=NullspaceModQ(TransposedMat=CohomologyModule(M)C,3);;
gap> fclasses:=(Random=Elements(CocycleBasisMod4) + RandomActedGroup(CocycleBasisMod3CH)) mod 12;
[ 2, 2, 2, 2, 1, 1, 3, 2, 1, 2, 2, 3, 2, 3, 1, 3, 0, 2, 4, 0 ]
Now let's convert f to a standard cocycle $F\colon G\times G\times G \rightarrow \mathbb Z/12\mathbb Z$.;; #This is the list of cohomology classes
gap> F:=StandardCocycleLength(R,f,3,12classes);;; #This gives the number of distinct cohomology classes
And now let's evaluate $F(g,h,k)$ for, say, three random elements $g,h,k \in S_5$.96
gap> g:=Random(G); h:=Random(G); kc:=Random=CH!.representativeCocycle(Gclasses[2]);
(2,4)(3,5)
(1,3)(2,4,5) #This gives a 3-cocycle representing the second cohomology class
(1,5,2,4) Standard 3-cocycle
gap> Ff:=Mapping(g,h,kc);
7;; #A cocycle f:GxGxG-->A corresponding to the second cohomology class