Chaotic solutions of the nonlinear Schrodinger equation in classical and quantum systems