  We develop a robust and efficient method for soliton calculations for
nonlinear Schr\"odinger equations. The method is based on the recently
developed sparsifying preconditioner combined with Newton's iterative method.
The performance of the method is demonstrated by numerical examples of gap
solitons in the context of nonlinear optics.
