Source-linked AI summary

TB2J: a python package for computing magnetic interaction parameters

Xu He, Nicole Helbig, Matthieu J. Verstraete, Eric Bousquet

arXiv:2009.01910v2cond-mat.mtrl-sci

TL;DR

Magnetic-interaction parameters are useful but can be cumbersome to obtain systematically from DFT, motivating an automated approach. TB2J uses local rigid spin rotations as perturbations in a Green’s-function framework applied to Wannier or localized-orbital Hamiltonians. It systematically computes isotropic and anisotropic exchange and DMI with minimal input, while its applicability is bounded by model, localization, and numerical assumptions.

  • Problem

    Obtaining effective magnetic-interaction parameters from DFT can require demanding fitting procedures, while the Heisenberg model may fail for itinerant-spin systems.

  • Method

    TB2J treats local rigid spin rotations as perturbations in a Green’s-function method using Wannier or LCAO Hamiltonians.

  • Results

    TB2J systematically calculates isotropic exchange, anisotropic exchange, and DMI from Wannier or LCAO Hamiltonians with minimal input.

  • Takeaways & Limitations

    TB2J can be integrated into high-throughput workflows and produces outputs usable in spin-dynamics and Monte Carlo codes.

  • Takeaways & Limitations

    Wannierization can introduce noise of a few µeV, and the Heisenberg model may not be valid when spins are itinerant.

Abstract

from arXiv · show

We present TB2J, a Python package for the automatic computation of magnetic interactions, including exchange and Dzyaloshinskii-Moriya interactions, between atoms of magnetic crystals from the results of density functional calculations. The program is based on the Green's function method with the local rigid spin rotation treated as a perturbation. As input,the package uses the output of either Wannier90, which is interfaced with many density functional theory packages,or of codes based on localized orbitals. A minimal user input is needed, which allows for easy integration into high-throughput workflows. The package is open source under BSD 2-Clause license, available at https://github.com/mailhexu/TB2J.

1. Introduction

TB2J addresses the need for accessible magnetic-interaction parameters by automating Heisenberg-model calculations from Wannier or localized-orbital Hamiltonians. Its Green’s-function approach avoids several burdens of total-energy fitting while supporting systematic workflows.

  • Motivation: DFT-based magnetic simulations commonly reduce many-body interactions to effective Heisenberg or Hubbard Hamiltonians whose parameters enable larger-system and dynamical simulations.The parameters are fitted to DFT data to simplify interpretation of magnetic interactions.
  • Existing approaches: Total-energy mapping requires multiple magnetic configurations, often large supercells, and can fail when configurations depart substantially from the ground state.The method can become unsuitable when required supercells are too large for DFT or when electronic states become delocalized.
  • Existing approaches: Alternative approaches include the Generalized Bloch Theorem and magnetic Density Functional Perturbation Theory for extracting interaction parameters from spin spirals or perturbations.DFPT implementations can also combine magnetic and atomic-displacement perturbations.
  • Green’s-function approach: Green’s-function methods treat local spin rotation as a perturbation and determine Heisenberg parameters from the ground-state solution for either ferromagnetic or antiferromagnetic systems.They also provide band-by-band decompositions and are easier to automate than total-energy mapping.
  • TB2J: TB2J automates isotropic exchange, anisotropic exchange, and DMI calculations from Wannier90 or localized-orbital Hamiltonians with minimal user input.Mandatory inputs generally comprise file paths and the species of magnetic atoms; generated outputs can feed spin-dynamics and Monte Carlo codes.
  • TB2J: TB2J is presented as a package whose implementation can be integrated with multiple electronic-structure workflows and extended to new tight-binding-like Hamiltonians or spin-dynamics simulations.The paper illustrates usage on several magnetic crystals and discusses method advantages and limitations.

2. Formalism and algorithms

TB2J maps local spin-rotation perturbations in a tight-binding or DFT-derived electronic model onto Heisenberg interactions. The formalism computes exchange and DMI quantities from Green’s functions, supplements missing components through xyz averaging, and discusses higher-order corrections and conventions.

  • 2. Formalism and algorithms: TB2J perturbs localized spins in both the Heisenberg model and the electronic model, then maps the electronic energy variation onto Heisenberg parameters.The electronic perturbation is treated within a single-particle Green’s-function method.
  • 2.1. Heisenberg model: The Heisenberg Hamiltonian includes single-ion anisotropy, isotropic exchange, symmetric anisotropic exchange, and DMI.The anisotropic exchange is represented by a 3 × 3 symmetric tensor, while DMI is antisymmetric.
  • 2.1. Heisenberg model: TB2J uses normalized spins and a convention in which positive isotropic exchange favors ferromagnetic alignment, while conversion factors relate Jij to other pair-counting conventions.The DMI parameters can be converted using the same convention framework.
  • 2.2. Tight-binding Hamiltonian and Green’s function: The electronic structure is represented by generalized tight-binding Hamiltonian and overlap matrices that may use non-orthogonal LCAO or orthogonal Wannier bases.Translation symmetry parameterizes these matrices by lattice vectors, and the discussion specializes to the orthogonal case.
  • 2.2. Tight-binding Hamiltonian and Green’s function: The reciprocal-space Green’s function is constructed from H(k) and S(k), then transformed to real-space atom-pair Green’s functions.The formalism groups orbital and spin components into site-resolved submatrices and uses translation symmetry for pair labeling.
  • 2.3. Magnetic force theorem: The magnetic force theorem equates small ground-state perturbation energy changes with changes in single-particle energies at fixed ground-state potential.First- and second-order variations of the integrated density of states are used for spin-rotation perturbations at one or two sites.
  • 2.3. Magnetic force theorem: Comparing the two-spin energy variation with the Heisenberg form yields isotropic exchange, anisotropic exchange, and DMI expressions.Without SOC, the DMI vanishes and the Green’s-function and spin-potential vectors have only quantization-axis components, recovering the LKAG isotropic-exchange expression.
  • 2.4. xyz average strategy: A single quantization direction omits selected tensor and DMI components, so TB2J rotates the system among x, y, and z directions and averages accessible components.The direct higher-order approach for obtaining Dz is not implemented and would be more sensitive to numerical noise.

3. Implementation

TB2J separates tight-binding, exchange, and output functionality to construct Green’s functions, derive magnetic interaction parameters, and expose results for further analysis. Its workflow uses eigenvalue-based Green’s functions, contour integration, and decomposition into interaction components.

  • TB module: The TB module interfaces with DFT and Wannier-function codes, constructs the Hamiltonian, and calculates Green’s functions.Wannier functions are assigned to nearby atoms while accounting for crystal periodicity, with warnings for distant centers.
  • Output module: The output module writes magnetic interaction parameters and provides a Python API for calculating magnon band structures.The available interaction quantities are summarized in Table 2.
  • Green’s functions: Green’s functions are obtained from eigenvalues and eigenvectors without repeatedly inverting εS(k) − H(k), then Fourier transformed into real space.
  • Exchange module: The exchange module decomposes the Hamiltonian and Green’s functions into {0,x,y,z} components before evaluating the required 4×4 matrix elements.These elements are calculated for each energy and integrated to obtain the Aij matrix.
  • Energy integration: A contour integration runs from Emin to EF, using a semicircle path in the upper complex half-plane by default.Emin is chosen below the lowest band or where lower orbitals have negligible interaction with states near EF.

4. TB2J user instructions

The user instructions cover installation, electronic-structure preparation, tight-binding construction, and computation of magnetic interaction parameters. TB2J is designed to accept converged DFT results with limited user input, while requiring careful orbital and Hamiltonian preparation.

  • 4. TB2J user instructions: This section documents practical TB2J usage, with more detailed and regularly updated guidance available online.
  • 4. TB2J user instructions: Examples demonstrate installation and magnetic-interaction calculations for BCC Fe, HCP Co, BiFeO3, and La2CuO4.
  • 4.1. Installation: TB2J can be installed with a simple command when Python and pip are already available.The package can alternatively be downloaded from its GitHub repository.
  • 4.1. Installation: The sisl package must be installed separately for reading Siesta or OpenMX Hamiltonians, and the GPAW interface requires the GPAW Python package.Only hard, non-optional dependencies are installed automatically by default.
  • 4.2. Computing the magnetic interaction parameters: Computing magnetic interaction parameters begins with a converged collinear or non-collinear DFT calculation of a magnetic crystal.The preferred reference is the magnetic ground state, although another reference state can also be used; TB2J assumes the spin quantization axis is z.
  • 4.2.1. Preparation of electronic structure and tight-binding Hamiltonian: For plane-wave calculations, Wannier functions can provide the tight-binding Hamiltonian through codes interfaced with Wannier90.All spin-polarized orbitals contributing to the magnetic interaction should be selected carefully, such as transition-metal d and oxygen p orbitals in transition-metal oxides.
  • 4.2.1. Preparation of electronic structure and tight-binding Hamiltonian: The quality of the Wannier-function Hamiltonian must be checked because magnetic interaction parameters are often on meV or µeV scales.

SrMnO3

TB2J provides command-line workflows for Wannier90 and localized-orbital Hamiltonians, with separate options for spin treatment, magnetic elements, structural data, and Fermi energy.

  • Wannier-function preparation: Rigid spin rotation requires Wannier functions associated with an atom to be centered on or near that atom.TB2J assigns Wannier functions using their centers and can shift centers using translational symmetry while modifying the Hamiltonian.
  • Localized-orbital preparation: Localized-orbital calculations such as Siesta require only the localized Hamiltonian and overlap matrix to compute Heisenberg parameters.These matrices can be enabled through Siesta saving options.
  • Executables: wann2J.py and siesta2J.py calculate J from Wannier90 and Siesta outputs, while openmx2J.py is supplied separately for OpenMX.The scripts require minimal input, mainly file paths for Hamiltonian information and magnetic atom species.
  • Wannier90 options: Non-collinear Wannier90 calculations require spin-up and spin-down Wannier functions or a spinor Hamiltonian selected with the --spinor option.TB2J assumes collinear calculations by default.
  • Input parameters: The posfile supplies atomic structure and cell parameters, while the Fermi energy is specified in eV and magnetic elements by periodic-table symbol.Formats without cell parameters, such as xyz, cannot be used.
  • Input parameters: Formats containing only lattice lengths and angles can cause trouble for anisotropic or DMI terms because these terms are not rotationally invariant.
  • Wannier90 example: A non-collinear Wannier90 calculation can be launched with wann2J.py by providing the structure, Fermi energy, magnetic element, and spin-channel prefixes.
  • Siesta usage: Siesta requires only its input filename because information such as SOC status and Fermi energy is read from the Siesta results.

With OpenMX.

The OpenMX interface is distributed separately because its parser uses GPL-licensed OpenMX code. OpenMX calculations must write Hamiltonian and overlap matrices for TB2J processing.

  • OpenMX interface: TB2J OpenMX is a separately installed GPL-licensed plugin that uses OpenMX code in its file parser.
  • OpenMX preparation: OpenMX must enable “HS.fileout on” so Hamiltonian and overlap matrices are written to a .scfout file.
  • OpenMX usage: openmx2J.py requires the calculation path, OpenMX file prefix, and magnetic elements.

General options.

TB2J exposes configurable integration, distance, rotation, and output options for computing and inspecting magnetic interactions. Its outputs also support downstream spin simulations and magnon-band analysis, with validity checks tied to Wannier-function quality and magnetic moments.

  • General options: Integration settings include contour steps, energy bounds relative to the Fermi energy, and a maximum spin-pair distance.The energy upper bound should be near 0 for metals and within the band gap for insulators.
  • General options: For DMI and anisotropic exchange, TB2J rotates structures along three directions and merges the resulting calculations to recover inaccessible components.The workflow uses TB2J_rotate.py, separate DFT and TB2J runs, and TB2J_merge.py.
  • Output files: TB2J generates a results directory containing merged outputs, including human-readable exchange parameters and files directly usable by Multibinit.The exchange output identifies cell, atom, and exchange sections, while Multibinit files support spin-dynamics workflows.
  • Output files: Large differences between TB2J and DFT charges or magnetic moments can indicate contour-integration, Wannierization, basis-set, or orbital-selection problems.For localized d and f orbitals, magnetic moments should remain close to their DFT counterparts; magnetic parameters may be only meV or µeV, requiring low Hamiltonian noise.
  • Output files: TB2J output reports atom-pair indices and lattice translations, with interactions computed within the k-mesh supercell or restricted by rcut.A 7×7×7 k-mesh produces pairs in the corresponding supercell around the central spin.
  • Magnon band structure: Real-space exchange parameters can be Fourier transformed to obtain magnon dispersions, but the current simple treatment does not support complex magnetic configurations or multiple magnetic-site types.The lowest-energy eigenvector of J(q), together with q, determines the ground-state spin configuration.

4.3. Examples

TB2J is demonstrated across benchmark magnetic materials, reproducing established exchange and DMI results while supporting magnon calculations and multiple DFT-derived inputs. For SrMnO3, different TB2J input routes yield consistent qualitative exchange trends.

  • Examples: Five examples span benchmark ferromagnets, superexchange, multiferroicity, and spin canting, demonstrating TB2J across varied magnetic materials.The examples are BCC Fe, HCP Co, SrMnO3, BiFeO3, and La2CuO4.
  • BCC Fe: BCC Fe exchange parameters agree within a few percent for the largest values with GGA-PBE TB-LMTO and KKR results.KKR results from Ref. are significantly smaller, possibly because their density functional is unreported.
  • BCC Fe: TB2J-Siesta bilinear (J′) and biquadratic (B) exchange follow the KKR-Green trend but are larger than Ref..The comparison concerns the exchange decomposition shown in Figure 2(b).
  • Magnons: BCC Fe has a magnon-band energy minimum at q = Γ, identifying a ferromagnetic ground-state structure.The reported minimum is q = [0. 0. 0.] with the Fe1 eigenvector [1.0 0.0 0.0].
  • HCP Co: HCP Co DMI is of order 0.01 meV, and TB2J agrees with KKR-Green within 10% for most values.The Dz component is inaccessible when the spin points along z.
  • SrMnO3: SrMnO3 calculations using Wannier90-Abinit, Siesta, and total-energy methods show a large negative first-neighbor parameter and small second- and third-neighbor interactions.The three methods produce similar qualitative results.

3 BiFeO3

BiFeO3 is treated as a distorted multiferroic structure where local inversion-symmetry breaking relates to DMI. TB2J-Siesta gives isotropic exchange and DMI values close to total-energy calculations and consistent with experiment for first neighbors.

  • Structure: BiFeO3 adopts an R3c structure with oxygen-octahedra rotation and polar distortion along [111].The DMI is related to local inversion-symmetry breaking caused by these distortions.
  • Computational setup: TB2J-Siesta calculates BiFeO3 anisotropic and DMI interactions using fully relativistic pseudopotentials, GGA-PBE+U with U(Fe) = 4, and SOC.The calculation uses a DZP LCAO basis and a 7 × 7 × 7 k-point mesh.
  • Results: TB2J-Siesta isotropic exchange and DMI parameters are close to total-energy results, while first-neighbor J and DMI agree well with experiment.The comparison is reported for the parameters listed in Table 4.3.4.

La2CuO4

La2CuO4 illustrates TB2J for a layered spin-canting material with antiferromagnetic Cu interactions and DMI-induced canting. TB2J results also support spin-dynamics calculations for SrMnO3, yielding a Néel temperature near experiment.

  • Spin dynamics: TB2J-Siesta parameters used in MULTIBINIT spin dynamics give SrMnO3 a Néel temperature of about 240 K, close to the experimental value of about 233 K.The temperature-dependent outputs include magnetic specific heat, susceptibility, and normalized magnetic moment.
  • La2CuO4: For La2CuO4, first-neighbor Cu exchange is antiferromagnetic, while the summed DMI has a nonzero x component producing a moment perpendicular to x.The parameters are compared with LMTO results using different Hubbard corrections.

5. Discussion

TB2J’s Green’s-function approach avoids many costly total-energy calculations and supports automated, long-range magnetic-interaction workflows, while its accuracy depends on phase proximity, Wannier quality, and model assumptions.

  • Advantages: A single ground-state DFT spin configuration is typically sufficient, avoiding difficult convergence for high-energy, unstable, or non-collinear SOC configurations.The method is most accurate near the magnetic phase represented by the input DFT calculation.
  • Advantages: TB2J avoids supercell construction and can calculate exchange interactions at any real-space distance when k-point sampling is sufficiently dense.This removes the supercell dependence that can wrap longer-range interactions into short-range fitted parameters.
  • Automation: Minimal user input and compatibility with Wannier functions or LCAO codes support integration into high-throughput workflows.The output is directly usable by spin-simulation codes, enabling automation from DFT exchange calculations through spin-system simulation.
  • Limitations: Wannierization can introduce noise of a few µeV, limiting resolution for small DMI or anisotropic-exchange parameters, especially under strong band disentanglement.Users should verify that the Wannier band structure agrees well with the DFT band structure.
  • Limitations: The Heisenberg model may fail for itinerant spins or non-bilinear interactions, and results can depend on the basis set when spins are displaced from basis-function centers.These limitations constrain interpretation beyond localized, approximately rigid-spin settings.
  • Availability: TB2J is freely available under the BSD 2-Clause license, with documentation and a separate GPLv3 OpenMX interface.The package is presented as an open-source tool that can be extended with additional interfaces.

6. Conclusions and perspectives

TB2J provides a Python implementation for calculating isotropic and anisotropic exchange and DMI from Wannier or LCAO Hamiltonians with minimal input. The authors position it as a tool for automated, larger-scale first-principles magnetic-interaction and micromagnetics workflows, with broader capabilities planned.

  • Conclusions: TB2J calculates isotropic exchange, anisotropic exchange, and DMI from Wannier or LCAO Hamiltonians using a Green’s-function method.It supports inputs through Wannier90 interfaces or directly from SIESTA, GPAW, and OPENMX.
  • Conclusions: One unit-cell DFT calculation, or three for numerical averaging over x, y, and z spin orientations, can evaluate interactions at any magnetic-atom separation.The minimal input requirement is intended to facilitate high-throughput integration.
  • Perspectives: Future versions are planned to add more DFT and ASD interfaces, single-ion anisotropy, magnon band structures, and higher-order spin parameters.The authors identify three-spin and four-spin interactions as a promising area for further development.
Loading 2009.01910v2…