IFermi: A python library for Fermi surface generation and analysis

The Fermi surface is an important tool for understanding the electronic, optical, and magnetic properties of metals and doped semiconductors (Dugdale, 2016). It defines the surface in reciprocal space that divides unoccupied and occupied states at zero temperature. The topology of the Fermi surface impacts a variety of quantum phenomena including superconductivity, topological insulation, and ferromagnetism, and it can be used to predict the complex behaviour of systems without requiring more detailed computations. For example: (i) large nested Fermi sheets are a characteristic of charge density ordering (Lomer, 1962); (ii) the size and position of Fermi pockets are indicators of high-performance thermoelectrics (Park et al., 2020); and (iii) the average group velocities across the Fermi surface control the sensitivity of materials for dark matter detection (Inzani et al., 2021). IFermi is a Python library for the generation, analysis, and visualisation of Fermi surfaces that can facilitate sophisticated analyses of Fermi surface properties.


Summary
The Fermi surface is an important tool for understanding the electronic, optical, and magnetic properties of metals and doped semiconductors (Dugdale, 2016). It defines the surface in reciprocal space that divides unoccupied and occupied states at zero temperature. The topology of the Fermi surface impacts a variety of quantum phenomena including superconductivity, topological insulation, and ferromagnetism, and it can be used to predict the complex behaviour of systems without requiring more detailed computations. For example: (i) large nested Fermi sheets are a characteristic of charge density ordering (Lomer, 1962); (ii) the size and position of Fermi pockets are indicators of high-performance thermoelectrics (Park et al., 2020); and (iii) the average group velocities across the Fermi surface control the sensitivity of materials for dark matter detection (Inzani et al., 2021). IFermi is a Python library for the generation, analysis, and visualisation of Fermi surfaces that can facilitate sophisticated analyses of Fermi surface properties.

Statement of need
Many tools already exist for the generation of Fermi surfaces from ab initio band structure calculations. For example, several electronic structure codes such as CASTEP (Segall et al., 2002) and QuantumATK (Smidstrup et al., 2020) include integrated tools for obtaining Fermi surfaces. Furthermore, software such as FermiSurfer (Kawamura, 2019), pyprocar (Herath et al., 2020), BoltzTraP2 (Madsen et al., 2018), and XCrysDen (Kokalj, 1999) interface with common density functional theory packages and can plot Fermi surfaces from their outputs. All such packages, however, are only designed to visualise Fermi surfaces and do not expose any application programming interfaces (APIs) for analysing and manipulating Fermi surfaces as objects. In IFermi, we address these limitations by developing a fully-featured Python library for representing and processing Fermi surfaces and Fermi slices. We also implement a novel algorithm for determining the dimensionality of Fermi surfaces using the connectivity across periodic boundaries and the Euler characteristic of the isosurface mesh. IFermi, therefore, enables the programmatic characterisation of Fermi surfaces and can be used as a foundational library for investigating complex Fermi surface properties such as nesting. * equal contribution † equal contribution

IFermi
IFermi is a Python 3.6+ library and set of command-line tools for the generation, analysis, and visualisation of Fermi surfaces and Fermi slices. The goal of the library is to provide fully-featured FermiSurface and FermiSlice objects that allow for easy manipulation and programmatic analysis. The main features of the package include: • The Fourier interpolation of electronic band structures onto dense k-point meshes required to obtain high resolution Fermi surfaces. • The extraction of Fermi surfaces and Fermi slices from electronic band structures. • A rich API for representing and manipulating Fermi surface objects. • The projection of arbitrary properties onto Fermi surfaces and Fermi slices. • Algorithms to calculate Fermi surface properties, including dimensionality, orientation, and averaged projections such as Fermi velocities. • Interactive visualisation of Fermi surfaces and slices, and their projections such as spintexture, with support for mayavi (Ramachandran & Varoquaux, 2011), plotly (Plotly Technologies Inc., 2021) and matplotlib (Hunter, 2007). Examples of the graphics produced by IFermi are presented in Figure 1. In addition to the Python library, IFermi includes several command-line tools that can perform common tasks such as calculating Fermi surface dimensionality and Fermi velocities. IFermi uses the pymatgen (Ong et al., 2013) library for parsing first-principles calculation outputs and therefore supports all electronic structure codes supported therein. At the time of writing this comprises Vienna ab initio Simulation Package (VASP), ABINIT, and CP2K. IFermi also relies on several open source packages, such as BoltzTraP2 (Madsen et al., 2018) for Fourier interpolation, trimesh (Dawson-Haggerty, n.d.) for processing triangular meshes, and scikit-image (van der Walt et al., 2014) for generating isosurfaces using the marching cubes algorithm developed by Lewiner et al. (2003).

Author Contributions
The library and command-line tools were written by AS and AMG. SMG designed and led the project. The first draft of the manuscript was written by AMG with input from all co-authors.

Conflicts of Interest
There are no conflicts to declare.