Application of the homotopy analysis method for the Gross—Pitaevskii equation with a harmonic trap