How does homodyne detection work in quantum optics? Homodyne detection is often cited in publications. I didn't find any good reference that explains what this is. Could you explain the principle and, if possible, the maths of it ?
Moreover, they usually also talk a lot about heralded photon, what does that mean ?
 A: Homodyne detection is the extraction of phase information about a laser by comparing it to a reference beam, referred to as a local oscillator (LO).  This is accomplished by interfering the beams on a beamsplitter and subtracting the intensity of the two output ports.  Intuitively this works because the phase of the LO is known, and we can therefore judge the phase of the other beam from it.
Mathematically, if the electric field of the unknown beam is $E_{u}$ and the field of the LO is $E_{LO}$, then the interference of them on a beamsplitter results in two output fields given by (this assumes a specific beamsplitter phase relation and arrangement of beams, but the result will be the same whatever you choose) [1]:
$$E_{1}=\frac{1}{\sqrt{2}}(E_{LO}+E_{u})$$
$$E_{2}=\frac{1}{\sqrt{2}}(E_{LO}-E_{u})$$
Subtracting the intensities results in, after a lot of assumptions and algebra:
$$N_{-}\propto\int E_{LO}E_{u}\text{d}V\propto|\alpha_{LO}|(\hat{a}e^{-i\theta}+\hat{a}^{\dagger}e^{i\phi})\propto\hat{Q}_{\theta}$$
where $|\alpha_{LO}|^{2}$ is the average photon number in the LO, and $\theta$ is the phase of the LO.  You will notice how similar this operator is to the electric field operator, but at the phase of the LO, and so we intuitively see that this measures the quadrature of the input beam at the phase of the LO.
In practice the local oscillator and the beam to be measured originate from the same laser.  The advantage of this is that fluctuations in the laser itself are cancelled out of the measurement process because both the local oscillator and the beam to be measured will fluctuate together.  
[1] Lvovsky, A. I., & Raymer, M. G. (2009). Continuous-variable optical quantum-state tomography. Reviews of Modern Physics, 81(1), 299. (https://arxiv.org/abs/quant-ph/0511044)
