in magnetic recording the typical time - scale for magnetization reversal is in the nanosecond range , and it is now believed that the ultimate limit for magnetization switching by magnetic field pulses may approach the picosecond mark  @xcite . down to the picosecond scale ,
the exchange interaction is constant in time and so is the magnetic anisotropy .
this allows the dynamics of magnetization to be modeled in terms of the continuous landau - lifshitz - gilbert equation  @xcite , usually solved with micromagnetic techniques @xcite .
the spatial resolution of such techniques is chosen in view of the problem at hand and numerical considerations , but the equation of motion is always the same . at the most fine - grained and microscopic end of the modeling spectrum
there are atomistic spin models , which have been proved to be a powerful tool for approaching the extreme phenomenology of the _ ultrafast _ magnetization dynamics @xcite . in these one associates
classical spin - vectors to magnetic atoms , @xmath2 , which are then coupled through a time - independent heisenberg hamiltonian @xmath3 where @xmath4 are the pairwise heisenberg exchange parameters .
the state of the art for the theory is then represented by performing atomistic dynamical simulations , in which the heisenberg hamiltonian is completed by various spin - orbit terms , by the interaction with an external magnetic field and eventually by stochastic fields  @xcite .    the parameters of the theory , the exchange integrals and the anisotropy , are usually fitted to experiments or calculated from static density functional theory ( dft )  @xcite . in this second case usually the exchange is obtained with the , so called , _ broken symmetry _ approach , proposed first by noodleman@xcite . in its dft variant broken symmetry refers to an unrestricted - spin calculation for open - shell complexes , where opposite spin densities are allowed to localize at different atomic sites .
this broken symmetry or low spin ( ls ) state , unlike the state with the highest spin ( hs ) , is not an eigenstate of the full spin operator ( hence the name ) .
the exchange parameters are then determined as differences between the total energy , @xmath5 ( @xmath6  ls , hs ) , of the different spin state @xmath7 where different formulations of the spin - dependent function @xmath8 are possible , depending on the choice of basis and level of localization , and where @xmath9 is the expectation values of the local spin at atom @xmath10 ( see for instance references [ ] ) .    the first demonstration of laser - induced ultra - fast demagnetization  @xcite in transition metals , however , opened a new frontier , namely , the possibility of manipulating and controlling the magnetization with ultrashort intense laser pulses  @xcite .
here one reaches the femtosecond time resolution , where both the exchange interaction and the anisotropy may become time - dependent .
most importantly , in this limit the approximation of associating a classical spin of constant magnitude to an atom may breakdown .
it makes sense that at a time - scale where the electronic degrees of freedom evolve in time in a non - adiabatic way ( the local magnetic moment changes in time ) , spin - dynamics needs to be addressed at the electronic level . yet , in order to interpret the results in a simple and transparent way , it is desirable to be able to map the electronic time - dependent simulations onto classical atomic models based on the heisenberg hamiltonian . how to perform such mapping , and whether this is at all possible , is the subject of the present paper . in particular
, we will discuss how the evolution in time of the spin - density in time - dependent dft  @xcite ( tddft , or , to be more specific , its extension to non - collinear spin  @xcite , the tdsdft  @xcite ) simulations can be used to extract an effective spin - dynamics , which in turns can be mapped on an heisenberg hamiltonian . as a byproduct of such analysis
we will be able to extract exchange parameters , whose values are quantitatively rather close to those calculated with the broken symmetry approach .
the paper is organized as follows . in the next section
we will discuss the most technical aspects of our work .
in particular , we will present the classical solution of the time - dependent heisenberg model for a diatomic molecule
. this will be useful to interpret our tddft results . in the same section we will describe the general aspect of the tddft simulations and explain how to integrate the charge density in order to map the tddft results onto the heisenberg model .
then , in the following two sections , we will present results for both a stretched h@xmath11 dimer and a hypothetical h - he - h trimer . these are qualitatively different systems with respect to the spin - spin interaction . in h@xmath11 the spins of the two h atoms are coupled via direct exchange , while in h - he - h the exchange is indirect , _ superexchange _
@xcite , across the closed shell he atom .
finally we will conclude .
_ ab initio _ spin dynamics is simulated in the time - domain with the state of the art tddft code octopus  @xcite .
this is a open - source ( gpl ) package capable of simulating excitations of molecules or clusters to custom - designed electromagnetic fields beyond the linear response regime , i.e. by the explicit time - propagation of the td kohn - sham equations in a basis - free real - space representation .
octopus provides an ideal environment for examining fundamental processes in the time - domain .
our starting point to understand _ ab initio _ spin dynamics in the time - domain has to be through the simplest complexes of non - spin - singlet atoms .
in fact , the simplest possible real system for which the heisenberg spin hamiltonian of eq .
( [ jij ] ) was originally conceived , is the hydrogen molecule . in its ground state h@xmath11
is closed - shell ( diamagnetic ) , but in the stretched dissociating state local spins can be defined for each of the hydrogen atoms ( e.g. in the broken symmetry ls state , the electrons localized on the opposite protons have particular and opposite spin expectation value , @xmath12 ) .
hence the stretched h@xmath11 provides the simplest physical realization of a molecular spin dimer .    in order to excite spin dynamics in collinear spin - dimers ,
we have introduced a spatial inhomogeneity into the magnetic field pulses available in octopus .
thus , an inhomogeneous transverse magnetic field pulse of a few femptosecond duration is used to generate a spin misalignment in the dimer . in order to quantify such misalignment , we need a measure for the spin of overlapping atoms .
although the tddft spin - density distribution is well - defined at every instance , the spin state ( and the charge ) of an individual atom in a molecule or solid is not an observable .
this of course prevents us to rigorously map the tddft dynamics onto a classical heisenberg model .
in fact , computing expectation values of local spin operators ( e.g. @xmath13 ) from _ ab initio _ wave functions is not a trivial task  @xcite and it has been recently shown that a continuum of valid local spin definitions exist  @xcite . in order to overcome such difficulty
we have implemented an intuitive _ rotating spin _
approximation for decomposing the spatial spin - density distribution into atomic contributions , which is based on defining an appropriate linear transformation .
the idea is to use the two extreme states , the hs and ls spin - density distributions , as reference points for decomposing the spin - density of any given non - collinear spin - state obtained through tddft evolution , assuming that it is simply a result of rigid rotation of some portion of the spin distribution in space .
we will demonstrate that such method allows us to practically eliminate from the definition of the local spins the dependence on a particular spatial volume and that this can be done for a wide range of interatomic distances .
this gives us the opportunity to define with a unique criterion the local spin trajectories , and thus to extract an effective exchange parameter @xmath1 for the spin dimer .
interestingly , the results agree quantitatively with those obtained by the broken symmetry method .
all the tddft simulations are performed at the level of the adiabatic local spin - density approximation ( alsda )  @xcite with the modified parameterization of the correlation functional by perdew and zunger @xcite . the electron density and all the observables
are represented over a dense real space grid ( with a spacing of 0.1   ) , and the entire simulation box is a parallelepiped of square cross - section ( with a @xmath1412    side ) and a length ( along the axis of the molecule ) ranging between 20    and 30   , depending on the length of the molecule considered ( in the dissociating limit ) .
the time propagation of the kohn - sham equation is performed via the crank - nicholson ( implicit mid - point ) rule , while the lanczos approximation of the propagator is used , as implemented in octopus  @xcite .
the typical time - step used in the simulations is 0.004  fs .
we consider first a generic two - center magnetic molecular complex , a spin - dimer , as cartooned in fig .
[ fig01](a ) .
the ground state dft calculation is initialized in either the hs or the ls collinear configuration . in order to generate spin non - collinearity ,
a spatially - inhomogeneous external magnetic field pulse @xmath15 is applied to the td - sdft hamiltonian @xcite @xmath16}\!\!\delta({\boldsymbol{\mathrm{r}}}\!-\!{\boldsymbol{\mathrm{r}}}_i ) + v_{s } { \left ( { \boldsymbol{\mathrm{r } } } \right)}\ , , \nonumber\end{aligned}\ ] ] where the sum runs over all ( @xmath17 ) electrons in the system , @xmath18 is the effective magnetic field for the ks orbitals , @xmath19 is their spin operator , @xmath20 is the bohr magneton and @xmath21 is the effective electrostatic potential which we assume not to carry an explicit time - dependence .
we have implemented @xmath22 $ ] with a gaussian time dependence and a variance @xmath23 typically between 2  fs and 5  fs .
this is applied soon after the beginning of the time - dependent simulation ( @xmath24 is chosen such that @xmath25 is sufficiently close to 0 so that the discontinuity in the potential introduced at @xmath26 is negligibly small ) . for the spatial dependence @xmath27 ,
we have experimented with a few simple continuous integrable functions and found that , as long as they are not symmetric with respect to the center of the molecule , there is little qualitative difference on the resulting spin dynamics . in other words , the sought outcome of spin - non - collinearity in the electronic structure
is readily obtained for a wide range of @xmath27 .
in particular , we have found that there is no qualitative difference between a divergence - free solenoidal field , for instance , @xmath28}\times\\ & \!\
! { \left ( { \boldsymbol{\mathrm{e}}}_x+(x - x_0)y/\xi^2{\boldsymbol{\mathrm{e}}}_y + ( x - x_0)z/\xi^2{\boldsymbol{\mathrm{e}}}_z \right)}\nonumber\end{aligned}\ ] ] and the simplified @xmath29 . hence ,
in most of the simulations we have used the latter , where ( typically ) @xmath30    with respect to the center of the molecule , @xmath31    and @xmath32 is a unit vector along the @xmath33-axis ( aligned with the spin - dimer axis ) .
this corresponds to a magnetic field transverse to the direction of the initial ( ground - state ) spin - polarization of the molecule , chosen as the @xmath34-axis [ see fig . [ fig01](a ) ] .
we have used values of @xmath35 ranging from 0.5  kt to 10  kt in order to generate desired misalignment for short enough simulation times . clearly , these short , intense and very localized magnetic field pulses are only to be taken as theoretical tool for producing the misalignment , which onsets the spin dynamics .
below we analyze the classical version of this problem , i.e. the dynamics of two misaligned classical angular momenta , @xmath36 and @xmath37 , interacting according to eq .
( [ jij ] ) , and the possibility of mapping the tddft spin - density evolution onto that .
-axis ) and offset from the mid point towards one of the atoms .
( b ) illustration of the definition of local spin @xmath38 [ see eq . ( [ spin_sph_def ] ) ] and the definition of the angle @xmath39 .
( c ) results from the _ ab initio _ time dependent simulations for h@xmath11 and two different durations of the magnetic field pulse ( shaded area ) : trajectories of the local spins @xmath34-component @xmath40 , angle @xmath39 between them and the expectation value of the total tddft energy of the system .
the radius of the sphere defining @xmath38 is @xmath41 and the bond length is @xmath42 . ]
[ fig01 ]      first , we examine the case of two rigid classical angular momenta @xmath43 interacting according to a heisenberg spin hamiltonian @xmath44 since we choose to have @xmath45 , the factor 2 in equation  ( [ h_cl ] ) is introduced in order for @xmath46 to produce the same difference between the energies of the parallel and antiparallel alignment of the classical spins as the triplet - singlet energy - difference @xmath47 of the corresponding quantum spin hamiltonian @xmath48 in the classical spin hamiltonian [ eq.([h_cl ] ) ] we include the physical dimension ( @xmath49 ) of the angular momenta in the coupling constant @xmath50 , which has a dimension of energy in analogy to the exchange parameter @xmath1 .
hence , the classical equation of motion for each spin , say @xmath51 , is @xmath52 where we have used the poisson bracket for the corresponding classical angular momenta @xmath53 , with @xmath54 representing the fully anti - symmetric levi - civita tensor . for classical spins , forming an arbitrary angle @xmath39 , eq.([cleom ] ) describes a precessional motion about the total spin , @xmath55 , with an angular velocity @xmath56    finally , we note that the precessional motion is stable against the application of any homogeneous external magnetic fields , which in the case of the quantum system can be used to define the quantization axis . in other words , if a homogeneous external magnetic field is applied , say along the @xmath34-axis , the total spin @xmath57 is driven into a precession about the field , but the individual classical spin components precess about the total spin with the same frequency given by equation ( [ omega ] ) .
hence , the trajectories of @xmath58 and @xmath59 are still harmonic oscillations at the field - free frequency @xmath60 .
the harmonic behavior , characteristic of the classical spin model described in the previous section , is easily obtainable in the _ ab initio _ spin - dynamics simulations of several spin dimers excited by an inhomogeneous magnetic field pulse .
in fact , any spin - density component  , the result remains valid only for the spin - density component along the field , i.e. the @xmath34-axis , in this case .
] integrated over any arbitrary finite volume in the simulation box shows a sinusoidal trajectory to a good accuracy for a number of periods [ see , for instance , fig .
[ fig01](c ) ; our longest simulations have confirmed that observation for up to 10 - 12 periods ; deviations from the ideal sinosoidal behavior in terms of higher frequency noise have been observed only in the case of small bond lengths and very small angles @xmath39 ] .
this seems to be the case for range of different two - center spin - polarized molecules , ranging from h@xmath11 in a stretched ( dissociating ) configuration , to the hypothetical h - he - h trimer , and to much more electronically - complex high - spin entities like mn@xmath11 ( not discussed here ) .    in order to analyze in a quantitative way this numerical observation
we consider first the most intuitive definition of local atomic spins : a local spin is obtained by integrating the spin density over non - overlapping spheres centered around each ion . in this way , from the instantaneous expectation value of the spin - density , a pair of cartesian vectors , @xmath62 can be extracted . as an example , the trajectories of the @xmath34-component of the spins obtained by integrating over spheres of radius half of the bond - length are presented in fig .
[ fig01](c ) .
we find these [ e.g. @xmath63 to be sinosoidal after the extinction of the pulse ( @xmath64 , with typically @xmath65 ) and we are able to extract the angular velocity of precession @xmath66 .
then , a characteristic _ dynamical _ exchange parameter can be evaluated from eq .
( [ omega ] ) as @xmath67 where @xmath68 is the angle between the local spins after the pulse and @xmath69 is the averaged long - time local spin magnitude ( which in all our simulations is practically identical between the two sites ) .
these averaged quantities are typically very stable and independent on the length of the simulation . as is evident from the right - hand side panels of fig .
[ fig01](c ) , after the decay of the pulse the angle @xmath39 saturates to a constant ( noise is typically in the fourth decimal place of the value in radians ) .
local ( atomic ) spins in dft calculations are usually estimated through some sort of _ partitioning _ of the total density , for instance , the popular mulliken and lwdin schemes .
typically , for calculations based on localized basis set , a population analysis consists in projecting over the chosen atomic orbital basis .
the local spins are then extracted from the elements of the density matrix , contracted in spin space by the pauli matrices . in the case of non - orthogonal bases
these are weighed by the corresponding matrix elements of the square - rooted overlap matrix  @xcite .    in octopus a readily available implementation exists for evaluating local magnetic moments directly as integrals of the spin - density distribution , @xmath70 , @xmath71 over individual spherical volumes @xmath72 of radius @xmath73 centered around each atom @xmath10 .
we call this definition _ direct _ and the correspondent spins _
apparent_. because of the overlap of the atomic wave - functions associated to the individual atoms in the interstitial region , the value of the local spin at site 1 , defined as eq .
( [ spin_sph_def ] ) , contains a contribution from site 2 .
this undesired contribution depends strongly on the radius @xmath73 [ see fig . [ fig01](b ) ] .
hence , for instance , the _ apparent _ inter - spin angle @xmath39 between two overlapping atoms is smaller than the actual angle between the overlapping atomic spin densities .    in order to decouple the contributions from the two sites ,
a simple linear transformation can be devised to eliminate the spatial dependence in the local spin definition .
this is exactly true in the case of a uniform spin - density distribution of the individual overlapping sites .
let us assume that in the case of the dissociating hydrogen molecule , the @xmath10-th electron ( @xmath74 ) , predominantly localized on the site @xmath75 , contributes to the total spin - density @xmath76 where @xmath77 is integrable and confined to a compact ( connected ) spatial region .
note that this does not imply necessarily a minimal basis model where only the two 1@xmath78 atomic orbitals are considered .
the function @xmath79 is the probability density distribution of the @xmath10-th electron , which does not need to be spherically symmetric .
the vectors @xmath19 are dimensionless and represent the _ actual _ spin direction ( expectation value ) of that electron , which in general is not directly observable from the dft calculation .
we can then chose a sphere @xmath80 that encloses most of that volume as ( naively ) cartooned in fig .
[ fig01](b ) .
then , the apparent local - spins can be expressed as @xmath81 where @xmath82 ( the top signs are for @xmath83 and the bottom ones for @xmath84 ) and @xmath85 is the bond length , which is aligned along the @xmath33 axis for definiteness . in other words ,
@xmath19 can be determined from the inverse of the above linear transformation as @xmath86 where @xmath87 for any cartesian component @xmath88 .
as @xmath83 and @xmath84 are in principle unknown , @xmath89 can be determined from the calculated apparent spins in the collinear configurations .
let @xmath90 and @xmath91 be the apparent local spin values in the singlet and in the triplet ( broken symmetry ) state , respectively , and we consider normalized @xmath19 , i.e. @xmath89 needs to fulfill the following equation @xmath92 the matrix elements of @xmath89 that satisfy this requirement are @xmath93    hence , through @xmath89 the individual electronic ( and atomic in the case of hydrogen ) spin polarization directions @xmath94 can be worked out from the apparent ( sphere - integrated ) local spin quantities @xmath38 . the practical applicability of this definition to the dynamically generated non - collinear spin configurations depends on how small the actual redistribution of electron charge between the hs and ls collinear states is .
that is , how close the individual electron charge distribution @xmath95 is to a constant of motion for the particular _ ab initio _ spin - dynamics simulation . in other words ,
if the dynamics can be locally described by an inter - rotation of overlapping spin - density kernels without a local norm variation , the spatial factor in the definition of the local spins can be completely eliminated .
this might also be considered as an approximation , providing grounds for an alternative density - based definition of local spin expectation values , which significantly reduces the effects of overlap inherent to the directly space - integrated atomic quantities .
we will call @xmath94 the _ transformed _ local spins . it will be demonstrated in the following sections that , with regard to the heisenberg interaction , this constitutes a good approximation for the simplest spin - dimer systems up to considerably small bond - lengths where the atomic overlap is significant .
the typical outcome of the described above tdsdft simulations of a stretched h@xmath11 molecule ( at a bond - length @xmath96  ) is presented in fig .
[ fig02 ] in the form of 2-dimensional contour plots representing the stacked snapshots of the various observables ( expectation value ) distribution along the molecule axis as a function of the simulation time ( in the horizontal direction ) .
this visualization offers a quick glimpse of the dynamics .
for instance , it shows that the inhomogeneous magnetic field pulse , used to generate non - collinearity from the ls ground state , produces a localized spin and charge redistribution . a comparison between the pulse geometry in fig .  [ fig02](a ) and
the charge and spin - currents in the underlying graphs shows little direct spatial correlation ( e.g. the pulse is centered at -2 while the excitation is centered at -1.3  where the proton sits ) and this demonstrates further the freedom available in the choice of the actual magnetic field distribution  .
it also shows that the small relative charge and spin redistribution in the dimer follows closely the temporal shape of the pulse .
after the the pulse dies out , only a tiny amount of charge sloshing between the two sites at very high frequency remains , as evident from fig .
[ fig02](b ) .
the figure represents the charge current as the sum of the up - spin and down - spin components ( with respect to the quantization axis set by the initial spin - polarization at @xmath26 ) of the expectation value of spin current tensor in the direction of the bond ( @xmath33-axis ) .
the later currents are defined by only two scalar components @xmath97 and @xmath97 of the spin - current tensor @xmath98 where @xmath99 , @xmath100 is the orbital current operator for the @xmath101-th electron and we have omitted the implicit time - dependence for simplicity . note
that while the charge current is near to zero after the pulse , the spin - current builds up . after the pulse - coherent depletion of the longitudinal spin in the site more exposed to the pulse ( the site at -1.3 )
, a uni - directional spin - current is established .
this corresponds to a transfer of spin - up along the positive @xmath33-direction and of spin - down along the negative @xmath33-direction .
hence , the the up - spin localized at the left site starts turning down while the down - spin on the right starts turning up .
figure [ fig02](d , e ) shows that while this spin - rotation process is taking place the distribution of the both the charge and the magnitude of the spin - density after the pulse tend to remain stationary in space .    ) of ( a ) the external magnetic pulse , in units of 3kt ; ( b ) the charge current density and ( c ) the @xmath34-component of the spin - current tensor [ see eq .
( [ spintensor ] ) ] in the same arbitrary unit scale ; and the variations with respect to the ground state of ( e ) the charge density @xmath102 , in units of @xmath103 ; and ( d ) the magnitude of the spin density ( euclidean norm ) @xmath104 , in units of @xmath105 .
note that soon after the magnetic pulse dies out the system becomes nearly stationary with respect to charge transfer between the two sites . ]    [ fig02 ]    in the long time limit , as a result of the such generated non - collinearity , a regular pattern of rigid local spin rotation is established throughout space ( spin - density at every point in the simulation box precesses about the total spin of the dimer with the same frequency ) .
this is also evident from the sloshing of pure spin currents between the two atoms ( see fig .  [ fig03 ] ) .
the corresponding trajectories of the spin - density integrated over atomically - centered spheres are similar to those depicted in fig .
[ fig01 ] ( for a different pulse strength ) and are typically sinusoidal to a great level of accuracy within the duration of simulation ( up to 200 - 250fs ) .    ) of ( a ) the @xmath34-component of the spin current density tensor ( arbitrary units , as in fig.[fig01 ] ) and ( b ) spin density @xmath34-component , in units of @xmath106 . ]    [ fig03 ]    the properties of the linear transformation @xmath89 and with respect to the mapping of the h@xmath11 spin - dimer dynamics onto classical degrees of freedom are demonstrated in fig .  [ fig04 ] .
a set of non - collinear quasi - stationary dynamical states with angles @xmath107 between the _ apparent _ local spins ranging from 0 to @xmath108 are produced by applying pulses of different strengths from either the ls or the hs initial state .
we find a systematic variation of the _ apparent _ local spin norm , @xmath109 , as a function of @xmath107 alone , irrespective of the particular collinear initial state .
the effect of the sphere radius on that dependence is significant [ see fig .  [ fig04](a ) ] .
in contrast , for the _ transformed _ spins the quality of the achieved normalization of @xmath110 is quite high regardless of the angle @xmath39 ( even when this is close to @xmath111 ) , and is practically the same for any size of the integration sphere [ fig .
[ fig04](c ) ] .
the magnitude of the _ transformed _ local spin varies by at most 0.5% .
such variation is practically negligible on the background of the variation of the apparent spin magnitude @xmath109 at the two extreme hs and ls states as a function of @xmath73 [ see fig .  [ fig04](d ) ] . at the same time the transformation of the angle
shows a small but systematic dependence on the sphere radius [ see fig .
[ fig04](b ) ] . the larger the spheres , the more of the overlap they capture and the greater the correction in the angle @xmath39 achieved by the transformation .     after the pulse for three different radii of the sphere ( a ) the magnitude of the apparent local spin @xmath109 ; ( b ) the difference between transformed and direct angle between local spins @xmath112 ; ( c ) transformed local spin magnitude @xmath113 .
right hand side panels : as a function of the sphere radius ( d ) local spin magnitude in the two stationary collinear states and in the non - collinear state , defined over the sphere ( @xmath109 ) and the transformed non - collinear spin magnitude ( @xmath113 ) for the largest sphere ; ( e ) corresponding heisenberg constants @xmath114 , as defined by eq .
( [ jdyn ] ) .
these caclulations are for h@xmath11 molecule of bond length @xmath96 . ]    [ fig04 ]    the calculated angle between the transformed local spins , @xmath39 , for any value of @xmath73 , is always above the upper asymptotic limit of the apparent @xmath107 as function of the sphere radius .
we find that @xmath107 always tend to a saturation maximum for decreasing @xmath73 .
in fact , for the particular excitation depicted in the right - hand - side panels of fig . [ fig04 ] , @xmath39 varies just between 2.648rad and 2.650rad for @xmath73 ranging between @xmath115 and @xmath116 , while the change in the apparent angle @xmath107 is massive , i.e. it changes from 2.626rad down to 0.789rad ( this data is not presented on the graph ) .
figure [ fig04](e ) shows the resulting correction in the corresponding exchange parameter @xmath114 , defined as in eq .
( [ jdyn ] ) .
it demonstrates that using the _ apparent _ local spins for @xmath114 is completely meaningless : the dependence on the sphere radius is very strong ( for instance , in the large radius limit @xmath114 understandably tends to 0 ) .
in contrast by using the transformed quantities , @xmath114 as a function of @xmath73 is constant with an accuracy of less than 0.15% ( for the case depicted in fig . [ fig04 ] , @xmath117ev averaged for the 11 values of @xmath73 in the range from @xmath115 to @xmath116 ) .
note that the linear transformation does not change the observed angular frequency of local spin rotation @xmath66 .
this is because any spatial portion of spin density in the non - collinear state rotates at the same rate .     of ( a ) the variation of the electron density distribution along the bond axis @xmath33 with respect to the low - spin state , here @xmath118 , locations of the nuclei are marked by the black lines ; ( b ) the electron density at @xmath119 , compared to a cosine function ( blue dashed curve ) and fitted ( least - squares ) by a two - parameter function : @xmath120 ( green curve ) .
the units for @xmath121 and @xmath122 are @xmath123 . ]
[ fig05 ]    in order to gain more insight into the dynamically - achieved quasi - stationary non - collinear state of the spin dimer , we can look at the snapshots of the long - time limit electron density distribution as we systematically increase the strength of the excitation . in fig .
[ fig05](a ) the long - time charge density along the bond axis is presented as a function of the ( transformed ) inter - spin angle @xmath39 ( relative to the density of the hs state with @xmath124 ) .
we find a clear visual evidence for the action of pauli exclusion principle and the corresponding exchange - correlation hole .
the contour plot shows that the hs state ( @xmath124 ) bond is depleted with respect to the ls state ( @xmath125 ) .
the dependence of the averaged charge density in middle of the dimer as a function of @xmath39 is shown in fig . [ fig05](b ) .
this nearly fits to a cosine function but not exactly .
in fact , by including even only a second order harmonic ( @xmath126 from the fourier series or a term proportional to @xmath127 ( the two are the same up to an additive constant ) a significant improvement of the fit is obtained .    , of ( a ) the extracted frequency of rotation ,
@xmath66 , ( this is the same for the _ apparent _ as well as the _ transformed _ spins ) ; ( b ) @xmath114 extracted from the spin trajectories [ eq . ( [ jdyn ] ) ] ; ( c ) the total tddft energy ( long - time value ) with respect to the average @xmath128 value between the ls and the hs states , i.e. @xmath129 ; ( d ) consecutive approximations to @xmath130 from eq ( [ je ] ) using the series @xmath131 of increasing order @xmath132 as a fitting function for @xmath133 . marked in panel ( b ) is also @xmath134mev and the results for the exchange constant based on @xmath133 derivatives as in eq  ( [ je ] ) ( colored symbols at @xmath124 and @xmath125 ) .
the results presented here are for a stretched h@xmath11 molecule ( @xmath96   ) . ]
[ fig06 ]    we now move to analyze how the exchange parameter is calculated from the dynamical simulations initiated with different magnetic pulses , i.e. for different angles , @xmath39 . in fig .
[ fig06](a ) we present the precession frequency @xmath66 , while in fig .
[ fig06](b ) the dynamical exchange parameter , @xmath135 , as calculated from eq .
( [ jdyn ] ) . clearly both @xmath66 and @xmath114
depend sensitively on the angle between the two spin moments .
this is expected for @xmath66 , which presents the same asymptotic behavior of the classical heisenberg model for @xmath136 .
however @xmath114 is not constant with @xmath39 , indicating that our quantum system , simulated with tddft , deviates from the classical one .
intriguingly the dynamical exchange seems to agree perfectly with that calculated from the broken symmetry approach , @xmath137 , for @xmath138 , i.e. when the two local spins are orthogonal to each other .
note also that , once again , the _ apparent _ local spins can not be used here since the variations in @xmath114 with the choice of integration radius are very large .
a similar deviation from the classical heisenberg model is found in the dependence of the total energy , @xmath128 , on the angle @xmath39 between the _ transformed _ local spins .
note that here we consider @xmath128 in the long - time limit , i.e. long after the external field pulse has extinguished . in this limit
@xmath128 is a constant of motion with numerical fluctuations at times of about 100fs being typically smaller than 10@xmath139ev .
the dependence of the total energy @xmath133 clearly deviates from the characteristic cosine form of the classical heisenberg model [ fig . [
fig06](c ) ] .
however , as we have found for the charge density [ see fig .
( [ fig05 ] ) ] , also for @xmath128 the best fit of the dynamical quantities is obtained by including higher harmonics , with already a remarkably good agreement at the level of the second harmonic ( @xmath140 , note that with the use of @xmath127 the offset of the fit is 0 ) .
the deviation of the total energy from the heisenberg model ( @xmath141 ) can be attributed to a combination of factors .
the heisenberg model returns the energy of two localized electrons as the scalar product of their corresponding local spin operators  @xcite .
clearly , any definition of the local spins in terms of the expectation values of spin - density and the corresponding @xmath39 is an approximation .
in addition , the total energy of the system in the non - collinear spin state is approximated by the choice of the lsda for the exchange - correlation potential .
a similar deviation from the heisenberg model was found also for a few spin - dimer complexes by peralta and barone  @xcite , who noticed that a systematic improvement of the agreement between the dft results and the classical heisenberg model is achieved as the approximation for the exchange and correlation functional improves . in particular a more heisenberg - like behavior is found for hybrid functionals , such as b3lyp  @xcite .
this is somehow expected , since in hybrid functionals the spurious self - interaction , which is present in lsda , is partially removed and the electron charge gets more localized at the nuclear sites  @xcite . in brief , hybrid functionals return an electronic structure closer to that underpinning the classical heisenberg model .
in any case , a variation of @xmath1 ( evaluated from the second derivative of the total energy with respect to @xmath39 ) between the values calculated around the ls state or those around the hs one was found for all functionals .
this variation has the same direction as our corresponding quantity , calculated as @xmath142 from figure  [ fig06](c ) it appears that @xmath143 , since the total energy as a function of @xmath39 is above the heisenberg @xmath144-type dependence both at @xmath124 and @xmath125 .
we now demonstrate that this variation is consistent quantitatively with the exchange couplings @xmath114 extracted from the dynamical trajectories via eq .
in fact , if we increase of the number of harmonics in the fourier series fitting @xmath145 , the match between the values of @xmath146 and @xmath114 calculated at the ls and hs states improves systematically [ see fig .
[ fig06](d ) , inset of fig .
[ fig06](c ) ] . in other words , the spin dynamics of the molecule , excited and mapped out as described , indeed probes the landscape of the spin - dependent energy of the system and in the vicinity of the hs and ls state the agreement of @xmath114 and the heisenberg model approximation of the total energy is remarkable . in conclusion
we find that the heisenberg spin interaction is the governing mechanism for the _ ab initio _ spin dynamics of stretched h@xmath11 , although with some deviations .
in particular @xmath145 contains higher contributions in the harmonic series over @xmath39 , beside the heisenberg - type @xmath147 dependence .
the hydrogen molecule has had a special role in quantum chemistry as a basis for understanding the chemical bond .
it is well known that the heitler - london theory of molecular bonding incorrectly produces a spin - triplet ground state in the dissociation limit  @xcite , because it omits the electron correlations . in the other limit
, the hartree fock molecular orbital wave - function fails due to an overestimation of the ionic contribution .
the ground state of the dissociating h@xmath11 has a significant multi - configurational character and it is still an unsolved problem for dft @xcite .
furthermore , the problem for the exchange coupling in h@xmath11 is the one for the spin - flip excitation energy @xmath148 .
the standard alda in tddft is found to have severe weaknesses and it badly underestimates the excitation energies in the dissociation limit @xcite . limiting ourselves to the non - collinear alda ,
the aim of our work is not to offer an accurate alternative evaluation of the exchange coupling in h@xmath11 , but to demonstrate a first attempt to relate the heisenberg @xmath1 to the actual spin trajectories calculated from tddft .
it is well - known that lsda has serious shortcomings in describing long - distance exchange and correlation effects  @xcite and our dynamical analysis can not improve on these .
for the sake of completeness in fig .
[ fig07 ] we present our results for the distance dependence of the exchange coupling in h@xmath11 at medium distances ( 2 - 3  ) and compare it with a number of previously published calculations , obtained at various levels of approximation .     calculated as ( a ) broken symmetry energy difference from static lsda ; ( b and c ) @xmath114 from eq .
( [ jdyn ] ) for very small and very large angles @xmath39 , respectively ; ( d ) _ ab initio _ variational calculation of ground state and first excited state total energies by kolos and wolniewicz @xcite ; ( e ) the leading term in the surface integral method by herring and flicker @xcite . ]    [ fig07 ]    our static broken symmetry lda result lies nearly in the middle between the leading term in the perturbative calculation of @xmath1 obtained with the surface integral method  @xcite and the exact variational result for the first excitation energy  @xcite .
as discussed above , the value of our dynamical heisenberg parameter , @xmath114 , depends strongly on the angle @xmath39 .
we show the range of @xmath114 values between some of the smallest and some of the largest angles obtained ( pulses are purposely chosen as to produce angles of nearly the same magnitude for all @xmath149 ) .
the range is significant and it is relatively similar for all the bond - lengths . notably , broken symmetry lsda value at any distance is always well reproduced by our dynamical calculation for angles @xmath150 .
we now apply the dynamical scheme discussed so far to another system , namely the hypothetical h - he - h molecule .
this is the simplest possible model system presenting a high order spin exchange interaction , e.g. the two h atoms interact via superexchange mechanism  @xcite across the close shell he atom .
there are no experimental observations for h - he - h but it is a good test case for new quantum chemistry methods  @xcite as full configuration interaction calculations exist @xcite for comparison . here , as many other works in the literature , we consider as typical the h - he distance of 1.625   .
in general our results for h - he - h are similar to those for h@xmath11 . again , after the application of the spatially - asymmetric magnetic field pulse the spins of the hydrogen electrons become misaligned by an angle @xmath39 and start to precess about the total spin at a steady angular frequency .
[ fig08 ] shows the long - time oscillations of the spin - density and the oscillating @xmath34-polarized spin - currents along the bond axis .
the spin current distribution is qualitative different from that of h@xmath11 in fig .
[ fig03 ] , since it now peaks at the he atom instead of the sites bearing the localized spins .
this provides an insight of the indirect exchange mechanism in h - he - h .     but
here for the case of h - he - h with @xmath151   .
note that the exciting magnetic pulse here has been strong enough to nearly reverse the spin of the ( leftmost ) h atom over which it is applied . as a result , here
@xmath152 and @xmath153 remains negative . ]
[ fig08 ]    similarly to the case of h@xmath11 , we extract the local spins at the hydrogen sites by using the linear transformation of eq .
( [ lintransf ] ) .
also in this case the transformation seems to work well since it produces consistent results and integration - volume independent local spin ( expectation value ) magnitudes , angles @xmath39 and corresponding @xmath114 .
the variation of electron density along the bond axis as a function of @xmath39 obtained in the long - time limit is shown in fig .
[ fig09 ] .
this represents a direct density - level signature of the superexchange mechanism .
as the spin state goes from ls to hs the charge density at the he atom splits spatially and the two he electrons show a tendency to pair up with the uncoupled hydrogen electrons in the interstitial regions .
but for h - he - h with @xmath151 . ]    [ fig09 ]    the profile of the local density variation with @xmath39 is again an approximate cosine ( plotted in fig .
[ fig09](b ) for the symmetry center but also true everywhere else ) . in this case
the deviation from a perfect cosine dependence is much less pronounced than in the case of h@xmath11 ( although we find again some higher order harmonic contributions ) .
the better agreement to a cosine function can be attributed both to the variation of the h - h distance in the two cases ( 2.6    for h@xmath11 and 3.2    for h - he - h ) and to the contribution of the superexchange spin - spin coupling mechanism @xcite .
similarly , the profile of @xmath133 fits to @xmath154 better than in the case of h@xmath11 .
in fact , by using only one additional harmonic to the fitting function , namely @xmath155 , we find @xmath146 [ see eq .
( [ je ] ) ] to agree extremely well with the extrapolated values of @xmath114 at @xmath124 and @xmath125 ( see fig .
[ fig10 ] ) .
the relative variation of both the @xmath1 s ( @xmath146 and @xmath114 ) calculated either near the ls state or the hs one is also much smaller that the one found in h@xmath11 .
this improvement is to a great extend due to the increased charge localization with inter - hydrogen distance of @xmath156    in h - he - h with respect to 2.6    for the h@xmath11 [ see fig .
[ fig06](b ) ] . in fact , for the same small @xmath157 , the exchange interaction in h - he - h shows much more substantial deviation from the heisenberg model ( see the appendix ) . for the case of the larger distance of 3.3 ,
the variation of @xmath114 between the hs and the ls spin is the same in sign and comparable in magnitude to the constained - spin dft result of peralta and barone @xcite .
they further suggest that a significant portion of that variation is related to the lsda approximation as @xmath158 can be reduced from about 6% of the average value to less than 1% with the use of a hybrid xc functional like b3lyp .
but for h - he - h with @xmath151   .
the broken symmetry energy difference marked in panel ( b ) is @xmath159mev .
the blue squares correspond to @xmath146 from eq .
( [ je ] ) with the fitting function in panel ( c ) , the blue broken line .
]    [ fig10 ]    we finally present results for the dependence of @xmath114 on the he - h distance , @xmath160 . in fig .
[ fig11 ] the exchange parameter calculated either from the hs or the ls state are compared to broken symmetry dft  @xcite and the exact configuration interaction results available in literature  @xcite .
figure  [ fig11 ] reveals that @xmath114 converges towards our lsda broken symmetry value as @xmath160 gets larger .
such convergence in not found for the case of h@xmath11 ( see fig .  [ fig07 ] ) .
this means that our dynamical measure of the superexchange interaction in h - he - h suggests that this is much more heisenberg - like than the direct exchange operating in h@xmath11 .
we have demonstrated that the spin dynamics of two simple spin - dimers , as calculated on the basis of tddft within the adiabatic lsda , is rather simple and understandable through a classical model .
a non - collinear spin state can be created with inhomogeneous magnetic field pulses and this retains the non - collinearity in the long - time limit .
the long - time spin dynamics is thus a harmonic precession in which the non - collinear spin - density rigidly revolves about the total spin of the dimer and all the relative angles remain constant in time .
hence , the trajectories of the localised atomic - like spins , independently from their particular definition , map well onto the classical heisenberg model . in order for this mapping to be used for the extraction of heisenberg exchange parameters ,
the actual definition of local spins is important .
we have showed how a linear transformation , based on the hs and the ls collinear states and the direct integration of spin density over atomically - centered spheres , can be used to extract the directions of two localized spins .
when defined in this way the latter are , to a good degree , independent of the integration sphere used for their definition .
this also remains valid for the corresponding dynamically - defined exchange paremeter @xmath114 , for a range of distances where the overlap of the atomic wave - function is significant .
such defined exchange parameters agree well with the results from constrained dft around the ls and the hs states and with broken symmetry total lsda energy results .
we do acknowledge that the actual form of the exchange parameter depends on the choice of exchange and correlation functional used and that our dynamical method does not remedy the shortfall of local and semi - local functionals .
we believe that the dynamical method highlighted in this paper , together with generating a quantitatively relevant estimate of @xmath1 , could potentially provide a straightforward verification for the applicability of the heisenberg spin model to any spin - polarized nano - scaled system .
furthermore , it offers a possible strategy for mapping _ ab initio _
simulations on the widely used atomistic landau - lifshitz - gilbert micromagnetic models for spin - dynamics .
this work has been sponsored by the the european union under the cronos project ( no .
the authors wish to acknowledge the sfi / hea funded irish centre for high - end computing ( ichec ) for the provision of computational facilities and support .
we elaborate here on the procedure for extracting the local spins and the exchange parameters for the h - he - h molecule .
the leading exchange mechanism in this system is not the direct one , i.e. it does not necessarily depend on the degree of direct overlap of the atomic orbitals at the two magnetic sites .
it is then not clear _ a priori _ whether the linear transformation used to eliminate the dependence on the wave - function overlap in h@xmath11 is transferable to this case .
indeed , for h - he - h the spin - density snapshots in the long - time limit show a complex texture with multiple peaks and valleys around the he site and the interstitial regions ( see fig .
[ fig09 ] ) .
the main approximation , subsumed in the linear transformation , that the hs and ls state have approximately the same single - electron density distributions ( but not spin direction ) , seems likely to be violated if one looks at the transformation of the spin - distribution between the hs and the ls state as cartooned in fig .
[ fig12](a ) .
this , however , is not the case and we find that the average variation between the actual density distributions of the ls and hs collinear states at any point in the simulation box is below 5% for @xmath161   . with this result at hand , we verify numerically that the linear transformation , described in section [ seclint ] , is still an adequate choice for the local spin definition even at relatively small interatomic distances .      ( note that individual cartoons are rigidly rotated so that the leftmost spins in all snapshots are parallel to each other ) .
( b ) the carrier functions of the two spin - density distributions @xmath162 and @xmath163 [ see eq .
( [ sigma_r ] ) ] , based on the hs and the ls collinear states .
( c ) variation of the magnitude of the local spin , defined as @xmath164 ( which is identical for @xmath74 because of the symmetry ) , as function of the angle @xmath39 when the linear combination @xmath165 is used to fit the non - collinear distributions in panel ( a ) .
this result matches exactly @xmath113 obtained through the linear transformation of eq .
( [ lintransf ] ) . ]      our first criterion for assessing the adequateness of the local spin definition is the fact that the spins values obtained through the linear transformation do not depend on the choice of the sampling spatial volume , e.g. on the radius , @xmath73 , of the sphere used to integrate the spin density .
we find numerical evidences that this criterion is fulfilled even for small h - he distances where the overlaps are significant . in the top panels of fig .
[ fig13 ] we compare the total energy dispersion as a function of the angle , @xmath39 , between the two hydrogen local spins , for @xmath39 determined directly from the apparent spins in an extremely small sphere ( @xmath166 ) , in an extremely large sphere ( @xmath167 ) , and the case of @xmath39 determined after the linear transformation ( the blue squares in the graphs ) . for instance , in the more problematic case of small separation @xmath161   , the average relative variation in the calculated @xmath39 ( after the linear transformation ) is bellow 0.5% for a variation of @xmath73 between @xmath168 and @xmath160 .
this constitutes a tiny horizontal error - bar of the blue square data - points in fig .
[ fig13](a ) , smaller than the symbol size and clearly insignificant on the background of the sphere - radius variation of the apparent local - spin definition . in the case of a large bond - length all the @xmath133 curves ( for different local sphere definitions ) collapse onto one , which tends towards the ideal heisenberg cosine law
[ see fig .
[ fig13](b ) ] .
( total tddft energy in the long - time limit ) profiles with angles @xmath169 corresponding to different definitions of the local spins for two different bond - lengths ( a ) @xmath170    and ( b ) @xmath171   .
corresponding @xmath146 values at the two collinear - spin limits [ see eq .
( [ je ] ) ] for three different definitions of the local spins , are compared to the dynamical results for @xmath114 ( the area shaded in gray ) .
the straight lines are just guides to the eye between the two values .
the type of line is matched to the corresponding dynamical result ( in or at the border of the gray - shaded region ) for the same definition of @xmath39 . ]
a second relevant criterion could be how well the definition preserves the magnitude of the local spin in the various non - collinear states . ideally , if the spin - density distributions @xmath172 [ fig .
[ fig12](b ) ] , determined from the sum and the difference of spin - density between the ls and hs collinear states , are preserved in the non - collinear state ( they only rotate ) , the linear transformation in eq .
( [ lintransf ] ) will not affect the spin magnitudes in the non - collinear states ( @xmath19 are normalized by definition ) .
the result of the linear transformation for @xmath170    is presented in fig .
[ fig12](c )
. clearly , the variations from the norm of 1 are relatively small with a peak at about @xmath173 , where the local spin is about 11% larger than its value at @xmath124 or @xmath125 .    as a final criterion
, we consider how well the exchange coupling @xmath146 extracted from the total energy , eq .
( [ je ] ) , agrees with the dynamical exchange @xmath114 defined in eq .
( [ jdyn ] ) .
this comparison is presented in the bottom panels of fig .
[ fig13 ] . here
we also take into an account the fact that different local spin definitions result in different values of the angle @xmath39 . the magnitude of the local spins in eq .
( [ jdyn ] ) assumed to be always @xmath174 .
when analyzing such a direct comparison we need to keep in mind that the values of @xmath146 are associated with substantial inaccuracy , as they rely on a numerical second derivative .
the error - bars represent the standard deviation of a set of results ( of about 20 entries ) obtained by using either different form of local interpolation ( polynomial ) around the end points ( 0 and @xmath108 ) or global fits of @xmath133 to fourier cosine series of up to ninth order .
we find that the worst performing definition is the one based on a large sphere .
this systematically produces an incorrect slope of @xmath175 [ see fig .
[ fig13](c , d ) ] . reducing the radius of the sphere
improves the agreement , particularly for the larger distance .
the result of the linear transformation is rather surprising in the small separation case .
it significantly corrects the angles and gives rise to a larger variation of @xmath114 between the two collinear limits .
this variation is a signature for the unfitness of the heisenberg model in this case . at the same time , @xmath146 , based on the second derivatives of @xmath133 is also showing a similar variation .
this suggests that the classical mapping of the tddft spin - dynamics seems to capture the same term in the hamiltonian as the total energy second derivative .
based on this comparison , it is difficult to argue whether the small sphere or the linear transformation is more suitable for the local spin definition in this molecule .
however , the comparison allows us , without analyzing microscopic details , to dismiss some definition ( the large sphere , in this case ) on the basis that it leads to inconsistent results between the dynamical and the total - energy method for evaluating the heisenberg exchange coupling @xmath1 .
e.  ruiz , j.  cano , s.  alvarez , and p.  alemany , j. comp .
chem . * 20 * , 1391 ( 1999 ) .
peralta , and v.  barone , j. chem .
* 129 * , 194107 ( 2008 ) .
e.  beaurepaire , j .- c .
merle , a.  daunois and j .- y .
bigot , phys .
lett . * 76 * , 4250 ( 1996 ) .
a.  castro , h.  appel , m.  oliveira , c.a .
rozzi , x.  andrade , f.  lorenzen , m.a.l .
marques , e.k.u .
gross and a.  rubio , phys .
b * 243 * , 2465 ( 2006 ) .
a.e .  clark and e.r .
davidson , j. chem .
* 115 * , 7382 ( 2001 ) .