Wavefunction "single-valued" vs "up to a phase" ( gauge transformation) Existence of global section in comple line bundle I always meet the following sayings: in one case people say that wavefunction must be single valued, in another case people say that wavefunction could be up to a phase in the same point if there is a gauge transformation. I'm so puzzled about these two sayings. I will list few cases I meet these sayings.
First, consider a free particle in a circle $S^1$ with radius $r$. The Hamitonian is 
$$H=\frac{1}{2mr^2}(-i\hbar \frac{\partial}{\partial \phi})^2$$
Then the eigenfunction is 
$$\psi= \frac{1}{\sqrt{2\pi r}}e^{i n \phi}$$
Because the wavefunction must be single-valued on $S^1$, $n$ must belong to integers, i.e. $n\in\mathbb{Z}$.
Second case, consider a particle in a circle $S^1$ with radius $r$ and put the flux $\Phi$ in the center of the circle. Then the Hamitonian is 
$$H=\frac{1}{2mr^2}(-i\hbar \frac{\partial}{\partial \phi}+\frac{e\Phi}{2\pi})^2$$

The eigenfunction is still 
$$\psi= \frac{1}{\sqrt{2\pi r}}e^{i n \phi}$$
Also because the wavefunction must be single-valued on $S^1$, $n$ must belong to integers, i.e. $n\in\mathbb{Z}$. The only difference is that there will be some shift of eigenvalue.
Third case, consider a particle in a Torus $T^2$, with two length $L_x$ and $L_y$. And we put a uniform magnetic field $B$ through the torus' surface. If we choose the Landau's gauge $A_x = 0$, $A_y= B x$. The Hamitonian is now 
$$H=\frac{1}{2m}(p_x^2 +(p_y+eBx)^2)$$
We know in this case the symmetry of Hamitonian is called magnetic translation group. 
$$T(\mathbf{d})= e^{-i \mathbf{d}\cdot(i\nabla+e \mathbf{A}/\hbar)}$$
that is $[T(\mathbf{d}),H]=0 $
So the eigenfunction $\psi(x,y)$ should be invariant under $T(\mathbf{d})$.
$$T_x \psi(x,y)=\psi(x+L_x,y)=\psi(x,y)$$
$$T_y \psi(x,y)=e^{-ieBL_yx/\hbar}\psi(x,y+L_y)=\psi(x,y)$$
with $T_x =T((L_x,0))$ and $T_y=T((0,L_y))$.
So we see the wavefunction is not single valued in this case,i.e. $\psi(x,y+L_y)\ne \psi(x,y)$.
My question is :
In what case, we admit wavefunction is not single-valued? We see all cases with physical space multiply connected.  Both 2nd and 3rd cases are the system with electromagnetic field/ gauge field, why 1st, 2nd is still single-valued but 3rd not? It seems existence of nontrivial topology of physical space or magnetic field/gauge field is not the answer.
PS: Thanks to @David Bar Moshe, I never realized this question may be related to the global section of complex line bundles.
 A: In quantum mechanics the normalization of the wave function is not important since we compute expectations according to:
$$\langle O \rangle = \frac{\psi^{\dagger} O \psi}{\psi^{\dagger}  \psi}$$
This is the reason that wave functions are identified with sections of complex line bundles. Please see this introduction  for physicists by Orlando Alvarez.
When a line bundle is trivial its space of sections can be formed from true functions, which should be single valued.
The equivalence class of line bundles over a manifold $M$ is called the Picard group $\mathrm{Pic}(M)$. Each element (besides the unity) of this group gives rise to a nonequivalent quantization in which the phase factor cannot be removed by a gauge transformation.
Please see Prieto and Vitolo for a brief explanation.
On differentiable manifolds, the Picard group is isomorphic to the second cohomology group over the integers
$$\mathrm{Pic}(M) \cong H^2(M, \mathbb{Z})$$
This is why it is rarely mentioned in quantum mechanics texts which rather refer the corresponding element from $H^2(M, \mathbb{Z})$  representing the first Chern class.
It should be emphasized:
(1) that even when the Picard group is trivial or the quantization corresponds to a trivial element, we can have multiple valued wave functions, but the multiple valuedness can be removed by a gauge transformation.
(2) The first Chern class is not a sufficient classifier of nonequivalent quantizations. It does not detect effects like the Aharonov-Bohm effect. These are detected by an element of the group  $ \mathrm{Hom}(\pi_1(M), U(1))$, please see for example, Doebner and Tolar.
(3) The relevant manifold $M$ is the phase space. Since the given example are of point particles, whose phase space is the cotangent bundle of a configuration space, the nontrivial topology lies in the configuration space and we can talk about line bundles over the configuration space.
Returning to your examples: The first two describe motion on the circle $S^1$. By dimensional reasoning $H^2(S^1, \mathbb{Z})=0$, thus wave functions can be chosen to be true functions. The second example refers to the case described in the second remark above since $\pi_1(S^1) = \mathbb{Z}$
In the third example  $H^2(T^2, \mathbb{Z})= \mathbb{Z}$,  generated by integer multiples of the basic area element, thus for a nonvanishing magnetic field the wave functions cannot be taken as true functions.
