@@ -69,13 +69,18 @@ def test_validate_quantum_numbers(
69
69
):
70
70
"""
71
71
Test the `validate_quantum_numbers` method.
72
+
73
+ Args:
74
+ number_label (str): The quantum number string to be tested.
75
+ values (List[int]): The values stored in `OrbitalState`.
76
+ results (List[bool]): The expected results after validation.
72
77
"""
73
78
orbital_state = OrbitalsState (n_quantum_number = 2 )
74
79
for val , res in zip (values , results ):
75
80
if number_label == 'ml_quantum_number' :
76
81
orbital_state .l_quantum_number = 2
77
82
setattr (orbital_state , number_label , val )
78
- assert orbital_state .validate_quantum_numbers (logger ) == res
83
+ assert orbital_state .validate_quantum_numbers (logger = logger ) == res
79
84
80
85
@pytest .mark .parametrize (
81
86
'quantum_name, value, expected_result' ,
@@ -103,6 +108,11 @@ def test_number_and_symbol(
103
108
):
104
109
"""
105
110
Test the number and symbol resolution for each of the quantum numbers defined in the parametrization.
111
+
112
+ Args:
113
+ quantum_name (str): The quantum number string to be tested.
114
+ value (Union[int, float]): The value stored in `OrbitalState`.
115
+ expected_result (Optional[str]): The expected result after resolving the counter-type.
106
116
"""
107
117
# Adding quantum numbers to the `OrbitalsState` section
108
118
orbital_state = OrbitalsState (n_quantum_number = 2 )
@@ -112,13 +122,13 @@ def test_number_and_symbol(
112
122
113
123
# Making sure that the `'number'` is assigned
114
124
resolved_type = orbital_state .resolve_number_and_symbol (
115
- quantum_name , 'number' , logger
125
+ quantum_name = quantum_name , quantum_type = 'number' , logger = logger
116
126
)
117
127
assert resolved_type == value
118
128
119
129
# Resolving if the counter-type is assigned
120
130
resolved_countertype = orbital_state .resolve_number_and_symbol (
121
- quantum_name , 'symbol' , logger
131
+ quantum_name = quantum_name , quantum_type = 'symbol' , logger = logger
122
132
)
123
133
assert resolved_countertype == expected_result
124
134
@@ -146,6 +156,14 @@ def test_degeneracy(
146
156
):
147
157
"""
148
158
Test the degeneracy of each orbital states defined in the parametrization.
159
+
160
+ Args:
161
+ l_quantum_number (int): The angular momentum quantum number.
162
+ ml_quantum_number (Optional[int]): The magnetic quantum number.
163
+ j_quantum_number (Optional[List[float]]): The total angular momentum quantum number.
164
+ mj_quantum_number (Optional[List[float]]): The magnetic quantum number for the total angular momentum.
165
+ ms_quantum_number (Optional[float]): The spin quantum number.
166
+ degeneracy (int): The expected degeneracy of the orbital state.
149
167
"""
150
168
orbital_state = OrbitalsState (n_quantum_number = 2 )
151
169
self .add_state (
@@ -195,13 +213,19 @@ def test_occupation(
195
213
):
196
214
"""
197
215
Test the occupation of a core hole for a given set of orbital reference and degeneracy.
216
+
217
+ Args:
218
+ orbital_ref (Optional[OrbitalsState]): The orbital reference of the core hole.
219
+ degeneracy (Optional[int]): The degeneracy of the orbital reference.
220
+ n_excited_electrons (float): The number of excited electrons.
221
+ occupation (Optional[float]): The expected occupation of the core hole.
198
222
"""
199
223
core_hole = CoreHole (
200
224
orbital_ref = orbital_ref , n_excited_electrons = n_excited_electrons
201
225
)
202
226
if orbital_ref is not None :
203
227
assert orbital_ref .resolve_degeneracy () == degeneracy
204
- resolved_occupation = core_hole .resolve_occupation (logger )
228
+ resolved_occupation = core_hole .resolve_occupation (logger = logger )
205
229
if resolved_occupation is not None :
206
230
assert np .isclose (resolved_occupation , occupation )
207
231
else :
@@ -232,6 +256,12 @@ def test_normalize(
232
256
):
233
257
"""
234
258
Test the normalization of the `CoreHole`. Inputs are defined as the quantities of the `CoreHole` section.
259
+
260
+ Args:
261
+ orbital_ref (Optional[OrbitalsState]): The orbital reference of the core hole.
262
+ n_excited_electrons (Optional[float]): The number of excited electrons.
263
+ dscf_state (Optional[str]): The DSCF state of the core hole.
264
+ results (Tuple[Optional[float], Optional[float], Optional[float]]): The expected results after normalization.
235
265
"""
236
266
core_hole = CoreHole (
237
267
orbital_ref = orbital_ref ,
@@ -265,6 +295,10 @@ def test_u_interactions(
265
295
):
266
296
"""
267
297
Test the Hubbard interactions `U`, `U'`, and `J` for a given set of Slater integrals.
298
+
299
+ Args:
300
+ slater_integrals (Optional[List[float]]): The Slater integrals of the Hubbard interactions.
301
+ results (Tuple[Optional[float], Optional[float], Optional[float]]): The expected results of the Hubbard interactions.
268
302
"""
269
303
# Adding `slater_integrals` to the `HubbardInteractions` section
270
304
hubbard_interactions = HubbardInteractions ()
@@ -276,7 +310,7 @@ def test_u_interactions(
276
310
u_interaction ,
277
311
u_interorbital_interaction ,
278
312
j_hunds_coupling ,
279
- ) = hubbard_interactions .resolve_u_interactions (logger )
313
+ ) = hubbard_interactions .resolve_u_interactions (logger = logger )
280
314
281
315
if None not in (u_interaction , u_interorbital_interaction , j_hunds_coupling ):
282
316
assert np .isclose (u_interaction .to ('eV' ).magnitude , results [0 ])
@@ -306,6 +340,11 @@ def test_u_effective(
306
340
):
307
341
"""
308
342
Test the effective Hubbard interaction `U_eff` for a given set of Hubbard interactions `U` and `J`.
343
+
344
+ Args:
345
+ u_interaction (Optional[float]): The Hubbard interaction `U`.
346
+ j_local_exchange_interaction (Optional[float]): The Hubbard interaction `J`.
347
+ u_effective (Optional[float]): The expected effective Hubbard interaction `U_eff`.
309
348
"""
310
349
# Adding `u_interaction` and `j_local_exchange_interaction` to the `HubbardInteractions` section
311
350
hubbard_interactions = HubbardInteractions ()
@@ -317,7 +356,7 @@ def test_u_effective(
317
356
)
318
357
319
358
# Resolving Ueff from class method
320
- resolved_u_effective = hubbard_interactions .resolve_u_effective (logger )
359
+ resolved_u_effective = hubbard_interactions .resolve_u_effective (logger = logger )
321
360
if resolved_u_effective is not None :
322
361
assert np .isclose (resolved_u_effective .to ('eV' ).magnitude , u_effective )
323
362
else :
@@ -358,10 +397,14 @@ def test_chemical_symbol_and_atomic_number(
358
397
):
359
398
"""
360
399
Test the `chemical_symbol` and `atomic_number` resolution for the `AtomsState` section.
400
+
401
+ Args:
402
+ chemical_symbol (str): The chemical symbol of the atom.
403
+ atomic_number (int): The atomic number of the atom.
361
404
"""
362
405
# Testing `chemical_symbol`
363
406
atom_state = AtomsState (chemical_symbol = chemical_symbol )
364
- assert atom_state .resolve_atomic_number (logger ) == atomic_number
407
+ assert atom_state .resolve_atomic_number (logger = logger ) == atomic_number
365
408
# Testing `atomic_number`
366
409
atom_state .atomic_number = atomic_number
367
- assert atom_state .resolve_chemical_symbol (logger ) == chemical_symbol
410
+ assert atom_state .resolve_chemical_symbol (logger = logger ) == chemical_symbol
0 commit comments