<<

Spirit: Multifunctional Framework for Atomistic Simulations

Gideon P. Müller,1, 2, 3, ∗ Markus Hoffmann,1 Constantin Dißelkamp,1, 3 Daniel Schürhoff,1, 3 Stefanos Mavros,1, 3 Moritz Sallermann,1 Nikolai S. Kiselev,1 Hannes Jónsson,2 and Stefan Blügel1 1Peter Grünberg Institut and Institute for Advanced Simulation, Forschungszentrum Jülich and JARA, 52425 Jülich, Germany 2Science Institute and Faculty of Physical Sciences, University of Iceland, VR-III, 107 Reykjavík, Iceland 3Department of Physics, RWTH Aachen University, 52056 Aachen, Germany (Dated: February 1, 2019) The Spirit framework is designed for atomic scale spin simulations of magnetic systems of arbitrary geometry and magnetic structure, providing a graphical user interface with powerful visualizations and an easy to use scripting interface. An extended Heisenberg type spin-lattice Hamiltonian includ- ing competing exchange interactions between neighbors at arbitrary distance, higher-order exchange, Dzyaloshinskii-Moriya and dipole-dipole interactions is used to describe the energetics of a system of classical spins localised at atom positions. A variety of common simulations methods are imple- mented including Monte Carlo and various time evolution algorithms based on the Landau-Lifshitz- Gilbert equation of motion, which can be used to determine static ground state and metastable spin configurations, sample equilibrium and finite temperature thermodynamical properties of magnetic materials and nanostructures or calculate dynamical trajectories including spin torques induced by stochastic temperature or electric current. Methods for finding the mechanism and rate of thermally assisted transitions include the geodesic nudged elastic band method, which can be applied when both initial and final states are specified, and the minimum mode following method when only the initial state is given. The lifetime of magnetic states and rate of transitions can be evaluated within the harmonic approximation of transition-state theory. The framework offers performant CPU and GPU parallelizations. All methods are verified and applications to several systems, such as vortices, domain walls, skyrmions and bobbers are described.

I. INTRODUCTION ics. From ab initio methods one may extract parame- ters for more approximate, atomistic spin models, such as Heisenberg type spin-lattice Hamiltonians. There, de- Multiscale materials’ simulations have emerged as one tailed information about the electronic structure is inte- of the most powerful and widespread assets in the quest grated out to effective parameters describing the inter- for novel materials with optimal or target properties, action between pairs of classical spins, so that simula- functionalities and performance. Simulations are em- tions of magnetization dynamics can be extended over ployed to narrow down the design continuum of de- the timescale of nanoseconds for systems of hundreds of vices, to decrease the effort required to design novel nanometers. The third level of the multiscale approach materials, to substitute experiments that seem unfea- in spintronics is the well-known micromagnetic approxi- sible, to suggest and analyse experiments and provide mation4 based on the assumption of a continuous magne- understanding of the underlying physics on scales rang- tization vector field, defined at any point of the magnetic ing from Ångström to millimeters and from femtoseconds sample, is valid when changes of the magnetization are to decades. In this context, spintronics is a very active much larger in space than the underlying atomic lattice. field where multiscale simulations1 play an important role In contrast, the atomistic spin-lattice model covers the for the conceptualization and development of the next- technologically increasingly important length scale from generation data devices,2 which includes nanoscale mag- a few to several tens of nanometers. netic objects like domain walls or nontrivial magnetic tex- tures such as solitons with a time dilemma of 16 orders of Here, we present a general purpose, open source, i.e. magnitude between writing and saving information. Re- publicly available, framework for atomistic spin simula- lating the requested properties to the development and tions called Spirit.5 There are actually a number of com- choice of magnetic materials, the simulation approach is putational tools available for the simulation of the time- highly useful, and a large variety of potential applications and space-dependent magnetization evolution. Among exist.3 arXiv:1901.11350v1 [cond-mat.mes-hall] 31 Jan 2019 the software packages for micromagnetic simulations, Since quantum mechanics is the key to understand two of the most impactful and widely known ones are , at the quantum mechanical level, ab initio OOMMF6 and mumax3.7 This software definitely revolu- methods, such as density functional theory, can be used tionized the simulation of magnetic properties of materi- to calculate various properties of and interactions be- als and the temporal behavior of devices described by the tween atoms. Due to the computational complexity of Landau Lifshitz Gilbert (LLG) dynamics. Based on the such calculations, they can currently only be applied to micromagnetic approach these methods have well-known magnetic structures in crystals with length scales in the limitations, e.g. the description of antiferromagnets, frus- order of 1 nm and cannot be used for time-dependent dy- trated magnets, higher order non-pairwise interactions namics simulations on time-scales relevant for spintron- (e.g. three-spin or four-spin interaction), stochastic spin 2 dynamics and Monte Carlo simulations, etc. Moreover, User Interfaces most micromagnetic software is not interactive or pro- vides quite limited in situ access to the parameters of Desktop GUI Web UI ( juspin.de ) Command Line the modeled system. Among the atomistic simulation programs, UppASD 8 and VAMPIRE9 are examples of well-tested tools that provide important functionalities beyond LLG simulations. Spirit Library API Layer The functionality of the aforementioned softwares can Python Other Programming Languages be greatly extended by adding an interactive graphical user interface (GUI) that can be used to control calcula- Generic C/C++ API tions in real time – to not only change parameters, but also interact with the spin texture as demonstrated for example in Ref. 10. Together with such a GUI, Spirit uni- fies various computational methods that are commonly Core applied to atomistic (and in part also to micromagnetic) simulations: Monte Carlo and Landau Lifshitz Gilbert Computational Methods Solvers Physical Models (LLG) dynamics,11 the geodesic nudged elastic band (GNEB) method12, minimum mode following13 (MMF), Backends harmonic transition-state theory14 (HTST), and the vi- Single-threaded OpenMP CPU parallelization CUDA GPU parallelization sualization of eigenmodes. All of these methods are quite 15 CPU CPU distinct, but complementary in nature. For example, CPU GPU LLG dynamics can be used to simulate the time evolu- CPU CPU tion of a magnetic system on a short time scale, while GNEB and/or MMF can be used to find first-order sad- dle points of the energy landscape – corresponding to transition states for thermally assisted transitions. These FIG. 1. The general structure of the framework, which is calculations can provide important information, such as separated into a core library with an application programming interface (API) layer and a set of user interfaces (UIs). The the energy barrier for the transition and can be used in core library handles input/output and calculations, while the HTST to calculate the lifetimes of metastable magnetic API layer provides an abstract way of interacting with the configurations over a long time scale. The integration of code through several programming languages. The UIs pro- these methods into a single, uniform framework can lead vide direct control of calculations, as well as real-time visu- to significant increase in productivity. alization and post-processing features. The back end for nu- The following section will introduce the structure of merical calculations can be used in single-threaded and CPU- the Spirit software and subsequent sections will detail as well as GPU-parallel calculations. the aforementioned methods, ordered by their complex- ity, which we rank according to the derivatives of the energy required for the implementation of these meth- version 3.2. Note that the images of spin systems in ods. Provided examples are mainly related to magnetic Figs. 3 and 8 have been generated using the graphical skyrmions, which represents one of the most rapidly de- user interface of Spirit. Other examples of the visualiza- veloping fields in modern nanomagnetism. tion features of Spirit can be found in Refs. 13, 17–19. Spirit has also been used for numerical calculations in Refs. 1, 13, 20, and 21. II. THE FRAMEWORK As the API layer is written in the C programming lan- guage, many other languages can be used to call the cor- The framework consists of modular components, as il- responding functions and the core library can, therefore, lustrated in Fig. 1: a core library for calculations and in- be used in many different contexts. An illustration of put/output; an application programming interface (API) this flexibility is the implementation of an additional, web layer to abstract the interaction with the code and pro- based user interface,22 using JavaScript to call Spirit and vide a uniform interface across various programming lan- WebGL to display the simulated system. The desktop guages, e.g. C/C++ and Python; a set of user interfaces GUI can be used to control parameters in the calculation, to enable fast and easy interaction with simulations, pow- such as system size or interaction parameters – useful for erful real-time visualization and post-processing features, fast testing and setup – as well as for direct interaction for instance visualization of 2D and 3D magnetization with the spin textures. The latter is highly useful, for vector fields with corresponding isosurfaces and visual- example to set up complex initial states10 or rectify cal- ization of eigenmodes. culations, such as GNEB paths that have diverged from The visualization of Spirit is available as a standalone their intended transition In order to increase productivity library called VFRendering,16 which utilizes advanced in repetitive or long-timescale calculations, Spirit can be features of modern OpenGL, e.g. shaders, available since used in Python scripts. Such scripts allow to reproduce 3 all steps which can be taken in the GUI and therefore mi = µini. The general form flexible and effective use of clusters and remote machines. X X X 2 Example Python scripts can be found in the code repos- H = − µiB · ni − Kj(Kˆ j · ni) 5 itory . Note that the ability to use Spirit from Python i i j also enables a straightforward integration into multiscale X X − Jijni · nj − Dij · (ni × nj) simulations and workflow automation frameworks, such (1) as ASE23 or AiiDA.24 Documentation of input, features hiji hiji 1 µ0 X (ni · rˆij)(nj · rˆij) − ninj and the APIs, as well as examples of usage can be found + µ µ , online.5 2 4π i j r 3 i,j ij i6=j

1 core 10 cores GPU includes (i) the Zeeman term describing the interaction 3 10 of the spins with the external magnetic field B, (ii) the ˆ 102 single-ion magnetic anisotropy, where Kj are the axes of the uniaxial anisotropies of the basis cell with the 1 10 anisotropy strength Kj, (iii) the symmetric exchange in-

0 teraction given by Jij and the antisymmetric exchange, Iterations per second 10 also called Dzyaloshinskii-Moriya interaction, given by 10 1 vectors Dij, where hiji denotes the unique pairs of inter- − 8 16 32 64 96 128 acting spins i and j, (iv) the dipolar interactions, where Side length L rˆij denotes the unit vector of the bond connecting two spins. FIG. 2. Iterations per second of a LLG simulation over side Quite often, the number of pairs for the exchange in- length L of a simple cubic system for 1 thread, 10 threads teractions is limited to nearest or next-nearest neighbors and on a GPU. The CPU parallelization consistently increases only. In Spirit the implementation of the Hamiltonian (1) performance by almost an order of magnitude. By using a does not assume any limitation on the number of or dis- GPU, another order of magnitude can be gained for large tance between such pairs, meaning that long-ranged and system sizes, while the GPU performance at small system non-isotropic interactions can be considered. sizes is limited by the overhead of CUDA kernel launches. Additionally, higher-order multi-spin-multi-site inter- Calculations were performed on a Linux system with an Intel 27 Core i9-7900X 3.30GHz and a NVIDIA GeForce GTX 1080. actions are implemented in Spirit as quadruplets of the form X The spin-lattice Hamiltonian, as well as all imple- EQuad = − Kijkl (ni · nj)(nk · nl) . (2) mented methods and solvers have been abstracted from ijkl the specifics of numerical operations, allowing a generic 28 backend, which can optionally use OpenMP for CPU These can represent the 4-spin-2-site (also called bi- 29 30 parallelization or CUDA for GPU parallelization. The quadratic), the 4-spin-3-site, and the 4-spin-4-site performance of a simple LLG simulation over different (also called "4-spin") interactions. system sizes, including dipolar interactions, is shown in Both the system geometry and the underlying lattice Fig. 2. The performance gain of the parallelization over symmetry can be chosen arbitrarily by setting the Bravais the single-threaded case is obvious as 10 cores give almost vectors and basis cells with any given number of atoms. an order of magnitude across a broad range of system Spirit also allows the pinning of individual spins or a set sizes and the GPU can give another order of magnitude of spins, for instance belonging to the boundary layers. at larger system sizes. As expected, the speed drops with One can also introduce defects, such as vacancies and the system size. Note that when dipolar interactions are atoms of different types. included, due to the usage of FFTs, iterations can be Dipolar interactions. The dipole-dipole interaction, slowed down if a side length of the system is not a power due to its long-ranged nature, represents the most com- of two. plex contribution to the Hamiltonian (1). Direct sum- mation over all interacting spins is of complexity O(N 2), where N is the number of spins, resulting in dramatic decrease of performance of the simulations. By making III. MODEL AND METHODS use of fast Fourier transforms (FFTs) and the convolu- tion theorem, the computational complexity can be re- duced to O(N log N). This convolution method is well- A. Hamiltonian known in micromagnetic simulations,31 based on a finite difference scheme. To treat arbitrary spin lattices with In Spirit, we implemented an extended Heisenberg any given number of atoms in the basis cells, we use an 25,26 Hamiltonian of classical spins ni of unit length lo- adapted version of this method. In particular, we con- cated at lattice sites i giving rise to the magnetic moment sider sublattices composed of atoms with the same index 4

1% with respect to the continuum solution. h = 0.1 0.8 Topological charge. In the past years, we wit- nessed the characterization of smooth magnetization 0.6 fields m(r) = µn(r) in terms of topological classes. In h = 0 this case, the 2 winding number defined as 0.4 S 1 Z 0.2 Q(n) = n · (∂xn × ∂yn) dr . (4) 4π 2 R v v2 0 It should be noted that a secondary topological charge 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 v can be considered as the defining index to distinguish h between skyrmion (v = 1) and antiskyrmion (v = −1) independently of the background state. It is defined as FIG. 3. Helicity (3) of a ferromagnetic cube, composed I 1 nxdny − nydnx of 50 × 50 × 50 spins on a simple cubic lattice with constant v = 2 2 (5) a = 1Å and nearest-neighbor exchange of J = 16.86 meV. 2π Γ nx + ny The stray-field induced helicity ν (circles) and ν2 (triangles) and is also referred to as the 1 winding number in com- on the reduced external magnetic field h are shown. h is given S parison to the conventional topological charge Q. Here, in reduced units of h = B/(µ0Ms) with the saturation mag- netisation density Ms. The fitted curves (solid lines) show Γ denotes an oriented Jordan curve around the center of that the dependence of ν2 close to the critical field is approxi- the skyrmion. mately linear and they give a critical field value of hc = 0.159 The notion of skyrmion/antiskyrmion refers to a local – which matches the expected value of hc = 0.158, as shown energy minimizer of (1) within the topological class char- in Ref. 34, within 1%. The two insets show illustrations of acterized by the relative skyrmion number N = ±1. For how the cube will be magnetized at h = 0 (left) and h = 0.1 sufficiently regular fields n decaying to the background (right). state nz(∞) = ±1, the index N is defined relative to 1 this background state, N(n) = −nz(∞)Q(n). In a typ- ical situation where the horizontal magnetization field in the basis cell. One FFT is performed on each of these vanishes at a single point (skyrmion center) the relative sublattices and additional convolutions are required to skyrmion number N agrees with the index of the hori- describe the interactions between the sublattices. An ef- zontal magnetization field at the skyrmion center. It is ficient implementation of this scheme is achieved using customary to fix the background state n (∞) = 1, which 32,33 z high performance, robust FFT libraries. leads to the characterization Q = −1 for skyrmions and To verify our implementation of dipolar interactions, Q = +1 for antiskyrmions. we compared it to the direct evaluation of the sum for The evaluation of expression (4) for the spindensity n random configurations with spatially non-symmetric ba- on a discrete lattice, as implemented in Spirit, is outlined sis cells and checked the convergence of the stray field of in Appendix A. a homogeneously magnetized monolayer against the an- alytically known result. Here, we show that Spirit cor- rectly reproduces the solution of typical problems, e.g. B. Monte Carlo Ref. 34, by calculating the stray field-induced helicity of a ferromagnetic cube. The helicity is defined as the ab- The Monte Carlo method is well-known in Physics solute value of the line integral over the curve C which and has a broad range of applications.35 We have imple- is composed of the upper edges of the cube: mented a basic Metropolis algorithm with a cone angle H for the displacement of the spins.11,36 This requires only C n · ds ν = H . (3) the calculation of the energy, making it the most straight- C |ds| forward of the methods implemented in Spirit. While it is a useful tool to calculate equilibrium properties, the In the atomistic case this is discretized into the appro- drawback is that it cannot resolve time-dependent pro- priate sums. cesses. The energy minimization was performed using a One iteration of the Metropolis algorithm will sequen- Verlet-like velocity projection method (see Appendix D). tially – but in random order – pick each spin in the sys- The results are shown in Fig. 3. The squared helicity is tem once and perform a trial step. Trial steps are pre- expected to approach the critical field linearly, so that a formed by defining a relative basis in which the current line can be fitted to extract the precise result from the spin is the z-axis and choosing a new spin direction by calculations. We note that the resulting critical field con- uniformly distributed random variables ϕ ∈ [0, 2π] and verges to the expected value of hc = 0.158 with increasing cos(θ) ∈ [0, cos(θ )], where θ is the opening angle 3 cone cone resolution of the grid, where a cube with 30 lattice sites of the cone. The trial step is accepted with a probability already gives an agreement within 2% and the shown ex- ample with 503 sites a discretization error of less than P = e−∆E/kBT , (6) 5

The results shown in Fig. 4 demonstrate the validity of 0.65 1 T 0.6 c the implementation, as the expected critical temperature 0.55 is matched with an error of less than 1%. 0.5 TI 0.45 Note that in Monte Carlo methods, the parallel tem- 15 16 17 18 41–43 0.5 pering algorithm has proven to be an effective tool. The usage of Python and a MPI package would enable

Normalized value one to quite easily reproduce this algorithm in a Python script using Spirit. 0

0 5 10 15 20 25 30 C. Landau-Lifshitz-Gilbert Dynamics T [K]

M M fitted χ C V The Landau-Lifshitz-Gilbert (LLG) equation44,45 is U4(L = 30) U4(L = 20) U4(L = 15) U4(L = 10) the well-established equation of motion for the dynamical propagation of classical spins. In its explicit form and in- FIG. 4. A 30 × 30 × 30 ferromagnet with J = 1 meV, with cluding spin torque and temperature contributions,46,47 an expected critical temperature of TC ≈ 16.71 K. Normalized values of the total magnetization M, susceptibility χ, specific it can be written th heat CV and 4 order Binder cumulant U4 are shown. The ∂n γ b i = − n × Beff magnetization is fitted with M(T ) = (1 − T/Tc) . At each ∂t (1 + α2)µ i i temperature, 10k thermalisation steps were made before tak- i γα eff ing 100k samples. Monte Carlo calculations give Tc ≈ 16.60 K − 2 ni × (ni × Bi ) – an agreement with expectation within 1%. The exponent is (1 + α )µi (10) fitted with b ≈ 0.33. The inset shows the Binder cumulants α − β − un × (j · ∇ )n for system sizes of L = 30, L = 20, L = 15 and L = 10, (1 + α2) i e r i giving an intersection at T = 16.5 + −0.25, which is an ex- I 1 + βα cellent agreement with the expected value of Tc within the + uni × (ni × (je · ∇r)ni) , temperature step of 0.5 K. (1 + α2) in which the terms correspond to (i) precession, where ∆E is the energy difference between the previous (ii) damping, (iii) precession-like current-induced spin spin configuration and the trial step. The cone angle can torque, and (iv) damping-like current-induced spin be set by an adaptive feedback algorithm according to a torque. γ is the electron gyromagnetic ratio, α is the eff desired acception-rejection ratio. damping parameter, Bi is the effective field, β is a non- Using this method, one can, for example, calculate the adiabatic parameter, je is the electron current vector, critical temperature of a spin system. It is known that the and ∇r = ∂/∂r is the spatial gradient acting on the spin isothermal susceptibility is related to the magnetization orientation. The effective field always contains a compo- eff fluctuations37 nent related to the energy gradient Bi = −∂H/∂ni, but in this notation for the LLG equation, the effec- 1   χ = hm2i − hmi2 , (7) tive field may contain also a stochastic thermal field, i.e. k T th B Bi → Bi + Bi , given by 1 P where m = | ni| is the average magnetization of the r µ N i Bth(t, T ) = p2D (T )η (t) = 2αk T i η (t) , (11) sample, while the specific heat relates to fluctuations of i i i B γ i the energy where the magnitude is given by the fluctuation- 1   C = hE2i − hEi2 , (8) dissipation theorem and ηi is white noise, such V 2 th th th kBT that hB (t, T )i = 0 and hB (t, T )B (0,T )i = iα t iα jβ t 2Di(T )δijδαβδ(t). To achieve these properties in an im- where both should diverge at the critical temperature Tc for a , e.g. to the paramagnetic phase. plementation, the vectors ηi(t) can each be created from The 4th order Binder cumulant38, which is often used to three independent standard normally distributed ran- avoid finite size scaling effects, is defined as dom values at every time step. Note also that in time- integration schemes, to fulfill the fluctuation-dissipation 4 hm i relation, the thermal field√ needs to be normalized by the U4 = 1 − . (9) 3 hm2i2 time step with a factor 1/ δt. For more details on the in- tegration of the stochastic LLG equation see for example Fig. 4 shows these quantities as results of a Monte Carlo references 49–51 and references therein. calculation of a cube of 30 × 30 × 30 lattice sites for Sampling of the stochastic LLG for the same param- J = 1 meV. For a simple cubic ferromagnet, from the eters as shown in Fig. 4 is presented in Appendix E, high-temperature expansion method,39 the critical tem- verifying the implementation and the equivalence of the 40 perature is known to be Tc = 1.44 J/kB = 16.71 K. stochastic LLG and Monte Carlo methods. 6

1

u u 0.06 w c

0 ) γ 0.04 Ja ( Normal component / s µ 〉

n n v

x z 〈 1 0.02 − β = 0.00 0 100 200 300 400 500 β = 0.02 t [ps] β = 0.10 7 0 10− · 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07

uµs/(Jaγ) 2 ) FIG. 6. The average velocity of head-to-head domain wall ana α

n (see top) for various values of the non-adiabatic parameter β. − 0 For β = 0.10 the Walker breakdown occurs at approximately sim α n uW ≈ 0.01. For β = 0 a critical current√ is at uc ≈ 0.0414. 2 2 2 From this point the relation hvi = u − uc /(1 + α ) men- Error( 53 2 tioned by Thiaville et al. takes effect. The mentioned rela- − tion is fitted to the data for β = 0. For β = 0.1 and currents n n x z under the walker breakdown and β = 0.02 the dashed lines 0 100 200 300 400 500 show linear fits. Open symbols denote rotation around the x-axis. The results from Ref. 47 are reproduced well. t [ps]

FIG. 5. LLG calculation of a single spin in an external can be compared are magnetic field of B = 1 T with a damping of α = 0.1 and a timestep of dt = 10 fs, using the Depondt method. Note  αγ  n (t) = tanh |B|t that the error may depend strongly on the time step and z (1 + α2)µ damping. While the Heun method matches well with results −6 γ (12) shown in Ref. 9, giving an error within 10 , the Depondt ϕ(t) = 2 |B|t method shows a lower error of around 3 × 10−7 with respect (1 + α )µ to the analytical solution. p 2 nx(t) = cos(ϕ(t)) 1 − nz(t) . The errors of the Depondt solver, shown in Fig. 5, match those of an equivalent calculation given in Ref. 9. In order to verify our implementation of spin current induced torques, the results from Ref. 47 on the velocity of a domain wall in a head-to-head spin chain were repro- duced for various non-adiabatic parameters β. The chain In order to evolve a spin system in time according to is oriented along the x-axis and the first and the last spin this equation, quite a few well-known solvers can be ap- are fixed in +x and −x direction, respectively. As a sub- plied. In Spirit, currently Heun’s method,11 a 4th or- set of the general Hamiltonian (1), the Hamiltonian for der Runge-Kutta solver, Depondt’s Heun-like method52, this example can be written as follows: and Mentink’s semi-implicit method B (SIB)49 are im- X 2 2 X plemented (see Appendices B and C for details). These H = − K1nix + K2niy − J ni · Sj . (13) methods can also be used for energy minimization by i hiji considering only the damping part of the LLG equation. The reference provides analytical equations against which However, experience has shown that a Verlet-like veloc- 12 the numerical results were checked. In Fig. 6 we show the ity projection solver can greatly improve convergence data for the average domain wall velocity hvi over ap- to the closest energy minimum, as it carries a fictive mo- plied current u in normalised units. The approximate mentum (see Appendix D for details). 53 p 2 2 2 prediction hvi = u − uc /(1 + α ) fits the results well, as shown in Fig. 6. As expected, we observe the Walker breakdown54 and a critical effective velocity of An easy test for the validity of the implemented dy- uc ≈ 0.0414, which is in close agreement with the re- namics solvers is the Larmor precession and the damping ported value of uc ≈ 0.0416. Note, for β = 0.1 and cur- of a single spin in an external magnetic field, as shown in rents larger than uW and for β = 0 and currents larger Fig. 5. The analytical equations with which the results than uc, the wall starts rotating around the x-axis. 7

D. Geodesic Nudged Elastic Band Method

When determining the rates of some rare transition B events or the lifetimes of metastable magnetic states, LLG dynamics simulations typically are typically unfea- sible due to the disparity between the time scales of the A simulation and the transition events. An approach to this problem is given by a set of rate theory methods, namely 12 the geodesic nudged elastic band (GNEB) and mini- C mum mode following13 (MMF) methods together with harmonic transition-state theory14 (HTST). The latter two are higher order methods, requiring knowledge of the second derivatives of the energy – the Hessian matrix – and will be described in the following sections. The GNEB method is a way of calculating minimum 1.5 energy transition paths between two pre-determined con-

] Initial guess GNEB CI-GNEB figurations. The path is discretized by a number of spin 1 configurations, in the following called images. In order to converge from an initial guess to a stable, energy- arb. units 0.5 [

minimized path, spring forces are applied along the path 0 E A C

tangents, while energy gradient forces are applied orthog- − 0 B onal to the path tangents. The total force therefore reads E

tot S E Fν = Fν + Fν , (14) 0 0.2 0.4 0.6 0.8 1 where ν is the image index along the chain, F S is a spring Reaction coordinate E force, and Fν is an energy gradient force. The forces in this section are 3N-dimensional vectors. A simple def- FIG. 7. An illustration of the GNEB method for a single spin inition of the spring force, which gives an equidistant system (the Hamiltonian and corresponding parameters are given in Appendix G). The two-dimensional energy landscape distribution of images in phase space, is given by is shown superimposed on a unit sphere. The initial guess F S = (l − l ) τ , (15) (green), relaxed path (blue), and final path using climbing ν ν−1,ν ν,ν+1 ν and falling images (red) are shown. where lν,µ is a measure of distance between images ν and µ and τν is the (normalized) path tangent at image ν. E The Fν should pull each image towards the minimum spin length and treat tangents and force vectors accord- energy path, while leaving the distance to other images ingly.12 For more details see Appendix F and H. unchanged. They can be defined to be orthogonal to the In order to verify and illustrate the GNEB method, we path by orthogonalizing with respect to the tangents show the example of a single spin in a set of Gaussian po- E tentials (see Appendix G). Fig. 7 shows the initial guess, Fν = −∇Eν + (∇Eν · τν )τν , (16) made by homogeneous interpolation between the initial where ∇i = ∂/∂ni. The path tangents can be easily and final configuration, as well as a relaxed chain of im- approximated by finite differences between spin configu- ages and a chain with two climbing and one falling image. rations, but in order to avoid the formation of kinks in The climbing images converge onto the saddle points and the path the definitions given in Ref. 55 should be used. the falling image onto an additional local minimum, so In order to precisely find the point of highest energy that the energy barriers are known exactly. along the minimum energy path, a first order saddle point The implementation of the GNEB method can be fur- of the energy landscape, one can use a so-called climbing 56 ther tested using a conceptually simple process, which image. Convergence onto the saddle point is achieved has enough degrees of freedom to pose a challenge for through the deactivation of the spring force for that im- convergence: the destruction of a skyrmion tube in a chi- age, while inverting the energy gradient force along the ral magnetic thin film. The parameter set is chosen in path: accordance with a calculation presented in Ref. 57, where S,CI E,CI a novel particle-like state is shown to emerge along the F = 0,F = −∇Eν + 2(∇Eν · τν )τν . (17) ν ν minimum energy path – the chiral bobber. The nucle- This will cause it to minimize all degrees of freedom, ex- ation of a pair of Bloch points, cutting the skyrmion tube cept the tangent to the path, which is instead maximized. in half, is reported, resulting in the formation of one chi- So far, the definitions match those of the regular NEB ral bobber at each surface of the film. In fact, as we show method. In order to use the NEB method for spin sys- in Fig. 8, also a single Bloch point can be nucleated at tems, it is necessary to consider the constraint of constant one of the films free surfaces. For these calculations the 8

SkT SP (top) SP (center) CB BP at surface BP in center 30 Bobber nucleation Bobber collapse ]

J 20 50 SP (top) SP (center) [ E

40 ∆

] 10 J

[ 30 SkT cone E 20 −

E 0 CB 10 0.65 0.7 0.75 0.8 0.85 0.9 0.95 Cone 0 B/BD 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Reaction Coordinate FIG. 9. Energy barriers for the nucleation of Bloch points at the surface (blue circles) and in the center (green square), as FIG. 8. The skyrmion tube (SkT) is either cut in half by well as the nucleation (red triangles up) and collapse (red tri- the nucleation of a pair of Bloch points in the center (red angles down) of a chiral bobber for a cube of size 30 × 30 × 30 MEP) or separated from the upper surface by nucleation of over applied magnetic field H. Periodic boundary conditions a single Bloch point (blue MEP). At a field strength of H = are applied in the xy-plane. The BP nucleation at the sur- face and center represents collapse of a skyrmion tube, while 0.8 HD, both processes have almost equal energy barriers of the bobber nucleation represents the creation of a BP in an ∆Ecenter = 23.13 J and ∆Esurface = 22.81 J. A chiral bobber is formed (two when the skyrmion tube is cut in half), whose otherwise homogeneous sample. collapse has an energy barrier of ∆Ebobber = 7.55 J. Note that the slight differences in the collapse of the CB between the two paths come from different initial paths. the energy barrier for the collapse of the bobber goes to zero right below the critical field HD, meaning that – in the frame of this model – it can only be stabilised in the specific parameters are J = 1 and D = 0.45 J, mean- conical phase. In order to give additional quantitative ing that the incommensurate spin spiral has a period of reference results for this parameter set, the dependence LD = 13.96 a. We note that the conical phase back- of the energy barrier on the external magnetic field is also ground – corresponding to the ground state of the system presented in Fig. 9. – introduces additional modes with little energy cost as- sociated and this can slow the rate of convergence to the minimum energy path. The climbing-image method56 was used to converge nearby images onto the maxima along the path and – analogous to what is suggested in E. Harmonic Transition-State Theory the reference – the spring force was modulated to dis- tribute images evenly along the energy curve. The latter As certain processes may be too rare or the desired improves the convergence onto the maxima, as the reso- time scale, which is to be simulated, too large to allow lution for the finite-difference calculation of the tangents for dynamical simulations, other approaches are essential at the saddle points is increased. As it is common to in estimating stability and the calculation of lifetimes of calculate cubic polynomials to interpolate between the metastable magnetic states. One can employ the well- discrete points, the segment length of these polynomials known transition-state theory,58 which has been used ex- can be used for the spring forces between the images. tensively, e.g. in chemical reaction and diffusion calcula- In Spirit, an additional parameter is implemented, with tions.59 The rate of transitions can be estimated from the which one can set the weighting of energy versus reac- probability of finding the system in the most restrictive tion coordinate. Without the climbing image method, and least likely region separating the initial state from energy barrier calculations may be quite imprecise, es- possible final states – the transition state, sometimes also pecially when the resolution near the maximum is low. called dividing surface. Within the harmonic approxima- This is illustrated by the fact that we observe a ratio of tion to transition-state theory14 (HTST), one can make the energy barriers between the collapse of the bobber simplifications allowing the analytical calculation of the and the Bloch point nucleation of only 3.3, while Ref. 57 rate, which is then given by an Arrhenius-type law with – not using climbing images – reports a ratio of 4.3. an exponential dependence on the inverse temperature T The GNEB calculations reveal a crossover between the and the energy barrier of the transition ∆E: two Bloch point nucleation mechanisms, where at in- creasing field it becomes favorable to nucleate just one v ΓHTST = Ω e−∆E/kBT , (18) Bloch point at the surface. It can further be seen that 2π 0 9

τ [s] skyrmions would exhibit longer lifetimes, the parameters 5 are chosen to produce a small skyrmion in order to 1020 reduce the computational effort. Fig. 10 shows the results for an external field varied between 3.5 T and 5 T

4.5 10 and temperature between 2 K and 5 K. HTST as well as 10 60 ] 1 ps Langers theory, which is closely related, have recently T [ both been used to calculate skyrmion lifetimes,61–63

H 0 showing that energy barriers are in general not enough 4 1 s 1 hour to estimate the stability of metastable magnetic states. 10 10 1 year − There are two translational zero modes at the initial state minimum, while – due to the lattice discretisation 10 20 3.5 − 2 2.5 3 3.5 4 4.5 5 and the defect-like shape of the skyrmion at the sad- dle point – there are no zero modes at the saddle point. T [K] Consequently, the transition rate prefactor has a linear FIG. 10. Lifetime τ of an isolated skyrmion in a periodic two- temperature dependence. dimensional system, with J = 1 meV and D = 0.6 meV, as a function of temperature T and external magnetic field H. The lifetime is given on a logarithmic scale with isolines ranging F. Minimum Mode Following Method from 1 ps up to 1 year. Due to the fact that only a single transition mechanism is taken into account, the structure of To find the first order saddle points on the energy sur- the graph is simple. face, without prior knowledge of the possible final states, the minimum mode following method13 can be used. The effective force acting on a spin configuration is defined as where F eff = F − 2(F · λˆ)λˆ , (22) v 0 s u Y M 0 M u λ det H u i i where F = −∇H is the negative gradient of the energy Ω0 = 0 = t 0 , (19) det HS Y S and λˆ is the normalized eigenvector corresponding to the λi i lowest, negative eigenvalue of the Hessian matrix of sec- s M S S 0 2 p N0 −N0 V X a ond derivatives. Note that these vectors and the dot v = 2πk T i , (20) B V M λS product are 3N-dimensional for a system with N spins. i i The calculation of second derivatives requires further where the M and S superscripts indicate the minimum attention, as the requirement of constant length effec- phys and first order saddle point of the transition. The λ are tively constrains the spins to a sub-manifold M ⊂ E i 3N eigenvalues of the Hessian matrix (see Appendix H), V of an embedding space E = R . As is shown in Ref. 13, are the phase space volumes of zero modes (if present, the covariant second derivatives, valid at all points of the phase space, can be calculated using a projector-based otherwise V = 1), N0 are the number of zero modes – approach.64 The corresponding 2N × 2N Hessian matrix modes with zero eigenvalue – and ai are coefficients in the expansion of the velocity along the unstable mode. The can be represented as primes next to determinants, products, and sums denote H = T T H¯ T − T T I(xj · ∇jH¯)T , (23) that only positive eigenvalues are taken into account. ij i ij j i j The factors ai are in fact velocities: the first row of where i and j are spin indices, H¯ is the smooth con- the dynamical matrix V transformed into the eigenbasis tinuation of the Hamiltonian to the embedding space, 2 of the Hessian according to H¯ij = ∂ H¯, I is the 3 × 3 unit matrix and Ti is a 3 × 2 matrix that transforms into a tangent space basis of spin 2N T T 3N V| = Λ T V| T Λ , (21) i. As the Hessian matrix (23) is represented in the 2N- dimensional tangent basis, the evaluation of an eigen- where T is a 3N × 2N basis matrix of the tangent space mode in the 3N-representation of the embedding space and Λij denote the matrix of the Hessians eigenvectors (in E requires a transformation back, i.e. λ|3N = T λ|2N . 2N-representation, i.e. in the basis T ). See Appendix H Further details on the above mathematical concepts and for more information. notations can be found in Appendix H. The implementation has been verified against 8 For a single spin, the energy landscape and force vec- UppASD, and we additionally present an example for tors can be visualized easily as the phase space is two- the calculation of the lifetime τ of an isolated skyrmion dimensional. An illustration of the method is shown in in a two-dimensional system. As parameters we chose Fig. 11 for a system consisting of one movable spin inter- J = 1 and D = 0.6 J and only the radial collapse mech- acting with a second, pinned spin. The parameters of the anism is considered, making for a simple structure of Hamiltonian are, relative to the exchange constant J, the dependence on external field and temperature. Note that this example is purely illustrative and while larger K = 4J, D = (0, 0, 1J) , (24) 10

a) netic structures, vortices or skyrmions. Arbitrary geome- tries and interactions can be described, such as bulk sys- tems, thin films, exchange bias, multilayers, nanotubes or core-shell nanoparticles. The computational domain can be treated by open and periodic boundary conditions and can be subjected to external magnetic fields, temperature and spin-current induced torques. Due to the fact that it can be used with the Python programming language, Spirit can integrate perfectly into multiscale simulations b) and workflow automation frameworks, such as ASE23 or AiiDA.24 It can be used on most common architectures, such as desktop and laptop computers, clusters or su- percomputers and even current day mobile devices. The calculations can be parallelized both on CPUs and GPUs. Various simulation methods have been implemented, including Monte Carlo, Landau-Lifshitz-Gilbert dynam- ics, Langevin dynamics, geodesic nudged elastic band and minimum mode following methods as well as the calcula- tions of transition rates and lifetimes within the harmonic FIG. 11. A single spin under the exchange and DMI in- approximation to transition-state theory. The basic algo- teraction with another spin. The energy landscape is two- rithms of these methods have been outlined, their imple- dimensional and is projected onto a sphere. a) the gradient mentation verified and applications to several systems, force field, pointing away from the maximum and towards the such as vortices, domain walls, skyrmions and boobers minima. b) the effective force field, pointing towards the sad- are described. The parameters of the simulation can be dle point. The resulting paths for four different starting points set and modified in real time through a graphical user are shown (black, gray and white lines). See Appendix I for interface and the output of the simulations can be visu- a visualization of the minimum mode directions. alized easily. We note that a micromagnetic description of the en- ergetics could easily be implemented in Spirit and the where the anisotropy K is used to reduce the symmetry micromagnetic calculations would then be able to make of the energy landscape. The figure illustrates how the use of the various simulation methods and visualization minimum mode can be used to invert the right part of features. the gradient force in order to obtain a force that directs the system to a first order saddle point. The test of a larger and far more has been given in Ref. 13, where the minimum mode follow- ACKNOWLEDGMENTS ing method revealed the existence of a skyrmion dupli- cation mechanism. By defining the force field in the The authors acknowledge helpful discussions with above way, previously unknown transition mechanisms Pavel Bessarab, Stephan von Malottki, Jan Müller, can be found and subsequently used in the calculation Jonathan Chico, Filipp N. Rybakov, and Florian Rhiem. of lifetimes. Applying this saddle point search method G.P.M. acknowledges funding by the Icelandic Research to three-dimensional systems will likely identify an even Fund (grants 185405-051 & 184949-051) and M.H. and larger variety of mechanisms, as the additional dimension S.B. from MAGicSky Horizon 2020 European Research can significantly increase the amount of possible transi- FET Open project (#665095) and from the DARPA TEE tions. program through grant MIPR (#HR0011831554) from DOI.

IV. CONCLUSIONS Appendix A: Determination of topological charge for spin density on a lattice The functionality of a comprehensive simulation frame- work, Spirit, for studies of atomic scale magnetic systems is presented and various example applications described. For the proper definition of the topological charge of It is an open source software written in the C++ pro- a discrete lattice of spins n(xi, yi), where i runs over all gramming language and is available for free under the lattice sites, we follow the definition given by Berg and 48 so-called MIT license (see Ref. 5). Spirit is a very flexi- Lüscher, and arrive at the following expression: ble, high-performance, and interactive tool, able to sim- 1 X ulate for example ferromagnets, antiferromagnets, syn- Q = A , (A1) 4π l thetic antiferromagnets, ferrimagnets, noncollinear mag- l 11

Appendix B: Heun’s solver

To simplify the following discussion, we write the LLG equation (10) as

∂n (t) i = n (t) × A (t, {n (t)}) , (B1) ∂t i i j FIG. 12. Fragment of hexagonal lattice of magnetic spins, where {nj} is the set of all spins and we keep the ex- which illustrates the definition of the topological charge on a plicit time-dependence of A , as the Hamiltonian can be discrete lattice as given in the main text. A is the area of i l time-dependent, for example when an AC magnetic field a spherical triangle defined by vectors ni, nj , nk located at the vertices of a triangle of lattice points (indicated shaded). is used. Heun’s method is a common and illustrative way to solve ordinary differential equations (ODEs) by first calculating an intermediate prediction step and then “av- eraging” to obtain the final approximation. Denoting the with time step δt, for an ODE of the form A  1 + n · n + n · n + n · n cos l = i j i k j k ∂y(t) p = f(t, y(t)) , y(t0) = y0 , (B2) 2 2 (1 + ninj) (1 + njnk) (1 + nkni) ∂t (A2) p where l runs over all elementary triangles of the hexag- the predicted value y is first calculated as onal lattice, and Al is the solid angle, i.e. the area yp(t + δt) = y(t) + δtf(t, y(t)) (B3) of the spherical triangle with vertices ni, nj, nk, see Fig. 12. The sign of A is determined as sign (A ) = l l and then the approximation for the next step as sign [ni · (nj × nk)]. The sites i, j, k of each elementary triangle are num- y(t + δt) = y(t) bered in a counter-clockwise sense relative to the surface f(t, y(t)) + f(t + δt, yp(t + δt)) (B4) normal vector rˆ⊥ pointing in positive direction of the z- + δt . axis. The latter means that the numbering should satisfy 2 the condition rˆ⊥·(rij ×rik) > 0, where rij is a connection When applied to the LLG equation, where f=bn×A, this vector directed from lattice site i to j. integration scheme obviously does not intrinsically pre- The parameter Al can be thought of as local topolog- serve the spin length, requiring the re-normalization of ical charge, which takes values in the range of −2π < the vectors ni after a given number of iterations, depend- 48 Al < +2π. According to Berg and Lüscher, there is ing on the required precision. Note that Heun’s method a set of exceptional spin configurations for which Q is falls into the category of Runge-Kutta methods, which not defined but still measurable as Al in (A2) is defined function analogously and therefore all have this property. for all possible spin configuration. The exceptional spin In order to improve on this, Ref. 52 proposes to make configurations correspond to the case when a spherical use of the fact that the spins are only allowed to rotate, triangle degenerates to a great circle Al = 2π. In this by writing an appropriate rotation matrix Ri, which is case the orientation of Al becomes ambiguous and the calculated directly from the field Ai. Applied to Heun’s ∗ position of these elementary triangles l are considered method, the prediction step (B3) reads as exceptional configurations or topological defects of a p two-dimensional magnetic structure. ni (t + δt) = Ri (Ai(t, {nj(t)})) ni(t) . (B5) These topological defects satisfy the following condi- tion: To perform the correction step (B4), one needs the cor- rection field Ac, which is calculated from the average of the initial and predicted fields: ni · (nj × nk) = 0, and |ni + nj + nk| ≤ 1. (A3) A (t, {n (t)}) + Ap(t + δt, {np(t + δt)}) ∗ c i j i j The elementary triangle l , for which the condition (A3) Ai = (B6) is satisfied, can be considered as the position at which 2 the localization of a topological defect takes place. It From this, in turn, the rotation matrix for the correction is important to note that the definition of the topologi- c c step Ri (Ai ) is obtained and the final step of the scheme cal charge given above remains correct only for spatially reads extended two-dimensional systems. This means that a c c topological analysis of the spin structure on a finite size ni(t + δt) = Ri (Ai ) ni(t) . (B7) domain is only defined if periodical boundary conditions are present. In the case of open boundary conditions, Higher order Runge-Kutta schemes could apply this ap- strictly speaking, the topological charge is not defined. proach analogously. 12

Appendix C: Semi-implicit midpoint solver The right hand side of Eq. (C6) can be easily calculated as: Instead of using a Runge-Kutta type scheme, as de- T scribed in Appendix B, Ref. 49 takes a different approach, M ni = ni + ni × Ai =: a . (C8) using the implicit midpoint (IMP) structure to preserve To solve Eq. (C6) we use Cramer’s rule. The components the spin length. The corresponding prediction step in its p p implicit form reads ni,α with α = x, y, z of ni are calculated with

n (t) + np(t + δt) det(M α) np(t + δt) = n (t)+δt i i × np = (C9) i i 2 (C1) i,α det(M) Ai(t, {nj(t)}) , where M α is the same matrix as M but column α is from which the corrector step can be analogously calcu- replaced with the vector a, for example lated as   ax −Az Ay n (t) + n (t + δt) x i i M = ay 1 −Ax . (C10) ni(t + δt) =ni(t) + δt × 2 az Ax 1 ( p )! δt nj(t) + n (t + δt) j p Ai t + , . 2 2 We now use the predictor ni in the IMP step (C4) to calculate n (t + δt): (C2) i The solutions to these equations can be obtained ana- n (t) + n (t + δt) lytically by rewriting them in a skew matrix form and n (t + δt) = n (t) + δt i i × i i 2 applying Cramer’s rule (see Appendix C). ( p )! (C11) δt nj(t) + n (t + δt) The implicit midpoint method, which the SIB method A t + , j . bases on, solves differential equations of the form y0(t) = i 2 2 f(t, y(t)), y(t0) = y0 (see Eq. (8) of the main text) and an iteration step is defined as The correction step is analogous to the prediction step (compare eqs. (C5) and (C11)), meaning that the  δt y(t) + y(t + δt) y(t + δt) = y(t) + δtf t + , . scheme (C9) can be applied to obtain ni(t + δt), too. 2 2 (C3) For the LLG equation (B1) and a time step δt this leads Appendix D: Velocity projection solver us to n (t) + n (t + δt) This description is derived from Ref. 12. Verlet-like n (t + δt) =n (t) + δt i i × i i 2 methods generally find application in solving second or-    der differential equations of the form x¨(t) = F (t, x(t)), δt nj(t) + nj(t + δt) Ai t + , . x(t ) = x , x˙(t ) = v , such as Newtons equation of 2 2 0 0 0 0 (C4) motion. One formulation of this method is to increment 49 p both the position and the velocity at each time step The semi-implicit scheme B (SIB) uses a predictor ni to reduce the implicitness of the equation above by re- 1 2 moving the dependence of Ai on nj(t + δt). To preserve x(t + δt) = x(t) + δt v(t) + δt F (t) (D1) the spin length the predictor is obtained with the IMP 2m structure.

p 1 p ni(t) + ni (t + δt) v(t + δt) = v(t) + δt(F (t) + F (t + δt)) . (D2) n (t + δt) = ni(t)+δt × 2m i 2 (C5) A(t, {nj(t)}) . The velocity projection is used to accelerate convergence towards local minima and to avoid overstepping due to Eq. (C5) can be rewritten as: momentum. The velocity at each time step is damped by projecting it on the force M · np(t + δt) = M T · n(t) (C6) ( (v · F )F/|F |2, (v · F ) > 0 with the matrix v → (D3) 0 else   1 −Az Ay M = I + skew(A) =  Az 1 −Ax . (C7) Note that the dot product and norm in this equation −Ay Ax 1 denote those of 3N-dimensional vectors. 13

To apply this scheme to the energy minimization of a Appendix F: GNEB tangents and forces spin system, we therefore no longer solve the LLG equa- tion, but instead pretend that the spins are massive par- ticles moving on the surfaces of spheres. The force is then τ* ν τ*proj simply ν

∂H * * nν F = − . (D4) nν 1 i *FD − ∂ni τν As the method does not conserve the length of the spins, they should be renormalized after each iteration * nν+1

ni(t + δt) ni(t + δt) → (D5) FIG. 14. Schematic visualization of the projection of the |ni(t + δt)| FD tangents for a single-spin system. After a tangent τν is Note that this scheme, too, would most likely benefit determined by finite difference calculation, it needs to be pro- from the usage of rotations instead of displacements. jected onto the tangent plane to the spin configuration so that it correctly points along the path. This tangent is denoted proj τν and can be calculated e.g. by removing the component in the direction of the image, see Eq. (F1). Note that the tan- Appendix E: Stochastic LLG gent vector τν needs to be normalized, which for a multi-spin system needs to be performed in 3N dimensions.

1 For spin systems, special care has to be taken due to the fact that the phase space is curved (the spins are restricted to unit spheres (see also Appendix H)). The expression for lν,µ should not be the Euclidean distance norm, but the geodesic (here, the great-circle) distance. 0.5 Further, the tangents τν need to lie in the tangent space to their corresponding image. One may correct the tan- Normalized value gents for example by a simple projection, orthogonalizing the corresponding 3-component subvectors with respect 0 to the spins 0 5 10 15 20 25 30

T [K] τν,i → τν,i − (τν,i · nν,i)nν,i . (F1)

E M M fitted χ C V After this, the tangent needs to be re-normalized τν → τν /|τν |. This tangent projection is illustrated for a single FIG. 13. A 30 × 30 × 30 ferromagnet with J = 1 meV, with spin in Fig. 14. As the spring forces are constructed from an expected critical temperature of TC ≈ 16.71 K. The energy tangent vectors, they are by definition in the tangent per spin E and normalized values of the total magnetization th space. Finally, for the energy gradient force, the same M, susceptibility χ, specific heat cV and 4 order Binder cu- scheme as for the tangents can be applied and we write mulant U are shown. The value obtained from the simulation 4 for each spin is Tc ≈ 16.92 K – an agreement with expectation of 1.2%. The exponent is fitted with b ≈ 0.33. At each temperature, 200k E E E thermalisation steps were made before taking 1M samples. Fν,i → Fν,i − (Fν,i · nν,i)nν,i . (F2)

Instead of Monte Carlo, one can also sample the stochastic LLG equation over time. We present here the Appendix G: GNEB Parameters of the single spin results of such sampling for the same system and parame- system ters, as the example shown in Fig. 4. Recall the expected critical temperature Tc = 1.44 J/kB ≈ 16.71 K. Fig. 13 The energy surface of the single-spin system, shown in shows the results. Fig. 7 in the main text to illustrate the geodesic nudged The results shown in Fig. 13 demonstrate the validity elastic band method is defined for a single spin as a sum of the implementation, as the expected critical temper- of Gaussians of the form ature of TC ≈ 16.71 K is matched with an error of only  2  X X (1 − n · ci) 1%. Note, however, the higher number of samples (com- H = H = a exp − , (G1) i i 2σ2 pared to Monte Carlo) required to obtain this result: at i i i each temperature 200k thermalisation steps were made before taking 1M samples. with parameters given in Table I. 14

late the Hessian, we insert v = P ⊥∂H¯ and retrieve TABLE I. Parameters of the Gaussians in the energy surface x of the single-spin system shown in Fig. 7 in the main text. ⊥ ¯ T ⊥ ¯ Wx(z, Px ∂H) = −zx Px ∂H a σ c c c x y z = −zxT xxT ∂H¯ (H4) −1.10 0.06 −0.20 0.00 −0.90 T ¯ 0.80 0.15 −1.00 0.20 −0.20 = −zx ∂H , −0.90 0.10 1.00 −0.20 −0.10 T ¯ 0.09 0.03 0.80 0.50 −0.80 where x ∂H is the scalar product of the spin with the 0.15 0.07 0.80 −0.50 −0.70 gradient. −0.90 0.10 0.50 1.20 −0.40 To illustrate the implementation in Spirit,5 we switch −0.90 0.10 0.20 −0.90 −0.40 notation to matrix representation and drop the subscript x. For spin indices i and j, the gradient ∂H¯ can be written as a 3-dimensional object ∇iH¯ and the second 2 ¯ ¯ Appendix H: Details on the curved manifold derivative ∂ H as a matrix H. In Euclidean represen- tation, the Hessian of Eq. (H2) becomes as a 3N × 3N matrix The following has been detailed in the supplementary  3N 3N  material of Ref. 13, but the key ideas are reproduced here. H11| H12| ··· 3N 3N Both the HTST and MMF methods require the calcula- 3N 3N H21| H22| ··· H| = (Hij| ) =   (H5) tion and diagonalization of the Hessian matrix. However, . . .. when treating Riemannian manifolds, the second deriva- . . . tives do not have an intrinsic geometrical meaning and 2 therefore need to be treated with special care.65 In a spin consisting of N blocks, each corresponding to a different spin-spin subspace. It is obtained by acting with Eq. (H2) system where the spin length is fixed, the manifold Mphys of physical states is composed of the direct product of N on the euclidean basis vectors of the embedding space E. spheres These subspace matrices of size 3 × 3 are given by 3N ¯ ¯ N Hij| = PiHij − δijInj · ∇jH , (H6) O 2 3N Mphys = S ⊂ R . (H1) where I denotes the 3 × 3 unit matrix. i=1 The matrix H|3N of course describes 3N degrees of freedom, while there can only be 2N physical eigenmodes Hence, M is a submanifold of the embedding eu- phys of the spins, spanning the tangent space to the spin con- clidean space E = 3N . R figuration. In order to remove the unphysical degrees It turns out to be convenient to treat the spins and of freedom in the embedding space E, is is sufficient to derivatives with respect to their orientations in a 3N- transform the matrix into a tangent space basis, which dimensional cartesian representation. This also avoids we can write as H = T T H |3N T , where T is the basis problems of other representations, such as the singulari- ij i ij j i transformation matrix of spin i fulfilling T T P = T T and ties which arise at the poles of spherical coordinates. The T T T = I|2N . The true Hessian H = (H ) of Eq. (H2) in derivatives in the embedding space E are readily calcu- ij the 2N × 2N matrix representation, containing only the lated by extending the Hamiltonian H, which is defined physical degrees of freedom, is therefore defined as on Mphys to a function H¯ on E. While we denote the gra- dient taken in the embedding space E as ∂H¯, the gradient T ¯ T ¯ Hij = Ti HijTj − Ti I(nj · ∇jH)Tj , (H7) taken on the manifold Mphys has to lie in the tangent space to the manifold, which we write as a projection Note that this reduction of dimensionality also improves ¯ Px∂H. The Hessian matrix of second derivatives in the the numerical efficiency of the diagonalization. As the embedding space E is denoted ∂2H¯. eigenmodes λ|2N are represented in the tangent basis, In this extrinsic view onto the spin manifold, the co- the 3N representation needs to be calculated by λ|3N = variant second derivatives can be extracted from a pro- T λ|2N . 64 jector approach, where for any scalar function f on the While the 3 × 2 basis matrix Ti can be calculated quite manifold Mphys, the covariant Hessian is defined as arbitrarily by choice of two orthonormal vectors, tangent to the spin ni, we found it convenient to use the unit 2 ¯ ⊥ ¯ vectors of spherical coordinates θ and ϕ Hess f(x)[z] = Px∂ f(x)z + Wx(z, Px ∂f) . (H2) cos θ cos ϕ − sin ϕ Wx denotes the Weingarten map, which, for a spherical manifold, for any vector v at a point x is given by T = {eθ, eϕ} = cos θ sin ϕ cos ϕ  − sin θ 0 (H8) T   Wx(z, v) = −zx v , (H3) zx/rxy −y/rxy = zy/rxy x/rxy  where z is a tangent vector to the sphere at x. To calcu- −rxy 0 15 √ 2 where rxy = sin θ = 1 − z . Note that the poles need Appendix I: Minimum modes in the interacting spin to be excluded, but since the basis does not need to be system continuous over the manifold, one may e.g. orthogonal- ize ex and ey with respect to the spin vector to obtain The following Fig. 15 illustrates how the minimum suitable tangent vectors. eigenmode unit vector λˆ is oriented and in which di- rection, therefore, the gradient force is inverted. Recall Finally, the Hessian matrix in the embedding space Eq. (22), which can be written 3N ¯ 3N E = R is needed, denoted Hij| . As the atomistic Hamiltonian can generally be written in matrix form F eff = −∇H + 2(λˆ · ∇H)λˆ , (I1)

N X X H = − Aijnj − niBijnj (H9) j hiji

where Aij are matrices of size 3 × 3 describing the lin- ear contributions, such as the Zeeman term, and Bij are matrices describing the quadratic contributions, such as anisotropy, Exchange, DMI and dipolar interactions. FIG. 15. Field of minimum eigenmodes of a single spin in The Hessian matrix is then naturally given by anisotropy and the interaction field of a second, pinned spin. The minimum mode following paths are shown in gray colors. The dashed lines show the separation of the convex regions around the minima from the rest of the configuration space. 2 H¯ij = ∂ H¯ = −2Bij . (H10)

∗ https://juspin.de; [email protected] 10 F. N. Rybakov and N. S. Kiselev, "Chiral Mag- 1 M. Hoffmann, B. Zimmermann, G. P. Müller, D. Schürhoff, netic Skyrmions with Arbitrary Topological Charge N. S. Kiselev, C. Melcher, and S. Blügel, "Antiskyrmions ("skyrmionic sacks")," arXiv:1806.00782 (2018). Stabilized at Interfaces by Anisotropic Dzyaloshinskii- 11 U. Nowak, "Thermally Activated Reversal in Mag- Moriya Interactions," Nat. Commun. 8, 308 (2017). netic Nanostructures," Annual Reviews of Computational 2 I. Žutić, J. Fabian, and S. Das Sarma. "Spintronics: Fun- Physics IX, 105 (2001). damentals and applications," Rev. Mod. Phys. 76 (2004). 12 P. F. Bessarab, V. M. Uzdin, and H. Jónsson, "Method for 3 S. D. Bader. "Colloquium: Opportunities in nanomag- Finding Mechanism and Activation Energy of Magnetic netism," Rev. Mod. Phys. 78 (2006). Transitions, Applied to Skyrmion and Antivortex Annihi- 4 W. F. Brown, "Micromagnetics," Interscience Publishers lation," Comp. Phys. Comm. 196 335 (2015). (1963). 13 G. P. Müller, P. F. Bessarab, S. M. Vlasov, F. R. Lux, N. 5 Spirit – spin simulation framework (see S. Kiselev, S. Blügel, V. M. Uzdin, and H. Jónsson, "Du- https://spirit-code.github.io). plication, Collapse, and Escape of Magnetic Skyrmions Re- 6 M.J. Donahue and D.G. Porter, "OOMMF User’s Guide, vealed Using a Systematic Saddle Point Search Method," Version 1.0," Interagency Report NISTIR 6376, National Phys. Rev. Lett. 121 19 197202 (2018). Institute of Standards and Technology, Gaithersburg, MD 14 P. F. Bessarab, V. M. Uzdin, and H. Jónsson, "Har- (1999). monic Transition-State Theory of Thermal Spin Transi- 7 A. Vansteenkiste, J. Leliaert, M. Dvornik, M. Helsen, F. tions," Phys. Rev. B 85 184409 (2012). Garcia-Sanchez, and B. Van Waeyenberge, "The design 15 H.-B. Braun, "Topological effects in nanomagnetism: from and verification of MuMax3," AIP Advances 4 107133 superparamagnetism to chiral quantum soliton," Advances (2014). in Physics 61 1 (2012). 8 B. Skubic, J. Hellsvik, L. Nordström, and O. Eriksson, "A 16 VFRendering – A vector field rendering library (see Method for Atomistic Spin Dynamics Simulations: Imple- https://github.com/FlorianRhiem/VFRendering). mentation and Examples," J. Phys.: Condens. Matter 20 17 Y. Liu, R. Lake, and J. Zang, "Binding a Hopfion in Chiral 315203 (2008). Magnet Nanodisk," arXiv:1806.01682 (2018). 9 R. F. L. Evans, W. J. Fan, P. Chureemart, T. A. Ostler, 18 F. Zheng, F. N. Rybakov, A. B. Borisov, D. Song, S. Wang, M. O. Ellis, and R. W. Chantrell, "Atomistic Z.-A. Li, H. Du, N. S. Kiselev, J. Caron, A. Kovács, M. Simulations of Magnetic Nanomaterials," J. Phys. Cond. Tian, Y. Zhang, S. Blügel, and R. E. Dunin-Borkowski, Mat. 26 10, 0953-8984 (2014). "Experimental Observation of Chiral Magnetic Bobbers in 16

B20-Type FeGe," Nat. Nanotechnol. 13, 451-455 (2018). 2 815-829 (1999). 19 H. Du, X. Zhao, F. N. Rybakov, A. B. Borisov, S. Wang, J. 35 K. Binder and D. W. Heermann, "Monte Carlo Simulation Tang, C. Jin, C. Wang, W. Wei, N. S. Kiselev, Y. Zhang, in Statistical Physics," Springer-Verlag, Berlin, (1997). R. Che, S. Blügel, and M. Tian, "Interaction of Individ- 36 D.Hinzke and U.Nowak, "Monte Carlo simulation of mag- ual Skyrmions in a Nanostructured Cubic Chiral Magnet," netization switching in a Heisenberg model for small ferro- Phys. Rev. Lett. 120, 197203 (2018). magnetic particles," Comp. Phys. Comm. 121 334 (1999). 20 J. Hagemeister, A. Siemens, L. Rózsa, E. Y. Vedmedenko, 37 D. P. Landau and K. Binder, "A guide to Monte Carlo and R. Wiesendanger, "Controlled Creation and Stability simulations in Statistical Physics," Cambridge University of kπ Skyrmions on a Discrete Lattice," Phys. Rev. B 97, Press, New York, NY. (2005). 174436 (2018). 38 K. Binder, "Finite Size Scaling Analysis of 21 M. Redies, F. R. Lux, P. M. Buhl, G. P. Müller, N. S. Block Distribution Functions," Z. Phys. B 43, 119 (1981). Kiselev, S. Blügel, and Y. Mokrousov, "Distinct Magne- 39 G. A. Baker, Jr., H. E. Gilbert, J. Eve, and G. S. Rush- totransport and Orbital Fingerprints of Chiral Bobbers," brooke. High-temperature expansions for the spin 1/2 arXiv:1811.01584 (2018). Heisenberg model," Phys. Rev. 164, 800 (1967). 22 Web interface for Spirit (see https://juspin.de). 40 Y. Rocio, "Modeling of Macroscopic Anisotropies Due to 23 A. H. Larsen, J. J. Mortensen, J. Blomqvist, I. E. Castelli, Surface Effects in Magnetic Thin Films and Nanoparti- R. Christensen, M. Dułak, J. Friis, M. N. Groves, B. Ham- cles," PhD thesis (2011). mer, C. Hargus, E. D. Hermes, P. C. Jennings, P. B. 41 R. H. Swendsen and J.-S. Wang, "Replica Monte Carlo Jensen, J. Kermode, J. R. Kitchin, E. L. Kolsbjerg, J. Simulation of Spin-Glasses," Phys. Rev. Lett. 57 2607 Kubal, K. Kaasbjerg, S. Lysgaard, J. Bergmann Maron- (1986). sson, T. Maxson, T. Olsen, L. Pastewka, A. Peterson, C. 42 K. Hukushima and K. Nemoto, "Exchange Monte Carlo Rostgaard, J. Schiøtz, O. Schütt, M. Strange, K. S. Thyge- Method and Application to Spin Glass Simulations," J. sen, T. Vegge, L. Vilhelmsen, M. Walter, Z. Zeng, and K. Phys. Soc. Jap. 65 1604 (1996). W. Jacobsen, "The Atomic Simulation Environment—A 43 M. Böttcher, S. Heinze, S. Egorov, J. Sinova, and B. Python library for working with atoms," J. Phys.: Con- Dupé, "B-T Phase Diagram of Pd/Fe/Ir(111) Computed dens. Matter 29 273002 (2017). (see https://wiki.fysik. with Parallel Tempering Monte Carlo," arXiv:1707.01708 dtu.dk/ase) (2017). 24 G. Pizzi, A. Cepellotti, R. Sabatini, N. Marzaria, and 44 L. D. Landau and E. M. Lifshitz, "On the Theory of B. Kozinsky, "AiiDA: automated interactive infrastructure the Dispersion of Magnetic Permeability in Ferromagnetic and database for computational science," Comp. Mat. Sci. Bodies," Physik Z. Sowjetunion 8 153 (1935). 111 218 (2016). (see also http://www.aiida.net/) 45 T. L. Gilbert, "A phenomenological theory of damping in 25 A. Aharoni, "Introduction to the Theory of Ferromag- ferromagnetic materials," IEEE Transactions on Magnet- netism," Oxford University Press (2000). ics, 40 (6), (2004). 26 G. T. Rado, Magnetism: a treatise on modern theory and 46 W. F. Brown, "Thermal Fluctuations of a Single-Domain materials. 3. Spin arrangements and crystal structure, do- Particle," Physical Review 130 5, 1677–86 (1963). mains, and micromagnetics. Academic Press (1963). 47 C. Schieback, M. Kläui, U. Nowak, U. Rüdiger, and P. 27 M. Hoffmann and S. Blügel, "Systematic derivation of re- Nielaba, "Numerical Investigation of Spin-Torque Using alistic spin-models for beyond-Heisenberg solids from mi- the Heisenberg Model," The European Physical Journal B croscopic model," arXiv:1803.01315 (2018). 59 4, 429–33 (2007). 28 A. Szilva, M. Costa, A. Bergman, L. Szunyogh, L. Nord- 48 B. Berg, M. Lüscher, "Definition and statistical distri- ström, and O. Eriksson, "Interatomic Exchange Interac- bution of a topological number in the Lattice O(3) σ- tions for Finite-Temperature Magnetism and Nonequilib- Model*," Nuclear Physics B 190[FS3] 412 (1981). rium Spin Dynamics," Phys. Rev. Lett. 111 (2013). 49 J. H. Mentink, M. V. Tretyakov, A. Fasolino, M. I. Kat- 29 A. Krönlein, M. Schmitt, M. Hoffmann, J. Kemmer, N. snelson, and T. Rasing, "Stable and Fast Semi-Implicit Seubert, M. Vogt, J. Küspert, M. Böhme, B. Alonazi, J. Integration of the Stochastic Landau–Lifshitz Equation," Kügel, H. A. Albrithen, M. Bode, G. Bihlmayer, and S. J. Phys. Cond. Mat. 22 17, 176001 (2010). Blügel, "Magnetic Ground State Stabilized by Three-Site 50 D. S. G. Bauer, P. Mavropoulos, S. Lounis, and S. Blügel, Interactions: Fe/Rh(111)," Phys. Rev. Lett. 120, 207202 "Thermally activated magnetization reversal in monatomic (2018). magnetic chains on surfaces studied by classical atomistic 30 S. Heinze, K. von Bergmann, M. Menzel, J. Brede, A. Ku- spin-dynamics simulations," J. Phys.: Condens. Matter 23 betzka, R. Wiesendanger, G. Bihlmayer, and S. Blügel, 394204 (2011). "Spontaneous atomic-scale magnetic skyrmion lattice in 51 L. Rózsa, L. Udvardi, and L. Szunyogh, "Langevin spin dy- two dimensions," Nat. Phys. 7 713 (2011). namics based on ab initio calculations: numerical schemes 31 N. Hayashi, K. Saito, and Y. Nakatani, "Calculation of and applications," J. Phys.: Condens. Matter 26 216003 Demagnetizing Field Distribution Based on Fast Fourier (2014). Transform of Convolution," Japanese Journal of Applied 52 P. Depondt and F. G. Mertens, "Spin Dynamics Simu- Physics 12 (1996). lations of Two-Dimensional Clusters with Heisenberg and 32 M. Frigo and S. G. Johnson, "The Design and Implemen- Dipole-Dipole Interactions," J. Phys.: Condens. Matter 21 tation of FFTW3," Proceedings of the IEEE 93 (2), 216 33 (2009). (2005). Invited paper, Special Issue on Program Genera- 53 A. Thiaville, Y. Nakatani, J. Miltat, and N. Vernier, "Do- tion, Optimization, and Platform Adaptation main Wall Motion by Spin-Polarized Current: A Micro- 33 cuFFT https://developer.nvidia.com/cufft magnetic Study," J. Appl. Phys. 95 11 (2004). 34 A. Hubert and W. Rave, "Systematic Analysis of Micro- 54 N. L. Schryer and L. R. Walker, "The motion of 180o do- magnetic Switching Processes," Phys. Status Solidi B 211 main walls in uniform dc magnetic fields," J. Appl. Phys. 17

45 (12):5406–5421 (1974) 61 P. F. Bessarab, G. P. Müller, I. S. Lobanov, F. N. Ry- 55 G. Henkelman and H. Jónsson, "Improved Tangent Esti- bakov, N. S. Kiselev, Nikolai, H. Jónsson, V. M. Uzdin, S. mate in the Nudged Elastic Band Method for Finding Min- Blügel, L. Bergqvist, and A. Delin, "Lifetime of Racetrack imum Energy Paths and Saddle Points," J. Chem. Phys. Skyrmions," Sci. Rep. 8 3433 (2018). 113, 9978 (2000). 62 L. Desplat, D. Suess, J.-V. Kim, and R. L. Stamps, "Ther- 56 G. Henkelman, G. P. Uberuaga, and H. Jónsson, "A climb- mal stability of metastable magnetic skyrmions: Entropic ing image nudged elastic band method for finding saddle narrowing and significance of internal eigenmodes," Phys. points and minimum energy paths," J. Chem. Phys. 113, Rev. B 98, 134407 (2018). 9901 (2000). 63 S. von Malottki, P. F. Bessarab, S. Haldar, A. Delin, 57 F. N. Rybakov, A. B. Borisov, S. Blügel, and N. S. Kiselev, and S. Heinze, "Skyrmion lifetimes in ultrathin films," "New type of particlelike state in chiral magnets," Phys. arXiv:1811.12067 (2018). Rev. Lett. 115 117201 (2015). 64 P.-A. Absil, R. Mahony, and J. Trumpf, "An Extrinsic 58 E. Wigner, "The Transition State Method," Transactions Look at the Riemannian Hessian," In Geometric Science of the Faraday Society 34, 29 (1938). of Information 361-68, Lecture Notes in Computer Science, 59 D. G. Truhlar, B. C. Garrett, and S. J. Klippenstein, "Cur- Springer, Berlin, Heidelberg (2013). rent Status of Transition-State Theory," J. Phys. Chem. 65 M. Nakahra, "Geometry, topology and physics," CRC 100 12771 (1996). Press (2003). 60 J. S. Langer, "Statistical theory of the decay of metastable states," Annals of Physics 54 258 (1969).