  The origin and fate of magnetars (young, extremely magnetized neutron stars,
NSs) remain unsolved. Probing their evolution is therefore crucial for
investigating possible links to other species of isolated NSs, such as the
X-ray dim NSs (XDINSs) and rotating radio transients (RRATs). Here we
investigate the spin evolution of magnetars. Two avenues of evolution are
considered: one with exponentially decaying B-fields, the other with sub- and
super-exponential decay. Using Monte Carlo methods, we synthesize magnetar
populations using different input distributions and physical parameters, such
as for the initial spin period, its time derivative and the B-field decay
timescale. Additionally, we introduce a fade-away procedure that can account
for the fading of old magnetars, and we briefly discuss the effect of alignment
of the B-field and spin axes. Imposing the Galactic core-collapse supernova
rate of ~20 kyr^-1 as a strict upper limit on the magnetar birthrate and
comparing the synthetic populations to the observed one using both manual and
automatic optimization algorithms for our input parameter study, we find that
the B-field must decay exponentially or super-exponentially with a
characteristic decay timescale of 0.5-10 kyr (with a best value of ~4 kyr). In
addition, the initial spin period must be less than 2 sec. If these constraints
are kept, we conclude that there are multiple choices of input physics that can
reproduce the observed magnetar population reasonably well. We also conclude
that magnetars may well be evolutionary linked to the population of XDINSs,
whereas they are in general unlikely to evolve into RRATs.
