Skip to content
Snippets Groups Projects
Commit 199956b6 authored by patavirt's avatar patavirt
Browse files

Documentation

parent 5f79a6fd
No related branches found
No related tags found
No related merge requests found
...@@ -63,11 +63,11 @@ def _gauss_series_weights(n): ...@@ -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) # 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] # Recurrence formula from [1]
a = 2 * np.pi ** 2 / (4 * j + 1) / (4 * j + 5) a = 2 * np.pi**2 / (4 * j + 1) / (4 * j + 5)
a[0] = np.pi ** 2 / 15 a[0] = np.pi**2 / 15
sqrt_b = np.pi ** 2 / np.sqrt((4 * j1 - 1) * (4 * j1 + 3)) / (4 * j1 + 1) 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 # Compute eigenvalues and first elements of eigenvectors
# #
...@@ -98,7 +98,7 @@ def _gauss_series_weights(n): ...@@ -98,7 +98,7 @@ def _gauss_series_weights(n):
# Then find eigenvectors, one by one # Then find eigenvectors, one by one
# Convert back to unweighted sum (z = 1/x^2) # Convert back to unweighted sum (z = 1/x^2)
w = m0 * w ** 2 / z w = m0 * w**2 / z
x = z ** (-0.5) x = z ** (-0.5)
# Swap order # Swap order
...@@ -147,7 +147,7 @@ def get_matsubara_sum(T, E_typical=1.0, max_ne=2000, steps=1): ...@@ -147,7 +147,7 @@ def get_matsubara_sum(T, E_typical=1.0, max_ne=2000, steps=1):
Examples Examples
-------- --------
>>> import numpy as np >>> 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) >>> w, a = get_matsubara_sum(T=1, E_typical=1)
>>> n = w / (2*np.pi) + 0.5; n >>> n = w / (2*np.pi) + 0.5; n
array([-55.01190294, -17.89542335, -10.6225115 , -7.63686822, 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): ...@@ -189,7 +189,7 @@ def get_matsubara_sum(T, E_typical=1.0, max_ne=2000, steps=1):
E_max = 100 * abs(E_typical) E_max = 100 * abs(E_typical)
try: 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) k, rem = divmod(ne, steps)
if rem != 0: if rem != 0:
k += 1 k += 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment