I hope it is ok to advertize some GAP code on this site.

Let G be a finite group and let

R_*: ... --> R_4 --> R_3 --> R_2 --> R_1 --> R_0

be a free ZG-resolution of Z.

A 3-cocycle with coefficients in U(1) is a ZG-linear homomorpism f:R_3 --> U(1) such that the composite R_4 --> R_3 --> U(1) is trivial. Using the Universal Coefficient Theorem I think we can represent such a ZG-linear homomorphism by a ZG-linear homomorphism f:R_3 --> Z/mZ where m is the exponent of the third homology H_3(G,Z).

Let's agree to call the cocycle f:R_3 --> Z/m a "standard cocycle" in the case where the resolution R_* is the standard bar resolution. A standard cocycle can then be thought of as a function F:GxGxG --> Z/mZ .

If we have a resolution R_*, endowed with a contracting homotopy, then we can (in principle) construct a standard cocycle for each cohomology class.

---------------------
EXAMPLE

As an example, let's construct a fairly random cocycle f:R_3 --> Z/mZ for the symmetric group G=S_5 with coefficients in U(1). We use a small resolution R.

gap> G:=SymmetricGroup(5);;
gap> m:=Lcm(GroupHomology(G,3));
12
gap> R:=ResolutionFiniteGroup(G,4);;
gap> M:=CocycleCondition(R,3);;
gap> CocycleBasisMod4:=NullspaceModQ(TransposedMat(M),4);;
gap> CocycleBasisMod3:=NullspaceModQ(TransposedMat(M),3);;
gap> f:=(Random(CocycleBasisMod4) + Random(CocycleBasisMod3)) 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:GxGxG --> Z/12Z.

gap> F:=StandardCocycle(R,f,3,12);


And now let's evaluate F(g,h,k) for three random elements of S_5.

gap> g:=Random(G); h:=Random(G); k:=Random(G);
(2,4)(3,5)
(1,3)(2,4,5)
(1,5,2,4)

gap> F(g,h,k);
7

END OF EXAMPLE