Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
40d420f
WIP: start adding mqdt state
johannes-moegerle Nov 26, 2025
ea3431e
add RydbergKetMQDT
johannes-moegerle Nov 27, 2025
ad99b06
add mqdt_julia_qn_to_angular_ket
johannes-moegerle Nov 27, 2025
c75b692
UNDOME: less warnings
johannes-moegerle Nov 28, 2025
a86d899
rename RadialState -> RadialKet
johannes-moegerle Nov 28, 2025
3f6799c
rename RydbergState -> RydbergStateSQDT
johannes-moegerle Dec 19, 2025
1a989ec
rename MQDTState -> RydbergStateMQDT
johannes-moegerle Nov 28, 2025
3213c54
fixup mqdt_julia_qn_to_angular_ket
johannes-moegerle Nov 28, 2025
2bef5c3
make RydbergStateSQDT a proper clss and simplify
johannes-moegerle Dec 19, 2025
8eceda6
fixup qn to angular ket
johannes-moegerle Dec 3, 2025
aa20a0d
AngularKet add calc_exp_qn
johannes-moegerle Dec 3, 2025
9f75dc7
start adding sqdt basis
johannes-moegerle Dec 3, 2025
20b9c0c
fixup RydbergStateSQDT
johannes-moegerle Dec 3, 2025
fadd752
split up basis base
johannes-moegerle Dec 3, 2025
40e0b3a
fixup rydberg sqdt
johannes-moegerle Dec 3, 2025
a013d0a
add julia_qn_to_dict instead of mqdt_julia_qn_to_angular_ket
johannes-moegerle Dec 3, 2025
c8328d2
imporve rydberg_mqdt (rename kets -> sqdt_states
johannes-moegerle Dec 3, 2025
8449ce6
start adding BasisMQDT
johannes-moegerle Dec 3, 2025
29574b6
fixup basis mqdt
johannes-moegerle Dec 3, 2025
a5ec659
UNDO ME: AngularState less warnings
johannes-moegerle Dec 3, 2025
2606156
bugfix rydberg mqdt
johannes-moegerle Dec 3, 2025
6b6b7ad
add rydberg base and adapt sqdt and mqdt accordingly
johannes-moegerle Dec 3, 2025
a74c08d
BasisBase start adding calc_reduced_...
johannes-moegerle Dec 3, 2025
43aa3e6
WIP UNDO ME
johannes-moegerle Dec 4, 2025
f27becc
add juliacall to pytoml
johannes-moegerle Dec 4, 2025
84d2369
update basis mqdt to dynamically get the parameter and model from julia
johannes-moegerle Dec 4, 2025
2e30d36
fix ruff and mypy
johannes-moegerle Dec 4, 2025
b170295
fix basis base pint array
johannes-moegerle Dec 4, 2025
b1fe46f
small fixes rydberg sqdt
johannes-moegerle Dec 4, 2025
b1b2528
WIP start fixing tests
johannes-moegerle Dec 4, 2025
a166633
fix cached properties
johannes-moegerle Dec 4, 2025
36a4a88
fix py39 TypeGuard
johannes-moegerle Dec 4, 2025
b31615d
add RydbergStateSQDTAlkalineFJ
johannes-moegerle Dec 5, 2025
8d5e2c2
fixup rydberg fj
johannes-moegerle Dec 5, 2025
7368b62
add BasisSQDTAlkalineJJ and BasisSQDTAlkalineFJ
johannes-moegerle Dec 5, 2025
8e571c9
WIP: Sr and Yb add quantum defects to all isotopes
johannes-moegerle Dec 5, 2025
762b647
[tests] fix test all elements
johannes-moegerle Dec 5, 2025
2b18e92
Basis update filter_states and add copy
johannes-moegerle Dec 8, 2025
1778ab3
start adding KS coupling scheme
johannes-moegerle Dec 8, 2025
36e6eb5
fix KS overlaps
johannes-moegerle Dec 9, 2025
2662198
basis add sort_states
johannes-moegerle Dec 9, 2025
6fa8d68
WIP fix KS
johannes-moegerle Dec 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ This package relies on quantum defects provided by the community. Consider citin
## Using custom quantum defects
To use custom quantum defects (or quantum defects for a new species), you can simply create a subclass of `rydstate.species.species_object.SpeciesObject` (e.g. `class CustomRubidium(SpeciesObject):`) with a custom species name (e.g. `name = "Custom_Rb"`).
Then, similarly to `rydstate.species.rubidium.py` you can define the quantum defects (and model potential parameters, ...) for your species.
Finally, you can use the custom species by simply calling `rydstate.RydbergStateAlkali("Custom_Rb", n=50, l=0, j=1/2, m=1/2)` (the code will look for all subclasses of `SpeciesObject` until it finds one with the species name "Custom_Rb").
Finally, you can use the custom species by simply calling `rydstate.RydbergStateSQDTAlkali("Custom_Rb", n=50, l=0, j=1/2, m=1/2)` (the code will look for all subclasses of `SpeciesObject` until it finds one with the species name "Custom_Rb").


## License
Expand Down
2 changes: 1 addition & 1 deletion docs/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Examples
RadialState
-----------

Some examples demonstrating the usage of the RadialState class, which uses the Numerov method for solving the radial Schrödinger equation.
Some examples demonstrating the usage of the RadialKet class, which uses the Numerov method for solving the radial Schrödinger equation.

.. nbgallery::
examples/radial/hydrogen_wavefunction
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/benchmark/benchmark_njit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"\n",
"import numpy as np\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali\n",
"from rydstate import RydbergStateSQDTAlkali\n",
"\n",
"test_cases: list[tuple[str, int, int, bool]] = [\n",
" # species, n, l, use_njit\n",
Expand All @@ -28,7 +28,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -41,21 +41,21 @@
" \"\"\"\n",
" # run the integration once to compile the numba function\n",
" species, n, l, use_njit = test_cases[0]\n",
" state = RydbergStateAlkali(species, n, l, j=l + 0.5)\n",
" state = RydbergStateSQDTAlkali(species, n, l, j=l + 0.5)\n",
" state.radial.create_wavefunction(_use_njit=True)\n",
"\n",
" results = []\n",
" for species, n, l, use_njit in test_cases:\n",
" # Setup the test function\n",
" stmt = (\n",
" \"state = RydbergStateAlkali(species, n, l, j=l+0.5)\\n\"\n",
" \"state = RydbergStateSQDTAlkali(species, n, l, j=l+0.5)\\n\"\n",
" \"state.radial.create_grid(dz=1e-3)\\n\"\n",
" \"state.radial.create_wavefunction(_use_njit=use_njit)\"\n",
" )\n",
"\n",
" # Time the integration multiple times and take average/std\n",
" globals_dict = {\n",
" \"RydbergStateAlkali\": RydbergStateAlkali,\n",
" \"RydbergStateSQDTAlkali\": RydbergStateSQDTAlkali,\n",
" \"species\": species,\n",
" \"n\": n,\n",
" \"l\": l,\n",
Expand Down
9 changes: 4 additions & 5 deletions docs/examples/comparisons/compare_dipole_matrix_element.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,8 +18,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali\n",
"from rydstate.units import ureg"
"from rydstate import RydbergStateSQDTAlkali, ureg"
]
},
{
Expand Down Expand Up @@ -92,8 +91,8 @@
"for qn1, qn2 in zip(qn1_list, qn2_list):\n",
" print(f\"n={qn1[0]}\", end=\"\\r\")\n",
" q = round(qn2[-1] - qn1[-1])\n",
" state_i = RydbergStateAlkali(\"Rb\", n=qn1[0], l=qn1[1], j=qn1[2], m=qn1[3])\n",
" state_f = RydbergStateAlkali(\"Rb\", n=qn2[0], l=qn2[1], j=qn2[2], m=qn2[3])\n",
" state_i = RydbergStateSQDTAlkali(\"Rb\", n=qn1[0], l=qn1[1], j=qn1[2], m=qn1[3])\n",
" state_f = RydbergStateSQDTAlkali(\"Rb\", n=qn2[0], l=qn2[1], j=qn2[2], m=qn2[3])\n",
" dipole_me = state_i.calc_matrix_element(state_f, \"electric_dipole\", q, unit=\"a.u.\")\n",
" matrixelements.append(dipole_me)\n",
"\n",
Expand Down
20 changes: 10 additions & 10 deletions docs/examples/comparisons/compare_model_potentials.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali, RydbergStateAlkalineLS"
"from rydstate import RydbergStateSQDTAlkali, RydbergStateSQDTAlkalineLS"
]
},
{
Expand All @@ -41,15 +41,15 @@
}
],
"source": [
"state = RydbergStateAlkali(\"Rb\", n=40, l=0, j=0.5)\n",
"state = RydbergStateSQDTAlkali(\"Rb\", n=40, l=0, j=0.5)\n",
"\n",
"states: dict[str, RydbergStateAlkali] = {}\n",
"states: dict[str, RydbergStateSQDTAlkali] = {}\n",
"\n",
"\n",
"states[\"model_potential_marinescu_1993\"] = RydbergStateAlkali(state.species, n=state.n, l=state.l, j=state.j)\n",
"states[\"model_potential_marinescu_1993\"] = RydbergStateSQDTAlkali(state.species, n=state.n, l=state.l, j=state.j)\n",
"states[\"model_potential_marinescu_1993\"].radial.create_model(potential_type=\"model_potential_marinescu_1993\")\n",
"\n",
"states[\"model_potential_fei_2009\"] = RydbergStateAlkali(state.species, n=state.n, l=state.l, j=state.j)\n",
"states[\"model_potential_fei_2009\"] = RydbergStateSQDTAlkali(state.species, n=state.n, l=state.l, j=state.j)\n",
"states[\"model_potential_fei_2009\"].radial.create_model(potential_type=\"model_potential_fei_2009\")\n",
"\n",
"for label, state in states.items():\n",
Expand Down Expand Up @@ -122,17 +122,17 @@
}
],
"source": [
"state = RydbergStateAlkalineLS(\"Sr88\", n=8, l=0, j_tot=0, s_tot=0)\n",
"state = RydbergStateSQDTAlkalineLS(\"Sr88\", n=8, l=0, j_tot=0, s_tot=0)\n",
"\n",
"states: dict[str, RydbergStateAlkalineLS] = {}\n",
"states: dict[str, RydbergStateSQDTAlkalineLS] = {}\n",
"\n",
"\n",
"states[\"model_potential_marinescu_1993\"] = RydbergStateAlkalineLS(\n",
"states[\"model_potential_marinescu_1993\"] = RydbergStateSQDTAlkalineLS(\n",
" state.species, n=state.n, l=state.l, j_tot=state.j_tot, s_tot=state.s_tot\n",
")\n",
"states[\"model_potential_marinescu_1993\"].radial.create_model(potential_type=\"model_potential_marinescu_1993\")\n",
"\n",
"states[\"model_potential_fei_2009\"] = RydbergStateAlkalineLS(\n",
"states[\"model_potential_fei_2009\"] = RydbergStateSQDTAlkalineLS(\n",
" state.species, n=state.n, l=state.l, j_tot=state.j_tot, s_tot=state.s_tot\n",
")\n",
"states[\"model_potential_fei_2009\"].radial.create_model(potential_type=\"model_potential_fei_2009\")\n",
Expand Down
9 changes: 4 additions & 5 deletions docs/examples/comparisons/compare_radial_matrix_element.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,8 +18,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali\n",
"from rydstate.units import ureg"
"from rydstate import RydbergStateSQDTAlkali, ureg"
]
},
{
Expand Down Expand Up @@ -64,8 +63,8 @@
" results[key] = []\n",
" for qn1, qn2 in zip(qn1_list, qn2_list):\n",
" print(f\"n={qn1[0]}\", end=\"\\r\")\n",
" state_i = RydbergStateAlkali(species, qn1[0], qn1[1], j=qn1[2])\n",
" state_f = RydbergStateAlkali(species, qn2[0], qn2[1], j=qn2[2])\n",
" state_i = RydbergStateSQDTAlkali(species, qn1[0], qn1[1], j=qn1[2])\n",
" state_f = RydbergStateSQDTAlkali(species, qn2[0], qn2[1], j=qn2[2])\n",
" radial_me = state_i.radial.calc_matrix_element(state_f.radial, 1, unit=\"a.u.\")\n",
" results[key].append(radial_me)\n",
"\n",
Expand Down
10 changes: 5 additions & 5 deletions docs/examples/comparisons/compare_wavefunctions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali"
"from rydstate import RydbergStateSQDTAlkali"
]
},
{
Expand Down Expand Up @@ -44,7 +44,7 @@
"source": [
"results[\"rydstate\"] = []\n",
"for qn in qns:\n",
" state = RydbergStateAlkali(\"Rb\", n=qn[0], l=qn[1], j=qn[2])\n",
" state = RydbergStateSQDTAlkali(\"Rb\", n=qn[0], l=qn[1], j=qn[2])\n",
" state.radial.create_grid()\n",
" state.radial.create_wavefunction()\n",
" results[\"rydstate\"].append(\n",
Expand Down Expand Up @@ -125,7 +125,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand All @@ -142,8 +142,8 @@
"# the small difference of the wavefunctions explains the difference in the radial matrix element of circular states\n",
"# (see also the compare_radial_matrix_element and compare_dipole_matrix_element notebooks)\n",
"\n",
"from rydstate import ureg\n",
"from rydstate.radial.radial_matrix_element import calc_radial_matrix_element_from_w_z\n",
"from rydstate.units import ureg\n",
"\n",
"to_mum = ureg.Quantity(1, \"bohr_radius\").to(\"micrometer\").magnitude\n",
"\n",
Expand Down
22 changes: 11 additions & 11 deletions docs/examples/comparisons/compare_whittaker.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from rydstate import RydbergStateAlkali\n",
"from rydstate import RydbergStateSQDTAlkali\n",
"\n",
"logging.basicConfig(level=logging.INFO, format=\"%(levelname)s %(filename)s: %(message)s\")"
]
Expand All @@ -41,7 +41,7 @@
"metadata": {},
"outputs": [],
"source": [
"states: dict[str, RydbergStateAlkali] = {}"
"states: dict[str, RydbergStateSQDTAlkali] = {}"
]
},
{
Expand All @@ -62,15 +62,15 @@
}
],
"source": [
"state = RydbergStateAlkali(\"Rb\", n=21, l=0, j=0.5)\n",
"state = RydbergStateSQDTAlkali(\"Rb\", n=21, l=0, j=0.5)\n",
"\n",
"state.radial.create_model(potential_type=\"model_potential_marinescu_1993\")\n",
"state.radial.create_wavefunction(\"numerov\")\n",
"states[\"Numerov with Model Potentials\"] = state\n",
"\n",
"# Using Numerov without model potentials will lead to some warnings,\n",
"# since the resulting wavefunction does not pass all heuristic checks\n",
"state_without_mp = RydbergStateAlkali(state.species, state.n, state.l, state.j)\n",
"state_without_mp = RydbergStateSQDTAlkali(state.species, state.n, state.l, state.j)\n",
"state_without_mp.radial.create_model(potential_type=\"coulomb\")\n",
"state_without_mp.radial.create_wavefunction(\"numerov\")\n",
"states[\"Numerov without Model Potentials\"] = state_without_mp"
Expand All @@ -91,7 +91,7 @@
}
],
"source": [
"state_whittaker = RydbergStateAlkali(state.species, state.n, state.l, state.j)\n",
"state_whittaker = RydbergStateSQDTAlkali(state.species, state.n, state.l, state.j)\n",
"state_whittaker.radial.create_grid(x_min=state.radial.grid.x_min, x_max=state.radial.grid.x_max)\n",
"state_whittaker.radial.create_wavefunction(\"whittaker\")\n",
"states[\"Whittaker\"] = state_whittaker"
Expand Down Expand Up @@ -188,15 +188,15 @@
}
],
"source": [
"state1 = RydbergStateAlkali(\"Rb\", n=10, l=0, j=0.5)\n",
"state2 = RydbergStateAlkali(\"Rb\", n=9, l=1, j=1.5)\n",
"state1 = RydbergStateSQDTAlkali(\"Rb\", n=10, l=0, j=0.5)\n",
"state2 = RydbergStateSQDTAlkali(\"Rb\", n=9, l=1, j=1.5)\n",
"\n",
"dipole_me = state1.radial.calc_matrix_element(state2.radial, 1)\n",
"print(f\"Numerov with model potentials: {dipole_me}\", flush=True)\n",
"\n",
"_state1 = RydbergStateAlkali(state1.species, state1.n, state1.l, state1.j)\n",
"_state1 = RydbergStateSQDTAlkali(state1.species, state1.n, state1.l, state1.j)\n",
"_state1.radial.create_model(potential_type=\"coulomb\")\n",
"_state2 = RydbergStateAlkali(state2.species, state2.n, state2.l, state2.j)\n",
"_state2 = RydbergStateSQDTAlkali(state2.species, state2.n, state2.l, state2.j)\n",
"_state2.radial.create_model(potential_type=\"coulomb\")\n",
"\n",
"dipole_me = _state1.radial.calc_matrix_element(_state2.radial, 1)\n",
Expand All @@ -206,10 +206,10 @@
"# to avoid integrating over the diverging peak at the origin (see plots above)\n",
"xmin1, xmax1 = _state1.radial.grid.x_min, _state1.radial.grid.x_max\n",
"xmin2, xmax2 = _state2.radial.grid.x_min, _state2.radial.grid.x_max\n",
"_state1 = RydbergStateAlkali(state1.species, state1.n, state1.l, state1.j)\n",
"_state1 = RydbergStateSQDTAlkali(state1.species, state1.n, state1.l, state1.j)\n",
"_state1.radial.create_grid(x_min=xmin1, x_max=xmax1)\n",
"_state1.radial.create_wavefunction(\"whittaker\")\n",
"_state2 = RydbergStateAlkali(state2.species, state2.n, state2.l, state2.j)\n",
"_state2 = RydbergStateSQDTAlkali(state2.species, state2.n, state2.l, state2.j)\n",
"_state2.radial.create_grid(x_min=xmin2, x_max=xmax2)\n",
"_state2.radial.create_wavefunction(\"whittaker\")\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/comparisons/compare_z_min_cutoff.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali"
"from rydstate import RydbergStateSQDTAlkali"
]
},
{
Expand Down Expand Up @@ -57,7 +57,7 @@
"z_i_dict = {\"hydrogen\": [], \"classical\": [], \"rydstate cutoff\": []}\n",
"for qn in qn_list:\n",
" print(f\"n={qn[0]}\", end=\"\\r\")\n",
" state = RydbergStateAlkali(\"Rb\", n=qn[0], l=qn[1], j=qn[2])\n",
" state = RydbergStateSQDTAlkali(\"Rb\", n=qn[0], l=qn[1], j=qn[2])\n",
"\n",
" hydrogen_z_i = state.radial.model.calc_hydrogen_turning_point_z(state.n, state.l)\n",
" z_i_dict[\"hydrogen\"].append(hydrogen_z_i)\n",
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/dipole_matrix_elements.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"from rydstate.rydberg_state import RydbergStateAlkali"
"from rydstate import RydbergStateSQDTAlkali"
]
},
{
Expand All @@ -34,8 +34,8 @@
}
],
"source": [
"state_i = RydbergStateAlkali(\"Rb\", 60, 2, j=3 / 2, m=1 / 2)\n",
"state_f = RydbergStateAlkali(\"Rb\", 60, 3, j=5 / 2, m=1 / 2)\n",
"state_i = RydbergStateSQDTAlkali(\"Rb\", 60, 2, j=3 / 2, m=1 / 2)\n",
"state_f = RydbergStateSQDTAlkali(\"Rb\", 60, 3, j=5 / 2, m=1 / 2)\n",
"\n",
"kappa = 1\n",
"radial = state_i.radial.calc_matrix_element(state_f.radial, k_radial=1)\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/radial/hydrogen_wavefunction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -18,7 +18,7 @@
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"from rydstate.radial import RadialState"
"from rydstate.radial import RadialKet"
]
},
{
Expand All @@ -27,7 +27,7 @@
"metadata": {},
"outputs": [],
"source": [
"state = RadialState(\"H_textbook\", nu=10, l_r=5)\n",
"state = RadialKet(\"H_textbook\", nu=10, l_r=5)\n",
"state.set_n_for_sanity_check(10)\n",
"state.create_model()\n",
"state.create_grid(dz=1e-2)\n",
Expand Down
Loading
Loading