Because of the isotropic energy band structure of the Γ electrons in the GaAs/AlGaAs quantum well infrared photodetector (QWIP), normal incident radiation absorption is forbidden, so that the optimization of optical grating becomes a key technology. In this work we present a scattering-matrix method based on plane-wave expansion for the two-dimensional QWIP grating. The transmission spectrum of the QWIP grating has been studied theoretically and experimentally. It has been shown that in general, both the propagating wave and the evanescent wave contribute to the optical coupling in n-type QWIP. The grating parameters, like period, depth and filling factor, will strongly affect the optical coupling.