Skip to content

Commit

Permalink
fix the default chempot behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsquires committed Apr 2, 2024
1 parent f148528 commit 326ddf1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions doped/interface/fermi_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,8 @@ def _add_effective_dopant_concentration_and_solve_pseudo(

def scan_chemical_potential_grid(
self,
chemical_potentials,
dependent_variable: str,
chemical_potentials=None,
n_points: int = 10,
temperature: float = 300,
annealing_temperature: Optional[float] = None,
Expand All @@ -444,8 +444,8 @@ def scan_chemical_potential_grid(
the grid points.
Args:
chemical_potentials (dict): chemical potentials to scan
dependent_variable (str): the dependent variable to scan
chemical_potentials (dict): chemical potentials to scan
n_points (int): number of points to scan
temperature (float): temperature to solve at
annealing_temperature (float): temperature to anneal at
Expand All @@ -457,6 +457,9 @@ def scan_chemical_potential_grid(
Returns:
pd.DataFrame: DataFrame containing the Fermi energy solutions at the grid points
"""
if chemical_potentials is None:
chemical_potentials = self.chemical_potentials["limits_wrt_el_refs"]

grid = ChemicalPotentialGrid.from_chemical_potentials(chemical_potentials).get_grid(
dependent_variable, n_points
)
Expand Down Expand Up @@ -491,10 +494,10 @@ def scan_chemical_potential_grid(

def min_max_X(
self,
chemical_potentials,
dependent_chempot,
target,
min_or_max,
chemical_potentials=None,
tolerance=0.01,
n_points=10,
temperature=300,
Expand All @@ -511,6 +514,9 @@ def min_max_X(
chemical potential that minimizes or maximizes the target variable
until the target value no longer changes by more than the tolerance.
"""
if chemical_potentials is None:
chemical_potentials = self.chemical_potentials["limits_wrt_el_refs"]

starting_grid = ChemicalPotentialGrid.from_chemical_potentials(chemical_potentials)
current_vertices = starting_grid.vertices
chemical_potentials_labels = list(current_vertices.columns)
Expand Down

0 comments on commit 326ddf1

Please sign in to comment.