Quantum field theory: field operators in terms of creation/annihilation operators I am learning Quantum Field Theory and there is a step in my notes that I do not really understand.
It starts with the classical definitions of position $q$ and momentum $p$: $$ q = \frac{1}{\sqrt{2\omega}}(a+a^{\dagger}) $$ and  $$ p = -i\sqrt{\frac{\omega}{2}}(a-a^{\dagger}). $$ 
$a$ and $a^{\dagger}$ being the annihilation and creation operators.
Then, it defines the field operators $\phi(\mathbf{x})$ and $\pi(\mathbf{x})$, equivalent to $q$ and $p$, in the following way:
$$ \phi(\mathbf{x}) = \int \frac{d^3p}{(2\pi)^3}\frac{1}{\sqrt{2\omega_{\mathbf{p}}}}[a_{\mathbf{p}}e^{i\mathbf{p}\cdot{\mathbf{x}}} + a_{\mathbf{p}}^{\dagger}e^{-i\mathbf{p}\cdot{\mathbf{x}}}]$$
and 
$$ \pi(\mathbf{x}) = \int \frac{d^3p}{(2\pi)^3}(-i)\sqrt{\frac{\omega_{\mathbf{p}}}{2}}[a_{\mathbf{p}}e^{i\mathbf{p}\cdot{\mathbf{x}}} - a_{\mathbf{p}}^{\dagger}e^{-i\mathbf{p}\cdot{\mathbf{x}}}].$$
Is there an obvious relation between the two expressions?
What mathematical and physical assumptions have been made?
 A: It seems there is a mistake in your $\pi (x)$ expression: there must be one minus sign near $\hat{a}^{\dagger}$. 
The relation between classical and field is obvious since lagrangian (hamiltonian) of free $\varphi $ (it's not hard to see that $\varphi$ satisfies Klein-Gordon equation) field may be rewritten as lagrangian of free ossilator in terms of $\hat{\varphi} , \hat{\pi} = \dot{\hat{\varphi}}$ which have been introduced in your question. The differences between "classical" and field expressions for coordinate and momentum is caused that field in every point can be represented as set of oscillators. This follows from hamiltonian in terms of $\hat{\varphi} , \hat{\pi}$):
$$
L =\frac{1}{2}\left( (\partial_{\mu}\varphi )^{2} - m^{2}\varphi^{2}\right) \Rightarrow \hat{H} = \int T^{00}d^{3}\mathbf r = \int \left(\frac{\partial L}{\partial (\partial_{0}\varphi)}\partial_{0}\varphi - L \right)d^{3}\mathbf r = 
$$
$$
= \frac{1}{2}\int d^{3}\mathbf r \left( m^{2}\varphi^{2} + \pi^{2} + (\nabla \varphi )^{2}\right).
$$
By introducing canonical relations 
$$
[\hat{a}(\mathbf p), \hat{a}^{\dagger}(\mathbf p')] = \delta (\mathbf p - \mathbf p '), \quad [\hat{a}(\mathbf p), \hat{a}(\mathbf p')] = [\hat{a}^{\dagger}(\mathbf p), \hat{a}^{\dagger}(\mathbf p')] = 0
$$
you get full correspondence between "classical" and "field" operators $\hat {x}, \hat{p}$, $\hat{\varphi}, \hat{\pi}$ (up to delta-function $\delta (\mathbf x - \mathbf x ')$):
$$
[\hat{x}_{i}, \hat{p}_{j}] = i\delta_{ij}, \quad [\hat{\varphi} (\mathbf x , t), \hat{\pi}(\mathbf y, t)] = i\delta (\mathbf x - \mathbf y).
$$
