The Quantum Theory of Nonlinear Optics