An algorithm to solve the Gross-Pitaevskii equation.