Patent ID: 8835950

Claim:
A semiconductor device, comprising an active layer which comprises a single or multiple quantum well structure having a quantum well having In x1 Ga 1-x1 N (0<x≦1) and a barrier layer having In x2 Ga 1-x2 N (0≦x2<1, x1>x2); a first semiconductor layer which comprises p-type GaN-based compound semiconductor; a first layer having In 1-x-y1 Ga x Al y1 N (0≦x<1, 0<y1≦1), disposed between the active layer and the first semiconductor layer; a second semiconductor layer which comprises p-type GaN-based compound semiconductor, which is disposed either between the active layer and the first layer or between the first layer and the first semiconductor layer; and a second layer having In y2 Ga 1-y2 N (0<y2≦1), disposed between the first semiconductor layer and the active layer, a band gap of the second layer being smaller than those of the first layer, the first semiconductor layer and the second semiconductor layer, a lattice constant of the second layer being larger than those of the first layer, the first semiconductor layer and the second semiconductor layer, the thickness of the second semiconductor being from 1 nm to 15 nm, and the second layer being doped with Mg from 1×10 17 cm −3 to 1×10 19 cm −3 , wherein an In composition ratio of the second layer is higher than those of the first layer, the first semiconductor layer and the second semiconductor layer.