Quantum theory of optical pulse propagation through an absorbing and dispersive slab