|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
| 3 | +import logging |
| 4 | + |
3 | 5 | import numpy as np |
4 | 6 |
|
5 | 7 | from rydstate.basis.basis_base import BasisBase |
6 | | -from rydstate.rydberg import RydbergStateSQDTAlkali, RydbergStateSQDTAlkalineLS |
| 8 | +from rydstate.rydberg import ( |
| 9 | + RydbergStateSQDTAlkali, |
| 10 | + RydbergStateSQDTAlkalineFJ, |
| 11 | + RydbergStateSQDTAlkalineJJ, |
| 12 | + RydbergStateSQDTAlkalineLS, |
| 13 | +) |
| 14 | + |
| 15 | +logger = logging.getLogger(__name__) |
7 | 16 |
|
8 | 17 |
|
9 | 18 | class BasisSQDTAlkali(BasisBase[RydbergStateSQDTAlkali]): |
@@ -48,3 +57,63 @@ def __init__(self, species: str, n_min: int = 1, n_max: int | None = None) -> No |
48 | 57 | species, n=n, l=l, s_tot=s_tot, j_tot=j_tot, f_tot=float(f_tot) |
49 | 58 | ) |
50 | 59 | self.states.append(state) |
| 60 | + |
| 61 | + |
| 62 | +class BasisSQDTAlkalineJJ(BasisBase[RydbergStateSQDTAlkalineJJ]): |
| 63 | + def __init__(self, species: str, n_min: int = 0, n_max: int | None = None) -> None: |
| 64 | + super().__init__(species) |
| 65 | + |
| 66 | + if n_max is None: |
| 67 | + raise ValueError("n_max must be given") |
| 68 | + |
| 69 | + i_c = self.species.i_c if self.species.i_c is not None else 0 |
| 70 | + j_c = 0.5 |
| 71 | + s_r = 0.5 |
| 72 | + self.states = [] |
| 73 | + for n in range(n_min, n_max + 1): |
| 74 | + for l_r in range(n): |
| 75 | + if self.species.is_allowed_shell(n, l_r, 0) != self.species.is_allowed_shell(n, l_r, 1): |
| 76 | + logger.warning( |
| 77 | + "For l=%d, n=%d one of the singlet/triplet states is not allowed. " |
| 78 | + "In JJ coupling the state does not exist, thus skipping this shell", |
| 79 | + *(l_r, n), |
| 80 | + ) |
| 81 | + if not all(self.species.is_allowed_shell(n, l_r, s_tot) for s_tot in [0, 1]): |
| 82 | + continue |
| 83 | + for j_r in np.arange(abs(l_r - s_r), l_r + s_r + 1): |
| 84 | + for j_tot in range(int(abs(j_r - j_c)), int(j_r + j_c + 1)): |
| 85 | + for f_tot in np.arange(abs(j_tot - i_c), j_tot + i_c + 1): |
| 86 | + state = RydbergStateSQDTAlkalineJJ( |
| 87 | + species, n=n, l=l_r, j_r=float(j_r), j_tot=j_tot, f_tot=float(f_tot) |
| 88 | + ) |
| 89 | + self.states.append(state) |
| 90 | + |
| 91 | + |
| 92 | +class BasisSQDTAlkalineFJ(BasisBase[RydbergStateSQDTAlkalineFJ]): |
| 93 | + def __init__(self, species: str, n_min: int = 0, n_max: int | None = None) -> None: |
| 94 | + super().__init__(species) |
| 95 | + |
| 96 | + if n_max is None: |
| 97 | + raise ValueError("n_max must be given") |
| 98 | + |
| 99 | + i_c = self.species.i_c if self.species.i_c is not None else 0 |
| 100 | + j_c = 0.5 |
| 101 | + s_r = 0.5 |
| 102 | + self.states = [] |
| 103 | + for n in range(n_min, n_max + 1): |
| 104 | + for l_r in range(n): |
| 105 | + if self.species.is_allowed_shell(n, l_r, 0) != self.species.is_allowed_shell(n, l_r, 1): |
| 106 | + logger.warning( |
| 107 | + "For l=%d, n=%d one of the singlet/triplet states is not allowed. " |
| 108 | + "In FJ coupling the state does not exist, thus skipping this shell", |
| 109 | + *(l_r, n), |
| 110 | + ) |
| 111 | + if not all(self.species.is_allowed_shell(n, l_r, s_tot) for s_tot in [0, 1]): |
| 112 | + continue |
| 113 | + for j_r in np.arange(abs(l_r - s_r), l_r + s_r + 1): |
| 114 | + for f_c in np.arange(abs(j_c - i_c), j_c + i_c + 1): |
| 115 | + for f_tot in np.arange(abs(f_c - j_r), f_c + j_r + 1): |
| 116 | + state = RydbergStateSQDTAlkalineFJ( |
| 117 | + species, n=n, l=l_r, j_r=float(j_r), f_c=float(f_c), f_tot=float(f_tot) |
| 118 | + ) |
| 119 | + self.states.append(state) |
0 commit comments