What is the connection between geometry of physical space and Hilbert space? In Quantum Mechanis (QM), the dynamical variables are the (quantized) coordinates $x_j$ and their canonical conjugate $p_j = -i\partial_j$  with the commutation relation $[x_j,p_k]=i\delta_{jk}$ acting as operators on the quantum state space. 
What exactly happens to that state space when we change the underlying geometry or topology of "physical" space - the (spacetime) manifold that serves as the background for the quantum system? How does this change in geometry/topology reflect on the Hilbert space?
In Quantum Field Theory (QFT), the dynamical objects are the (quantized) fields $\phi (x^\mu)$ and the coordinates $x_i$ are demoted to mere labels. What happens in this case? How does a change in geometry/topology alter the resulting Fock space?
I am new to this area, so what I need would be a basic explanation (for QM and QFT) how to make the connection between the two concepts geometry/topology of physical space and resulting properties of the quantum state space - if such a wish makes sense at all.
 A: OP comments as an example of what the question is about:

Let us consider the case of an electron confined to a curved surface. Does the geometry of the background have any consequences for the state space?

A simple answer can be given for ordinary QM: A (scalar, i.e. spin-0) particle moving in one-dimension has state space $L^2(\mathbb{R})$, a particle in three dimensions has state space $L^2(\mathbb{R}^3)$. The state space of a particle moving on a submanifold $\mathcal{M} \subset \mathbb{R}^3$, e.g. a particle moving on any smooth surface, is then by analogy simply $L^2(\mathcal{M})$ i.e. the functions whose square-integral over $\mathcal{M}$ exists.
Note that Fourier (i.e. relating the position and momentum representations) transforms on manifolds that are not $\mathbb{R}^n$ are somewhat complicated, cf. this math.SE post.
A: Comments to the question (v3):


*

*The possible quantum states depend on the topology of spacetime. For instance, the momentum in the extra (fifth) direction of a 5-dimensional Kaluza-Klein theory is quantized/discrete variable if the extra (fifth) dimension is a compact circle $S^1$, but a continuous variable if the extra (fifth) dimension instead is a non-compact real line $\mathbb{R}$. 

*Given a classical system with certain geometric data, say, a Hamiltonian system defined on a symplectic manifold $(M,\omega)$, it is a huge research area in physics to try to device a general recipe of how to quantize the theory, and determine the corresponding Hilbert space of physical states and observables. See e.g. the topic of geometric quantization, cf. Refs. 1-3.
References:


*

*Wikipedia.

*nLab.

*John Baez.
