Design and simulation of terahertz quantum cascade lasers