Text this: The study of optical gain for terahertz quantum cascade laser using density matrix method