@@ -182,61 +182,6 @@ def calc_matrix_element(
182182class RydbergStateAlkali (RydbergStateBase ):
183183 """Create an Alkali Rydberg state, including the radial and angular states."""
184184
185- def __init__ (
186- self ,
187- species : str | SpeciesObject ,
188- n : int ,
189- l : int ,
190- j : float | None = None ,
191- m : float | None = None ,
192- ) -> None :
193- r"""Initialize the Rydberg state.
194-
195- Args:
196- species: Atomic species.
197- n: Principal quantum number of the rydberg electron.
198- l: Orbital angular momentum quantum number of the rydberg electron.
199- j: Angular momentum quantum number of the rydberg electron.
200- m: Total magnetic quantum number.
201- Optional, only needed for concrete angular matrix elements.
202-
203- """
204- if isinstance (species , str ):
205- species = SpeciesObject .from_name (species )
206- self .species = species
207- self .n = n
208- self .l = l
209- self .j = try_trivial_spin_addition (l , 0.5 , j , "j" )
210- self .m = m
211-
212- if species .number_valence_electrons != 1 :
213- raise ValueError (f"The species { species .name } is not an alkali atom." )
214- if not species .is_allowed_shell (n , l ):
215- raise ValueError (f"The shell ({ n = } , { l = } ) is not allowed for the species { self .species } ." )
216-
217- @cached_property
218- def angular (self ) -> AngularKetLS :
219- """The angular/spin state of the Rydberg electron."""
220- return AngularKetLS (l_r = self .l , j_tot = self .j , m = self .m , species = self .species )
221-
222- @cached_property
223- def radial (self ) -> RadialState :
224- """The radial state of the Rydberg electron."""
225- radial_state = RadialState (self .species , nu = self .get_nu (), l_r = self .l )
226- radial_state .set_n_for_sanity_check (self .n )
227- return radial_state
228-
229- def __repr__ (self ) -> str :
230- species , n , l , j , m = self .species , self .n , self .l , self .j , self .m
231- return f"{ self .__class__ .__name__ } ({ species .name } , { n = } , { l = } , { j = } , { m = } )"
232-
233- def get_nu (self ) -> float :
234- return self .species .calc_nu (self .n , self .l , self .j , s_tot = 1 / 2 )
235-
236-
237- class RydbergStateAlkaliHyperfine (RydbergStateBase ):
238- """Create an Alkali Rydberg state, including the radial and angular states."""
239-
240185 def __init__ (
241186 self ,
242187 species : str | SpeciesObject ,
@@ -254,19 +199,19 @@ def __init__(
254199 l: Orbital angular momentum quantum number of the rydberg electron.
255200 j: Angular momentum quantum number of the rydberg electron.
256201 f: Total angular momentum quantum number of the atom (rydberg electron + core)
202+ Optional, only needed if the species supports hyperfine structure (i.e. species.i_c is not None or 0).
257203 m: Total magnetic quantum number.
258204 Optional, only needed for concrete angular matrix elements.
259205
260206 """
261207 if isinstance (species , str ):
262208 species = SpeciesObject .from_name (species )
263- if species .i_c is None :
264- raise ValueError (f"The species { species .name } does not have a defined nuclear spin i_c." )
265209 self .species = species
210+ i_c = species .i_c if species .i_c is not None else 0
266211 self .n = n
267212 self .l = l
268213 self .j = try_trivial_spin_addition (l , 0.5 , j , "j" )
269- self .f = try_trivial_spin_addition (self .j , species . i_c , f , "f" )
214+ self .f = try_trivial_spin_addition (self .j , i_c , f , "f" )
270215 self .m = m
271216
272217 if species .number_valence_electrons != 1 :
@@ -304,6 +249,7 @@ def __init__(
304249 l : int ,
305250 s_tot : int ,
306251 j_tot : int | None = None ,
252+ f_tot : float | None = None ,
307253 m : float | None = None ,
308254 ) -> None :
309255 r"""Initialize the Rydberg state.
@@ -314,17 +260,21 @@ def __init__(
314260 l: Orbital angular momentum quantum number of the rydberg electron.
315261 s_tot: Total spin quantum number of all electrons.
316262 j_tot: Total angular momentum quantum number of all electrons.
263+ f_tot: Total angular momentum quantum number of the atom (rydberg electron + core)
264+ Optional, only needed if the species supports hyperfine structure (i.e. species.i_c is not None or 0).
317265 m: Total magnetic quantum number.
318266 Optional, only needed for concrete angular matrix elements.
319267
320268 """
321269 if isinstance (species , str ):
322270 species = SpeciesObject .from_name (species )
323271 self .species = species
272+ i_c = species .i_c if species .i_c is not None else 0
324273 self .n = n
325274 self .l = l
326275 self .s_tot = s_tot
327276 self .j_tot = try_trivial_spin_addition (l , s_tot , j_tot , "j_tot" )
277+ self .f_tot = try_trivial_spin_addition (self .j_tot , i_c , f_tot , "f_tot" )
328278 self .m = m
329279
330280 if species .number_valence_electrons != 2 :
@@ -335,7 +285,9 @@ def __init__(
335285 @cached_property
336286 def angular (self ) -> AngularKetLS :
337287 """The angular/spin state of the Rydberg electron."""
338- return AngularKetLS (l_r = self .l , s_tot = self .s_tot , j_tot = self .j_tot , m = self .m , species = self .species )
288+ return AngularKetLS (
289+ l_r = self .l , s_tot = self .s_tot , j_tot = self .j_tot , f_tot = self .f_tot , m = self .m , species = self .species
290+ )
339291
340292 @cached_property
341293 def radial (self ) -> RadialState :
0 commit comments