yalip 0.9.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
yalip-0.9.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2025 Reinhard Caspary <r.caspary@posteo.de>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
yalip-0.9.0/PKG-INFO ADDED
@@ -0,0 +1,162 @@
1
+ Metadata-Version: 2.4
2
+ Name: yalip
3
+ Version: 0.9.0
4
+ Summary: Python 3 package to calculate the energy levels of lanthanide ions.
5
+ Author-email: Reinhard Caspary <reinhard.caspary@phoenixd.uni-hannover.de>
6
+ Classifier: Development Status :: 3 - Alpha
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: MIT License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.8
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: numpy>=2.4.0
14
+ Requires-Dist: scipy>=1.17.0
15
+ Requires-Dist: h5py>=3.16.0
16
+ Requires-Dist: requests>=2.34.0
17
+ Requires-Dist: platformdirs>=4.9.0
18
+ Dynamic: license-file
19
+
20
+ # YALIP 0.9.0 (Yet Another Lanthanide Ion Package)
21
+
22
+ This is a Python 3 package to calculate the energy levels of multi-electron
23
+ systems populating the 4f configuration, which means the lanthanide or
24
+ rare-earth ions from Ce<sup>3+</sup> (4f<sup>1</sup>) to Yb<sup>3+</sup>
25
+ (4f<sup>13</sup>).
26
+ The calculation is based on Racah's tensor algebra using an approach
27
+ introduced in my PhD thesis [[1]](#ref1) and advanced in [[2]](#ref2).
28
+ You find a copy of the [thesis](private/Dissertation.pdf) and
29
+ [corrections](private/errata5.pdf) in the folder `docs`.
30
+ The original version of the software is available in the GitHub repository
31
+ [Lanthanide-0.3](https://github.com/reincas/Lanthanide-0.3) and the last
32
+ implementation of the original approach in the repository
33
+ [Lanthanide](https://github.com/reincas/Lanthanide).
34
+ However, instead of computing its numerical operator matrices, the YALIP package
35
+ is using the matrix elements from the Zenodo repository
36
+ [AMELI](https://zenodo.org/communities/ameli) calculated and stored in exact
37
+ arithmetic according to [[2]](#ref2).
38
+
39
+ ## Installation
40
+
41
+ The package is available on PyPI and the installation therefore is possible using `pip`
42
+
43
+ ```
44
+ pip install yalip
45
+ ```
46
+
47
+ ## Usage
48
+
49
+ The YALIP package is designed for three use cases on different abstraction levels.
50
+
51
+ ### 1. Class `States`
52
+
53
+ Access to raw numerical representations of states and
54
+ [operator matrices](docs/operators.md) from the AMELI repository is provided by
55
+ the [class `States`](docs/states.md).
56
+ The following code initialises all basis states of the Pr<sup>3+</sup> ion in $SLJ$
57
+ coupling:
58
+
59
+ ```
60
+ from yalip import States, Coupling
61
+
62
+ config = "f2"
63
+ coupling = Coupling.SLJ
64
+
65
+ states = States(config, coupling)
66
+ ```
67
+
68
+ ### 2. Class `Levels`
69
+
70
+ Calculation of states in intermediate coupling, their energy levels and radiative
71
+ transitions based on given radial integrals and Judd-Ofelt parameters is provided
72
+ by the [class `Levels`](docs/levels.md).
73
+ Typical initialisation code for a Pr<sup>3+</sup> ion looks like:
74
+
75
+ ```
76
+ from yalip import Cauchy, Coupling, Levels
77
+
78
+ config = "f2"
79
+ coupling = Coupling.SLJ
80
+ radial = {"base": 327.39, "H1/2": 68576.05, "H1/4": 49972.76, "H1/6": 32415.29, "H2": 728.18,
81
+ "H3/0": 16.99, "H3/1": -417.98, "H3/2": 1371, "H5fix": 0.19, "H6fix": 1.67}
82
+ jo = {"JO/2": 1.981, "JO/4": 4.645, "JO/6": 6.972}
83
+ material = Cauchy(1.35123e-5, 2.94780e-3, 1.49985, -1.30933e-3, -3.23335e-6)
84
+
85
+ ion = Levels(config, coupling, radial, jo, material)
86
+ ```
87
+
88
+ ### 3. Class `Fits`
89
+
90
+ The [class `Fits`](docs/fits.md) is used to perform energy level and Judd-Ofelt
91
+ fits to determine optimised radial integrals and Judd-Ofelt parameters matching
92
+ a measured absorption spectrum.
93
+ Typical initialisation code for a Pr<sup>3+</sup> ion looks like:
94
+
95
+ ```
96
+ from yalip import Cauchy, Coupling, Fits
97
+
98
+ config = "f2"
99
+ coupling = Coupling.SLJ
100
+ radial = {"base": 327.39, "H1/2": 68576.05, "H1/4": 49972.76, "H1/6": 32415.29, "H2": 728.18,
101
+ "H3/0": 16.99, "H3/1": -417.98, "H3/2": 1371, "H5fix": 0.19, "H6fix": 1.67}
102
+ material = Cauchy(1.35123e-5, 2.94780e-3, 1.49985, -1.30933e-3, -3.23335e-6)
103
+
104
+ opt = Fits(config, coupling, radial, material)
105
+ ```
106
+
107
+ ### Example Scripts
108
+
109
+ Some application example scripts are available in the folder [run](run).
110
+
111
+ ## Logging
112
+
113
+ The YALIP package uses the logger package for status messages.
114
+ The following code example provides a basic setup to make these messages visible
115
+ on the console:
116
+
117
+ ```
118
+ import logging
119
+ from yalip import Coupling, States
120
+
121
+ logger = logging.getLogger("my_script")
122
+
123
+ def init_logger(level=logging.INFO):
124
+ root = logging.getLogger()
125
+ root.setLevel(level)
126
+ log_format = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
127
+
128
+ console_h = logging.StreamHandler()
129
+ console_h.setFormatter(log_format)
130
+ console_h.setLevel(level)
131
+ root.addHandler(console_h)
132
+
133
+ if __name__ == "__main__":
134
+ init_logger(level=logging.DEBUG)
135
+
136
+ config = "f2"
137
+ coupling = Coupling.SLJ
138
+
139
+ states = States(config, coupling)
140
+ ```
141
+
142
+ ## Caching
143
+
144
+ The YALIP package uses `platformdirs.user_cache_dir()` to create a cache folder
145
+ for files from the AMELI repository and another one for converted floating point
146
+ matrices.
147
+ YALIP regularly checks the repository for new versions, but at most twice a day.
148
+
149
+ The decorator `functools.lru_cache` is used to keep numerical matrices in the
150
+ memory.
151
+
152
+ ## License
153
+
154
+ This is free software under the MIT License.
155
+
156
+ ## References
157
+
158
+ <span id="ref1">[1]</span> Reinhard Caspary: "Applied Rare-Earth Spectroscopy for Fiber Laser Optimization", doctoral dissertation at
159
+ Technische Universität Braunschweig, published with Shaker, Aachen, 2002
160
+
161
+ <span id="ref2">[2]</span> Reinhard Caspary: "AMELI: Angular Matrix Elements of Lanthanide Ions", arXiv, 2026,
162
+ https://doi.org/10.48550/arXiv.2603.21947
yalip-0.9.0/README.md ADDED
@@ -0,0 +1,143 @@
1
+ # YALIP 0.9.0 (Yet Another Lanthanide Ion Package)
2
+
3
+ This is a Python 3 package to calculate the energy levels of multi-electron
4
+ systems populating the 4f configuration, which means the lanthanide or
5
+ rare-earth ions from Ce<sup>3+</sup> (4f<sup>1</sup>) to Yb<sup>3+</sup>
6
+ (4f<sup>13</sup>).
7
+ The calculation is based on Racah's tensor algebra using an approach
8
+ introduced in my PhD thesis [[1]](#ref1) and advanced in [[2]](#ref2).
9
+ You find a copy of the [thesis](private/Dissertation.pdf) and
10
+ [corrections](private/errata5.pdf) in the folder `docs`.
11
+ The original version of the software is available in the GitHub repository
12
+ [Lanthanide-0.3](https://github.com/reincas/Lanthanide-0.3) and the last
13
+ implementation of the original approach in the repository
14
+ [Lanthanide](https://github.com/reincas/Lanthanide).
15
+ However, instead of computing its numerical operator matrices, the YALIP package
16
+ is using the matrix elements from the Zenodo repository
17
+ [AMELI](https://zenodo.org/communities/ameli) calculated and stored in exact
18
+ arithmetic according to [[2]](#ref2).
19
+
20
+ ## Installation
21
+
22
+ The package is available on PyPI and the installation therefore is possible using `pip`
23
+
24
+ ```
25
+ pip install yalip
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ The YALIP package is designed for three use cases on different abstraction levels.
31
+
32
+ ### 1. Class `States`
33
+
34
+ Access to raw numerical representations of states and
35
+ [operator matrices](docs/operators.md) from the AMELI repository is provided by
36
+ the [class `States`](docs/states.md).
37
+ The following code initialises all basis states of the Pr<sup>3+</sup> ion in $SLJ$
38
+ coupling:
39
+
40
+ ```
41
+ from yalip import States, Coupling
42
+
43
+ config = "f2"
44
+ coupling = Coupling.SLJ
45
+
46
+ states = States(config, coupling)
47
+ ```
48
+
49
+ ### 2. Class `Levels`
50
+
51
+ Calculation of states in intermediate coupling, their energy levels and radiative
52
+ transitions based on given radial integrals and Judd-Ofelt parameters is provided
53
+ by the [class `Levels`](docs/levels.md).
54
+ Typical initialisation code for a Pr<sup>3+</sup> ion looks like:
55
+
56
+ ```
57
+ from yalip import Cauchy, Coupling, Levels
58
+
59
+ config = "f2"
60
+ coupling = Coupling.SLJ
61
+ radial = {"base": 327.39, "H1/2": 68576.05, "H1/4": 49972.76, "H1/6": 32415.29, "H2": 728.18,
62
+ "H3/0": 16.99, "H3/1": -417.98, "H3/2": 1371, "H5fix": 0.19, "H6fix": 1.67}
63
+ jo = {"JO/2": 1.981, "JO/4": 4.645, "JO/6": 6.972}
64
+ material = Cauchy(1.35123e-5, 2.94780e-3, 1.49985, -1.30933e-3, -3.23335e-6)
65
+
66
+ ion = Levels(config, coupling, radial, jo, material)
67
+ ```
68
+
69
+ ### 3. Class `Fits`
70
+
71
+ The [class `Fits`](docs/fits.md) is used to perform energy level and Judd-Ofelt
72
+ fits to determine optimised radial integrals and Judd-Ofelt parameters matching
73
+ a measured absorption spectrum.
74
+ Typical initialisation code for a Pr<sup>3+</sup> ion looks like:
75
+
76
+ ```
77
+ from yalip import Cauchy, Coupling, Fits
78
+
79
+ config = "f2"
80
+ coupling = Coupling.SLJ
81
+ radial = {"base": 327.39, "H1/2": 68576.05, "H1/4": 49972.76, "H1/6": 32415.29, "H2": 728.18,
82
+ "H3/0": 16.99, "H3/1": -417.98, "H3/2": 1371, "H5fix": 0.19, "H6fix": 1.67}
83
+ material = Cauchy(1.35123e-5, 2.94780e-3, 1.49985, -1.30933e-3, -3.23335e-6)
84
+
85
+ opt = Fits(config, coupling, radial, material)
86
+ ```
87
+
88
+ ### Example Scripts
89
+
90
+ Some application example scripts are available in the folder [run](run).
91
+
92
+ ## Logging
93
+
94
+ The YALIP package uses the logger package for status messages.
95
+ The following code example provides a basic setup to make these messages visible
96
+ on the console:
97
+
98
+ ```
99
+ import logging
100
+ from yalip import Coupling, States
101
+
102
+ logger = logging.getLogger("my_script")
103
+
104
+ def init_logger(level=logging.INFO):
105
+ root = logging.getLogger()
106
+ root.setLevel(level)
107
+ log_format = logging.Formatter("%(asctime)s - %(name)s - %(levelname)s - %(message)s")
108
+
109
+ console_h = logging.StreamHandler()
110
+ console_h.setFormatter(log_format)
111
+ console_h.setLevel(level)
112
+ root.addHandler(console_h)
113
+
114
+ if __name__ == "__main__":
115
+ init_logger(level=logging.DEBUG)
116
+
117
+ config = "f2"
118
+ coupling = Coupling.SLJ
119
+
120
+ states = States(config, coupling)
121
+ ```
122
+
123
+ ## Caching
124
+
125
+ The YALIP package uses `platformdirs.user_cache_dir()` to create a cache folder
126
+ for files from the AMELI repository and another one for converted floating point
127
+ matrices.
128
+ YALIP regularly checks the repository for new versions, but at most twice a day.
129
+
130
+ The decorator `functools.lru_cache` is used to keep numerical matrices in the
131
+ memory.
132
+
133
+ ## License
134
+
135
+ This is free software under the MIT License.
136
+
137
+ ## References
138
+
139
+ <span id="ref1">[1]</span> Reinhard Caspary: "Applied Rare-Earth Spectroscopy for Fiber Laser Optimization", doctoral dissertation at
140
+ Technische Universität Braunschweig, published with Shaker, Aachen, 2002
141
+
142
+ <span id="ref2">[2]</span> Reinhard Caspary: "AMELI: Angular Matrix Elements of Lanthanide Ions", arXiv, 2026,
143
+ https://doi.org/10.48550/arXiv.2603.21947
@@ -0,0 +1,31 @@
1
+ # pyproject.toml
2
+ [build-system]
3
+ requires = ["setuptools >= 61.0"]
4
+ build-backend = "setuptools.build_meta"
5
+
6
+ [project]
7
+ name = "yalip"
8
+ version = "0.9.0"
9
+ authors = [
10
+ { name = "Reinhard Caspary", email = "reinhard.caspary@phoenixd.uni-hannover.de"},
11
+ ]
12
+ description = "Python 3 package to calculate the energy levels of lanthanide ions."
13
+ readme = "README.md"
14
+ requires-python = ">=3.8"
15
+ dependencies = [
16
+ 'numpy >= 2.4.0',
17
+ 'scipy >= 1.17.0',
18
+ 'h5py >= 3.16.0',
19
+ 'requests >= 2.34.0',
20
+ 'platformdirs >= 4.9.0',
21
+ ]
22
+ classifiers = [
23
+ "Development Status :: 3 - Alpha",
24
+ "Programming Language :: Python :: 3",
25
+ "License :: OSI Approved :: MIT License",
26
+ "Operating System :: OS Independent"
27
+ ]
28
+
29
+ [tool.setuptools.packages.find]
30
+ where = ["src"]
31
+ include = ["yalip"]
yalip-0.9.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,22 @@
1
+ ##########################################################################
2
+ # Copyright (c) 2026 Reinhard Caspary #
3
+ # <reinhard.caspary@phoenixd.uni-hannover.de> #
4
+ # This program is free software under the terms of the MIT license. #
5
+ ##########################################################################
6
+
7
+ from enum import Enum
8
+
9
+ __version = "0.9.0"
10
+
11
+
12
+ class Coupling(Enum):
13
+ Product = 0
14
+ SLJM = 1
15
+ SLJ = 2
16
+
17
+
18
+ from .lanthanide import LANTHANIDES, RADIAL, JUDD_OFELT, MATERIAL
19
+ from .spectrum import CONST_e, CONST_eps0, CONST_me, CONST_h, CONST_c, CONST_gs, Cauchy, Sellmeier
20
+ from .states import States
21
+ from .levels import Levels
22
+ from .fits import Fits