|
8 | 8 |
|
9 | 9 | import numpy as np |
10 | 10 |
|
11 | | -from rydstate.angular import AngularKetLS |
| 11 | +from rydstate.angular import AngularKetJJ, AngularKetLS |
12 | 12 | from rydstate.angular.utils import try_trivial_spin_addition |
13 | 13 | from rydstate.radial import RadialState |
14 | 14 | from rydstate.species.species_object import SpeciesObject |
@@ -302,3 +302,79 @@ def __repr__(self) -> str: |
302 | 302 |
|
303 | 303 | def get_nu(self) -> float: |
304 | 304 | return self.species.calc_nu(self.n, self.l, self.j_tot, s_tot=self.s_tot) |
| 305 | + |
| 306 | + |
| 307 | +class RydbergStateAlkalineJJ(RydbergStateBase): |
| 308 | + """Create an Alkaline Rydberg state, including the radial and angular states.""" |
| 309 | + |
| 310 | + def __init__( |
| 311 | + self, |
| 312 | + species: str | SpeciesObject, |
| 313 | + n: int, |
| 314 | + l: int, |
| 315 | + j_r: float, |
| 316 | + j_tot: int | None = None, |
| 317 | + f_tot: float | None = None, |
| 318 | + m: float | None = None, |
| 319 | + ) -> None: |
| 320 | + r"""Initialize the Rydberg state. |
| 321 | +
|
| 322 | + Args: |
| 323 | + species: Atomic species. |
| 324 | + n: Principal quantum number of the rydberg electron. |
| 325 | + l: Orbital angular momentum quantum number of the rydberg electron. |
| 326 | + j_r: Total angular momentum quantum number of the Rydberg electron. |
| 327 | + j_tot: Total angular momentum quantum number of all electrons. |
| 328 | + f_tot: Total angular momentum quantum number of the atom (rydberg electron + core) |
| 329 | + Optional, only needed if the species supports hyperfine structure (i.e. species.i_c is not None or 0). |
| 330 | + m: Total magnetic quantum number. |
| 331 | + Optional, only needed for concrete angular matrix elements. |
| 332 | +
|
| 333 | + """ |
| 334 | + if isinstance(species, str): |
| 335 | + species = SpeciesObject.from_name(species) |
| 336 | + self.species = species |
| 337 | + s_r, s_c = 1 / 2, 1 / 2 |
| 338 | + i_c = species.i_c if species.i_c is not None else 0 |
| 339 | + self.n = n |
| 340 | + if l < 5: |
| 341 | + raise RuntimeError("RydbergStateAlkalineJJ is intended for high-l states only.") |
| 342 | + self.l = l |
| 343 | + self.j_r = try_trivial_spin_addition(l, s_r, j_r, "j_r") |
| 344 | + self.j_tot = try_trivial_spin_addition(self.j_r, s_c, j_tot, "j_tot") |
| 345 | + self.f_tot = try_trivial_spin_addition(self.j_tot, i_c, f_tot, "f_tot") |
| 346 | + self.m = m |
| 347 | + |
| 348 | + if species.number_valence_electrons != 2: |
| 349 | + raise ValueError(f"The species {species.name} is not an alkaline atom.") |
| 350 | + for s_tot in [0, 1]: |
| 351 | + if not species.is_allowed_shell(n, l, s_tot=s_tot): |
| 352 | + raise ValueError(f"The shell ({n=}, {l=}) is not allowed for the species {self.species}.") |
| 353 | + |
| 354 | + @cached_property |
| 355 | + def angular(self) -> AngularKetJJ: |
| 356 | + """The angular/spin state of the Rydberg electron.""" |
| 357 | + return AngularKetJJ( |
| 358 | + l_r=self.l, j_r=self.j_r, j_tot=self.j_tot, f_tot=self.f_tot, m=self.m, species=self.species |
| 359 | + ) |
| 360 | + |
| 361 | + @cached_property |
| 362 | + def radial(self) -> RadialState: |
| 363 | + """The radial state of the Rydberg electron.""" |
| 364 | + radial_state = RadialState(self.species, nu=self.get_nu(), l_r=self.l) |
| 365 | + radial_state.set_n_for_sanity_check(self.n) |
| 366 | + return radial_state |
| 367 | + |
| 368 | + def __repr__(self) -> str: |
| 369 | + species, n, l, j_r, j_tot, m = self.species, self.n, self.l, self.j_r, self.j_tot, self.m |
| 370 | + return f"{self.__class__.__name__}({species.name}, {n=}, {l=}, {j_r=}, {j_tot=}, {m=})" |
| 371 | + |
| 372 | + def get_nu(self) -> float: |
| 373 | + nu_singlet = self.species.calc_nu(self.n, self.l, self.j_tot, s_tot=0) |
| 374 | + nu_triplet = self.species.calc_nu(self.n, self.l, self.j_tot, s_tot=1) |
| 375 | + if abs(nu_singlet - nu_triplet) > 1e-10: |
| 376 | + raise ValueError( |
| 377 | + "RydbergStateAlkalineJJ is intended for high-l states only, " |
| 378 | + "where the quantum defects are the same for singlet and triplet states." |
| 379 | + ) |
| 380 | + return nu_singlet |
0 commit comments