Theory of propagation and scattering of exciton–polaritons in quantum wells