  A class of periodic solutions of the nonlinear Schrodinger equation with non-
Hermitian potentials are considered. The system may be implemented in planar
nonlinear optical waveguides carrying an appropriate distribution of local gain
and loss, in a combination with a photonic-crystal structure. The complex
potential is built as a solution of the inverse problem, which predicts the
potential supporting required periodic solutions. The main subject of the
analysis is the spectral structure of the linear (in)stability for the
stationary spatially periodic states in the periodic potentials. The stability
and instability bands are calculated by means of the plane-wave-expansion
method, and verified in direct simulations of the perturbed evolution. The
results show that the periodic solutions may be stable against perturbations in
specific Floquet-Bloch bands, even if they are unstable against small random
perturbations.
