From 199956b6d45c56a7f84d8fc38b8b8090ec97c67b Mon Sep 17 00:00:00 2001 From: Pauli Virtanen <pauli.t.virtanen@jyu.fi> Date: Tue, 23 Apr 2024 16:42:04 +0300 Subject: [PATCH] Documentation --- usadelndsoc/matsubara.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usadelndsoc/matsubara.py b/usadelndsoc/matsubara.py index 74a05de..135874f 100644 --- a/usadelndsoc/matsubara.py +++ b/usadelndsoc/matsubara.py @@ -63,11 +63,11 @@ def _gauss_series_weights(n): # bessel_poly_yn = lambda n, x: np.sqrt(2/(np.pi*x)) * np.exp(1/x) * special.kv(n+0.5, 1/x) # Recurrence formula from [1] - a = 2 * np.pi ** 2 / (4 * j + 1) / (4 * j + 5) - a[0] = np.pi ** 2 / 15 - sqrt_b = np.pi ** 2 / np.sqrt((4 * j1 - 1) * (4 * j1 + 3)) / (4 * j1 + 1) + a = 2 * np.pi**2 / (4 * j + 1) / (4 * j + 5) + a[0] = np.pi**2 / 15 + sqrt_b = np.pi**2 / np.sqrt((4 * j1 - 1) * (4 * j1 + 3)) / (4 * j1 + 1) - m0 = pi ** 2 / 6 # = sum_{k=1}^oo 1/k^2 + m0 = pi**2 / 6 # = sum_{k=1}^oo 1/k^2 # Compute eigenvalues and first elements of eigenvectors # @@ -98,7 +98,7 @@ def _gauss_series_weights(n): # Then find eigenvectors, one by one # Convert back to unweighted sum (z = 1/x^2) - w = m0 * w ** 2 / z + w = m0 * w**2 / z x = z ** (-0.5) # Swap order @@ -147,7 +147,7 @@ def get_matsubara_sum(T, E_typical=1.0, max_ne=2000, steps=1): Examples -------- >>> import numpy as np - >>> from nfiscomp.matsubara import get_matsubara_sum + >>> from usadelndsoc.matsubara import get_matsubara_sum >>> w, a = get_matsubara_sum(T=1, E_typical=1) >>> n = w / (2*np.pi) + 0.5; n array([-55.01190294, -17.89542335, -10.6225115 , -7.63686822, @@ -189,7 +189,7 @@ def get_matsubara_sum(T, E_typical=1.0, max_ne=2000, steps=1): E_max = 100 * abs(E_typical) try: - ne = 5 + int(np.sqrt(4 * E_max / (pi ** 2 * abs(T)))) + ne = 5 + int(np.sqrt(4 * E_max / (pi**2 * abs(T)))) k, rem = divmod(ne, steps) if rem != 0: k += 1 -- GitLab