PyZFS: A Python package for first-principles calculations of zero-field splitting tensors

Electron spins in molecules and materials may be manipulated and used to store information, and hence they are interesting resources for quantum technologies. A way to understand the physical properties of electron spins is to probe their interactions with electromagnetic fields. Such interactions can be described by using a so-called spin Hamiltonian, with parameters derived from either experiments or calculations. For a single electron spin (e.g., associated to a point-defect in a semiconductor or insulator), the leading terms in the spin Hamiltonian are


Summary
Electron spins in molecules and materials may be manipulated and used to store information, and hence they are interesting resources for quantum technologies. A way to understand the physical properties of electron spins is to probe their interactions with electromagnetic fields. Such interactions can be described by using a so-called spin Hamiltonian, with parameters derived from either experiments or calculations. For a single electron spin (e.g., associated to a point-defect in a semiconductor or insulator), the leading terms in the spin Hamiltonian are where µ B is the Bohr magneton, S is the electron spin operator, B is an external magnetic field, g and D are rank-2 tensors that characterize the strength of the Zeeman interaction, and the zero-field splitting (ZFS), respectively. Experimentally, the spin Hamiltonian parameters g and D may be obtained by electron paramagnetic resonance (EPR). The ZFS tensor describes the lifting of degeneracy of spin sublevels in the absence of external magnetic fields, and is an important property of open-shell molecules and spin defects in semiconductors with spin quantum number S ≥ 1. The ZFS tensor can be predicted from first-principles calculations, thus complementing experiments and providing valuable insight into the design of novel molecules and materials with desired spin properties. Furthermore, the comparison of computed and measured ZFS tensors may provide important information on the atomistic structure and charge state of defects in solids, thus helping to identify the defect configuration present in experimental samples. Therefore, the development of robust methods for the calculation of the ZFS tensor is an interesting topic in molecular chemistry and materials science.
In this work we describe the code PyZFS for the calculation of the ZFS tensor D of molecules and solids, based on wavefunctions obtained from density functional theory (DFT) calculations. For systems without heavy elements, i.e., where spin-orbit coupling is negligible, magnetic spinspin interactions are the dominant ones in the determination of the ZFS tensor. For molecules and materials with magnetic permeability close to the vacuum permeability µ 0 , the spin-spin ZFS tensor evaluated using the DFT Kohn-Sham wavefunctions, is given by Harriman (1978): where a, b = x, y, z are Cartesian indices; γ e is the gyromagnetic ratio of electrons; the summation runs over all pairs of occupied Kohn-Sham orbitals; χ ij = ±1 for parallel and antiparallel spins, respectively; Φ ij (r, r ′ ) are 2 × 2 determinants formed from Kohn-Sham Several quantum chemistry codes (for example, ORCA (Neese, 2012)) include the implementation of ZFS tensor calculations for molecules, where electronic wavefunctions are represented using Gaussian basis sets. However, few open-source codes are available to compute ZFS tensors using plane-wave basis sets, which are usually the basis sets of choice to study condensed systems. In PyZFS we implement the evaluation of spin-spin ZFS tensors using plane-wave basis sets. The double integration in real space is reduced to a single summation over reciprocal lattice vectors through the use of Fast Fourier Transforms (Rayson & Briddon, 2008).
We note that a large-scale DFT calculations can yield wavefunction files occupying tens of gigbytes. Therefore, proper distribution and management of data is critical. In PyZFS, the summation over pairs of Kohn-Sham orbitals is distributed into a square grid of processors through the use of the Message Passing Interface (MPI), which significantly reduces the CPU time and memory cost per processor.
PyZFS can use wavefunctions generated by various plane-wave DFT codes as input. For instance, it can directly read wavefunctions from Quantum Espresso (Giannozzi et al., 2009) in the HDF5 format and from Qbox (Gygi, 2008) in the XML format. The standard cube file format is also supported. PyZFS features a modular design and utilizes abstract classes for extensibility. Support for new wavefunction format may be easily implemented by defining subclasses of the relevant abstract class and overriding corresponding abstract methods.
Since its development, PyZFS has been adopted to predict ZFS tensors for spin defects in semiconductors, and facilitated the discovery of novel spin defects (Seo, Ma, Govoni, & Galli, 2017) and the study of spin-phonon interactions in solids (Whiteley et al., 2019). PyZFS has also been adopted to generate benchmark data for the development of methods to compute the ZFS tensor using all electron calculations on finite element basis sets (Ghosh, Ma, Gavini, & Galli, 2019). Thanks to the parallel design of the code, PyZFS can perform calculations for defects embedded in large supercells. For example, the calculations performed by Whiteley et al. (2019) used supercells that contain more than 3000 valence electrons, and are among the largest first-principles calculations of ZFS tensors reported at the time this document was written.