First, consider $M$ to be a compact connected Riemannian smooth manifold, we say that a map $f: M \rightarrow S^1 $ is harmonic if the pullback 1-form $f^*(d\theta)$ is harmonic in the hodge laplacian sense, i.e. $d\omega=0, d^*\omega=0$.
With this setting, how do we see the following isomorphism?
$$\{\text{harmonic maps} f :M \rightarrow S^1\}=S^1 \rtimes H^1(M,\mathbb{Z})$$