Phase portrait of a gradient system on a torus 
Let $T$ be the torus defined as the square $0\leq \theta_1, \theta_2\leq 2\pi$ with opposite sides identified. Let $F(\theta_1,\theta_2)=\cos\theta_1+\cos\theta_2$. Sketch the phase portrait for the system $-\text{grad}\, F$ in $T$. Sketch a three-dimensional representation of this phase portrait with $T$ represented as the surface of a doughnut.

I understand that the $-\text{grad}(F) = (\sin(\theta_1), \sin(\theta_2))$, but I'm very confused on how the torus is defined here.  Why is a doughnut defined as a square?  
I'm guessing in essence that we can find $\theta'_1$ and $\theta'_2$ and apply the domain to it, but the confusion on $T$ leaves me stuck?
 A: It's called flat torus. Here is the animation from Wikipedia page about torus, that shows how you can map points of a square with identical sides to a torus surface in 3D.

A: To continue the answered of  Vasily Mitch, the torus is homeomorphic to
$ S^1\times S^1 $, where $S^1$ is the circle.
Thus, if we consider the square $0\leq\theta_1,\theta_2\leq 2\pi$, the top boundary $\theta_2=2\pi$ and the bottom one $\theta_2=0$ should be consider the same. In a completely analogous way, the left and right boundaries $\theta_1=0$ and $\theta_2=2\pi$ are supposed to be consider the same.
Take for example, the following vector field on a $T^2$ torus,
\begin{align}\theta_1'&=1\\\theta_2'&=\omega,\quad \omega\in\mathbb{R}\backslash\mathbb{Q}\end{align}
then you going to have something of this form, where the line represents the vectors field and they have slope $\omega$.. Note that this phase portrait is an approximation, because the solution $(\theta_1(t),\theta_2(t))$ fills $T^2$ densely.
In your exercise,
\begin{align}
\theta_1'&=\sin\theta_1\\
\theta_2'&=\sin\theta_2
\end{align}
with the following phase portrait in the square $0\leq\theta_1,\theta_2\leq 2\pi$, found by means of nullclines. Thus we have 4 equilibrium points: 1 sink, 2 saddle and 1 source. From this you can easily found the 3 dimensional phase portrait.
