Commit b8646cb6 authored by Pablo Piskunow's avatar Pablo Piskunow Committed by Anton Akhmerov
Browse files

fix pyflakes failure and lint

parent 7d354180
Pipeline #48612 passed with stages
in 10 minutes and 14 seconds
......@@ -29,6 +29,7 @@ __all__ = ['SpectralDensity', 'Correlator', 'conductivity',
SAMPLING = 2 # number of sampling points to number of moments ratio
class SpectralDensity:
r"""Calculate the spectral density of an operator.
......@@ -248,6 +249,7 @@ class SpectralDensity:
def energies(self):
return (self._a * _chebyshev_nodes(SAMPLING * self.num_moments)
+ self._b)
@property
def num_vectors(self):
return len(self._moments_list)
......@@ -733,6 +735,7 @@ class Correlator:
e_scaled = (self.energies - self._b) / self._a
m_array = np.arange(n_moments)
def _integral_factor(e):
# arrays for faster calculation
sqrt_e = np.sqrt(1 - e ** 2)
......@@ -956,6 +959,7 @@ class LocalVectors:
must be a list of integers with the indices where column vectors
are nonzero.
"""
def __init__(self, syst, where=None, *args):
self.tot_norbs, self.orbs = _normalize_orbs_where(syst, where)
self._idx = 0
......@@ -976,6 +980,7 @@ class LocalVectors:
# ### Auxiliary functions
def fermi_distribution(energy, mu, temperature):
"""Returns the Fermi distribution f(e, µ, T) evaluated at 'e'.
......@@ -997,6 +1002,7 @@ def fermi_distribution(energy, mu, temperature):
else:
return 1 / (1 + np.exp((energy - mu) / temperature))
def _from_where_to_orbs(syst, where):
"""Returns a list of slices of the orbitals in 'where'"""
assert isinstance(syst, system.System)
......@@ -1174,6 +1180,7 @@ def _rescale(hamiltonian, eps, v0, bounds):
return rescaled_ham, (a, b)
def _chebyshev_nodes(n_sampling):
"""Return an array of 'n_sampling' points in the interval (-1,1)"""
raw, step = np.linspace(np.pi, 0, n_sampling,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment