Skip to main content

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].

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

Installation

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 setup.py install from within the extracted directory.

Testing

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

Tutorial

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
module.

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)
4.0233994366893939e-05
>>> fdk(0.5,-10)
4.0233994366893939e-05
>>> fdk(k=0.5,phi=5)
7.837976057293096
>>> fdk(k=0.5,phi=50)
235.81861512588432
>>> dfdk(k=0.5,phi=-10,d=1)
4.0233348580568672e-05
>>> dfdk(k=0.5,phi=5,d=1)
2.1916282173557855
>>> dfdk(k=0.5,phi=50,d=1)
7.0699026455055112
>>> dfdk(k=0.5,phi=50,d=2)
0.07074571454521902

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/fdint.py", line 68, in fdk
    raise NotImplementedError()
NotImplementedError
>>> dfdk(k=0.5,phi=50,d=10)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "fdint/fdint.py", line 99, in dfdk
    raise NotImplementedError()
NotImplementedError

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

>>> _fd.fd1h(-10)
4.0233994366893939e-05

Documentation

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

Metadata

Release files for fdint 1.0.1

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

Source distribution (sdist)

Source distribution for fdint 1.0.1
File Size Uploaded Provenance Actions
fdint-1.0.1.tar.gz 78.8 kB Without provenance Details for fdint-1.0.1.tar.gz

Release files / fdint-1.0.1.tar.gz

Download URL fdint-1.0.1.tar.gz
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
80c7896dedc6c80bcb0294954cffae9210502c8e6f6e25a753e03ad9e11db845
BLAKE2b-256 checksum
How to use checksums
ffecf88a2649da4e147046880159fe43b1ffcd7b3df6e7240e7190a2f7615e66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for fdint 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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