Skip to main content

Fermi surface plotting tool from DFT output

Project description

IFermi logo

📖📖 Online Documentation 📖📖

IFermi is a package for plotting Fermi surfaces and from ab initio calculation outputs. The main features include:

  1. Plotting three-dimensional Fermi surfaces, with interactive plotting supported by mayavi, plotly and matplotlib.
  2. Plotting slices of three-dimensional Fermi surfaces along a specified plane.

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

Example

An example of the Fermi surface and a two-dimensional slice for MgB2 is shown below:

MgB2

Usage

The online documentation provides a full description of the available options. To summarise, three-dimensional Fermi surfaces can be plotted from a vasprun.xml file using:

ifermi

The two-dimensional slice of a Fermi slices along the plane specified by the miller indices (A B C) and distance d can be plotted from a vasprun.xml file using:

ifermi --slice A B C d

Python interface

Alternatively, IFermi can be controlled using the Python API. A full summary of the API is given in the API introduction page in the documentation.

The core classes in IFermi are:

  • Inerpolator: to take a band structure on a uniform k-point mesh and interpolate it onto a denser mesh.
  • FermiSurface: to store isosurfaces and reciprocal lattice information.
  • FermiSurfacePlotter: to plot a Fermi surface from a FermiSurface object.

A minimal working example to plot the Fermi surface from a vasprun.xml file is:

from pymatgen.io.vasp.outputs import Vasprun
from ifermi.fermi_surface import FermiSurface
from ifermi.interpolator import Interpolator
from ifermi.plotter import FermiSurfacePlotter, show_plot, save_plot


vr = Vasprun("vasprun.xml")
bs = vr.get_band_structure()

# interpolate the energies to a finer k-point mesh
interpolator = Interpolator(bs)
dense_bs, kmesh = interpolator.interpolate_bands(interpolation_factor=10)

fs = FermiSurface.from_band_structure(dense_bs, kmesh, mu=0.0, wigner_seitz=True)
plotter = FermiSurfacePlotter(fs)
plot = plotter.get_plot(plot_type='plotly')

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

Note, if you're not running the example in a notebook then it must be proceeded by if __name__ == '__main__':.

Installation

IFermi can be installed with the command:

pip install ifermi

IFermi is currently compatible with Python 3.5+ 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

Alex Ganose for developing/improving code and documentation. Sinead Griffin for suggesting the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ifermi-0.1.4.tar.gz (3.1 MB view hashes)

Uploaded Source

Built Distribution

ifermi-0.1.4-py3-none-any.whl (26.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page