Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A free, open-source python package for computing Fermi-Dirac integrals.

Project description

Fermi-Dirac Integrals (FDINT)

FDINT is a free, open-source python package that provides fast, double precision (64-bit floating point) approximations to the Fermi-Dirac integrals of integer and half integer order, based on the work by Prof. Fukushima [1].

[1]T. Fukushima, “Precise and fast computation of Fermi-Dirac integral of integer and half integer order by piecewise minimax rational approximation,” Applied Mathematics and Computation, vol. 259, pp. 708-729, May 2015.

The source code and documentation (coming soon) are graciously hosted by GitHub.


In order to use FDINT, you must having a working Python distribution installed. Python 3 support has not yet been tested, so Python 2.7 is suggested. In order to achieve the highest performance, a Fortran 90 compiler, such as gfortran, is required.

From PyPi

This is the easiest method. Install from PyPi by running the following command:

pip install fdint

From Github

First, you will need to install the following prerequisite packages:

Additional functionality is provided by the following optional packages:

Once these are installed, download the latest release .zip or .tar.gz source package from the github page, extract its contents, and run python install from within the extracted directory.


Once installed, you can test the package by running the following command:

python -m fdint.tests

If you have Matplotlib installed, you can also plot a sample of the available functions by running the following command:

python -m fdint


First, start up an interactive python shell from the command line:

$ python

Next, import everything from the fdint package:

>>> from fdint import *

If you see the following warning, then the Fortran library failed to compile and/or install:

WARNING: Unable to import fortran module. Falling back to the slower python

The same functionality is provided by the fall-back python module, but the python module is considerably slower. Either way, now you can access the Fermi-Dirac integral, fdk, and the derivative, dfdk, convenience functions:

>>> fdk(k=0.5,phi=-10)
>>> fdk(0.5,-10)
>>> fdk(k=0.5,phi=5)
>>> fdk(k=0.5,phi=50)
>>> dfdk(k=0.5,phi=-10,d=1)
>>> dfdk(k=0.5,phi=5,d=1)
>>> dfdk(k=0.5,phi=50,d=1)
>>> dfdk(k=0.5,phi=50,d=2)

If you request an order or derivative that is not implemented, a NotImplementedError is raised:

>>> fdk(22,0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "fdint/", line 68, in fdk
    raise NotImplementedError()
>>> dfdk(k=0.5,phi=50,d=10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "fdint/", line 99, in dfdk
    raise NotImplementedError()

If you prefer to call the low-level functions directly, you can access them from the _fd module:

>>> _fd.fd1h(-10)


The documentation (coming soon) is graciously hosted by GitHub.

Project details

Download files

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

Files for fdint, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size fdint-1.0.macosx-10.9-x86_64.tar.gz (122.3 kB) File type Dumb Binary Python version 2.7 Upload date Hashes View
Filename, size fdint-1.0.tar.gz (78.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page