Quantum dot nonlinearity through cavity-enhanced feedback with a charge memory