mirror of
https://github.com/triqs/dft_tools
synced 2024-06-29 00:15:00 +02:00
sum_k.calc_mu exposes dichotomy parameter max_loops
Default behavior unchanged
This commit is contained in:
parent
b0b2a64286
commit
1fa2376a99
|
@ -1939,7 +1939,7 @@ class SumkDFT(object):
|
||||||
"""
|
"""
|
||||||
self.chemical_potential = mu
|
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"""
|
r"""
|
||||||
Searches for the chemical potential that gives the DFT total charge.
|
Searches for the chemical potential that gives the DFT total charge.
|
||||||
A simple bisection method is used.
|
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.
|
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'.
|
If not provided, broadening will be set to double of the distance between mesh points in 'mesh'.
|
||||||
Only relevant for real-frequency GF.
|
Only relevant for real-frequency GF.
|
||||||
|
max_loops : int, optional
|
||||||
|
Number of dichotomy loops maximally performed.
|
||||||
|
|
||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
|
@ -1969,7 +1971,7 @@ class SumkDFT(object):
|
||||||
|
|
||||||
self.chemical_potential = dichotomy.dichotomy(function=F,
|
self.chemical_potential = dichotomy.dichotomy(function=F,
|
||||||
x_init=self.chemical_potential, y_value=density,
|
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",
|
x_name="Chemical Potential", y_name="Total Density",
|
||||||
verbosity=3)[0]
|
verbosity=3)[0]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user