.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gen_examples/utils/plot_fermi_integral_inversion.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gen_examples_utils_plot_fermi_integral_inversion.py: Showcase the inversion of Fermi-Dirac-Ingerals ============================================== The following code displays the quality of the inversion of the Fermi-Dirac integral for the Functions presented in :cite:`Antia.1993` and the improments published in :cite:`Fukushima.2015`. .. GENERATED FROM PYTHON SOURCE LINES 9-36 .. image-sg:: /gen_examples/utils/images/sphx_glr_plot_fermi_integral_inversion_001.svg :alt: plot fermi integral inversion :srcset: /gen_examples/utils/images/sphx_glr_plot_fermi_integral_inversion_001.svg :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as onp import jaxrts plt.style.use("science") xmin, xmax = 0, 200 x = onp.linspace(xmin, xmax, 400) y = jaxrts.math.fermi_integral(x, 0.5)[:, 0] plt.plot( x[10:], (jaxrts.math.inverse_fermi_12_rational_approximation_antia(y) - x)[10:], label="Antia 1993", ) plt.plot( x, jaxrts.math.inverse_fermi_12_fukushima_single_prec(y) - x, label="Fukushima 2015", ) plt.plot(x, onp.zeros_like(x), color="black", linestyle="dashed") plt.xlabel(r"$x$") plt.ylabel(r"$\mathcal{F}^{-1}(\mathcal{F}_{real}(x))-x$") plt.legend() plt.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.677 seconds) .. _sphx_glr_download_gen_examples_utils_plot_fermi_integral_inversion.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_fermi_integral_inversion.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_fermi_integral_inversion.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_