Thank you for the excellent question. Magnetism is
a fascinating area of physics, which is complex
and still being studied. The properties of a rare
earth magnet are directly connected to its crystal
structure [1,2]. To illustrate I will use the
neodymium magnet, the general ideas apply to other
rare earth magnets.
In order to flip magnetic spins in a neodymium
magnet, the spin must change direction in the
crystal structure. The crystal creates a very high
energy barrier so the spin cannot flip unless a
very strong magnetic field is applied.
Coercitivity of a magnet is the strength of
magnetic field needed to demagnetize the magnet.
It is measured in Oersteds (Oe). The
coercitivity of neodymium magnets depends on the
quality and structure of the crystal. It is about
10kOe . 10 kOe corresponds to applying about a
1 Tesla field to the neodymium magnet. Applying a
magnetic field smaller would induce almost no
effect. The remnant magnetic field of a neodymium
is about 1 Tesla. The magnetic field drops off
very quickly, as one over distance cubed.
Neodymium magnets placed 1 mm apart from one
another would hold no effect. To place neodymium
magnets into opposite polarity directly in contact
with one another may have an effect but the
mechanical strength needed to do this is not
easily achievable in the lab.
A study was done in 2009 which showed if you heat
a neodymium magnet and it has a poor crystal
structure it can lose 10% of its magnetization
over 30 years. As long as temperatures are kept at
room level and the quality of the crystal is good,
the loss of magnetization is negligible .
Neodymium magnets are highly corrosive and
temperature dependent. It is more likely for it
disintegrate or be heated before first principles
cause the magnet to demagnetize.
 Herbst, J. F. "R 2 Fe 14 B materials:
Intrinsic properties and technological aspects."
Reviews of Modern Physics 63.4 (1991): 819.
 Haavisto, Minna, and Martti Paju. "Temperature
stability and flux losses over time in sintered
Nd–Fe–B permanent magnets." Magnetics, IEEE
Transactions on 45.12 (2009): 5277-5280.