3
0
mirror of https://github.com/triqs/dft_tools synced 2024-06-29 08:24:54 +02:00

Merge pull request #152 from materialstheory/unstable

sum_k.calc_mu exposes dichotomy parameter max_loops
This commit is contained in:
Alexander Hampel 2020-10-30 17:29:52 -04:00 committed by GitHub
commit 160dc9d9ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1939,7 +1939,7 @@ class SumkDFT(object):
"""
self.chemical_potential = mu
def calc_mu(self, precision=0.01, iw_or_w='iw', broadening=None, delta=0.5):
def calc_mu(self, precision=0.01, iw_or_w='iw', broadening=None, delta=0.5, max_loops=100):
r"""
Searches for the chemical potential that gives the DFT total charge.
A simple bisection method is used.
@ -1955,6 +1955,8 @@ class SumkDFT(object):
Imaginary shift for the axis along which the real-axis GF is calculated.
If not provided, broadening will be set to double of the distance between mesh points in 'mesh'.
Only relevant for real-frequency GF.
max_loops : int, optional
Number of dichotomy loops maximally performed.
Returns
-------
@ -1969,7 +1971,7 @@ class SumkDFT(object):
self.chemical_potential = dichotomy.dichotomy(function=F,
x_init=self.chemical_potential, y_value=density,
precision_on_y=precision, delta_x=delta, max_loops=100,
precision_on_y=precision, delta_x=delta, max_loops=max_loops,
x_name="Chemical Potential", y_name="Total Density",
verbosity=3)[0]