diff --git a/pysuperconductor/os_gap_calc.py b/pysuperconductor/os_gap_calc.py index ab0b95c..59b362c 100644 --- a/pysuperconductor/os_gap_calc.py +++ b/pysuperconductor/os_gap_calc.py @@ -33,3 +33,10 @@ def find_gap(temp, mu_star, debye_frequency, nv): x0=debye_frequency / (numpy.sinh(nv_inv)) ) return sol.x + + +def n_integrand_function(xi, temp, delta, mu_star): + big_e = energy(xi, delta) + left = 1 / (1 + numpy.exp((big_e - mu_star) / temp)) + right = 1 / (1 + numpy.exp(big_e / temp)) + return left - right diff --git a/tests/test_os_gap_calc.py b/tests/test_os_gap_calc.py index ad67d58..61d5d24 100644 --- a/tests/test_os_gap_calc.py +++ b/tests/test_os_gap_calc.py @@ -46,3 +46,12 @@ def test_gap(): decimal=7, err_msg='had trouble with gap at non-zero temp and mustar', verbose=True ) + + +def test_n_integrand_function(): + actual = pysuperconductor.os_gap_calc.n_integrand_function(1, 2, 2, 1) + numpy.testing.assert_almost_equal( + actual, 0.1038525814172795, + decimal=7, err_msg='did not find correct n integrand value', + verbose=True + )