Is $\phi_n =\left\langle \vec r | n \right\rangle $ the photon wave function? I am a bit confused about this issue and I am still not clear whether is there is a photon wave function or not. Since we use Fock states $| n \rangle$ to represent the state of a quantized monochromatic field with $n$ photons then I guess that if I project this onto the position basis ($\left\langle \vec r | n \right\rangle $) I would obtain its wave function $\phi_n$ (which will have the form of the eigenfunctions of the harmonic oscillator). Is that correct?
 A: Strictly speaking a photon cannot be localized and the single particle "wavefunction" (as well as it's corresponding position operator $\hat{r}$) only exists in an approximate sense.
The reason for this is quantum electrodynamics (QED), which is the theory that contains photons, is a quantum field theory (QFT) rather than the (non-relativistic) quantum theory you are familiar with. This means that the corresponding classical quantity described is a field rather than a particle and the states are wave functionals rather than wave-functions.
As an example of what this difference means (function vs functional):
In the latter, quantum particle case, classical dynamic quantities like position become operators ($r\to\hat r$), and any state can be described in terms of the eigenstates of this operator i.e.
$$\hat r\left|\psi\right> \to \psi(r).$$
For a quantum field theory the dynamic quantities are fields, and these are what become operators. So a classical field $\psi(r)\to\hat\psi(r)$ and if you have any quantum field state $\left|\Psi\right >$ can be described by the eigenstates of $\hat\psi(r)$ (which are field configurations), i.e.
$$\hat \psi(r)\left|\Psi\right> \to \Psi(\psi(r)).$$
Notice that the object $\Psi(*)$ takes a function rather than a variable (which is what is meant by functional).
The reason I used $\hat\psi$ rather than a more obviously classical variable (such as $\hat E$ for electric field operator) is because at high energies even "particles" (like electrons) need to be described using the QFT language, and in a sense the non-relativistic quantum wavefunctions become the classical "fields" that are used. This is why QFT is sometimes called "second quantization."
A: The formal analogy between a mode of the radiation field and a particle in a harmonic potential stems from the fact that both systems have the Hamiltonian (in appropriate units)
$$ H =  \frac{1}{2}P^2 + \frac{1}{2}\omega^2 X^2,$$
where the variables $X$ and $P$ obey canonical commutation relations $[X,P] = \mathrm{i}\hbar$. For the radiation field, these variables represent the field quadratures, i.e. the amplitude of the electric and magnetic fields. So the wavefunction $\langle x | n\rangle$ actually represents the probability amplitude of the electric field taking the value $x$.
