Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
2.0.2
=====
* 101: Bump `numpy` version.

2.0.1
===========
=====
* 99: Replace `tox` functionality with `hatch`.

2.0.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"astropy",
"attrs",
"mpmath",
"numpy~=1.26.4",
"numpy>=1.26.4",
]
dynamic = ["version"]

Expand Down
11 changes: 6 additions & 5 deletions src/ibei/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import astropy.units
import attrs
import functools
import math
import mpmath
import numpy as np

Expand Down Expand Up @@ -159,26 +160,26 @@ def upper(self) -> astropy.units.Quantity:
if self.reduced_chemical_potential == 0 and self.reduced_energy_bound == 0:
# Specify this condition just to skip the next condition.
term = float(mpmath.polylog(self.order + 1, real_arg))
bei = term * self.prefactor * np.math.factorial(self.order)
bei = term * self.prefactor * math.factorial(self.order)

elif self.reduced_chemical_potential >= self.reduced_energy_bound:
bei = 0 * self.prefactor * np.math.factorial(self.order)
bei = 0 * self.prefactor * math.factorial(self.order)

elif real_arg == 0:
# When the lower bound of the integral approaches
# infinity, the value of the integral approaches zero.
bei = 0 * self.prefactor * np.math.factorial(self.order)
bei = 0 * self.prefactor * math.factorial(self.order)

else:
summand = 0
for indx in range(1, self.order + 2):
index = self.order - indx + 1

term = self.reduced_energy_bound**index * float(mpmath.polylog(indx, real_arg)) / np.math.factorial(index)
term = self.reduced_energy_bound**index * float(mpmath.polylog(indx, real_arg)) / math.factorial(index)

summand += term

bei = self.prefactor * summand * np.math.factorial(self.order)
bei = self.prefactor * summand * math.factorial(self.order)

return bei

Expand Down
Loading