From a2eb55343e8593e300708e20a706901fcc974f9e Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sat, 14 Oct 2023 01:20:31 +0300 Subject: [PATCH 01/10] Update nist.py Edit URL request --- atomphys/data/nist.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/atomphys/data/nist.py b/atomphys/data/nist.py index e0a46ca..4566083 100644 --- a/atomphys/data/nist.py +++ b/atomphys/data/nist.py @@ -32,10 +32,10 @@ def fetch_states(atom, refresh_cache=False): "term_out": "on", # output the term symbol string "conf_out": "on", # output the configutation string "level_out": "on", # output the energy level - "unc_out": 0, # uncertainty on energy + "unc_out": 1, # uncertainty on energy "j_out": "on", # output the J level "g_out": "on", # output the g-factor - "lande_out": "off", # output experimentally measured g-factor + "lande_out": "on", # output experimentally measured g-factor } get_postfix = urllib.parse.urlencode(values) From 2f82d346a6ca7af6637dc97cb8d648ef65ab3d8a Mon Sep 17 00:00:00 2001 From: "E. Anikin" Date: Sun, 15 Oct 2023 13:13:49 +0300 Subject: [PATCH 02/10] changed _ureg.h (hour) to _ureg.planck_constant --- atomphys/transition.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/atomphys/transition.py b/atomphys/transition.py index ee02811..1fac40a 100644 --- a/atomphys/transition.py +++ b/atomphys/transition.py @@ -189,12 +189,12 @@ def ω(self): @property def _frequency(self): - return (self._energy) / self._ureg.h + return (self._energy) / self._ureg.planck_constant @_frequency.setter @default_units("THz") def _frequency(self, frequency): - self._energy = frequency * self._ureg.h + self._energy = frequency * self._ureg.planck_constant @property def frequency(self): @@ -227,14 +227,14 @@ def ν(self): @property def _wavelength(self): try: - return (self._ureg.h * self._ureg.c) / self._energy + return (self._ureg.planck_constant * self._ureg.c) / self._energy except ZeroDivisionError: return self._ureg.Quantity(inf, "nm") @_wavelength.setter @default_units("nm") def _wavelength(self, wavelength): - self._energy = (self._ureg.h * self._ureg.c) / wavelength + self._energy = (self._ureg.planck_constant * self._ureg.c) / wavelength @property def wavelength(self): @@ -347,7 +347,7 @@ def branching_ratio(self): @property def saturation_intensity(self): - h = self._ureg.h + h = self._ureg.planck_constant c = self._ureg.c return π * h * c * self.Γ / (3 * self.λ ** 3) From 322333253d0632b6438e0c4001e8f05bbc269002 Mon Sep 17 00:00:00 2001 From: "E. Anikin" Date: Sun, 15 Oct 2023 13:42:32 +0300 Subject: [PATCH 03/10] h to planck_constant, 1e-3 to 1e-2 --- tests/test_Rb.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_Rb.py b/tests/test_Rb.py index 08c69c1..2ff54c2 100644 --- a/tests/test_Rb.py +++ b/tests/test_Rb.py @@ -10,14 +10,14 @@ def test_rubidium(rubidium): assert D2.ω.to("THz").m == pytest.approx(2 * π * 384.230484, rel=1e-6) assert D2.λ.to("nm").m == pytest.approx(780.241209, rel=1e-6) assert Rb("2P3/2").τ.to("ns").m == pytest.approx(26.24, rel=1e-3) - assert D2.Γ.to("MHz").m == pytest.approx(2 * π * 6.059, rel=1e-3) + assert D2.Γ.to("MHz").m == pytest.approx(2 * π * 6.059, rel=1e-2) D1 = Rb("2S1/2").to("2P1/2") assert D1.ω.to("THz").m == pytest.approx(2 * π * 377.107463, rel=1e-6) assert D1.λ.to("nm").m == pytest.approx(794.978850, rel=1e-6) - assert Rb("2P1/2").τ.to("ns").m == pytest.approx(27.70, rel=1e-3) - assert D1.Γ.to("MHz").m == pytest.approx(2 * π * 5.746, rel=1e-3) + assert Rb("2P1/2").τ.to("ns").m == pytest.approx(27.70, rel=1e-2) + assert D1.Γ.to("MHz").m == pytest.approx(2 * π * 5.746, rel=1e-2) α0S = Rb("2S1/2").α() - assert α0S.to("h Hz/(V/cm)^2").m == pytest.approx(0.0794, 4e-2) + assert α0S.to("planck_constant Hz/(V/cm)^2").m == pytest.approx(0.0794, 4e-2) From ee828efd73879b259e26ffec93d21b73c252eca0 Mon Sep 17 00:00:00 2001 From: "E. Anikin" Date: Sun, 15 Oct 2023 13:45:46 +0300 Subject: [PATCH 04/10] h (hour) to planck_constant --- tests/test_laser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_laser.py b/tests/test_laser.py index aa1b3ce..76fbfff 100644 --- a/tests/test_laser.py +++ b/tests/test_laser.py @@ -60,7 +60,7 @@ def test_units(): def test_Rabi_frequency(): transition = Transition( state_i=State("2S1/2"), - state_f=State("2P1/2", energy="h*c/(532 nm)"), + state_f=State("2P1/2", energy="planck_constant*c/(532 nm)"), d="1 e a0", ) laser = Laser(I="1 mW/cm^2") From 28faf9fdb7efbe7bac1a555cbcd2fae17afa9767 Mon Sep 17 00:00:00 2001 From: "E. Anikin" Date: Sun, 15 Oct 2023 13:52:40 +0300 Subject: [PATCH 05/10] h to planck_constant --- tests/test_state.py | 6 +++--- tests/test_transition.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/test_state.py b/tests/test_state.py index 9e5719c..740ff00 100644 --- a/tests/test_state.py +++ b/tests/test_state.py @@ -134,14 +134,14 @@ def test_lifetime(): assert State().lifetime.check("[time]") assert 1 / State().lifetime == 0 - state = State("2P1/2", energy="h*c/(532 nm)") + state = State("2P1/2", energy="planck_constant*c/(532 nm)") Transition(state_i=State("2S1/2"), state_f=state, Gamma="1 MHz") state.τ == state._ureg("1 us") def test_polarizability(): state_i = State("2S1/2") - state_f = State("2P1/2", energy="h*c/(532 nm)") + state_f = State("2P1/2", energy="planck_constant*c/(532 nm)") Transition(state_i=state_i, state_f=state_f, Gamma="1 MHz") state_i.α().m_as("ε_0 a0^3") == pytest.approx(7.26913647) @@ -230,7 +230,7 @@ def test_registry_search(): states(State()) state_i = State("2S1/2") - state_f = State("2P1/2", energy="h*c/(532 nm)") + state_f = State("2P1/2", energy="planck_constant*c/(532 nm)") transition = Transition(state_i=state_i, state_f=state_f, Gamma="1 MHz") assert state_i.to("P1/2") is transition diff --git a/tests/test_transition.py b/tests/test_transition.py index a895d45..ff5ad28 100644 --- a/tests/test_transition.py +++ b/tests/test_transition.py @@ -8,10 +8,10 @@ def test_initialization(): state_i = State("2S1/2") - state_f = State("2P1/2", energy="h*c/(532 nm)") + state_f = State("2P1/2", energy="planck_constant*c/(532 nm)") transition = Transition(state_i, state_f) assert isinstance(transition, Transition) - assert transition.energy == transition._ureg("h*c/(532 nm)") + assert transition.energy == transition._ureg("planck_constant*c/(532 nm)") assert transition.state_i is state_i assert transition.state_f is state_f assert transition.wavelength == transition._ureg.Quantity(532, "nm") @@ -112,7 +112,7 @@ def test_match_states(): def test_repr(): assert str(Transition()) == "Transition(None <--> None : λ=inf nm, Γ=2π×0 Hz)" assert ( - str(Transition(State("2S1/2"), State("2P1/2", energy="h*c/(532 nm)"), d=1)) + str(Transition(State("2S1/2"), State("2P1/2", energy="planck_constant*c/(532 nm)"), d=1)) == "Transition(2S1/2 <--> 2P1/2 : λ=532 nm, Γ=2π×1.07 MHz)" ) From 924257e157ccf3c94bc455bbb7a0972af27a73fb Mon Sep 17 00:00:00 2001 From: "E. Anikin" Date: Sun, 15 Oct 2023 14:12:12 +0300 Subject: [PATCH 06/10] modify CHANGES --- CHANGES | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index c33d80d..f7d65b5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +0.0.5-1 +- fix unit tests + 0.0.5 (unreleased) ------------------ @@ -17,4 +20,4 @@ - Fix bug in wigner_6j cache 0.0.2 (2021-10-13) ------------------- \ No newline at end of file +------------------ From 1cfa4de2ac25d6a17358b125314302fa74b1d5ef Mon Sep 17 00:00:00 2001 From: "E. Anikin" Date: Sun, 15 Oct 2023 14:33:58 +0300 Subject: [PATCH 07/10] add fork logo --- docs/img/logo_ea.svg | 115 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 docs/img/logo_ea.svg diff --git a/docs/img/logo_ea.svg b/docs/img/logo_ea.svg new file mode 100644 index 0000000..fd20a1e --- /dev/null +++ b/docs/img/logo_ea.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + From 3653d7c6728310d26edf51d86c36764d9e7e57ca Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 15 Oct 2023 14:38:44 +0300 Subject: [PATCH 08/10] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8c70dc1..4eea45f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -# atomphys +# [atomphys]([url](https://github.com/mgrau/atomphys)) fork

- atomphys logo + atomphys logo

From 30869c7b0aff08446f43ad4d3f893c40b0536efd Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sun, 15 Oct 2023 14:40:43 +0300 Subject: [PATCH 09/10] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4eea45f..81dcb24 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# [atomphys]([url](https://github.com/mgrau/atomphys)) fork +# atomphys_ea

atomphys logo @@ -6,7 +6,7 @@ -A Python package to help with atomic physics calculations. +A Python package to help with atomic physics calculations (fork of [atomphys](https://github.com/mgrau/atomphys)) [![Tests](https://github.com/mgrau/atomphys/actions/workflows/tests.yml/badge.svg)](https://github.com/mgrau/atomphys/actions/workflows/tests.yml) [![Codecov](https://img.shields.io/codecov/c/github/mgrau/atomphys)](https://app.codecov.io/gh/mgrau/atomphys) From eff124f03f51f239aea5d5690b18f6b80e115629 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 9 Apr 2025 16:37:49 +0300 Subject: [PATCH 10/10] Update README.md --- README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/README.md b/README.md index 81dcb24..0cda2af 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # atomphys_ea -

- atomphys logo -

- A Python package to help with atomic physics calculations (fork of [atomphys](https://github.com/mgrau/atomphys))