Skip to content
This repository was archived by the owner on Nov 10, 2025. It is now read-only.

Commit 423d34b

Browse files
fixup
1 parent b477db5 commit 423d34b

7 files changed

Lines changed: 16 additions & 16 deletions

File tree

docs/examples/angular/angular_state.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
},
208208
{
209209
"cell_type": "code",
210-
"execution_count": 10,
210+
"execution_count": null,
211211
"id": "51756a1f",
212212
"metadata": {},
213213
"outputs": [
@@ -224,7 +224,7 @@
224224
"ket1 = AngularKetFJ(f_c=2, l_r=1, j_r=1.5, f_tot=2.5, species=\"Yb173\")\n",
225225
"ket2 = AngularKetFJ(f_c=2, l_r=2, j_r=1.5, f_tot=2.5, species=\"Yb173\")\n",
226226
"\n",
227-
"print(ket1.calc_reduced_matrix_element(ket2, operator=\"SPHERICAL\", kappa=1))\n",
227+
"print(ket1.calc_reduced_matrix_element(ket2, operator=\"spherical\", kappa=1))\n",
228228
"print(ket1.calc_reduced_matrix_element(ket1, operator=\"s_tot\", kappa=1))"
229229
]
230230
}

docs/examples/comparisons/compare_dipole_matrix_element.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
},
7777
{
7878
"cell_type": "code",
79-
"execution_count": 4,
79+
"execution_count": null,
8080
"metadata": {},
8181
"outputs": [
8282
{
@@ -94,7 +94,7 @@
9494
" q = round(qn2[-1] - qn1[-1])\n",
9595
" state_i = RydbergStateAlkali(\"Rb\", n=qn1[0], l=qn1[1], j=qn1[2], m=qn1[3])\n",
9696
" state_f = RydbergStateAlkali(\"Rb\", n=qn2[0], l=qn2[1], j=qn2[2], m=qn2[3])\n",
97-
" dipole_me = state_i.calc_matrix_element(state_f, \"ELECTRIC_DIPOLE\", q, unit=\"a.u.\")\n",
97+
" dipole_me = state_i.calc_matrix_element(state_f, \"electric_dipole\", q, unit=\"a.u.\")\n",
9898
" matrixelements.append(dipole_me)\n",
9999
"\n",
100100
"results[\"ryd-numerov\"] = np.array(matrixelements)"

docs/examples/dipole_matrix_elements.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@
3939
"\n",
4040
"kappa = 1\n",
4141
"radial = state_i.radial.calc_matrix_element(state_f.radial, k_radial=1)\n",
42-
"angular = state_i.angular.calc_matrix_element(state_f.angular, \"SPHERICAL\", kappa=kappa, q=0)\n",
42+
"angular = state_i.angular.calc_matrix_element(state_f.angular, \"spherical\", kappa=kappa, q=0)\n",
4343
"prefactor = np.sqrt(4 * np.pi / (2 * kappa + 1))\n",
4444
"print(f\"Numerov radial matrix element: {radial}\")\n",
4545
"print(f\"Numerov angular matrix element: {angular}\")\n",
4646
"\n",
47-
"dipole = state_i.calc_matrix_element(state_f, \"ELECTRIC_DIPOLE\", q=0)\n",
47+
"dipole = state_i.calc_matrix_element(state_f, \"electric_dipole\", q=0)\n",
4848
"print(f\"Numerov dipole matrix element: {dipole}\")\n",
4949
"\n",
5050
"assert np.isclose(dipole.magnitude, (prefactor * radial * angular).magnitude), (\n",

src/ryd_numerov/angular/angular_ket.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def calc_reduced_matrix_element( # noqa: C901
387387
return self.to_state().calc_reduced_matrix_element(other.to_state(), operator, kappa)
388388

389389
qn_name: AngularMomentumQuantumNumbers
390-
if operator == "SPHERICAL":
390+
if operator == "spherical":
391391
qn_name = "l_r"
392392
complete_reduced_matrix_element = calc_reduced_spherical_matrix_element(self.l_r, other.l_r, kappa)
393393
elif operator in self.quantum_number_names:
@@ -434,9 +434,9 @@ def calc_matrix_element(self, other: AngularKetBase, operator: AngularOperatorTy
434434
Args:
435435
other: The other AngularKet :math:`|other>`.
436436
operator: The operator type :math:`\hat{O}_{kq}` for which to calculate the matrix element.
437-
Can be one of "MAGNETIC", "ELECTRIC", "SPHERICAL".
438-
kappa: The quantum number :math:`\kappa` of the angular momentum operator.
439-
q: The quantum number :math:`q` of the angular momentum operator.
437+
E.g. 'spherical', 's_tot', 'l_r', etc.
438+
kappa: The rank :math:`\kappa` of the angular momentum operator.
439+
q: The component :math:`q` of the angular momentum operator.
440440
441441
Returns:
442442
The dimensionless angular matrix element.

src/ryd_numerov/angular/angular_matrix_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def lru_cache(maxsize: int) -> Callable[[Callable[P, R]], Callable[P, R]]: ...
3535
"identity_f_tot",
3636
]
3737
AngularOperatorType = Literal[
38-
"SPHERICAL",
38+
"spherical",
3939
AngularMomentumQuantumNumbers,
4040
IdentityOperators,
4141
]

src/ryd_numerov/rydberg_state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def calc_reduced_matrix_element(
124124

125125
elif operator in ["electric_dipole", "electric_quadrupole", "electric_octupole", "electric_quadrupole_zero"]:
126126
# Electric multipole operator: p_{k,q} = e r^k_radial * sqrt(4pi / (2k+1)) * Y_{k_angular,q}(\theta, phi)
127-
angular_matrix_element = self.angular.calc_reduced_matrix_element(other.angular, "SPHERICAL", k_angular)
127+
angular_matrix_element = self.angular.calc_reduced_matrix_element(other.angular, "spherical", k_angular)
128128
matrix_element = (
129129
ureg.Quantity(1, "e")
130130
* math.sqrt(4 * np.pi / (2 * k_angular + 1))

tests/test_angular_matrix_elements.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ def test_reduced_identity(ket: AngularKetBase) -> None:
7979
@pytest.mark.parametrize(("ket1", "ket2"), TEST_KET_PAIRS)
8080
def test_matrix_elements_in_different_coupling_schemes(ket1: AngularKetBase, ket2: AngularKetBase) -> None:
8181
example_list: list[tuple[AngularOperatorType, int]] = [
82-
("SPHERICAL", 0),
83-
("SPHERICAL", 1),
84-
("SPHERICAL", 2),
85-
("SPHERICAL", 3),
82+
("spherical", 0),
83+
("spherical", 1),
84+
("spherical", 2),
85+
("spherical", 3),
8686
("s_tot", 1),
8787
("l_r", 1),
8888
("i_c", 1),

0 commit comments

Comments
 (0)