$S^1$-valued function on $T^n$ Let $f:T^n\to S^1$ be a smooth function on the $n$-torus $T^n=S^1\times \cdots \times S^1$. The differential $df$ can be viewed as a closed 1-form on $T^n$ (not exact).
Moreover, it should give a nonzero cohomology class $[df]$ in $H^1(T^n;\mathbb Z)$ in $\mathbb Z$-coefficients. Concerning the natural isomorphism $H^1(T^n;\mathbb Z)\cong \mathrm{Hom}(\pi_1(T^n),\mathbb Z)$, this should mean the map sending a loop $\sigma$ in $T^n$ to the integer $\mathrm{deg}(f\circ \sigma)$. (Note that $f\circ \sigma: S^1\to S^1$)
I believe all these are standard, but I fail to find a reference or write down enough details to convince myself. Could you help me to make this clear? Or, maybe I was mistaken somewhere?
 A: $\mathbb{R}$ and $S^1$ have isomorphic lie algebras thus we can identify forms with values in $TS^1$ with forms with values in $\mathbb{R}$ as follows. We take angle functions
$$\theta_{\alpha}: U_{\alpha}\subsetneq S^1 \to \mathbb{R}$$ given by $e^{i2\pi \theta}\mapsto \theta$. Those maps gives $S^1$ a smooth chart. We note that $\theta_\alpha \circ f$ is in general not globally well defined on $T^n$, we can patch together a global 1-form defined locally on $f^{-1}(U_\beta)$ by $d(\theta_\beta \circ f)$ by noticing that $d\theta_{\alpha}$ and $d\theta_\beta$ agree on $U_\beta \cap U_\alpha$ and do not depend on the branch of the logarithm we choose. This is definitely a closed 1 from as it is defined locally as the exterior derivative of a smooth function.
Let $[df] \in H_{dr}^1(T^n,\mathbb{R})$ be the class represented by the 1-form above. We have a natural inclusion of the chain complex that defines $H^1(T^n,\mathbb{Z})$ in the chain complex that defines $H^1(T^n,\mathbb{R})$ using the inclusion of $\mathbb{Z}\hookrightarrow  \mathbb{R}$. We will use de-rham isomorphism to identify $[df] $ with an element of $H^1(T^n,\mathbb{R})$. Recall that the isomorphism is given by
$[df]\mapsto (\sigma \mapsto \int_{\sigma}df)$. We can further identify $[df]$  with an element of $H^1(T^n,\mathbb{Z})$. In order to see this, we take a smooth chain $\sigma:[0,1] \to T^n$ representing one of the generators of $H_1(T^n,\mathbb{Z})$. We will now compute
$$\int_{\sigma}df$$
and show that its an integer. We note that $f \circ \sigma:[0,1] \to S^1$ is a map from a simply connected domain. Hence we can lift it $\widetilde{f \circ \sigma}:[0,1]\to \mathbb{R}$ to a map that satisfy
$$e^{i2\pi \widetilde{f \circ \sigma}}= f\circ \sigma.$$
We deduce that
$$\int_{\sigma}df=\int_0^1 d\widetilde{f \circ \sigma}=\widetilde{f \circ \sigma}(1)-\widetilde{f \circ \sigma}(0).$$
As $\sigma$ is closed we have $\sigma(0)=\sigma(1)$. Thus we have
$$e^{i2\pi \widetilde{f \circ \sigma(1)}}=e^{i2\pi \widetilde{f \circ \sigma(0)}},$$ and this implies that $\widetilde{f \circ \sigma}(1)-\widetilde{f \circ \sigma}(0)\in \mathbb{Z}$. If you have some experience with complex analysis you have probably noticed that
$$\int_{\sigma}df=\frac{1}{i2\pi}\int_{0}^1d \ln(f \circ \sigma)$$
which is the winding number of $f \circ \sigma$ and this is the missing connection with degree theory.
