  We study the dynamics of one-dimensional solitons in the attractive and
repulsive Bose-Einstein condensates (BECs) loaded into an optical lattice (OL),
which is combined with an external parabolic potential. First, we demonstrate
analytically that, in the repulsive BEC, where the soliton is of the gap type,
its effective mass is \emph{negative}. This gives rise to a prediction for the
experiment: such a soliton cannot be not held by the usual parabolic trap, but
it can be captured (performing harmonic oscillations) by an anti-trapping
inverted parabolic potential. We also study the motion of the soliton a in long
system, concluding that, in the cases of both the positive and negative mass,
it moves freely, provided that its amplitude is below a certain critical value;
above it, the soliton's velocity decreases due to the interaction with the OL.
At a late stage, the damped motion becomes chaotic. We also investigate the
evolution of a two-soliton pulse in the attractive model. The pulse generates a
persistent breather, if its amplitude is not too large; otherwise, fusion into
a single fundamental soliton takes place. Collisions between two solitons
captured in the parabolic trap or anti-trap are considered too. Depending on
their amplitudes and phase difference, the solitons either perform stable
oscillations, colliding indefinitely many times, or merge into a single
soliton. Effects reported in this work for BECs can also be formulated for
optical solitons in nonlinear photonic crystals. In particular, the capture of
the negative-mass soliton in the anti-trap implies that a bright optical
soliton in a self-defocusing medium with a periodic structure of the refractive
index may be stable in an anti-waveguide.
