Gain Switching and Active Mode Locking Of Mid-Infrared Quantum Cascade Lasers