Inhomogeneous effects in the quantum free electron laser