@@ -2126,11 +2126,17 @@ def __repr__(self) -> str:
2126
2126
TITEL , VRHFIN , n_valence_elec = (self .keywords .get (key ) for key in ("TITEL" , "VRHFIN" , "ZVAL" ))
2127
2127
return f"{ cls_name } ({ symbol = } , { functional = } , { TITEL = } , { VRHFIN = } , { n_valence_elec = :.0f} )"
2128
2128
2129
- @property
2130
- def electron_configuration (self ) -> list [tuple [int , str , float ]]:
2129
+ def get_electron_configuration (
2130
+ self ,
2131
+ occu_cutoff : float = 0.01 ,
2132
+ ) -> list [tuple [int , str , float ]]:
2131
2133
"""Valence electronic configuration corresponding to the ZVAL,
2132
2134
read from the "Atomic configuration" section of POTCAR.
2133
2135
2136
+ Args:
2137
+ occu_cutoff (float): Occupancy cutoff below which an orbital
2138
+ would be considered empty.
2139
+
2134
2140
Returns:
2135
2141
list[tuple[int, str, float]]: A list of tuples containing:
2136
2142
- n (int): Principal quantum number.
@@ -2157,11 +2163,11 @@ def electron_configuration(self) -> list[tuple[int, str, float]]:
2157
2163
2158
2164
total_electrons = 0.0
2159
2165
valence_config : list [tuple [int , str , float ]] = []
2160
- for line in lines [start_idx + 3 + num_entries - 1 : start_idx + 2 : - 1 ]:
2166
+ for line in lines [start_idx + 2 + num_entries : start_idx + 2 : - 1 ]:
2161
2167
parts = line .split ()
2162
2168
n , ang_moment , _j , _E , occ = int (parts [0 ]), int (parts [1 ]), float (parts [2 ]), float (parts [3 ]), float (parts [4 ])
2163
2169
2164
- if occ >= 0.01 : # TODO: hard-coded occupancy cutoff
2170
+ if occ >= occu_cutoff :
2165
2171
valence_config .append ((n , l_map [ang_moment ], occ ))
2166
2172
total_electrons += occ
2167
2173
@@ -2170,6 +2176,19 @@ def electron_configuration(self) -> list[tuple[int, str, float]]:
2170
2176
2171
2177
return list (reversed (valence_config ))
2172
2178
2179
+ @property
2180
+ def electron_configuration (self ) -> list [tuple [int , str , float ]]:
2181
+ """Valence electronic configuration corresponding to the ZVAL,
2182
+ read from the "Atomic configuration" section of POTCAR.
2183
+
2184
+ Returns:
2185
+ list[tuple[int, str, float]]: A list of tuples containing:
2186
+ - n (int): Principal quantum number.
2187
+ - subshell (str): Subshell notation (s, p, d, f).
2188
+ - occ (float): Occupation number, limited to ZVAL.
2189
+ """
2190
+ return self .get_electron_configuration ()
2191
+
2173
2192
@property
2174
2193
def element (self ) -> str :
2175
2194
"""Attempt to return the atomic symbol based on the VRHFIN keyword."""
0 commit comments