atomistic spin model simulations of magnetic...

25
Atomistic spin model simulations of magnetic nanomaterials EVANS, R F L, FAN, W J, CHUREEMART, P, OSTLER, Thomas <http://orcid.org/0000-0002-1328-1839>, ELLIS, M O A and CHANTRELL, R W Available from Sheffield Hallam University Research Archive (SHURA) at: http://shura.shu.ac.uk/15280/ This document is the author deposited version. You are advised to consult the publisher's version if you wish to cite from it. Published version EVANS, R F L, FAN, W J, CHUREEMART, P, OSTLER, Thomas, ELLIS, M O A and CHANTRELL, R W (2014). Atomistic spin model simulations of magnetic nanomaterials. Journal of Physics: Condensed Matter, 26 (10), p. 103202. Copyright and re-use policy See http://shura.shu.ac.uk/information.html Sheffield Hallam University Research Archive http://shura.shu.ac.uk

Upload: others

Post on 24-Jun-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

  • Atomistic spin model simulations of magnetic nanomaterialsEVANS, R F L, FAN, W J, CHUREEMART, P, OSTLER, Thomas , ELLIS, M O A and CHANTRELL, R W

    Available from Sheffield Hallam University Research Archive (SHURA) at:

    http://shura.shu.ac.uk/15280/

    This document is the author deposited version. You are advised to consult the publisher's version if you wish to cite from it.

    Published version

    EVANS, R F L, FAN, W J, CHUREEMART, P, OSTLER, Thomas, ELLIS, M O A and CHANTRELL, R W (2014). Atomistic spin model simulations of magnetic nanomaterials. Journal of Physics: Condensed Matter, 26 (10), p. 103202.

    Copyright and re-use policy

    See http://shura.shu.ac.uk/information.html

    Sheffield Hallam University Research Archivehttp://shura.shu.ac.uk

    http://shura.shu.ac.uk/http://shura.shu.ac.uk/information.html

  • This content has been downloaded from IOPscience. Please scroll down to see the full text.

    Download details:

    IP Address: 143.52.67.181

    This content was downloaded on 15/03/2017 at 15:43

    Please note that terms and conditions apply.

    Atomistic spin model simulations of magnetic nanomaterials

    View the table of contents for this issue, or go to the journal homepage for more

    2014 J. Phys.: Condens. Matter 26 103202

    (http://iopscience.iop.org/0953-8984/26/10/103202)

    Home Search Collections Journals About Contact us My IOPscience

    You may also be interested in:

    Fundamentals and applications of the Landau–Lifshitz–Bloch equation

    U Atxitia, D Hinzke and U Nowak

    Laser-induced magnetization dynamics and reversal in ferrimagnetic alloys

    Andrei Kirilyuk, Alexey V Kimel and Theo Rasing

    A method for atomistic spin dynamics simulations: implementation and examples

    B Skubic, J Hellsvik, L Nordström et al.

    Micromagnetic simulations using Graphics Processing Units

    L Lopez-Diaz, D Aurelio, L Torres et al.

    Atomistic spin dynamics and surface magnons

    Corina Etz, Lars Bergqvist, Anders Bergman et al.

    Magnetism in ultrathin film structures

    C A F Vaz, J A C Bland and G Lauhoff

    http://iopscience.iop.org/page/termshttp://iopscience.iop.org/0953-8984/26/10http://iopscience.iop.org/0953-8984http://iopscience.iop.org/http://iopscience.iop.org/searchhttp://iopscience.iop.org/collectionshttp://iopscience.iop.org/journalshttp://iopscience.iop.org/page/aboutioppublishinghttp://iopscience.iop.org/contacthttp://iopscience.iop.org/myiopsciencehttp://iopscience.iop.org/article/10.1088/1361-6463/50/3/033003http://iopscience.iop.org/article/10.1088/0034-4885/76/2/026501http://iopscience.iop.org/article/10.1088/0953-8984/20/31/315203http://iopscience.iop.org/article/10.1088/0022-3727/45/32/323001http://iopscience.iop.org/article/10.1088/0953-8984/27/24/243202http://iopscience.iop.org/article/10.1088/0034-4885/71/5/056501

  • Journal of Physics: Condensed Matter

    J. Phys.: Condens. Matter 26 (2014) 103202 (23pp) doi:10.1088/0953-8984/26/10/103202

    Topical Review

    Atomistic spin model simulations ofmagnetic nanomaterialsR F L Evans1, W J Fan, P Chureemart, T A Ostler2, M O A Ellis andR W Chantrell

    Department of Physics, The University of York, York YO10 5DD, UK

    E-mail: [email protected]

    Received 3 December 2013, revised 2 January 2014Accepted for publication 7 January 2014Published 19 February 2014

    AbstractAtomistic modelling of magnetic materials provides unprecedented detail about theunderlying physical processes that govern their macroscopic properties, and allows thesimulation of complex effects such as surface anisotropy, ultrafast laser-induced spindynamics, exchange bias, and microstructural effects. Here we present the key methods usedin atomistic spin models which are then applied to a range of magnetic problems. We detail theparallelization strategies used which enable the routine simulation of extended systems withfull atomistic resolution.

    Keywords: magnetism, atomistic model, classical spin model, Monte Carlo, spin dynamics

    (Some figures may appear in colour only in the online journal)

    Contents

    1. Introduction 2

    2. The atomistic spin model 2

    2.1. The classical spin Hamiltonian 32.2. A note on magnetic units 4

    3. System parameterization and generation 4

    3.1. Atomistic parameters from ab initio calculations 43.2. Atomistic parameters from macroscopic

    properties 53.3. Atomistic system generation 6

    4. Integration methods 6

    4.1. Spin dynamics 64.2. Langevin dynamics 74.3. Time Integration of the LLG equation 74.4. Monte Carlo methods 9

    1 www-users.york.ac.uk/∼rfle500/.2 www.tomostler.co.uk.

    5. Test simulations 10

    5.1. Angular variation of the coercivity 11

    5.2. Boltzmann distribution for a single spin 11

    5.3. Curie temperature 12

    5.4. Demagnetizing fields 12

    6. Parallel implementation and scaling 15

    7. Conclusions and perspectives 16

    Acknowledgments 17

    Appendix A. Code structure and design philosophy 17

    Appendix B. Atomistic system generation in VAMPIRE 17

    Appendix C. Parallelization strategies 18

    C.1. Statistical parallelism 18

    C.2. Geometric decomposition 18

    C.3. Replicated data 20

    C.4. Additional scaling tests 20

    References 21

    0953-8984/14/103202+23$33.00 1 c© 2014 IOP Publishing Ltd Printed in the UK

    Made open access 17 December 2014

    Content from this work may be used under the terms of the Creative Commons Attribution 3.0 licence.Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

    http://dx.doi.org/10.1088/0953-8984/26/10/103202mailto:[email protected]://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www-users.york.ac.uk/~rfle500/http://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://www.tomostler.co.ukhttp://creativecommons.org/licenses/by/3.0

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    1. Introduction

    Atomistic models of magnetic materials, where the atoms aretreated as possessing a local magnetic moment, originatedwith Ising in 1925 as the first model of the phase transition ina ferromagnet [1]. The Ising model has spin-up and spin-downonly states, and is amenable to analytical treatment, at leastin two dimensions. Although it is still extensively used inthe study of phase transitions, it is limited in applicability tomagnetic materials and cannot be used for dynamic simula-tions. A natural extension of the Ising model is to allow theatomic spin to vary freely in 3D space [2, 3] which yieldsthe classical Heisenberg model, where quantum mechanicaleffects on the atomic spins are neglected [2]. Monte Carlosimulations of the classical Heisenberg model allowed thestudy of phase transitions, surface and finite size effects insimple magnetic systems. The study of dynamic phenomenahowever was intrinsically limited due to the use of Monte Carlomethods until the development of dynamic [4, 5] and stochasticLandau–Lifshitz–Gilbert atomistic spin models [6–8].

    Today atomistic simulation of magnetic materials hasbecome an essential tool in understanding the processesgoverning the complex behaviour of magnetic nanomaterials,including ultrafast laser-induced magnetization dynamics[9–11], exchange bias in core-shell nanoparticles [12–14]and multilayers [5, 15], surface anisotropy in magneticnanoparticles [16, 17], microstructural effects [18–20], spinvalves [21] and spin torque [22], temperature effects andproperties [23–26] and magnetic recording media [27, 28]. Asignificant capability of the atomistic spin model is to bridgethe gap between ab initio electronic structure calculations andmicromagnetics by using a multiscale model [29–32]. Sucha model is able to calculate effective parameters for largerscale micromagnetic simulations [33], such as anisotropies,and exchange constants [34]. The atomistic model is alsoable to interface directly with micromagnetic simulations totackle extended systems by calculating interface propertiesatomistically while treating the bulk of the material with amicromagnetic discretization [35, 36]. Despite the broad ap-plicability and importance of atomistic models, no easy-to-useand open-source software packages are presently available toresearchers, unlike the mesoscopic micromagnetic approacheswhere several packages are currently available [37–39].

    Today most magnetic modelling is performed using nu-merical micromagnetics in finite difference [37] and finiteelement [38, 39] flavours. The theoretical basis of micromag-netics is that the atomic dipoles which make up the magneticmaterial can be approximated as a continuous vector fieldwhere, due to the exchange interaction, the atomic dipoles ina small finite volume are perfectly aligned. Micromagneticshas proven to be an essential tool in understanding a rangeof complex magnetic effects [40–42] but due to the rapidpace of technological development in magnetic materials thecontinuum approximation at its heart precludes its applicationto many problems of interest at the beginning of the 21stcentury, such as heat assisted magnetic recording [43], ultrafastlaser-induced demagnetization [44, 45], exchange bias in spinvalves [46], surface and interface anisotropy [47, 48] and high

    anisotropy materials for ultrahigh density recording mediasuch as FePt [49]. The common theme to these problemsis a sub-nanometre spatial variation in the magnetizationcaused by high temperatures, atomic level ordering (anti-and ferrimagnets), or atomic surface and interface effects. Totackle these problems requires a formalism to take accountof the detailed atomic structure to express its impact on themacroscopic behaviour of a nano particle, grain or completedevice.

    Some, but not all, of these problems can adequately betackled by next-generation micromagnetic approaches uti-lizing the Landau–Lifshitz–Bloch equation [50–52], whichis based on a physically robust treatment of the couplingof a macrospin to a heat bath, allowing the study of hightemperature processes [53], ultrafast demagnetization [54, 55]and switching [56]. However, true atomic scale variations ofthe magnetization, as apparent in antiferromagnets, surfacesand interfaces, still require an atomistic approach. Additionallywith the decreasing size of magnetic elements, finite size ef-fects begin to play in increasing role in the physical propertiesof magnetic systems [57].

    In this article we present an overview of the commoncomputational methods utilized in atomistic spin simulationsand details of their implementation in the open-source VAMPIREsoftware package3. Testing of the code is an essential partof ensuring the accuracy of the model and so we also detailimportant tests of the various parts of the model and comparethem to analytic results while exploring some interestingphysics of small magnetic systems.

    VAMPIRE is designed specifically with these problems inmind, and can easily simulate nanoparticles, multilayer films,interfacial mixing, surface anisotropy and roughness, core-shell systems, granular media and lithographically definedpatterns, all with fully atomistic resolution. In addition, trulyrealistic systems predicted by Molecular Dynamics simula-tions [19, 20, 59] can also be used giving unprecedenteddetail about the relationships between shape and structureand the magnetic properties of nanoparticles. In addition tothese physical features VAMPIRE also utilizes the computingpower of multiprocessor machines through parallelization,allowing systems of practical interest to be simulated routinely,and large-scale problems on the 100+ nm length scale to besimulated on computing clusters. Further details of the VAMPIREcode and its architecture are presented in appendix A.

    2. The atomistic spin model

    The physical basis of the atomistic spin model is the local-ization of unpaired electrons to atomic sites, leading to aneffective local atomistic magnetic moment. The degree oflocalization of electrons has historically been a contentiousissue in 3d metals [60], due to the magnetism originatingin the outer electrons which are notionally loosely bound tothe atoms. Ab initio calculations of the electron density [61]show that in reality, even in ‘itinerant’ ferromagnets, the spinpolarization is well-localized to the atomic sites. Essentially

    3 Details available from vampire.york.ac.uk.

    2

    vampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.ukvampire.york.ac.uk

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    this suggests that the bonding electrons are unpolarized, andafter taking into account the bonding charge the remainingd-electrons form a well-defined effective localized moment onthe atomic sites.

    Magnetic systems are fundamentally quantum mechani-cal in nature since the electron energy levels are quantized,the exchange interaction is a purely quantum mechanicaleffect, and other important effects such as magnetocrystallineanisotropy arise from relativistic interactions of electronicorbitals with the lattice, which are the province of ab initiomodels. In addition to these properties at the electronic level,the properties of magnetic materials are heavily influencedby thermal effects which are typically difficult to incorporateinto standard density functional theory approaches. Thereforemodels of magnetic materials should combine the quantummechanical properties with a robust thermodynamic formal-ism. The simplest model of magnetism using this approach isthe Ising model [1], which allows the atomic moments one oftwo allowed states along a fixed quantization axis. Althoughuseful as a descriptive system, the forced quantization isequivalent to infinite anisotropy, limiting the applicability ofthe Ising model in relation to real materials. In the classicaldescription the direction of the atomic moment is a continuousvariable in 3D space allowing for finite anisotropies anddynamic calculations. In some sense the classical spin model isanalogous to Molecular Dynamics, where the energetics of thesystem are determined primarily from quantum mechanics, butthe time evolution and thermodynamic properties are treatedclassically.

    2.1. The classical spin Hamiltonian

    The extended Heisenberg spin model encapsulates the essen-tial physics of a magnetic material at the atomic level, wherethe energetics of a system of interacting atomic moments isgiven by a spin Hamiltonian (which neglects non-magneticeffects such the as the Coulomb term). The spin HamiltonianH typically has the form:

    H=Hexc+Hani+Happ (1)

    denoting terms for the exchange interaction, magneticanisotropy, and externally applied magnetic fields respectively.

    The dominant term in the spin Hamiltonian is the Heisen-berg exchange energy, which arises due to the symmetry of theelectron wavefunction and the Pauli exclusion principle [60]which governs the orientation of electronic spins in over-lapping electron orbitals. Due to its electrostatic origin, theassociated energies of the exchange interaction are around1–2 eV, which is typically up to 1000 times larger than thenext largest contribution and gives rise to magnetic orderingtemperatures in the range 300–1300 K. The exchange energyfor a system of interacting atomic moments is given by theexpression

    Hexc =−∑i 6= j

    Ji j Si · S j (2)

    where Ji j is the exchange interaction between atomic sitesi and j , Si is a unit vector denoting the local spin momentdirection and S j is the spin moment direction of neighbouring

    atoms. The unit vectors are taken from the actual atomic mo-mentµs and given by Si =µs/|µs|. It is important to note herethe significance of the sign of Ji j . For ferromagnetic materialswhere neighbouring spins align in parallel, Ji j > 0, and forantiferromagnetic materials where the spins prefer to alignanti-parallel Ji j < 0. Due to the strong distance dependenceof the exchange interaction, the sum in equation (2) is oftentruncated to include nearest neighbours only. This significantlyreduces the computational effort while being a good approxi-mation for many materials of interest. In reality the exchangeinteraction can extend to several atomic spacings [29, 30],representing hundreds of pairwise interactions.

    In the simplest case the exchange interaction Ji j isisotropic, meaning that the exchange energy of two spinsdepends only on their relative orientation, not their direction.In more complex materials, the exchange interaction forms atensor with components:

    JMi j =

    [Jxx Jxy JxzJyx Jyy JyzJzx Jzy Jzz

    ], (3)

    which is capable of describing anisotropic exchange interac-tions, such as two-ion anisotropy [29] and the Dzyaloshinskii–Moriya interaction (off-diagonal components of the exchangetensor). In the case of tensorial exchange HMexc, the exchangeenergy is given by the product:

    HMexc =−∑i 6= j

    [Six S

    iy S

    iz] [Jxx Jxy Jxz

    Jyx Jyy JyzJzx Jzy Jzz

    ]Sjx

    S jyS jz

    . (4)Obtaining the components of the exchange tensor may bedone phenomenologically, or via ab initio methods such asthe relativistic torque method [62–65] or the spin-clusterexpansion technique [30, 66–68]. The above expressionsfor the exchange energy also exclude higher-order exchangeinteractions such as three-spin and four-spin terms. In mostmaterials the higher-order exchange terms are significantlysmaller than the leading term and can safely be neglected.

    While the exchange energy gives rise to magnetic orderingat the atomic level, the thermal stability of a magnetic materialis dominated by the magnetic anisotropy, or preference for theatomic moments to align along a preferred spatial direction.There are several physical effects which give rise to anisotropy,but the most important is the magnetocrystalline anisotropy(namely the preference for spin moments to align with particu-lar crystallographic axes) arising from the interaction of atomicelectron orbitals with the local crystal environment [69, 70].

    The simplest form of anisotropy is of the single-ionuniaxial type, where the magnetic moments prefer to alignalong a single axis, e, often called the easy axis and is aninteraction confined to the local moment. Uniaxial anisotropyis most commonly found in particles with elongated shape(shape anisotropy), or where the crystal lattice is distortedalong a single axis as in materials such as hexagonal Cobalt andL10 ordered FePt. The uniaxial single-ion anisotropy energyis given by the expression:

    Huniani =−ku∑

    i

    (Si · e)2 (5)

    3

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    where ku is the anisotropy energy per atom. Materials witha cubic crystal structure, such as iron and nickel, have adifferent form of anisotropy known as cubic anisotropy. Cubicanisotropy is generally much weaker than uniaxial anisotropy,and has three principal directions which energetically areeasy, hard and very hard magnetization directions respectively.Cubic anisotropy is described by the expression:

    Hcubani =kc2

    ∑i

    (S4x + S

    4y + S

    4z

    )(6)

    where kc is the cubic anisotropy energy per atom, and Sx , Sy ,and Sz are the x , y, and z components of the spin moment Srespectively.

    Most magnetic problems also involve interactions be-tween the system and external applied fields, denoted as Happ.External fields can arise in many ways, for example a nearbymagnetic material, or as an effective field from an electriccurrent. In all cases the applied field energy is simply given by:

    Happ =−∑

    i

    µsSi · Happ. (7)

    2.2. A note on magnetic units

    The subject of magnetic units is controversial due to theexistence of multiple competing standards and historical ori-gins [60]. Starting from the atomic level however, the dimen-sionality of units is relatively transparent. Atomic momentsare usually accounted for in multiples of the Bohr magneton(µB), the magnetic moment of an isolated electron, with unitsof J T−1. Given a number of atoms of moment µs in a volume,the moment per unit volume is naturally in units of J T m−3,which is identical to the SI unit of A m−1. However, thedimensionality (moment per unit volume) of the unit A m−1

    is not as obvious as J T−1m−3, and so the latter form is usedherein.

    Applied magnetic fields are hence defined in Tesla, whichcomes naturally from the derivative of the spin Hamiltonianwith respect to the local moment. The unit of Tesla for appliedfield is also beneficial for hysteresis loops, since the areaenclosed a typical M–H loop is then given as an energy density(J m−3). A list of key magnetic parameters and variables andtheir units are shown in table 1.

    3. System parameterization and generation

    Unlike micromagnetic simulations where the magnetic systemcan be partitioned using either a finite difference or finiteelement discretization, atomistic simulations generally requiresome a priori knowledge of atomic positions. Most simplemagnetic materials such as Fe, Co or Ni form regular crystals,while more complex systems such as oxides, antiferromagnetsand Heusler alloys possess correspondingly complex atomicstructures. For ferromagnetic metals, the details of atomicpositions are generally less important due to the strong parallelorientation of moments, and so they can often (but not always)be represented using a simple cubic discretization. In contrast,the properties of ferrimagnetic and antiferromagnetic materials

    Table 1. Table of key variables and their units.

    Variable Symbol Unit

    Atomic magnetic moment µs Joules/Tesla (J T−1)Unit cell size a Angstroms (Å)Exchange energy Ji j Joules/link (J)Anisotropy energy ku Joules/atom (J)Applied field H Tesla (T)Temperature T Kelvin (K)Time t Seconds (s)

    Parameter Symbol Value

    Bohr magneton µB 9.2740× 10−24 J T−1

    Gyromagnetic ratio γ 1.76× 1011 T−1 s−1

    Permeability of free space µ0 4π × 10−7 T2 J−1 m3

    Boltzmann constant kB 1.3807× 10−23 J K−1

    are inherently tied to the atomic positions due to frustrationand exchange interactions, and so simulation of these materialsmust incorporate details of the atomic structure.

    In addition to the atomic structure of the material, it is alsonecessary to parameterize the terms of the spin Hamiltoniangiven by equation (1), principally including exchange andanisotropy values but also with other terms. There are generallytwo ways in which this may be done: using experimentallydetermined properties or with a multiscale approach usingab initio density functional theory calculations as input to thespin model.

    3.1. Atomistic parameters from ab initio calculations

    Ab initio density functional theory (DFT) calculations utilizethe Hohenberg–Kohn–Sham theory [71, 72] which states thatthe total energy E of a system can be written solely in terms theelectron density, ρ. Thus, if the electron density is known thenthe physical properties of the system can be found. In practice,the both electron density and the spin density are used asfundamental quantities in the total energy expression for spin-polarized systems [73]. In many implementations DFT-basedmethods only consider the outer electrons of a system, sincethe inner electrons play a minimal role in the bonding and alsopartially screen the effect of the nuclear core. These effectsare approximated by a pseudopotential which determines thepotential felt by the valence electrons. In all-electron methods,however, the core electron density is also relaxed. By energyminimization, DFT enables the calculation of a wide rangeof properties, including lattice constants, and in the case ofmagnetic materials localized spin moments, magnetic groundstate and the effective magnetocrystalline anisotropy. Standardsoftware packages such as VASP [74], CASTEP [75, 76] andSIESTA [77] make such calculations readily accessible. Atpresent determining site resolved properties such as anisotropyconstants and pairwise exchange interactions is more involvedand requires ab initio Green’s functions techniques such asthe fully relativistic Korringa–Kohn–Rostoker method [78,79] or the LMTO method [80, 81] in conjunction with themagnetic force theorem [62]. An alternative approach forthe calculation of exchange parameters is the utilization

    4

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    of the generalized Bloch theorem for spin-spiral states inmagnetic systems [82] together with a Fourier transformationof k-dependent spin-spiral energies [83, 84].

    A number of studies have determined atomic magneticproperties from first principles calculations by direct mappingonto a spin model, including the principal magnetic elementsCo, Ni and Fe [81], metallic alloys including FePt [29],IrMn [31], oxides [85] and spin glasses [86], and also bilayersystems such as Fe/FePt [87]. Such calculations give detailedinsight into microscopic magnetic properties, including atomicmoments, long-ranged exchange interactions, magnetocrys-talline anisotropies (including surface and two-ion interac-tions) and other details not readily available from phenomeno-logical theories. Combined with atomistic models it is possibleto determine macroscopic properties such as the Curie tem-perature, temperature-dependent anisotropies, and magneticground states, often in excellent agreement with experiment.However, the computational complexity of DFT calculationsalso means that the systems which can be simulated with thismulti scale approach are often limited to small clusters, perfectbulk systems and 2D periodic systems, while real materials ofcourse often contain a plethora of defects disrupting the longrange order. Some studies have also investigated the effectsof disorder in magnetic systems combined with a spin modelmapping, such as dilute magnetic semiconductors [88] andmetallic alloys [89].

    Magnetic properties calculated at the electronic level havea synergy with atomistic spin models, since the electronicproperties can often be mapped onto a Heisenberg spin modelwith effective local moments. This multiscale electronic andatomistic approach avoids the continuum approximations ofmicromagnetics and treats magnetic materials at the naturalatomic scale.

    3.2. Atomistic parameters from macroscopicproperties

    The alternative approach to multiscale atomistic/density-functional-theory simulations is to derive the parameters fromexperimentally determined values. This has the advantage ofspeed and lower complexity, whilst foregoing microscopicdetails of the exchange interactions or anisotropies. Anotherkey advantage of generic parameters is the possibility ofparametric studies, where parameters are varied explicitly todetermine their importance for the macroscopic propertiesof the system, such as has been done for studies of surfaceanisotropy [17] and exchange bias [13].

    Unlike micromagnetic simulations, the fundamental ther-modynamic approach of the atomistic model means that allparameters must be determined for zero temperature. Thespin fluctuations then determine the intrinsic temperature de-pendence of the effective parameters which are usually putinto micromagnetic simulations as parameters. Fortunatelydetermination of the atomic moments, exchange constants andanisotropies from experimental values is relatively straightfor-ward for most systems.

    3.2.1. Atomic spin moment. The atomic spin moment µs isrelated to the saturation magnetization simply by:

    µs =Msa3

    nat(8)

    where Ms is the saturation magnetization at 0 K in J T−1m−3,a is the unit cell size (m), and nat is the number of atoms per unitcell. We also note the usual convention of expressing atomicmoments in multiples or fractions of the Bohr magneton,µB owing to their electronic origin. Taking BCC iron as anexample, the zero temperature saturation magnetization is1.75 MA m−1 [90], unit cell size of a = 2.866 Å, this gives anatomic moment of 2.22 µB/atom.

    3.2.2. Exchange energy. For a generic atomistic model withz nearest neighbour interactions, the exchange constant isgiven by the mean-field expression:

    Ji j =3kBTc�z

    (9)

    where kB is the Boltzmann constant and Tc is the Curietemperature z is the number of nearest neighbours. � is acorrection factor from the usual mean-field expression whicharises due to spin waves in the 3D Heisenberg model [91].Because of this � is also dependent on the crystal structure andcoordination number, and so the calculated Tc will vary slightlyaccording to the specifics of the system. For Cobalt with a Tcof 1388 K and assuming a hexagonal crystal structure withz = 12, this gives a nearest neighbour exchange interactionJi j = 6.064× 10−21 J/link.

    3.2.3. Anisotropy energy. The atomistic magnetocrystallineanisotropy ku is derived from the macroscopic anisotropyconstant Ku by the expression:

    ku =Kua3

    nat(10)

    where Ku in given in J m−3. In addition to the atomisticparameters, it is also worth noting the analogous expressionsfor the anisotropy field Ha for a single domain particle:

    Ha =2KuMs=

    2kuµs

    (11)

    where symbols have their usual meaning. At this point it isworth mentioning that the measured anisotropy is a free energydifference. While the intrinsic ku remains (to a first approxima-tion) temperature independent, at a non-zero temperature thefree energy in the easy/hard directions is increased/decreaseddue to the magnetization fluctuations. Thus the macroscopicanisotropy value decreases with increasing temperature, van-ishing at Tc. The thermodynamic basis of atomistic modelsmakes them highly suitable for the investigation of suchphenomena, as we show later. Applying the above, parametersfor the key ferromagnetic elements are given in table 2.

    5

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Table 2. Table of derived constants for the ferromagnetic elements Fe, Co, Ni and Gd.

    Fe Co Ni Gd Unit

    Crystal structure bcc hcp fcc hcp —Unit cell size a 2.866 2.507 3.524 3.636 ÅInteratomic spacing ri j 2.480 2.507 2.492 3.636 ÅCoordination number z 8 12 12 12 —Curie temperature Tc 1043 1388 631 293 KSpin-wave MF correction [91, 92] � 0.766 0.790 0.790 0.790 —Atomic spin moment µs 2.22 1.72 0.606 7.63 µBExchange energy Ji j 7.050× 10−21 6.064× 10−21 2.757× 10−21 1.280× 10−21 J/linkAnisotropy energy [93] k 5.65× 10−25 6.69× 10−24 5.47× 10−26 5.93× 10−24 J/atom

    3.2.4. Ferrimagnets and antiferromagnets. In the case offerrimagnets and antiferromagnets the above methods foranisotropy and moment determination do not work dueto the lack of macroscopic measurements, although theestimated exchange energies apply equally well to the Néeltemperature provided no magnetic frustration (due to latticesymmetry) is present. In general, other theoretical calculationsor formalisms are required to determine parameters, suchas mean-field approaches [9] or density functional theorycalculations [31].

    3.3. Atomistic system generation

    In addition to determining the parameters of the spin Hamil-tonian, an essential part of the atomistic model is the determi-nation of the nuclear, or atomic, positions in the system. In themultiscale approach utilizing ab initio parameterization of thesystem, the spin Hamiltonian is intrinsically tied to the atomicpositions. The additional detail offered by first principlescalculations is highly desirable even for perfect crystals andatomically sharp interfaces, however the computational com-plexity of the calculations limits the ability to parameterize aspin Hamiltonian for systems of extended defects over 10 nm+length scales, including physical effects such as vacancies,impurities, dislocations and even amorphous materials.

    For systems modelled using the nearest neighbour ap-proximation, the atomic structures are much less restricted,allowing for simulations of material defects such as interfaceroughness [13] and intermixing [21], magnetic multilayers[94], disordered magnetic alloys [9], surface [17] and finitesize effects [57]. VAMPIRE includes extensive functionality togenerate such systems, the details of which are included inappendix B. In addition to crystallographic and molecular sys-tems [95, 96] it is also possible to investigate magnetic effectsin disordered materials and nanoparticles by incorporating theresults of Molecular Dynamics simulations [19, 20, 97].

    4. Integration methods

    Although the spin Hamiltonian describes the energetics of themagnetic system, it provides no information regarding its timeevolution, thermal fluctuations, or the ability to determine theground state for the system. In the following the commonlyutilized integration methods for atomistic spin models areintroduced.

    4.1. Spin dynamics

    The first understanding of spin dynamics came from ferro-magnetic resonance experiments, where the time-dependentbehaviour of a magnetic materials is described by the equationderived by Landau and Lifshitz [98], and in the modern formgiven by:

    ∂m∂t=−γ [m×H+αm× (m×H)] (12)

    where m is a unit vector describing the direction of thesample magnetization, H is the effective applied field actingon the sample, γ is the gyromagnetic ratio and α is aphenomenological damping constant which is a property ofthe material. The physical origin of the Landau–Lifshitz(LL) equation arises due to two distinct physical effects. Theprecession of the magnetization (first term in equation (12))arises due to the quantum mechanical interaction of an atomicspin with an applied field. The relaxation of the magnetization(second term in equation (12)) is an elementary formulation ofenergy transfer representing the coupling of the magnetizationto a heat bath which aligns the magnetization along the fielddirection with a characteristic coupling strength determined byα. In the LL equation the relaxation rate of the magnetizationto the field direction is a linear function of the dampingparameter, which was shown by Gilbert to yield incorrectdynamics for materials with high damping [99]. SubsequentlyGilbert introduced critical damping, with a maximum effectivedamping for α = 1, to arrive at the Landau–Lifshitz–Gilbert(LLG) equation. Although initially derived to describe thedynamics of the macroscopic magnetization of a sample, theLLG is the standard equation of motion used in numericalmicromagnetics, describing the dynamics of small magneticelements.

    The same equation of motion can also be applied at theatomistic level. The precession term arises quantum mechan-ically for atomic spins and the relaxation term now describesdirect angular momentum transfer between the spins and theheat bath, which includes contributions from the lattice [100]and the electrons [101]. A distinction between the macroscopicLLG and the atomistic LLG now appears in terms of the effectsincluded within the damping parameter. In the macroscopicLLG, α includes all contributions, both intrinsic (such asspin–lattice and spin–electron interactions) and extrinsic (spin-spin interactions arising from demagnetization fields, surface

    6

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    defects [102], doping [103] and temperature [50]), while theatomistic LLG only includes the local intrinsic contributions.To distinguish the different definitions of damping we thereforeintroduce a microscopic damping parameter λ. Although theform of the LLG is identical for atomistic and macroscopiclength scales, the microstructural detail in the atomistic modelallows for calculations of the effective damping includingextrinsic effects, such as rare-earth doping [103]. Including amicroscopic damping λ the atomistic Landau–Lifshitz–Gilbertequation is given by

    ∂Si∂t=−

    γ

    (1+ λ2)[Si ×Hieff + λSi × (Si ×H

    ieff)] (13)

    where Si is a unit vector representing the direction of themagnetic spin moment of site i , γ is the gyromagnetic ratio andHieff is the net magnetic field on each spin. The atomistic LLGequation describes the interaction of an atomic spin momenti with an effective magnetic field, which is obtained from thenegative first derivative of the complete spin Hamiltonian, suchthat:

    Hieff =−1µs

    ∂H∂Si

    (14)

    where µs is the local spin moment. The inclusion of the spinmoment within the effective field is significant, in that thefield is then expressed in units of Tesla, given a Hamiltonian inJoules. Given typical energies in the Hamiltonian of 10 µeV–100 meV range. This gives fields typically in the range0.1–1000 T, given a spin moment of the same order as theBohr magneton (µB).

    4.2. Langevin dynamics

    In its standard form the LLG equation is strictly only applicableto simulations at zero temperature. Thermal effects causethermodynamic fluctuations of the spin moments which atsufficiently high temperatures are stronger than the exchangeinteraction, giving rise to the ferromagnetic-paramagnetictransition. The effects of temperature can be taken into accountby using Langevin Dynamics, an approach developed byBrown [104]. The basic idea behind Langevin Dynamics isto assume that the thermal fluctuations on each atomic sitecan be represented by a Gaussian white noise term. As thetemperature is increased, the width of the Gaussian distributionincreases, thus representing stronger thermal fluctuations.The established Langevin Dynamics method is widely usedfor spin dynamics simulations and incorporates an effectivethermal field into the LLG equation to simulate thermaleffects [105–107]. The thermal fluctuations are representedby a Gaussian distribution 0(t) in three dimensions with amean of zero. At each time step the instantaneous thermalfield on each spin i is given by:

    Hith =0(t)

    √2λkBTγµs1t

    (15)

    where kB is the Boltzmann constant, T is the system temper-ature, λ is the Gilbert damping parameter, γ is the absolutevalue of the gyromagnetic ratio, µs is the magnitude of the

    atomic magnetic moment, and 1t is the integration time step.The effective field for application in the LLG equation withLangevin Dynamics then reads:

    Hieff =−1µs

    ∂H∂Si+Hith. (16)

    Given that for each time step three Gaussian distributedrandom numbers are required for every spin, efficient gen-eration of such numbers is essential. VAMPIRE makes use theMersenne Twister [108] uniform random number generatorand the Ziggurat method [109] for generating the Gaussiandistribution.

    It is useful at the this point to address the applicabilityof the atomistic LLG equation to slow and fast problemsrespectively. In reality the thermal and magnetic fluctuationsare correlated at the atomic level, arising from the dynamicinteractions between the atoms and lattice/electron system.These correlations may be important in terms of the thermalfluctuations experienced by the atomistic spins. In the conven-tional Langevin dynamics approach described above, the noiseterm is completely uncorrelated in time and space. For shorttimescales however, the thermal fluctuations are correlatedin time, and so the noise is coloured [110]. The effect ofthe coloured noise is to lessen the effect of sudden temper-ature changes on the magnetization dynamics. However, theexistence of ultrafast magnetization dynamics [11, 44], andthat it is driven by a thermal rather than quantum mechanicalprocess [111], requires that the effective correlation timeis short, with an upper bound of around 1 fs. Given thatthe correlation time is close to the integration timestep, theapplicability of the LLG to problems with timescales ≥ 1 fsis sound. There will be a point however where the LLG isno longer valid, where direct simulation of the microscopicdamping mechanisms will be necessary. Progress has beenmade in linking molecular dynamics and spin models [100,112, 113] which enables the simulation of spin–lattice inter-actions, which is particularly relevant for slow problems, suchas conventional magnetic recording where switching occursover nanosecond timescales. However, it is also essentialto consider spin–electron effects [101, 114] necessary forultrafast demagnetization processes, although the physicalorigins are still currently debated [115].

    4.3. Time Integration of the LLG equation

    In order to determine the time evolution of a system ofspins, it is necessary to solve the stochastic LLG equation,as given by equations (13) and (16), numerically. The choiceof solver is limited due to the stochastic nature of the equations.Specifically, it is necessary to ensure convergence to theStratonovich solution. This has been considered in detail byGarcia-Palacios [105], but the essential requirement [116]is that the solver enforces the conservation of the magni-tude of the spin, either implicitly or by renormalization. Themost primitive integration scheme uses Euler’s method, whichassumes a linear change in the spin direction in a singlediscretized time step, 1t . An improved integration scheme,known as the Heun method [105] is commonly used, which

    7

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    allows the use of larger time steps because of its use ofa predictor–corrector algorithm. Other more advanced in-tegration schemes have been suggested, such as the mid-point method [117] and modified predictor–corrector midpointschemes [103, 118]. The principal advantage of the midpointscheme is that the length of the spin vector is preserved duringthe integration which allows larger time steps to be used. How-ever for the midpoint scheme the significant increase in com-putational complexity outweighs the benefits of larger timesteps [118]. Modified predictor–corrector schemes [103, 118]reduce the computational complexity of the midpoint scheme,but with a loss of accuracy, particularly in the time-dependentdynamics [103]. For valid integration of the stochastic LLGequation it is also necessary for the numerical scheme toconverge to the Stratonovich solution [105, 119]. Althoughproven for the midpoint and Heun numerical schemes, thevalidity of the predictor–corrector midpoint schemes for thestochastic LLG have yet to be confirmed. On balance theHeun scheme, despite its relative simplicity, is sufficientlycomputationally efficient that it is still the most widely usedintegration scheme for stochastic magnetization dynamics, andso we proceed to describe its implementation in detail.

    In the Heun method, the first (predictor) step calculatesthe new spin direction, S′i , for a given effective field H

    ieff by

    performing a standard Euler integration step, given by:

    S′i = Si +1S1t (17)

    where

    1S=−γ

    (1+ λ2)[Si ×Hieff + λSi × (Si ×H

    ieff)]. (18)

    The Heun scheme does not preserve the spin length and so itis essential to renormalize the spin unit vector length Si afterboth the predictor and corrector steps to ensure numericalstability and convergence to the Stratanovich solution. Afterthe first step the effective field must be re-evaluated as theintermediate spin positions have now changed. It should benoted that the random thermal field does not change betweensteps. The second (corrector) step then uses the predicted spinposition and revised effective field Hi

    eff to calculate the finalspin position, resulting in a complete integration step givenby:

    St+1ti = Si +12

    [1S+1S′

    ]1t (19)

    where

    1S′ =−γ

    (1+ λ2)[S′i ×H

    i ′eff + λS

    i × (S′

    i ×Hi ′eff)]. (20)

    The predictor step of the integration is performed on everyspin in the system before proceeding to evaluate the correctorstep for every spin. This is then repeated many times so that thetime evolution of the system can be simulated. Although theHeun scheme was derived specifically for a stochastic equationwith multiplicative noise, in the absence of the noise term theHeun method reduces to a standard second order Runge–Kuttamethod [120]. In order to test the implementation of the Heunintegration scheme, it is possible to compare the calculatedresult with the analytical solution for the LLG. For the simple

    case of a single spin initially along the x-axis in an appliedfield along the z-axis, the time evolution [121] is given by:

    Sx (t)= sech(λγ H1+ λ2

    t)

    cos(γ H

    1+ λ2t)

    Sy(t)= sech(λγ H1+ λ2

    t)

    sin(γ H

    1+ λ2t)

    Sz(t)= tanh(λγ H1+ λ2

    t).

    (21)

    The expected and simulated time evolution for a single spinwith H = 10 T, 1t = 1× 10−15 s and λ= 0.1, 0.05 is plottedin figure 1. Superficially the simulated and expected timeevolution agree very well, with errors around 10−6. The errorgives a characteristic trace the size and shape of which isindicative of a correct implementation of the Heun integrationscheme.

    Ideally one would like to use the largest time step possibleso as to simulate systems for the longest time. For micromag-netic simulations at zero temperature, the minimum time stepis a well defined quantity since the largest field (usually theexchange term) essentially defines the precession frequency.However, for atomistic simulations using the stochastic LLGequation with Langevin dynamics, the effective field becomestemperature dependent. The consequence of this is that foratomistic models the most difficult region to integrate is in theimmediate vicinity of the Curie point. Errors in the integrationof the system will be apparent from a non-converged valuefor the average magnetization. This gives a relatively simplecase which can then be used to test the stability of integrationschemes for the stochastic LLG model. A plot of the meanmagnetization as a function of temperature is shown in figure 2for a representative system consisting of 22× 22× 22 unitcells with generic material parameters of FePt with an fcccrystal structure, nearest neighbour exchange interaction ofJi j = 3.0× 10−21 J/link and uniaxial anisotropy of 1.0×10−23 J/atom. The system is first equilibrated for 10 ps at eachtemperature and then the mean magnetization is calculatedover a further 10 ps.

    First, comparing the effect of temperature on the minimumallowable time step, the data show that for low temperaturesreasonably large time steps of 1× 10−15 give the correctsolution of the LLG equations, while near the Curie point(690 K) the deviations from the correct equilibrium valueare significant. Consequently for simulations studying hightemperature reversal processes time steps of 1× 10−16 s arenecessary. It should be noted that the time steps which can beused are material-dependent—specifically if a material withhigher Curie temperature is used then the usable time stepswill be correspondingly lower due to the increased exchangefield.

    From a practical perspective a significant advantage ofthe spin dynamics method is the ability to parallelize theintegration system by domain decomposition, details of whichare given in appendix C. This allows the efficient simulationof relatively large systems consisting of tens or hundreds ofgrains or nano structures with dimensions greater than 100 nmfor nanosecond timescales, with typical numbers of spins inthe range 106–108.

    8

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Figure 1. Time evolution of a single isolated spin in an applied field of 10 T and time step of 1 fs. Magnetization traces (a) and (c) showrelaxation of the magnetization to the z-direction and precession of the x component (the y-component is omitted for clarity) for dampingconstants λ= 0.1 and λ= 0.05 respectively. The points are the result of direction integration of the LLG and the lines are the analyticalsolution plotted according to equation (21). Panels (b) and (d) show the corresponding error traces (difference between the expected andcalculated spin components) for the two damping constants for (a) and (c) respectively. For λ= 0.1 the error is below 10−6, while for lowerdamping the numerical error increases significantly due to the increased number of precessions, highlighting the damping dependence of theintegration time step.

    Figure 2. Time step dependence of the mean magnetization fordifferent reduced temperatures for the Heun integration scheme.Low (T � Tc) and high (T � Tc) temperatures integrate accuratelywith a 1fs timestep, but in the vicinity of Tc a timestep of around10−16 is required for this system.

    4.4. Monte Carlo methods

    While spin dynamics are particularly useful for obtain-ing dynamic information about the magnetic properties orreversal processes for a system, they are often not theoptimal method for determining the equilibrium properties, for

    example the temperature-dependent magnetization. The MonteCarlo Metropolis algorithm [122] provides a natural way tosimulate temperature effects where dynamics are not requireddue to the rapid convergence to equilibrium and relative easeof implementation.

    The Monte Carlo metropolis algorithm for a classicalspin system proceeds as follows. First a random spin i ispicked and its initial spin direction Si is changed randomlyto a new trial position S′i , a so-called trial move. The changein energy 1E = E(S′i )− E(Si ) between the old and newpositions is then evaluated, and the trial move is then acceptedwith probability

    P = exp(−1EkBT

    )(22)

    by comparison with a uniform random number in the range0–1. Probabilities greater than 1, corresponding with a reduc-tion in energy, are accepted unconditionally. This procedure isthen repeated until N trial moves have been attempted, whereN is the number of spins in the complete system. Each set ofN trial moves comprises a single Monte Carlo step.

    The nature of the trial move is important due to tworequirements of any Monte Carlo algorithm: ergodicity andreversibility. Ergodicity expresses the requirement that allpossible states of the system are accessible, while reversibility

    9

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Figure 3. Schematic showing the three principal Monte Carlomoves: (a) spin flip; (b) Gaussian; and (c) random.

    requires that the transition probability between two states isinvariant, explicitly P(Si → S′i )= P(S

    i → Si ). From equa-tion (22) reversibility is obvious since the probability of aspin change depends only on the initial and final energy.Ergodicity is easy to satisfy by moving the selected spinto a random position on the unit sphere, however this hasan undesirable consequence at low temperatures since largedeviations of spins from the collinear direction are highlyimprobable due to the strength of the exchange interaction.Thus at low temperatures a series of trial moves on the unitsphere will lead to most moves being rejected. Ideally a moveacceptance rate of around 50% is desired, since very high andvery low rates require significantly more Monte Carlo steps toreach a state representative of true thermal equilibrium.

    One of the most efficient Monte Carlo algorithms for clas-sical spin models was developed by Hinzke and Nowak [123],involving a combinational approach using a mixture of dif-ferent trial moves. The principal advantage of this methodis the efficient sampling of all available phase space whilemaintaining a reasonable trial move acceptance rate. TheHinzke–Nowak method utilizes three distinct types of move:spin flip, Gaussian and random, as illustrated schematically infigure 3.

    The spin flip move simply reverses the direction of thespin such that S′i =−Si to explicitly allow the nucleation of aswitching event. The spin flip move is identical to a move inIsing spin models. It should be noted that spin flip moves do notby themselves satisfy ergodicity in the classical spin model,since states perpendicular to the initial spin direction areinaccessible. However, when used in combination with otherergodic trial moves this is quite permissible. The Gaussian trialmove takes the initial spin direction and moves the spin to apoint on the unit sphere in the vicinity of the initial positionaccording to the expression

    S′i =Si + σg0|Si + σg0|

    (23)

    where0 is a Gaussian distributed random number and σg is thewidth of a cone around the initial spin Si . After generating thetrial position S′i the position is normalized to yield a spin of unitlength. The choice of a Gaussian distribution is deliberate sinceafter normalization the trial moves have a uniform samplingover the cone. The width of the cone is generally chosen to betemperature dependent and of the form

    σg =225

    (kBTµB

    )1/5. (24)

    Figure 4. Visualization of Monte Carlo sampling on the unit spherefor (a) random and (b) Gaussian sampling algorithms at T = 10 K.The dots indicate the trial moves. The random algorithm shows auniform distribution on the unit sphere, and no preferential biasingalong the axes. The Gaussian trial moves are clustered around theinitial spin position, along the z-axis.

    The Gaussian trial move thus favours small angular changesin the spin direction at low temperatures, giving a goodacceptance probability for most temperatures.

    The final random trial move picks a random point on theunit sphere according to

    S′i =0

    |0|(25)

    which ensures ergodicity for the complete algorithm andensures efficient sampling of the phase space at high tem-peratures. For each trial step one of these three trial moves ispicked randomly, which in general leads to good algorithmicproperties.

    To verify that the random sampling and Gaussian trialmoves give the expected behaviour, a plot of the calculatedtrial moves on the unit sphere for the different algorithms isshown in figure 4. The important points are that the randomtrial move is uniform on the unit sphere, and that the Gaussiantrial move is close to the initial spin direction, along the z-axisin this case.

    At this point it is worthwhile considering the relativeefficiencies of Monte Carlo and spin dynamics for calcu-lating equilibrium properties. Figure 5 shows the simulatedtemperature-dependent magnetization for a test system usingboth LLG spin dynamics and Monte Carlo methods. Agree-ment between the two methods is good, but the spin dynamicssimulation takes around twenty times longer to compute due tothe requirements of a low time step and slower convergence toequilibrium. However, Monte Carlo algorithms are notoriouslydifficult to parallelize, and so for larger systems LLG spindynamic simulations are generally more efficient than MonteCarlo methods.

    5. Test simulations

    Having outlined the important theoretical and computationalmethods for the atomistic simulation of magnetic materials,we now proceed to detail the tests we have refined to ensurethe correct implementation of the main components of themodel. Such tests are particularly helpful to those wishing toimplement these methods. Similar tests developed for micro-magnetic packages [124] have proven an essential benchmarkfor the implementation of improved algorithms and codes withdifferent capabilities but the same core functionality.

    10

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Figure 5. Comparative simulation of temperature-dependentmagnetization for Monte Carlo and LLG simulations. Simulationparameters assume a nearest neighbour exchange of6.0× 10−21 J/link with a simple cubic crystal structure, periodicboundary conditions and 21952 atoms. The Monte Carlosimulations use 50 000 equilibration and averaging steps, while theLLG simulations use 5000 000 equilibration and averaging stepswith critical damping (λ= 1) and a time step of 0.01 fs. The valueof Tc ∼ 625 K calculated from equation (9) is shown by the dashedvertical line. The temperature-dependent magnetization is fitted tothe expression m(T )= (1− T/Tc)β (shown by the solid line) whichyields a fitted Tc = 631.82 K and exponent β = 0.334 297.

    5.1. Angular variation of the coercivity

    Assuming a correct implementation of an integration schemeas described in the previous section, the first test case of interestis the correct implementation of uniaxial magnetic anisotropy.For a single spin in an applied field and at zero temperature,the behaviour of the magnetization is essentially that of aStoner–Wohlfarth particle, where the angular variation of thecoercivity, or reversing field, is well known [125]. This testserves to verify the static solution for the LLG equation byensuring an easy axis loop gives a coercivity of Hk = 2ku/µsas expected analytically. For this problem the Hamiltonianreads

    H=−kuS2z −µsS · Happ (26)

    where ku is the on-site uniaxial anisotropy constant and Happis the external applied field. The spin is initialized pointingalong the applied field direction, and then the LLG equationis solved for the system, until the net torque on the systemS×Heff ≤ |10−6| T, essentially a condition of local minimumenergy.

    The field strength is decreased from saturation in stepsof 0.01 H/Hk and solved again until the same condition isreached. A plot of the calculated alignment of the magnetiza-tion to the applied field (S · Happ) for different angles from theeasy axis is shown in figure 6. The calculated hysteresis curveconforms exactly to the Stoner–Wohlfarth solution.

    5.2. Boltzmann distribution for a single spin

    To quantitatively test the thermal effects in the model andthe correct implementation of the stochastic LLG or MonteCarlo integrators, the simplest case is that of the Boltzmann

    Figure 6. Plot of alignment of magnetization with the applied fieldfor different angles of from the easy axis. The 0◦ and 90◦ loopswere calculated for very small angles from the easy and hard axesrespectively, since in the perfectly aligned case the net torque is zeroand no change of the spin direction occurs.

    Figure 7. Calculated angular probability distribution for a singlespin with anisotropy for different effective temperatures ku/kBT .The lines show the analytic solution given by equation (27).

    distribution for a single spin with anisotropy (or appliedfield), where the probability distribution is characteristic ofthe temperature and the anisotropy energy. The Boltzmanndistribution is given by:

    P(θ)∝ sin θ exp(−

    ku sin2 θkBT

    )(27)

    where θ is the angle from the easy axis. The spin is initializedalong the easy axis direction and the system is allowedto evolve for 108 time steps after equilibration, recordingthe angle of the spin to the easy axis at each time. Sincethe anisotropy energy is symmetric along the easy axis, theprobability distribution is reflected and summed about π/2,since at low temperatures the spin is confined to the upperwell (θ < π/2). Figure 7 shows the normalized probabilitydistribution for three reduced temperatures.

    The agreement between the calculated distributions isexcellent, indicating a correct implementation of the stochasticLLG equation.

    11

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    5.3. Curie temperature

    Tests such as the Stoner–Wohlfarth hysteresis or Boltzmanndistribution are helpful in verifying the mechanical implemen-tation of an algorithm for a single spin, but interacting systemsof spins present a significant challenge in that no analyticalsolutions exist. Hence it is necessary to calculate some well-defined macroscopic property which ensures the correct imple-mentation of interactions in a system. The Curie temperatureTc of a nanoparticle is primarily determined by the strength ofthe exchange interaction between spins and so makes an idealtest of the exchange interaction. As discussed previously thebulk Curie temperature is related to the exchange coupling bythe mean-field expression given in equation (9). However, fornanoparticles with a reduction in coordination number at thesurface and a finite number of spins, the Curie temperature andcriticality of the temperature-dependent magnetization willvary significantly with varying size [57].

    To investigate the effects of finite size and reduction insurface coordination on the Curie temperature, the equilibriummagnetization for different sizes of truncated octahedronnanoparticles was calculated as a function of temperature. TheHamiltonian for the simulated system is

    H=−∑i 6= j

    Ji j Si · S j (28)

    where Ji j = 5.6× 10−21 J/link, and the crystal structure isface-centred-cubic, which is believed to be representativeof Cobalt nanoparticles. Given the relative strength of theexchange interaction, anisotropy generally has a negligibleimpact on the Curie temperature of a material, and so theomission of anisotropy from the Hamiltonian is purely forsimplicity. The system is simulated using the Monte Carlomethod with 10 000 equilibration and 20 000 averaging steps.The system is heated sequentially in 10 K steps, with thefinal state of the previous temperature taken as the startingpoint of the next temperature to minimize the number of stepsrequired to reach thermal equilibrium. The mean temperature-dependent magnetization for different particle sizes is plottedin figure 8.

    From equation (9) the expected Curie temperature is1282 K, which is in agreement with the results for the 10 nmdiameter nanoparticle. For smaller particle sizes the magneticbehaviour close to the Curie temperature loses its criticality,making Tc difficult to determine. Traditionally the Curie pointis taken as the maximum of the gradient dm/dT [57], howeverthis significantly underestimates the actual temperature atwhich magnetic order is lost (which is, by definition, the Curietemperature). Other estimates of the Curie point such as thedivergence in the susceptibility are probably a better estimatefor finite systems, but this is beyond the scope of the presentarticle. Another effect visible for very small particle sizes isthe appearance of a magnetization above the Curie point, aneffect first reported by Binder [126]. This arises from localmoment correlations which exist above Tc. It is an effect onlyobservable in nanoparticles where the system size is close tothe magnetic correlation length.

    Figure 8. Calculated temperature-dependent magnetization andCurie temperature for truncated octahedron nanoparticles withdifferent size. A visualization of a 3 nm diameter particle is inset.

    5.4. Demagnetizing fields

    For systems larger than the single domain limit [33] andsystems which have one dimension significantly differentfrom another, the demagnetizing field can have a dominanteffect on the macroscopic magnetic properties. In micromag-netic formalisms implemented in software packages such asOOMMF [37], MAGPAR [38] and NMAG [39], the calculation ofthe demagnetization fields is calculated accurately due tothe routine simulation of large systems where such fieldsdominate. Due to the long-ranged interaction the calculationof the demagnetization field generally dominates the computetime and so computational methods such as the fast-Fourier-transform [127, 128] and multipole expansion [129] have beendeveloped to accelerate their calculation.

    In large-scale atomistic calculations, it is generally suffi-cient to adopt a micromagnetic discretization for the demag-netization fields, since they only have a significant effect onnanometre length scales [7]. Additionally due to the generallyslow variation of magnetization, the timescales associatedwith the changes in the demagnetization field are typicallymuch longer than the time step for atomistic spins. Here wepresent a modified finite difference scheme for calculating thedemagnetization fields, described as follows.

    The complete system is first discretized into macrocellswith a fixed cell size, each consisting of a number of atoms,as shown in figure 9(a). The cell size is freely adjustablefrom atomistic resolution to multiple unit cells depending onthe accuracy required. The position of each macrocell pmc isdetermined from the magnetic ‘centre of mass’ given by theexpression

    pαmc =

    ∑ni µi p

    αi∑n

    i µi(29)

    where n is the number of atoms in the macrocell, µi is thelocal (site-dependent) atomic spin moment and α representsthe spatial dimension x, y, z. For a magnetic material with thesame magnetic moment at each site, equation (29) corrects forpartial occupation of a macrocell by using the mean atomicposition as the origin of the macrocell dipole, as shown infigure 9(b). For a sample consisting of two materials withdifferent atomic moments, the ‘magnetic centre of mass’ is

    12

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Figure 9. (a) Visualization of the macrocell approach used tocalculate the demagnetization field, with the system discretized intocubic macrocells. Each macrocell consists of several atoms, shownschematically as cones. (b) Schematic of the macrocelldiscretization at the curved surface of a material, indicated by thedashed line. The mean position of the atoms within the macrocelldefines the centre of mass where the effective macrocell dipole islocated. (c) Schematic of a macrocell consisting of two materialswith different atomic moments. Since the magnetization isdominated by one material, the magnetic centre of mass movescloser to the material with the higher atomic moments.

    closer to the atoms with the higher atomic moments, as shownin figure 9(c). This modified micromagnetic scheme givesa good approximation of the demagnetization field withouthaving to use computationally costly atomistic resolutioncalculation of the demagnetization field.

    The total moment in each macrocell mmc is calculatedfrom the vector sum of the atomic moments within each cell,given by

    mαmc =n∑i

    µi Sαi . (30)

    Depending on the particulars of the system, the macrocellmoments can vary significantly depending on position, com-position and temperature. At elevated temperatures close tothe Curie point, the macrocell magnetization becomes small,and so the effects of the demagnetizing field are much lessimportant. Similarly in compensated ferrimagnets consistingof two competing sublattices the overall macrocell magnetiza-tion can also be small again leading to a reduced influence ofthe demagnetizing field.

    The demagnetization field within each macrocell p isgiven by

    Hmc,pdemag =µ0

    ∑p 6=q

    3(mmcq · r̂)r̂−mmcq

    r3

    − µ03

    mmc p

    V pmc(31)

    where r is the separation between dipoles p and q , r̂ is a unitvector in the direction p→ q , and V pmc is the volume of themacrocell p. The first term in equation (31) is the usual dipoleterm arising from all other macrocells in the system, while thesecond term is the self-demagnetization field of the macrocell,taken here as having a demagnetization factor 1/3. Strictlythis is applicable only for the field at the centre of a cube.However, the non-uniformity of the field inside a uniformlymagnetized cube is not large and the assumption of a uniformdemagnetization field is a reasonable approximation. The self-demagnetization term is often neglected in the literature, butin fact is essential when calculating the field inside a magneticmaterial. Once the demagnetization field is calculated for eachmacrocell, this is applied uniformly to all atoms as an effectivefield within the macrocell. It should be noted however thatthe macrocell size cannot be larger than the smallest sampledimension, otherwise significant errors in the calculation ofthe demagnetizing field will be incurred.

    The volume of the macrocell Vmc is an effective volumedetermined from the number of atoms in each cell and givenby

    Vmc = namcVatom = namc

    Vucnauc

    (32)

    where namc is the number of atoms in the macrocell, nauc is the

    number of atoms in the unit cell and Vuc is the volume of theunit cell. The macrocell volume is necessary to determine themagnetization (moment per volume) in the macrocell. For unitcells much smaller than the system size, equation (32) is a goodapproximation, however for a large unit cell with significantfree space, for example a nanoparticle in vacuum, the freespace contributes to the effective volume which reduces theeffective macrocell volume.

    5.4.1. Demagnetizing field of a platelet. To verify the im-plementation of the demagnetization field calculation it isnecessary to compare the calculated fields with some analyticsolution. Due to the complexity of demagnetization fieldsanalytical solutions are only available for simple geometricshapes such cubes and cylinders [130], however for an infiniteperpendicularly magnetized platelet the demagnetization fieldapproaches the magnetic saturation −µ0 Ms. To test this limitwe have calculated the demagnetizing field of a 20 nm×20 nm× 1 nm platelet as shown in figure 10. In the centreof the film agreement with the analytic value is good, while atthe edges the demagnetization field is reduced as expected.

    5.4.2. Performance characteristics. In micromagnetic simu-lations, calculation of the demagnetization field usually dom-inates the runtime of the code and generally it is preferable tohave as large a cell size as possible. For atomistic calculationshowever, additional flexibility in the frequency of updates of

    13

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Figure 10. Calculated cross-section of the demagnetization fields ina 20 nm× 20 nm× 1 nm platelet (visualization inset) withmagnetization perpendicular to the film plane. A macrocell size of 2unit cells is used. In the centre of the film the calculateddemagnetization field is −2.236 T which compares well to theanalytic solution of Hdemag =−µ0 M =−2.18 T. Note that the 2Dgrid used slightly overestimates the demagnetization field.

    the demagnetization field is permitted due to the short timesteps used and the fact that the magnetization is generally aslowly varying property.

    To investigate the effects of different macrocell sizes andthe time taken between updates of the demagnetization fieldwe have simulated hysteresis loops of a nanodot of diameter 40nm and height of 1.4 nm. Figure 11(a) shows hysteresis loopscalculated for different macrocell sizes for the nanodot. For

    most cell sizes the results of the calculation agree quite well,however, for a cell size of 4 unit cells, the calculated coercivityis significantly larger, owing to the creation of a flat macrocell(with dimensions 4× 4× 1 unit cells). This illustrates that forsystems with small dimensions, extra care must be taken whenspecifying the macro cell size in order to avoid non-cubiccells. In general, the problem with asymmetric macrocells isnot trivial to solve within the finite difference formalism, sincethe problem arises due to a modification of both the intracelland intercell contributions to the demagnetizing field.

    Figure 11(b) shows the runtime for a single update of thedemagnetizing field on a single CPU for different macrocellsize discretizations. Noting the logarithmic scale for the simu-lation time, single unit cell discretizations are computationallycostly while not giving significantly better results than largermacrocell discretizations. Although the demagnetization fieldcalculation is an n2mc problem, it is possible to pre-calculatethe distances between the macrocells at the cost of increasedmemory usage. Due to the computational cost of calculatingthe position vectors, this method is often much faster than thebrute force calculation. However, due to the fact that memoryusage increases proportionally to n2mc, fine discretizations forlarge systems can require many GBs of memory.

    By collating terms in equation (31) it is possible to con-struct the following matrix Mpq for each pairwise interaction:

    Mpq =[(3rx rx − 1)/r 3pq − 1/3 3rx ry 3rx rz

    3rx ry (3ryry − 1)/r 3pq − 1/3 3ryrz3rx rz 3ryrz (3rzrz − 1)/r 3pq − 1/3

    ](33)

    Figure 11. Simulated hysteresis loops and computational efficiency for a 40 nm× 40 nm× 1 nm nanodot for different cell sizes (multiplesof unit cell size) ((a), (b)) and update rates (seconds between update calculations) ((c), (d)).

    14

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    where rx , ry , rz are the components of the unit vector in thedirection p→ q, and rpq is the separation of macrocells. Sincethe matrix is symmetric along the diagonal only six numbersneed to be stored in memory. The total demagnetization fieldfor each macrocell p is then given by:

    Hmc,pdemag =µ0

    ∑p 6=q

    Mpq · mmcq− µ0

    3mmc p

    V pmc. (34)

    The relative performance of the matrix optimization is plottedfor comparison in figure 11(b), showing a significant reductionin runtime. Where the computer memory is sufficiently large,the recalculated matrix should always be employed for optimalperformance.

    In addition to variable macrocell sizes, due to the smalltime steps employed in atomistic models and that the mag-netization is generally a slowly varying property, it is notalways necessary to update the demagnetization fields everysingle time step. Hysteresis loops for different times betweenupdates of the demagnetization field are plotted in figure 11(c).In general hysteresis calculations are sufficiently accuratewith a picosecond update of the demagnetizing field, whichsignificantly reduces the computational cost.

    In general good accuracy for the demagnetizing fieldcalculation can be achieved with coarse discretization andinfrequent updates, but fast dynamics such as those inducedby laser excitation require much faster updates, or simulationof domain wall processes in high anisotropy materials requiresfiner discretizations to achieve correct results.

    5.4.3. Demagnetizing field in a prolate ellipsoid. Since themacrocell approach works well in platelets and nanodots, itis also interesting to apply the same method to a slightlymore complex system: a prolate ellipsoid. An ellipsoid addsan effective shape anisotropy due to the demagnetizationfield, and so for a particle with uniaxial magnetocrystallineanisotropy along the elongated direction (z), the calculatedcoercivity should increase according to the difference in thedemagnetization field along x and z, given by:

    H shapedm =+1Nµ0 Ms (35)

    where 1N = Nz − Nx . The demagnetizing factors Nx , Ny ,and Nz are known analytically for various ellipticities [131],and here we assume a/c = b/c = 0.5, where a, b, and c arethe extent of the ellipsoid along x , y and z respectively.

    To verify the macrocell approach gives the same expectedincrease of the coercivity we have simulated a generic ferro-magnet with atomic moment 1.5 µB, an FCC crystal structurewith lattice spacing 3.54 Å and anisotropy field of Ha = 1 T.The particle is cut from the lattice in the shape of an ellipsoid,of diameter 10 nm and height of 20 nm, as shown inset infigure 12. A macrocell size of 2 unit cells is used, which isupdated every 100 time steps (0.1 ps).

    As expected the coercivity increases due to the shapeanisotropy. From [131] the expected increase in the coercivityis H shapedm = 0.37 T which compares well to the simulatedincrease of 0.33 T.

    Figure 12. Simulated hysteresis loops for an ellipsoidal nanoparticlewith an axial ratio of 2 showing the effect of the demagnetizing fieldcalculated with the macrocell approach. A visualization of thesimulated particle is inset.

    6. Parallel implementation and scaling

    Although the algorithms and methods discussed in the preced-ing sections describe the mechanics of atomistic spin models, itis important to note finally the importance of parallel process-ing in simulating realistic systems which include many-particleinteractions, or nano patterned elements with large lateralsizes. Details of the parallelization strategies which have beenadopted to enable the optimum performance of VAMPIRE fordifferent problems are presented in appendix C. In generalterms the parallelization works by subdividing the simulatedsystem into sections, with each processor simulating part ofthe complete system. Spin orientations at the processor bound-aries have to be exchanged with neighbouring processors tocalculate the exchange interactions, which for small problemsand large numbers of processors can significantly reducethe parallel efficiency. The use of latency hiding, where thelocal spins are calculated in parallel with the inter-processorcommunications, is essential to ensure good scaling for theseproblems.

    To demonstrate the performance and scalability of VAM-PIRE, we have performed tests for three different system sizes:small (10 628 spins), medium (8× 105 spins), and large (8×106 spins). We have access to two Beowulf-class clusters; onewith 8 cores/node with an Infiniband 10 Gbps low-latencyinterconnect, and another with 4 cores/node with a GigabitEthernet interconnect. For parallel simulations the intercon-nect between the nodes can be a limiting factor for increasingperformance with increasing numbers of processors, sinceas more processors are added, each has to do less work pertime step. Eventually network communication will dominatethe calculation since processors with small amounts of workrequire the data from other processors in shorter times, leadingto a drop in performance. The scaling performance of thecode for 100 000 time steps on both machines is presented infigure 13.

    The most challenging case for parallelization is the smallsystem size, since a significant fraction of the system mustbe communicated to other processors during each timestep.

    15

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    Figure 13. Runtime scaling of VAMPIRE for three different problemsizes on the Infiniband network (a) and Ethernet network (b),normalized to the runtime for 2 cores for each problem size.

    On the Ethernet network system for the smallest system sizereasonable scaling is seen only for 4 CPUs due to the highlatency of the network. However larger problems are much lesssensitive to network latency due to latency hiding, and showexcellent scalability up to 32 CPUs. Essentially this means thatlarger problems scale much better than small ones, allowingmore processors to be utilized. This is of course well known forparallel scaling problems, but even relatively modest systemsconsisting of 105 spins show significant improvements withmore processors.

    For the system with the low-latency Infiniband network,excellent scalability is seen for all problems up to 64 CPUs.Beyond 64 CPUs the reduced scalability for all problemsizes is likely due to a lack of network bandwidth. Thebandwidth requirements are similar for all problem sizes,since smaller problems complete more time steps in a givenperiod of time and so have to send several sets of data to otherprocessors. Nevertheless improved performance is seen withincreasing numbers of CPUs allowing for continued reductionsin compute time. Although not shown, initial tests on anIBM Blue Gene class system have demonstrated excellentscaling of VAMPIRE up to 16 000 CPUs, allowing the realpossibility for atomistic simulations with lateral dimensionsof micrometres. Additional scaling tests for systems includingcalculation of the demagnetizing field and a long-rangedexchange interaction are presented in appendix C.

    7. Conclusions and perspectives

    We have described the physical basis of the rapidly developingfield of atomistic spin models, and given examples via itsimplementation in the form of the VAMPIRE code. Althoughthe basic formalism underpinning atomistic spin models iswell established, ongoing developments in magnetic materialsand devices means that new approaches will need to bedeveloped to simulate a wider range of physical effects at theatomistic scale. One of the most important phenomena is spintransport and magnetoresistance which is behind an emergentfield of spin–electronics, or spintronics. Simulation of spintransport and spin torque switching is already in development,and must be included in atomistic level models in order tosimulate a wide range of spintronic materials and devices,including read sensors and MRAM (magnetic random accessmemory). Other areas of interest include ferroelectrics, the spinSeebeck effect [132], and Coloured noise [110] where simu-lation capabilities are desirable, and incorporation of theseeffects are planned in future. In addition to modelling knownphysical effects, it is hoped that improved models of dampingincorporating phononic and electronic mechanisms will bedeveloped which enable the study of magnetic properties ofmaterials at sub-femtosecond timescales.

    The ability of atomistic models to incorporate magneticparameters from density functional theory calculations is apowerful combination which allows complex systems suchas alloys, surfaces and defects to be accurately modelled. Thismultiscale approach is essential to relate microscopic quantummechanical effects to a macroscopic length scale accessible toexperiment. Such a multiscale approach leads to the possibilityof simulation driven technological development, where themagnetic properties of a complete device can be predicted andoptimized through a detailed understanding of the underlyingphysics. Due to the potential of multiscale simulations, it isplanned in future to develop links to existing DFT codes suchas CASTEP [75, 76] to allow easier integration of DFT parametersand atomistic spin models.

    The computational methods presented here provide asound basis for atomistic simulation of magnetic materials, butfurther improvements in both algorithmic and computationalefficiency are of course likely. One area of potential compu-tational improvement is GPGPU (general purpose graphicsprocessing unit) computation, which utilizes the massivelyparallel nature of GPUs to accelerate simulations, with speedups over a single CPU of 75 times routinely reported. Withseveral supercomputers moving to heterogenous computing ar-chitectures utilizing both CPUs and GPUs, supporting GPGPUcomputation is likely to be important in future, and an imple-mentation in our VAMPIRE code is currently planned. In termsof algorithmic improvements it should be noted that the Heunnumerical scheme although simple is relatively primitive bymodern standards, and moving to a midpoint scheme mayallow for larger time steps to be used than currently.

    With the continuing improvements in computer power,atomistic simulations have become a viable option for theroutine simulation of magnetic materials. With the increas-ing complexity of devices and material properties, atomistic

    16

  • J. Phys.: Condens. Matter 26 (2014) 103202 Topical Review

    models are a significant and important development. Whilemicromagnetic models remain a powerful tool for the simula-tion and design of devices, the limitations of the (continuum)micromagnetic formalism are increasingly exposed by its fail-ure to deal with the complex physics of elevated temperatures,ultrafast magnetization processes and interfaces. The atomisticmodel also allows for the study of complex microstructuraleffects which is pertinent to Brown’s paradox [133], wherethere is generally a large disparity between the intrinsic andmeasured magnetic properties arising from nucleation causedby defects in the sample structure. While micromagnetics willremain the computational model of choice for large-scale andcoarse-grained applications, the ability to accurately modelthe effects of microscopic details, temperature effects andultrafast dynamics make atomistic models an essential tool tounderstand the physics of magnetic materials at the forefrontof of the field.

    Acknowledgments

    The authors wish to thank Jerome Jackson for helpful discus-sions particularly with regard to the parallel implementationof the code; Thomas Schrefl for insisting on the name ofVAMPIRE ; Matt Probert, Phil Hasnip, Joe Barker, Uli Nowak andOndrej Hovorka for helpful discussions; and Laszlo Szunyogh,Phivos Mavropoulos and Stefan Blügel for assistance withthe section on the ab initio parameterization of the atomisticmodel. We also acknowledge the financial support from the EUSeventh Framework Programme grant agreement No. 281043FEMTOSPIN and Seagate Technology Inc. This work made useof the facilities of N8 HPC provided and funded by the N8consortium and EPSRC (Grant No. EP/K000225/1) co-ordinatedby the Universities of Leeds and Manchester and the EPSRCSmall items of research equipment at the University of YorkENERGY (Grant No. EP/K031589/1).

    Appendix A. Code structure and design philosophy

    In addition to implementing the necessary computationalmethods for magnetic atomistic calculations, it is also im-portant to provide a framework structure for the code, wherenew additions in the form of features or improvements canbe made with minimal disturbance to other sections of thecode. Equally important for intensive computational problemsis ensuring high performance of the code so that simulationsproceed as rapidly as possible.

    In VAMPIRE this is achieved through hybrid coding usinga mixture of object-oriented and functional programmingstyles. Object-oriented programming is widely used in modernsoftware projects as a level of abstraction around the data, orobjects, in the code. This abstraction makes it easy to storeinformation about an element, for example an atom, as a singleunified data type, known as a class. One significant caveat withobject-oriented code is that it is generally hard to optimize formaximum performance. High performance codes generallyutilize a different coding approach known as functional pro-gramming, where the focus is on functions which operate onnumerous data sets. However the organization of data into large

    blocks in functional programming generally makes it harder toorganize the data. VAMPIRE therefore makes use of both method-ologies to gain the benefits of object-oriented design during theinitialization phase, while for the performance-critical partsof the code the data is re-arranged to use a functional stylefor maximum performance. Due to the requirements of highperformance, object-oriented design and parallelization, theC++ programming language was chosen for all parts of thecode. The popularity of the C++ language also allows foreasy future integration of other libraries, such as NVIDIA’sCUDA framework for utilizing graphics processing units. Forportability the code also has a minimal dependence on externallibraries and also conforms to the published standard allowingsimple compilation on the widest possible variety of computerarchitectures.

    In addition to the low-level structure described in terms ofobject-oriented and functional programming styles, the codeis also designed in a modular fashion so that most of themechanistic operations (such as the para