Analog of the Franck?Condon principle for a heterojunction laser inhomogeneous over its length