Uppasd Manual Uppsala Atomistic Spin Dynamics User Guide

June 10, 2024
Uppsala

Uppasd Manual Uppsala Atomistic Spin Dynamics

Introduction

This user guide describes the essential features of Uppsala Atomistic Spin Dynamics program (UppASD). The emphasis is on the input files necessary to run calculations using UppASD and the output files it generates. Some information concerning the analysis of data generated by the code is also given. The ASD method and our implementation of it is described in the article by Skubic et al. [1]. The underlying theory is described in the articles by Antropov et al. [2] and Garc´ıa-Palacios and L´azaro. [3] An old, yet remarkably lucid overview is also given by Watson et al. [4] The program evolves the equations of motion for atomic magnetic moments in a solid. These take the form of the Landau-Lifshitz-Gilbert (LLG) equation,

Uppasd Manual Uppsala-fig1

In this expression, γ is the gyromagnetic ratio and bi(t) is a stochastic magnetic field with a Gaussian distribution, the magnitude of which is related to the damping parameter α, which eventually brings the system into thermal equilibrium. The typical time step for solving the differential equations is ∆t = 0.1 femtoseconds, i.e. 10−16 seconds.

The effective field, Bi, experienced by each atom i is given by

Uppasd Manual Uppsala-fig2

where H is the exchange Hamiltonian,

Uppasd Manual Uppsala-fig3

in which i and j are atomic indices, and Jij is the strength of the exchange interaction. This may be obtained from first-principles calculations, and often even inferred from experiment. It is also possible (and in many cases even essential) to include other terms to the Hamiltonian, such as anisotropies and external magnetic fields. As discussed below, the code is able to implement these with a high level of flexibility.

License

The UppASD code is developed by the Division of Materials Theory, in the Department of Physics and Astronomy at the University of Uppsala, Sweden. It is not (yet) open source software. Further information concerning the license and contact information of the developers may be found on the UppASD webpage: http://www.physics.uu.se/en/page/UppASD. The current version of the code (3.0) is still under active development.

Installation

The source code is distributed along with documentation and a growing set of examples. To install, uncompress the file UppASD.tar.gz, enter the source directory, and compile with the supplied Makefiles. If possible, compilation with the Intel Fortran compiler is recommended, using the command make -f MakefileIfort
Other than the source directory, the current UppASD distribution also con- tains an examples directory, and a docs directory, in which this user manual is located, along with some programming notes for developers (UppASDnotes.tex).

Principles of the Code

When run, UppASD essentially goes through three stages:

  1. Initialization: the system is set up.
  2. Initial phase: an optional stage in which the system is brought into thermal equilibrium, with limited data sampling.
  3. Measurement phase: the system is evolved in time, with complete data sampling being made.

During the initialization phase, all the parameters necessary to describe the system of interest, such as its geometry, dimensions, exchange couplings and boundary conditions, are set up. In addition, the initial phase also sets the simulation parameters, such as the number of simulation steps to record data over, which SDE solver to use, and the temperature at which the simulation should be run. The initial phase, which is optional, is typically performed in order to bring the system into thermal equilibrium so that the data recorded in the measurement phase is for a thermalized system. Obviously, if one is interested in out-of-equilibrium dynamics, then there is no need to perform this phase. The initial phase can either be performed using Spin Dynamics (SD), or a Monte Carlo (MC) algorithm using Metropolis dynamics. [5] The latter is convenient for ground state searches, provided the system is not too complex (i.e. a spin glass). During the measurement phase, the data sampling is performed. Simulations can be run in either MC or SD mode. In MC mode only magnetization averages may be measured. In SD mode, a much richer set of observables are measured, including spin correlations and dynamics structure factors.

Input

A file with the hardcoded name inpsd.dat is the main input file necessary to run UppASD. Contained in this file are also the names of the files containing the exchange interactions, the atomic positions, and the atomic moments. Although the names of these files is arbitrary, in this manual they are referred to as the jfile, posfile and momfile, respectively. Other optional files containing information such as the uniaxial anisotropy and the Dzyaloshinskii-Moriya vectors may also be included, as described below.
The input format is keyword based. The code is programmed to search for given keywords and then read in the values that follow. If no keyword is given, a default value is set. An example inpsd.dat file for bcc Fe is shown below:

Uppasd Manual Uppsala-fig4

While the meaning of most of the entries in this particular example should be obvious, it is also clear that more information must be read in from external files for the system to be fully defined. These are:

posfile
The positions of the atoms in the unit cell are given in basis vector coordinates. These can be listed directly in the inpsd.dat file, but in our examples they are oftened read in from the posfile. For a bcc structure:

The first entry indicates the atom number, whereas the second one indicates the atom type. In this specific case there is only one atom type, namely Fe.
momfile This file lists the magnetic moments of the atoms in the unit cell. Also, if the initmag entry is set to 3, the initial direction of the moments is read from this file. For bcc Fe:

The first entry indicates the atom number, the second entry the atom type, and the third entry indicates the magnitude of the magnetic moment in µB. The last three entries indicate the x, y, and z components of the moment (assuming initmag is set to 3).

exchange
This file lists the exchange couplings within the system. The content of this file depends somewhat on the symmetry of the system, and the number of atom types present. For the present bcc Fe example:

The first two entries indicate atom type i and j. The third, fourth and fifth entries specify the coordination shell in basis vector coordinates. The last entry is the exchange energy in mRy. This jfile lists the Jij values for the first four coordination shells, and assumes a cubic symmetry (sym is set to 1). In systems with more than one atom type, the exchange parameters need to be defined between all atoms (i.e. for 2 atoms the interactions are between the 1-1, 1-2, 2-1 and 2-2 atoms). Note also that if no symmetry is assumed (sym is set to 0), then the Jij parameters need to be specified for all neighbours, even those belonging to the same coordination shell.

Input Entries
The following entries are currently implemented in UppASD. Where applicable, the default entry setting is underlined.

  • simid The 8 character long simulation id.

  • cell The three lattice vectors describing the cell.

  • ncell Number of repetitions of the cell. bc Boundary conditions (P=periodic, 0=free).

  • natoms Number of atoms in one cell.

  • ntypes Number of types atoms in one cell.

  • sym Flag to determine the assumed symmetry of the system (0=none, 1=cu- bic, 2=2d cubic (in xy plane), 3=hexagonal).

  • maptype Flag to change between 1=cartesian or 2=BGFM style for exchange coupling vectors.

  • posfile External file for the positions of the atoms in one cell, accompanied with the site number and type of the atom.

  • momfile External file for magnitudes and directions of magnetic moments.

  • exchange External file for Heisenberg exchange couplings.

  • dm External file for Dzyaloshinskii-Moriya (DM) exchange coupling, which takes the form
    where Dij is the DM vector. The format is similar to that of the exchange file, i.e. in a 2d square lattice it may look something like:Uppasd Manual
Uppsala-fig9
    The first two entries indicate the site number and the type of atom, respectively. The third to fith entries indicate the components of the DM vector Dij , and the final three entries indicate the strength of these com- ponents. Note that in this case the maptype flag has been set to 2 in the input file.

  • anisotropy External file for anisotropy strengths and directions. The singleion, or uniaxial, anisotropy is defined as
    where K1 and K2 are the strength of the linear and four-fold term along an axis with direction ei. In a cubic system, one must also define the so-called cubic anisotropy, given byUppasd Manual Uppsala-fig11
    where m = (mx, my, mz). UppASD is able to read in either Eq. (5) or Eq. (6), or even both. For bcc Fe, a plausible kfile might be:

Uppasd Manual Uppsala-fig12
The first entry lists the atom number, whereas the second entry indicates if the uniaxial (1), cubic (2) or both (7) anisotropies are to be mounted. The second and third entries list the strength of K1 and K2, respectively. The fifth to seventh entries indicate the components of the vector ei. Finally, in the instance of the second entry being set to 7, the final entry indicates the ratio between KU and KC

  • do_jtensor (0=off/1=on). This switch allows the exchange data to be read in according to the tensorial representation of the Heisenberg Hamiltonian, as implemented in the Vienna-Budapest SKKR code. [6] In this case, the exchange Hamiltonian is defined as
    Here, Jij = Ji,j I + Ji,jS + Ji,jA is a 3 × 3 tensor (in which I is the unit matrix), the trace of which is equal to the exchange constant as defined in Eq. (3) by [6]
    In this formalism, the off-diagonal terms of the tensor are proportional to
    Uppasd Manual Uppsala-fig15
    Uppasd Manual Uppsala-fig16
    NB: maptype must be set to 2 in order to use the tensorial format. In addition, since SKKR prints the exchange in Ry, UppASD reads this input in Ry and not in mRy as usual.

  • do_dip Flag for enabling dipole-dipole interactions (0=off/1=on).

  • do_prnstruct Flag to print lattice structure (0=off/1=on). Useful for checking if the system geometry and couplings are correctly set up.

  • do_ralloy Flag to set if a random alloy is being simulated (0=off/1=on).

  • units Implement atomic units, i.e. set kB, ¯h, … = 1 (Y/N). If this is switched on, the timestep in SD mode should be roughly 0.1Jij .

  • sdealgh Switch for choosing SDE solver (1=Midpoint, 4=Heun proper, 5=Depondt). The default option runs the semi-implicit midpoint solver devel-oped by Mentink et al. [7] In this case, the timestep can be as large as 10−16 seconds, but this should always be checked.

  • mensemble Number of ensembles to simulate. The default value is 1, but this may be increased to improve statistics, especially if investigating laterally confined systems, such as chains.

  • tseed Random number seed for the stochastic field simulating the fluctuations due to temperature. Default value is 1.

  • initmag Switch for setting up the initial configuration of the magnetic moments (1=Random distrubution, 2=Cone, 3=aligned along direction de-fined in momfile, 4=Read from restartfile).

  • restartfile External file containing stored snapshot from previous simulation (used when initmag=4). The format coincides with the format of the output file restart.simid.out.

  • mseed Random number seed for magnetic moments if initmag=3. Set to 1 by default.

  • theta0 If initmag=3, the magnetic moments are randomly distributed in a cone prescribed by this angle, and phi0. Set to 0 by default.

  • phi0 Cone angle for initmag=2. Set to 0 by default.

  • roteul Perform global rotation of magnetization. Set to 0 by default.

  • rotang Euler angles describing the rotation if roteul=1.

  • ip mode Mode for initial phase run (S=SD, M=Monte Carlo, N=none).

  • ip temp Temperature for initial phase run.

  • ip hfield External applied field for initial phase run. This is given in cartesian coordinates, e.g.,
    hfield 1.0 0.0 0.0

  • ip mcnstep Number of Metropolis sweeps over the system if ip mode=M.

  • ip damping Damping parameter α for SD initial phase. Default value is 0.05.

  • ip nphase Number of initial phases to be done with SD. This must be followed by ip nphase lines containing number of steps and timestep for each phase.

  • mode Mode for measurement phase run (S=SD, M=Monte Carlo).

  • temp Temperature for measurement phase.

  • hfield External applied field for measurement phase.

  • mcnstep Number of Metropolis sweeps over the system if mode=M. damping Damping parameter α for SD measurement phase. Default value is 0.05.

  • timestep Time step between SD iterations. Unless aunits=Y, this should be set to a value between 10−17 and 10−15 seconds, depending on the system and SDE solver.

  • do avrg Sample and print average magnetization, and its higher order moments. (Y/N).

  • do proj avrg Sample and print type (i.e. sublattice) projected average moments. (Y/N).

  • do projch avrg Sample and print chemical (i.e. sublattice) projected average moments. (Y/N).

  • avrg step Time step between sampling of averages. Set to 100 by default.

  • avrg buff Number of samplings of averages to buffer between printing to file. Set to 10 by default.

  • do tottraj Sample and print all trajectories (moments) in the system. (Y/N).
    Generates the (rather large) moment.simid.out file.

  • tottraj step Time step between samplings of moments. Set to 1000 by default.

  • tottraj buff Number of samplings of moments to buffer between printing to file. Set to 10 by default.

  • ntraj Number of individual trajectories to sample and print. Followed by ntraj lines describing atoms to sample, time step between samples and steps to buffer. Set to 0 by default.

  • set bpulse Add magnetic field pulse (0=no, 1 − 4 for different shapes)

  • plotenergy Flag to enable the calculation of the energy of the system projected to the different components of the Hamiltonian. (0=off/1=on).

  • set landeg Flag for assigning different values of the gyromagnetic factor for the moments. Set to 0 by default.

  • do sc Flag to determine if spin correlations should be analysed (Y=yes,N=no, C=G(r) only). Setting this flag to Y measures the space- and time-displaced correlation function,Uppasd Manual Uppsala-fig20
    where the angular brackets signify an ensemble average and k the cartesian component, and its Fourier Transform, the dynamical structure factorUppasd
Manual Uppsala-fig21
    which yields information concerning the spin waves present in the sys-tem. [8] The quality of the measured data depends sensitively on the val-ues of sc nstep, sc step, sc navrg, sc nsep and sc volume. If the flag is set to C, only the static correlation function is measured.

  • do sc proj Flag to determine if type projected spin correlation should be analyzed (Y=yes, N=no). This works only if sc mode=2.

  • sc mode Flag to determine when to transform the spin correlations (0=inmemory, 1=in scratch file, 2=on the fly). Options 0 and 1 generate enor-mous files.

  • sc nstep Number of steps to sample.

  • sc step Number of time steps between each sampling.

  • sc navrg Number of spin correlation measurements to average over.

  • sc nsep Number of time steps between the start of subsequent spin correlation measurements.

  • sc volume Sub-volume of system to sample the correlation functions over. qpoints Flag for for generation of q-point mesh necessary for S(q, ω) calculations. (F=external file, A=automatic, C=full cell, D=external file with direct coordinates).

  • qfile External file containing the q point mesh for S(q, ω) calculations.

  • rdirfile External file containing directions to calculate S(r, t) for.

  • do autocorr Flag to enable autocorrelation sampling (Y=yes, N=no). acfile External file containing waiting times for the autocorrelation measurements.

Output files

Depending on the settings chose in the input file, UppASD prints out a varying number of output files. These all share the suffix .out.

  • aniso1.simid.out
    Occurs if the anisotropy is defined. Prints the anisotropy parameters for each atom in the format
    ex, ey, ez, k1, k2
    where the three first entries are the direction of the anisotropy axis.

  • averages.simid.out
    Occurs if the measurement phase is run in SD mode. Prints out the average magnetization as a function of simulation time, in the format
    step, mx, my, mz, m, m2, m4
    where step is the simulation time expressed in terms of the number of time steps,mx, my and mz are the components of the intensive average magnetization (i.e.,

  • coord.simid.out
    Occurs if do prnstruct is switched on. Prints out the coordinates of each moment in the system.

  • cumulants.simid.out
    Prints out the running time averages of the intensive magnetization and its higher order moments, in the format
    step, mt, mt2, mt4, U4
    where, U4 = 1− 1m t is the fourth order ‘Binder’ cumulant, useful for estimating transition temperatures. [5]

  • dmdata.simid.out
    Occurs if the DM interaction is defined. Prints out the DM vector components and their strengths for each atom.

  • inp.simid.out
    Extensive output of the values assigned to global variables after reading inpsd.dat and accompanying files.

  • mcinitial.simid.out
    Occurs if initial phase is set to MC mode. Prints out the final iterations of the MC initial phase, in the format
    mcstep, m, U4, χ
    where χ is the magnetic susceptibility. This is useful for checking whether or not the initial run has thermalized before entering the measurement stage.

  • mcmeasure.simid.out
    Occurs if measurement phase is set to MC mode. Prints out the quantities measured in MC mode, using the same format used for mcinitial.simid.out.

  • moments.simid.out
    Occurs if the do tottraj flag is switched on. Prints the configuration of all magnetic moments at regular interval in time in the format
    Note that this file is very large. It is useful for creating animations of the evolution in time of the magnetic configuration of the system.

  • projavs.simid.out
    Occurs of the do projavs flag is switched on. Prints out the same thermody- namic averages printed in averages.simid.out, but projected to each atom type sublattice. The format is also identical to averages.simid.out, except for the addition of a column indicating the sublattice.

  • projsqt.simid.out
    Occurs of the do sc proj flag is switched on. Prints out the same information printed in sqt.simid.out, but projected to each atom type present in the system. This file can be very large.

  • projsqw.simid.out
    Occurs of the do sc proj flag is switched on. Prints out the same information printed in sqw.simid.out, but projected to each atom type present in the system. This file can be very large.

  • restart.simid.out
    The magnetic configuration of the system at a specific point in time. Can be used as input when the initmag flag is set to 4.

  • trajectory.simid.out
    The trajectory as a function of time step for an individual magnetic moment on format
    step, atomnr, mx,i, my,i, mz,i, mm, mi
    If the number ntraj is also defined to be greater than 1, the code prints out ntraj files named trajectory.simid.ntraj.out.

  • sqt.simid.out
    Occurs of the do sc flag is switched on. Prints out the time-resolved structure factor S(q, t) in the format nstep, nq, Re[Sx(q, t)], Im[Sx(q, t)], Re[Sy(q, t)], Im[Sy(q, t)], Re[Sz(q, t)], Im[Sz(q, t)] This file can be very large.

  • sqw.simid.out
    Occurs of the do sc flag is switched on. Prints out the frequency-resolved structure factor S(q, ω) in the format nq, qx, qy, qz, nstep, Sx(q, ω), Sy(q, ω), Sz(q, ω), S(q, ω)
    This file can be very large.

  • struct1.simid.out
    Occurs if do prnstruct is switched on. Prints out the structure and exchange couplings of the system. Handy for checking if the system is set up correctly.

  • struct.simid.out
    Occurs if do prnstruct is switched on. Also prints out the structure and ex- change couplings of the system. Again, handy for checking if the system is set up correctly.

  • swdos.simid.out
    Occurs of the do sc flag is switched on. Prints out the S(q, ω) ‘density of states’ as a function of energy.

  • totenergy.simid.out
    Occurs if the plotenergy flag is switched on. Prints out the total energy of the system as a function of time step.

Examples

The best way to learn the code is to work through the examples in the directory examples. The current set of examples illustrates the range of the functionality of UppASD, and gives a feel for the data analysis that is necessary in order to interpret the results of the simulations.

bcc Fe
The bccFe directory contains the necessary input in order to simulate bcc Fe. There are a couple of Matlab scripts enclosed that plot quantities such as the average magnetization as a function of time. By varying input parameters such as the temperature, one may get a feel for how these affect these observable quantities.
The bccFe-Tsweep directory contains very similar input to the bccFe di- rectory. However, a small wrapper is included in order to run SD simulations as a function of temperature. This is often useful for checking the transition temperature of a given system.

Heisenberg Spin Chain
The HeisChain directory contains possibly the simplest system that can be set up with UppASD: a Heisenberg ferromagnetic chain. This example is set up to allow the spin wave spectrum of the system to be probed. Since the dispersion of this system can be derived analytically (as discussed any many textbooks concerning solid-state physics), it is a handy example to get acquainted with spin correlations and dynamics in UppASD. By copying over the sqw.simid.out and inpsd.dat files into the Sqw directory, and running the sqw map.sh script, S(q, ω) as a function of q is plotted, giving rise to the spin wave displersion. The dynamics of spin waves have been studied in this way in the paper by Bergman et al. [8]

Two-dimensional Systems
The 2d-systems directory contains a couple of two-dimensional systems: the surface simulating the Co/Cu(001) monolayer system (fcc001), and the square lattice Heisenberg system (sc, which stands for simple cubic). In the latter example, the flag aunits is switched on. By running the simulation as a function of temperature, the magnetization can be benchmarked against data obtained from the ALPS software package1, which is contained in the scL64ALPS.dat file. For both the fcc001 and sc examples, a directory Snapshots is included, that allows snapshots of the lattices to be taken. The scripts are written in VTK, and require the inp.simid.out, coord.simid.out and moment.simid.out files to work.

fcc Co
Another very common structure in solid-state physics is the fcc structure. This example allows the measurement of the dyamical structure factor, S(q, ω), for fcc Co, as in the Heisenberg spin chain example.

GaMnAs
The GaMnAs directory contains input data that sets up a GaMnAs dilute magnetic semiconductor.

Random Alloy
The Ralloy directory contains input data necessary to set up a dilute random alloy.

SKKR Input (test)
The xctensortest directory contains the same data as in the bccFe directory, but set up in the tensorial format that arises from the Vienna-Budapest SKKR code. [6]

References

  1. B. Skubic, J. Hellsvik, L. Nordstr¨om, and O. Eriksson. A method for atomistic spin dynamics simulations: implementations and examples. J. Phys.: Condens. Matter, 20:315203, 2008.

  2. V. P. Antropov, M. I. Katsnelson, B. N. Harmon, M. van Schilfgaarde, and
    D. Kusnezov. Spin dynamics in magnets: Equation of motion and finite temperature effects. Phys. Rev. B, 54:1019, 1996.

  3. J. L. Garc´ıa-Palacios and F. J. L´azaro. Anisotropy effects on the nonlinear magnetic susceptibilities of superparamagnetic particles. Phys. Rev. B, 55:1006, 1997.

  4. http://alps.comp-phys.org

  5. R. E. Watson, M. Blume, and G. H. Vineyard. Spin motions in a classical ferromagnet. Phys. Rev., 181:811, 1969.

  6. K. Binder and D. P. Landau. A Guide to Monte Carlo Simulation in Statistical Physics. Cambridge University Press, Cambridge, 3rd edition,2009.

  7. L. Udvardi, L. Szunyogh, K. Palot´as, and P. Weinberger. First-principles relativistic study of spin waves in thin magnetic films. Phys. Rev. B, 68:104436, 2003.

  8. J. H. Mentink, M. V. Tretyakov, A. Fasolino, M. I. Katsnelson, and Th. Ras-ing. Stable and fast semi-implicit integration of the stochastic Landau-Lifshitz equation. J. Phys.: Condens. Matter, 22:176001, 2010.

  9. A. Bergman, A. Taroni, L. Bergqvist, J. Hellsvik, B. Hj¨orvarsson, and O. Eriksson. Magnon softening in a ferromagnetic monolayer: A first-principles spin dynamics study. Phys. Rev. B, 81:144416, 2010.

Download PDF:Uppasd Manual Uppsala Atomistic Spin Dynamics User Guide

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals