Position operator in QFT My Professor in QFT did a move which I cannot follow:
Given the state $$\hat\phi|0\rangle = \int \frac{d^3p}{(2\pi)^3 2 E_p}  a^\dagger_p e^{- i p_\mu x^\mu}|0\rangle,$$ he wanted to show that this state is an eigenstate of the position operator. Therefore he applied the position operator in the momentum representation which is $$\hat X^\mu = i\frac{\partial}{\partial p_\mu}.$$
Then a miracle for me appears as he interchanges the derivative and the integral hat hence gets $$\hat X^\mu \hat\phi|0\rangle= \hat X^\mu  \int \frac{d^3p}{(2\pi)^3 2 E_p}  a^\dagger_p e^{- i p_\mu x^\mu} = i \frac{\partial}{\partial p_\mu}\int \frac{d^3p}{(2\pi)^3 2 E_p}  a^\dagger_p e^{- i p_\mu x^\mu} = x^\mu \hat \phi |0\rangle.$$
I cannot see why he is allowed to interchange the integral and the derivative.
 A: Here is the answer (I will not consider the constants on the denominator of your Fourier transform for simplicity, however they are there ;-) ). When you write the operator $\hat{\phi}$ you have to be careful. I will drop the hats, because it will be clearer I think (maybe here the hat stands for an operator and not for the fourier transform). Your operator is not in the momentum representation, since you have the integration over $p$. That operator depends on $x$, and can be written as $\phi(x)$.
Denote the fourier transform by $\mathscr{F}$. It is a unitary transformation on $L^2$, so when acting on an operator $A$ of that space it is often written as $\mathscr{F}A\mathscr{F}^{-1}$. Because, by unitarity, $$\langle\psi_1, A\psi_2\rangle=\langle\mathscr{F}\psi_1,\mathscr{F}A\psi_2\rangle=\langle \mathscr{F}\psi_1,(\mathscr{F}A\mathscr{F}^{-1})\mathscr{F}\psi_2\rangle\; .$$
Thus the correct writing is that the position operator in the fourier transform representation is the derivative w.r.t. $p$:
$$\mathscr{F}X^\mu\mathscr{F}^{-1}=+i\partial/\partial p_\mu\; .$$
In the same spirit, your operator $\phi(x)$ becomes in the Fourier transform, and acting on the vacuum (to follow your notation, the momentum vacuum $\lvert 0\rangle=\mathscr{F}\lvert 0_x\rangle$, while $\lvert 0_x\rangle$ is the position vacuum):
$$\mathscr{F}\phi(x)\lvert 0_x\rangle=a^{\dagger}_p\lvert 0\rangle\; .$$
Therefore: 
$$X_\mu\phi(x)\lvert0_x\rangle= \mathscr{F}^{-1}(\mathscr{F}X_\mu\mathscr{F}^{-1})(\mathscr{F}\phi(x)\mathscr{F}^{-1})\lvert 0\rangle=i\mathscr{F}^{-1}\frac{\partial}{\partial p_\mu}a^\dagger_p \lvert 0\rangle\\=i\int dp \,e^{ip_\nu x^\nu}\frac{\partial}{\partial p_\mu}a^\dagger_p \lvert 0\rangle\; .$$
Now if you "integrate by parts" on the last term (in the sense of distributions) you get:
$$X_\mu\phi(x)\lvert0_x\rangle=-i\int \, dp \Bigl(\frac{\partial}{\partial p_\mu}e^{ip_\nu x^\nu}\Bigr)a^\dagger_p\lvert 0\rangle = x^\mu \phi(x)\lvert 0_x\rangle\; .$$
A: This issue is a bit confused in textbooks, however the statement of the professor is physically wrong (mathematically all the procedure can be rigorously justified using the theory of distributions). The point is that the claimed position operator is not the position operator because it is not even self-adjoint (nor Hermitian) in the relevant Hilbert space of the theory. Actually I will not enter into the details and I just show the basic problem affecting these (quite popular unfortunately) ideas. 
Let us start from scratch. If, taking advantage of the Lorentz invariant measure $\frac{d\vec{p}}{E(\vec{p})}$, you decide to write the field operator as 
$$\hat{\phi}(x) = \int_{\mathbb R^3} \frac{d\vec{p}}{2E(\vec{p})} a_p e^{ip_\mu x^\mu} +  a^\dagger_p e^{-ip_\mu x^\mu} \:,$$
where $\vec{p} \in \mathbb R^3$ is the three momentum while $p_0 := E(\vec{p}) = \sqrt{\vec{p}^2+m^2}$,
you see that the commutation relations $$[\hat{\phi}(t,\vec{x}), \partial_0 \hat{\phi}(t,\vec{y})] = i \delta(\vec{x}-\vec{y})$$ are possible if and only if (I omit some $(2\pi)^a$ coefficient) 
$$[a_p,a^\dagger_q]= 2E(\vec{p}) \delta(\vec{p}-\vec{q})\:.$$ 
This means that the relevant momentum representation is not $L^2(\mathbb R^3, d\vec{p})$ but is its Lorentz-invariant version $$L^2\left(\mathbb R^3, \frac{d\vec{p}}{2E(\vec{p})}\right)$$
I mean that the amplitude of two momentum wavefunctions $\psi= \psi(\vec{p})$ and $\psi'= \psi'(\vec{p})$ is:
$$\langle \psi'|\psi\rangle = \int_{\mathbb R^3} \frac{d\vec{p}}{2E(\vec{p})} \overline{\psi'(\vec{p})} \psi(\vec{p})\:.$$
With this choice of the momentum representation the operator $i\frac{\partial}{\partial p_k}$ is not Hermitian because of the presence of the factor 
$E(\vec{p})^{-1}$ giving rise to an obstruction for the integration by parts procedure, when trying to move $X_k$ from one side to the other side of the scalar product in order to prove that $\langle \psi'|X_k\psi\rangle=\langle X_k\psi'|\psi\rangle$ (wrong).
Indeed, the position operator along the spatial direction $x_k$  is defined by the Hermitian operator
$$\left(X_k \psi\right)(\vec{p}) = iE(\vec{p})\frac{\partial }{\partial p_k} \frac{1}{E(\vec{p})}\psi = i\left(\frac{\partial }{\partial p_k} - \frac{1}{E(\vec{p})}\frac{\partial E(\vec{p})}{\partial p_k}\right) \psi$$
that is
$$\left(X_k \psi\right)(\vec{p}) = i\left(\frac{\partial }{\partial p_k} - \frac{p_k}{E(\vec{p})^2}\right) \psi(\vec{p}) \tag{1}$$
This is the so-called Newton-Wigner  position operator in momentum representation for a relativistic scalar field which is believed to be the right definition of position operator in relativistic quantum mechanics, if such a notion makes still sense in relativistic quantum mechanics. With this definition, it is possible to show that a position localized state $\psi_{x_0}$ when read in field representation $${\phi}(\vec{x}) = \int_{\mathbb R^3} \frac{d\vec{p}}{2E(\vec{p})} \psi_{x_0}(\vec{p}) e^{i\vec{p}\cdot\vec{x}}$$
gives rise to a field configuration concentrated around $x_0$ in a region with the dimensions of the Compton length of the particle. 
It is clear that, with this (correct) definition of momentum operator, the claim of the professor is wrong because the extra term in the right hand side of (1) does not permit to achieve the (wrong) identity. $\hat{X}^k \hat{\phi}|0\rangle = x^k\hat{\phi}|0\rangle $
 The general claim is also untenable because the component $\hat{X}^0$ should be interpreted as a "time operator" which as it known does not exist (Pauli's theorem).
