Skip to main content
IFermi logo

📖 Online Documentation 📖

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 full featured FermiSurface and FermiSlice objects which allow for easy manipulation and analysis. The main features include:

  • Interpolation of electronic band structures onto dense k-point meshes.
  • Extraction of Fermi surfaces and Fermi slices from electronic band structures.
  • Projection of arbitrary properties on to Fermi surfaces and Fermi slices.
  • Tools to calculate Fermi surface dimensionality, orientation, and averaged projections, including Fermi velocities.
  • Interactive visualisation of Fermi surfaces and slices, with support for mayavi, plotly and matplotlib.
  • Generation and visualisation of spin-texture.

IFermi currently only works with VASP calculations but support for additional DFT packages will be added in the future.

Example Fermi surfaces

Quick start

The online documentation provides a full description of the available command-line options.

Analysis

Fermi surface properties, including dimensionality and orientation can be extracted from a vasprun.xml file using.

ifermi info
Fermi Surface Summary
=====================

  # surfaces: 5
  Area: 32.745 Å⁻²

Isosurfaces
~~~~~~~~~~~

    Band    Area [Å⁻²]   Dimensionality    Orientation
  ------  ------------  ----------------  -------------
       6         1.944         2D           (0, 0, 1)
       7         4.370         1D           (0, 0, 1)
       7         2.961         2D           (0, 0, 1)
       8         3.549         1D           (0, 0, 1)
       8         3.549         1D           (0, 0, 1)

Visualisation

Three-dimensional Fermi surfaces can be visualized from a vasprun.xml file using:

ifermi plot

The two-dimensional slice of a Fermi surface along the plane specified by the miller indices (j k l) and distance d can be plotted from a vasprun.xml file using:

ifermi plot --slice j k l d

Python library

The ifermi command line tools are build on the IFermi Python library. Here is an example of how to load DFT calculation outputs, interpolate the energies onto a dense mesh, generate a Fermi surface, calculate Fermi surface properties, and visualise the surface. A more complete summary of the API is given in the API introduction page and in the API Reference page in the documentation.

from pymatgen.io.vasp.outputs import Vasprun
from ifermi.surface import FermiSurface
from ifermi.interpolate import FourierInterpolator
from ifermi.plot import FermiSlicePlotter, FermiSurfacePlotter, save_plot, show_plot

# load VASP calculation outputs
vr = Vasprun("vasprun.xml")
bs = vr.get_band_structure()

# interpolate the energies onto a dense k-point mesh
interpolator = FourierInterpolator(bs)
dense_bs = interpolator.interpolate_bands()

# generate the Fermi surface and calculate the dimensionality
fs = FermiSurface.from_band_structure(
  dense_bs, mu=0.0, wigner_seitz=True, calculate_dimensionality=True
)

# number of isosurfaces in the Fermi surface
fs.n_surfaces

# number of isosurfaces for each Spin channel
fs.n_surfaces_per_spin

# the total area of the Fermi surface
fs.area

# the area of each isosurface
fs.area_surfaces

# loop over all isosurfaces and check their properties
# the isosurfaces are given as a list for each spin channel
for spin, isosurfaces in fs.isosurfaces.items():
  for isosurface in isosurfaces:
    # the dimensionality (does the surface cross periodic boundaries)
    isosurface.dimensionality

    # what is the orientation
    isosurface.orientation

    # does the surface have face properties
    isosurface.has_properties

    # calculate the norms of the properties
    isosurface.properties_norms

    # calculate scalar projection of properties on to [0 0 1] vector
    isosurface.scalar_projection((0, 0, 1))

    # uniformly sample the surface faces to a consistent density
    isosurface.sample_uniform(0.1)

# plot the Fermi surface
fs_plotter = FermiSurfacePlotter(fs)
plot = fs_plotter.get_plot()

# generate Fermi slice along the (0 0 1) plane going through the Γ-point.
fermi_slice = fs.get_fermi_slice((0, 0, 1))

# number of isolines in the slice
fermi_slice.n_lines

# do the lines have segment properties
fermi_slice.has_properties

# plot slice
slice_plotter = FermiSlicePlotter(fermi_slice)
plot = slice_plotter.get_plot()

save_plot(plot, "fermi-slice.png")  # saves the plot to a file
show_plot(plot)  # displays an interactive plot

Installation

IFermi can be installed with the command:

pip install ifermi

IFermi is currently compatible with Python 3.6+ and relies on a number of open-source python packages, specifically:

What’s new?

Track changes to IFermi through the changelog.

Contributing

We greatly appreciate any contributions in the form of Pull Request. We maintain a list of all contributors here.

License

IFermi is made available under the MIT License.

Acknowledgements

Developed by Amy Searle and Alex Ganose. Sinead Griffin designed and led the project.

Metadata

Release files for ifermi 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ifermi 0.2.0
File Size Uploaded
ifermi-0.2.0.tar.gz 10.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for ifermi 0.2.0
File Interpreter ABI Platform
ifermi-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.0 MB

Release files / ifermi-0.2.0.tar.gz

Download URL ifermi-0.2.0.tar.gz
Size 10.0 MB
Tags Source
SHA-256 checksum
How to use checksums
704ee9abcf453ea9a69981ba5e652623d1029ede73a22d0c71a3db8e962ba4f4
BLAKE2b-256 checksum
How to use checksums
33223868b3a9be7c6194206a784dd3eae66bdb7863c424d287566022f613f50d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release files / ifermi-0.2.0-py3-none-any.whl

Download URL ifermi-0.2.0-py3-none-any.whl
Size 49.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
966ba54f1fd442953985cac9a8f030773f80514c859259075efc977b41f51299
BLAKE2b-256 checksum
How to use checksums
6b407f2e26a1c72bce898ec116345a3b56e72114be51935af9bfc4aa10d23be9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2

Release history Release notifications | RSS feed

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page