qrotor 4.0.0a2__tar.gz → 4.0.1__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.
Potentially problematic release.
This version of qrotor might be problematic. Click here for more details.
- {qrotor-4.0.0a2 → qrotor-4.0.1}/PKG-INFO +111 -4
- {qrotor-4.0.0a2 → qrotor-4.0.1}/README.md +109 -3
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/_version.py +1 -1
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/constants.py +25 -12
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/plot.py +3 -3
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/potential.py +7 -8
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor.egg-info/PKG-INFO +111 -4
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor.egg-info/requires.txt +1 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/setup.py +1 -2
- {qrotor-4.0.0a2 → qrotor-4.0.1}/tests/test_qrotor.py +1 -1
- {qrotor-4.0.0a2 → qrotor-4.0.1}/LICENSE +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/__init__.py +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/rotate.py +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/solve.py +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/system.py +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor/systems.py +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor.egg-info/SOURCES.txt +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor.egg-info/dependency_links.txt +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/qrotor.egg-info/top_level.txt +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/setup.cfg +0 -0
- {qrotor-4.0.0a2 → qrotor-4.0.1}/tests/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qrotor
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.1
|
|
4
4
|
Summary: QRotor
|
|
5
5
|
Author: Pablo Gila-Herranz
|
|
6
6
|
Author-email: pgila001@ikasle.ehu.eus
|
|
@@ -21,6 +21,7 @@ Requires-Dist: pandas
|
|
|
21
21
|
Requires-Dist: numpy
|
|
22
22
|
Requires-Dist: matplotlib
|
|
23
23
|
Requires-Dist: aton
|
|
24
|
+
Requires-Dist: periodictable
|
|
24
25
|
Dynamic: author
|
|
25
26
|
Dynamic: author-email
|
|
26
27
|
Dynamic: classifier
|
|
@@ -33,7 +34,7 @@ Dynamic: requires-dist
|
|
|
33
34
|
Dynamic: requires-python
|
|
34
35
|
Dynamic: summary
|
|
35
36
|
|
|
36
|
-
<p align="center"><img width="
|
|
37
|
+
<p align="center"><img width="60.0%" src="pics/qrotor.png"></p>
|
|
37
38
|
|
|
38
39
|
QRotor is a Python package used to study molecular rotations,
|
|
39
40
|
such as those of methyl and amine groups.
|
|
@@ -44,10 +45,43 @@ These quantum systems are represented by the `qrotor.System()` object.
|
|
|
44
45
|
QRotor can obtain custom potentials from DFT,
|
|
45
46
|
which are used to solve the quantum system.
|
|
46
47
|
|
|
47
|
-
Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
48
48
|
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# Installation
|
|
53
|
+
|
|
54
|
+
As always, it is recommended to install your packages in a virtual environment:
|
|
55
|
+
```bash
|
|
56
|
+
python3 -m venv .venv
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## With pip
|
|
62
|
+
|
|
63
|
+
Install or upgrade ATON with
|
|
64
|
+
```bash
|
|
65
|
+
pip install qrotor -U
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## From source
|
|
70
|
+
|
|
71
|
+
Optionally, you can install ATON from the [GitHub repo](https://github.com/pablogila/qrotor/).
|
|
72
|
+
Clone the repository or download the [latest stable release](https://github.com/pablogila/qrotor/tags)
|
|
73
|
+
as a ZIP, unzip it, and run inside it:
|
|
74
|
+
```bash
|
|
75
|
+
pip install .
|
|
76
|
+
```
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Documentation
|
|
83
|
+
|
|
84
|
+
QRotor contains the following modules:
|
|
51
85
|
|
|
52
86
|
| | |
|
|
53
87
|
| --- | --- |
|
|
@@ -59,6 +93,11 @@ Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
|
59
93
|
| [qrotor.solve](https://pablogila.github.io/qrotor/qrotor/solve.html) | Solve rotation eigenvalues and eigenvectors |
|
|
60
94
|
| [qrotor.plot](https://pablogila.github.io/qrotor/qrotor/plot.html) | Plotting functions |
|
|
61
95
|
|
|
96
|
+
Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
62
101
|
|
|
63
102
|
# Usage
|
|
64
103
|
|
|
@@ -165,3 +204,71 @@ See [R. M. Dimeo, American Journal of Physics 71, 885–893 (2003)](https://doi.
|
|
|
165
204
|
and [A. J. Horsewill, Progress in Nuclear Magnetic Resonance Spectroscopy 35, 359–389 (1999)](https://doi.org/10.1016/S0079-6565(99)00016-3)
|
|
166
205
|
for further reference.
|
|
167
206
|
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
# Contributing
|
|
212
|
+
|
|
213
|
+
If you are interested in opening an issue or a pull request, please feel free to do so on [GitHub](https://github.com/pablogila/qrotor/).
|
|
214
|
+
For major changes, please get in touch first to discuss the details.
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## Code style
|
|
218
|
+
|
|
219
|
+
Please try to follow some general guidelines:
|
|
220
|
+
- Use a code style consistent with the rest of the project.
|
|
221
|
+
- Include docstrings to document new additions.
|
|
222
|
+
- Include automated tests for new features or modifications, see [automated testing](#automated-testing).
|
|
223
|
+
- Arrange function arguments by order of relevance.
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## Automated testing
|
|
227
|
+
|
|
228
|
+
If you are modifying the source code, you should run the automated tests of the [`tests/`](https://github.com/pablogila/qrotor/tree/main/tests) folder to check that everything works as intended.
|
|
229
|
+
To do so, first install PyTest in your environment,
|
|
230
|
+
```bash
|
|
231
|
+
pip install pytest
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
And then run PyTest inside the main directory,
|
|
235
|
+
```bash
|
|
236
|
+
pytest -vv
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
## Compiling the documentation
|
|
241
|
+
|
|
242
|
+
The documentation can be compiled automatically to `docs/qrotor.html` with [Pdoc](https://pdoc.dev/) and [ATON](https://pablogila.github.io/aton), by running:
|
|
243
|
+
```shell
|
|
244
|
+
python3 makedocs.py
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
This runs Pdoc, updating links and pictures, and using the custom theme CSS template from the `css/` folder.
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# Citation
|
|
254
|
+
|
|
255
|
+
QRotor is currently under development.
|
|
256
|
+
Please cite it if you use it in your research,
|
|
257
|
+
> Pablo Gila-Herranz, *QRotor*, https://pablogila.github.io/qrotor
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
# License
|
|
264
|
+
|
|
265
|
+
Copyright (C) 2025 Pablo Gila-Herranz
|
|
266
|
+
This program is free software: you can redistribute it and/or modify
|
|
267
|
+
it under the terms of the **GNU Affero General Public License** as published
|
|
268
|
+
by the Free Software Foundation, either version **3** of the License, or
|
|
269
|
+
(at your option) any later version.
|
|
270
|
+
This program is distributed in the hope that it will be useful,
|
|
271
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
272
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
273
|
+
See the attached GNU Affero General Public License for more details.
|
|
274
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p align="center"><img width="
|
|
1
|
+
<p align="center"><img width="60.0%" src="pics/qrotor.png"></p>
|
|
2
2
|
|
|
3
3
|
QRotor is a Python package used to study molecular rotations,
|
|
4
4
|
such as those of methyl and amine groups.
|
|
@@ -9,10 +9,43 @@ These quantum systems are represented by the `qrotor.System()` object.
|
|
|
9
9
|
QRotor can obtain custom potentials from DFT,
|
|
10
10
|
which are used to solve the quantum system.
|
|
11
11
|
|
|
12
|
-
Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
13
12
|
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Installation
|
|
17
|
+
|
|
18
|
+
As always, it is recommended to install your packages in a virtual environment:
|
|
19
|
+
```bash
|
|
20
|
+
python3 -m venv .venv
|
|
21
|
+
source .venv/bin/activate
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## With pip
|
|
26
|
+
|
|
27
|
+
Install or upgrade ATON with
|
|
28
|
+
```bash
|
|
29
|
+
pip install qrotor -U
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## From source
|
|
34
|
+
|
|
35
|
+
Optionally, you can install ATON from the [GitHub repo](https://github.com/pablogila/qrotor/).
|
|
36
|
+
Clone the repository or download the [latest stable release](https://github.com/pablogila/qrotor/tags)
|
|
37
|
+
as a ZIP, unzip it, and run inside it:
|
|
38
|
+
```bash
|
|
39
|
+
pip install .
|
|
40
|
+
```
|
|
14
41
|
|
|
15
|
-
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# Documentation
|
|
47
|
+
|
|
48
|
+
QRotor contains the following modules:
|
|
16
49
|
|
|
17
50
|
| | |
|
|
18
51
|
| --- | --- |
|
|
@@ -24,6 +57,11 @@ Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
|
24
57
|
| [qrotor.solve](https://pablogila.github.io/qrotor/qrotor/solve.html) | Solve rotation eigenvalues and eigenvectors |
|
|
25
58
|
| [qrotor.plot](https://pablogila.github.io/qrotor/qrotor/plot.html) | Plotting functions |
|
|
26
59
|
|
|
60
|
+
Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
27
65
|
|
|
28
66
|
# Usage
|
|
29
67
|
|
|
@@ -130,3 +168,71 @@ See [R. M. Dimeo, American Journal of Physics 71, 885–893 (2003)](https://doi.
|
|
|
130
168
|
and [A. J. Horsewill, Progress in Nuclear Magnetic Resonance Spectroscopy 35, 359–389 (1999)](https://doi.org/10.1016/S0079-6565(99)00016-3)
|
|
131
169
|
for further reference.
|
|
132
170
|
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
# Contributing
|
|
176
|
+
|
|
177
|
+
If you are interested in opening an issue or a pull request, please feel free to do so on [GitHub](https://github.com/pablogila/qrotor/).
|
|
178
|
+
For major changes, please get in touch first to discuss the details.
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
## Code style
|
|
182
|
+
|
|
183
|
+
Please try to follow some general guidelines:
|
|
184
|
+
- Use a code style consistent with the rest of the project.
|
|
185
|
+
- Include docstrings to document new additions.
|
|
186
|
+
- Include automated tests for new features or modifications, see [automated testing](#automated-testing).
|
|
187
|
+
- Arrange function arguments by order of relevance.
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## Automated testing
|
|
191
|
+
|
|
192
|
+
If you are modifying the source code, you should run the automated tests of the [`tests/`](https://github.com/pablogila/qrotor/tree/main/tests) folder to check that everything works as intended.
|
|
193
|
+
To do so, first install PyTest in your environment,
|
|
194
|
+
```bash
|
|
195
|
+
pip install pytest
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
And then run PyTest inside the main directory,
|
|
199
|
+
```bash
|
|
200
|
+
pytest -vv
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
## Compiling the documentation
|
|
205
|
+
|
|
206
|
+
The documentation can be compiled automatically to `docs/qrotor.html` with [Pdoc](https://pdoc.dev/) and [ATON](https://pablogila.github.io/aton), by running:
|
|
207
|
+
```shell
|
|
208
|
+
python3 makedocs.py
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
This runs Pdoc, updating links and pictures, and using the custom theme CSS template from the `css/` folder.
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
---
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
# Citation
|
|
218
|
+
|
|
219
|
+
QRotor is currently under development.
|
|
220
|
+
Please cite it if you use it in your research,
|
|
221
|
+
> Pablo Gila-Herranz, *QRotor*, https://pablogila.github.io/qrotor
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
# License
|
|
228
|
+
|
|
229
|
+
Copyright (C) 2025 Pablo Gila-Herranz
|
|
230
|
+
This program is free software: you can redistribute it and/or modify
|
|
231
|
+
it under the terms of the **GNU Affero General Public License** as published
|
|
232
|
+
by the Free Software Foundation, either version **3** of the License, or
|
|
233
|
+
(at your option) any later version.
|
|
234
|
+
This program is distributed in the hope that it will be useful,
|
|
235
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
236
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
237
|
+
See the attached GNU Affero General Public License for more details.
|
|
238
|
+
|
|
@@ -11,7 +11,8 @@ Bond lengths and angles were obtained from MAPbI3, see
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
import numpy as np
|
|
14
|
-
import
|
|
14
|
+
import periodictable
|
|
15
|
+
import scipy.constants as const
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
# Distance between Carbon and Hydrogen atoms (measured from MAPbI3)
|
|
@@ -31,29 +32,31 @@ angle_NH = 180 - angle_NH_external
|
|
|
31
32
|
"""Internal angle of the X-N-H bond, in degrees."""
|
|
32
33
|
|
|
33
34
|
# Rotation radius (calculated from distance and angle)
|
|
34
|
-
r_CH = distance_CH * np.sin(np.deg2rad(angle_CH)) *
|
|
35
|
+
r_CH = distance_CH * np.sin(np.deg2rad(angle_CH)) * 1e-10
|
|
35
36
|
"""Rotation radius of the methyl group, in meters."""
|
|
36
|
-
r_NH = distance_NH * np.sin(np.deg2rad(angle_NH)) *
|
|
37
|
+
r_NH = distance_NH * np.sin(np.deg2rad(angle_NH)) * 1e-10
|
|
37
38
|
"""Rotation radius of the amine group, in meters."""
|
|
38
39
|
|
|
39
40
|
# Inertia, SI units
|
|
40
|
-
|
|
41
|
+
_amu = const.physical_constants['atomic mass constant'][0]
|
|
42
|
+
I_CH3 = 3 * (periodictable.H.mass * _amu * r_CH**2)
|
|
41
43
|
"""Inertia of CH3, in kg·m^2."""
|
|
42
|
-
I_CD3 = 3 * (
|
|
44
|
+
I_CD3 = 3 * (periodictable.D.mass * _amu * r_CH**2)
|
|
43
45
|
"""Inertia of CD3, in kg·m^2."""
|
|
44
|
-
I_NH3 = 3 * (
|
|
46
|
+
I_NH3 = 3 * (periodictable.H.mass * _amu * r_NH**2)
|
|
45
47
|
"""Inertia of NH3, in kg·m^2."""
|
|
46
|
-
I_ND3 = 3 * (
|
|
48
|
+
I_ND3 = 3 * (periodictable.D.mass * _amu * r_NH**2)
|
|
47
49
|
"""Inertia of ND3, in kg·m^2."""
|
|
48
50
|
|
|
49
|
-
# Rotational energy
|
|
50
|
-
|
|
51
|
+
# Rotational energy
|
|
52
|
+
_hbar = const.physical_constants['reduced Planck constant'][0]
|
|
53
|
+
B_CH3 = ((_hbar**2) / (2 * I_CH3)) * (1000 / const.eV)
|
|
51
54
|
"""Rotational energy of CH3, in meV·s/kg·m^2."""
|
|
52
|
-
B_CD3 = ((
|
|
55
|
+
B_CD3 = ((_hbar**2) / (2 * I_CD3)) * (1000 / const.eV)
|
|
53
56
|
"""Rotational energy of CD3, in meV·s/kg·m^2."""
|
|
54
|
-
B_NH3 = ((
|
|
57
|
+
B_NH3 = ((_hbar**2) / (2 * I_NH3)) * (1000 / const.eV)
|
|
55
58
|
"""Rotational energy of NH3, in meV·s/kg·m^2."""
|
|
56
|
-
B_ND3 = ((
|
|
59
|
+
B_ND3 = ((_hbar**2) / (2 * I_ND3)) * (1000 / const.eV)
|
|
57
60
|
"""Rotational energy of ND3, in meV·s/kg·m^2."""
|
|
58
61
|
|
|
59
62
|
# Potential constants from titov2023 [C1, C2, C3, C4, C5]
|
|
@@ -70,3 +73,13 @@ for the `qrotor.potential.titov2023` potential.
|
|
|
70
73
|
In meV units.
|
|
71
74
|
"""
|
|
72
75
|
|
|
76
|
+
# Quick conversion factors
|
|
77
|
+
Ry_to_eV = const.physical_constants['Rydberg constant times hc in eV'][0]
|
|
78
|
+
"""Quick conversion factor from eV to Rydberg energy."""
|
|
79
|
+
Ry_to_meV = Ry_to_eV * 1000
|
|
80
|
+
"""Quick conversion factor from meV to Rydberg energy."""
|
|
81
|
+
eV_to_Ry = 1 / Ry_to_eV
|
|
82
|
+
"""Quick conversion factor from Rydberg to eV."""
|
|
83
|
+
meV_to_Ry = 1 / Ry_to_meV
|
|
84
|
+
"""Quick conversion factor from Rydberg to meV."""
|
|
85
|
+
|
|
@@ -21,11 +21,11 @@ This module provides straightforward functions to plot QRotor data.
|
|
|
21
21
|
|
|
22
22
|
from .system import System
|
|
23
23
|
from . import systems
|
|
24
|
+
from . import constants
|
|
24
25
|
import matplotlib.pyplot as plt
|
|
25
26
|
import numpy as np
|
|
26
27
|
from copy import deepcopy
|
|
27
28
|
import aton.alias as alias
|
|
28
|
-
import aton.phys as phys
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
def potential(
|
|
@@ -284,10 +284,10 @@ def splittings(
|
|
|
284
284
|
x = [c.comment for c in calcs]
|
|
285
285
|
# What units do we want?
|
|
286
286
|
if units.lower() in alias.units['ueV']:
|
|
287
|
-
y = [j *
|
|
287
|
+
y = [j * 1000 for j in y] # Convert meV to micro eV
|
|
288
288
|
ax.set_ylabel("Energy / $\\mu$eV")
|
|
289
289
|
elif units.lower() in alias.units['Ry']:
|
|
290
|
-
y = [j *
|
|
290
|
+
y = [j * constants.meV_to_Ry for j in y]
|
|
291
291
|
ax.set_ylabel("Energy / Ry")
|
|
292
292
|
#else: # It's okay let's use meV
|
|
293
293
|
|
|
@@ -50,7 +50,6 @@ from scipy.interpolate import CubicSpline
|
|
|
50
50
|
import aton.alias as alias
|
|
51
51
|
import aton.file as file
|
|
52
52
|
import aton.api.qe as qe
|
|
53
|
-
import aton.phys as phys
|
|
54
53
|
from ._version import __version__
|
|
55
54
|
|
|
56
55
|
|
|
@@ -100,10 +99,10 @@ def save(
|
|
|
100
99
|
if energy.lower() in alias.units['meV']:
|
|
101
100
|
potential_data += 'Potential/meV\n'
|
|
102
101
|
elif energy.lower() in alias.units['eV']:
|
|
103
|
-
potential_values = potential_values *
|
|
102
|
+
potential_values = potential_values * 1e-3
|
|
104
103
|
potential_data += 'Potential/eV\n'
|
|
105
104
|
elif energy.lower() in alias.units['Ry']:
|
|
106
|
-
potential_values = potential_values *
|
|
105
|
+
potential_values = potential_values * constants.meV_to_Ry
|
|
107
106
|
potential_data += 'Potential/Ry\n'
|
|
108
107
|
else:
|
|
109
108
|
print(f"WARNING: Unrecognised '{energy}' energy units, using meV instead")
|
|
@@ -161,11 +160,11 @@ def load(
|
|
|
161
160
|
raise ValueError(f"Angle unit '{angle}' not recognized.")
|
|
162
161
|
# Save energies to numpy arrays
|
|
163
162
|
if energy.lower() in alias.units['eV']:
|
|
164
|
-
potentials = np.array(potentials) *
|
|
163
|
+
potentials = np.array(potentials) * 1000
|
|
165
164
|
elif energy.lower() in alias.units['meV']:
|
|
166
165
|
potentials = np.array(potentials)
|
|
167
166
|
elif energy.lower() in alias.units['Ry']:
|
|
168
|
-
potentials = np.array(potentials) *
|
|
167
|
+
potentials = np.array(potentials) * constants.Ry_to_meV
|
|
169
168
|
else:
|
|
170
169
|
raise ValueError(f"Energy unit '{energy}' not recognized.")
|
|
171
170
|
# Set the system
|
|
@@ -244,15 +243,15 @@ def from_qe(
|
|
|
244
243
|
counter_errors += 1
|
|
245
244
|
continue
|
|
246
245
|
if energy.lower() in alias.units['eV']:
|
|
247
|
-
energy_value = content['Energy'] *
|
|
246
|
+
energy_value = content['Energy'] * constants.Ry_to_eV
|
|
248
247
|
elif energy.lower() in alias.units['meV']:
|
|
249
|
-
energy_value = content['Energy'] *
|
|
248
|
+
energy_value = content['Energy'] * constants.Ry_to_meV
|
|
250
249
|
elif energy.lower() in alias.units['Ry']:
|
|
251
250
|
energy_value = content['Energy']
|
|
252
251
|
else:
|
|
253
252
|
print(f"WARNING: Energy unit '{energy}' not recognized, using meV instead.")
|
|
254
253
|
energy = 'meV'
|
|
255
|
-
energy_value = content['Energy'] *
|
|
254
|
+
energy_value = content['Energy'] * constants.Ry_to_meV
|
|
256
255
|
splits = filename.split('_')
|
|
257
256
|
angle_value = splits[-1].replace('.out', '')
|
|
258
257
|
angle_value = float(angle_value)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: qrotor
|
|
3
|
-
Version: 4.0.
|
|
3
|
+
Version: 4.0.1
|
|
4
4
|
Summary: QRotor
|
|
5
5
|
Author: Pablo Gila-Herranz
|
|
6
6
|
Author-email: pgila001@ikasle.ehu.eus
|
|
@@ -21,6 +21,7 @@ Requires-Dist: pandas
|
|
|
21
21
|
Requires-Dist: numpy
|
|
22
22
|
Requires-Dist: matplotlib
|
|
23
23
|
Requires-Dist: aton
|
|
24
|
+
Requires-Dist: periodictable
|
|
24
25
|
Dynamic: author
|
|
25
26
|
Dynamic: author-email
|
|
26
27
|
Dynamic: classifier
|
|
@@ -33,7 +34,7 @@ Dynamic: requires-dist
|
|
|
33
34
|
Dynamic: requires-python
|
|
34
35
|
Dynamic: summary
|
|
35
36
|
|
|
36
|
-
<p align="center"><img width="
|
|
37
|
+
<p align="center"><img width="60.0%" src="pics/qrotor.png"></p>
|
|
37
38
|
|
|
38
39
|
QRotor is a Python package used to study molecular rotations,
|
|
39
40
|
such as those of methyl and amine groups.
|
|
@@ -44,10 +45,43 @@ These quantum systems are represented by the `qrotor.System()` object.
|
|
|
44
45
|
QRotor can obtain custom potentials from DFT,
|
|
45
46
|
which are used to solve the quantum system.
|
|
46
47
|
|
|
47
|
-
Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
48
48
|
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
# Installation
|
|
53
|
+
|
|
54
|
+
As always, it is recommended to install your packages in a virtual environment:
|
|
55
|
+
```bash
|
|
56
|
+
python3 -m venv .venv
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## With pip
|
|
62
|
+
|
|
63
|
+
Install or upgrade ATON with
|
|
64
|
+
```bash
|
|
65
|
+
pip install qrotor -U
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## From source
|
|
70
|
+
|
|
71
|
+
Optionally, you can install ATON from the [GitHub repo](https://github.com/pablogila/qrotor/).
|
|
72
|
+
Clone the repository or download the [latest stable release](https://github.com/pablogila/qrotor/tags)
|
|
73
|
+
as a ZIP, unzip it, and run inside it:
|
|
74
|
+
```bash
|
|
75
|
+
pip install .
|
|
76
|
+
```
|
|
49
77
|
|
|
50
|
-
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
# Documentation
|
|
83
|
+
|
|
84
|
+
QRotor contains the following modules:
|
|
51
85
|
|
|
52
86
|
| | |
|
|
53
87
|
| --- | --- |
|
|
@@ -59,6 +93,11 @@ Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
|
59
93
|
| [qrotor.solve](https://pablogila.github.io/qrotor/qrotor/solve.html) | Solve rotation eigenvalues and eigenvectors |
|
|
60
94
|
| [qrotor.plot](https://pablogila.github.io/qrotor/qrotor/plot.html) | Plotting functions |
|
|
61
95
|
|
|
96
|
+
Check the [full documentation online](https://pablogila.github.io/qrotor/).
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
62
101
|
|
|
63
102
|
# Usage
|
|
64
103
|
|
|
@@ -165,3 +204,71 @@ See [R. M. Dimeo, American Journal of Physics 71, 885–893 (2003)](https://doi.
|
|
|
165
204
|
and [A. J. Horsewill, Progress in Nuclear Magnetic Resonance Spectroscopy 35, 359–389 (1999)](https://doi.org/10.1016/S0079-6565(99)00016-3)
|
|
166
205
|
for further reference.
|
|
167
206
|
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
# Contributing
|
|
212
|
+
|
|
213
|
+
If you are interested in opening an issue or a pull request, please feel free to do so on [GitHub](https://github.com/pablogila/qrotor/).
|
|
214
|
+
For major changes, please get in touch first to discuss the details.
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
## Code style
|
|
218
|
+
|
|
219
|
+
Please try to follow some general guidelines:
|
|
220
|
+
- Use a code style consistent with the rest of the project.
|
|
221
|
+
- Include docstrings to document new additions.
|
|
222
|
+
- Include automated tests for new features or modifications, see [automated testing](#automated-testing).
|
|
223
|
+
- Arrange function arguments by order of relevance.
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
## Automated testing
|
|
227
|
+
|
|
228
|
+
If you are modifying the source code, you should run the automated tests of the [`tests/`](https://github.com/pablogila/qrotor/tree/main/tests) folder to check that everything works as intended.
|
|
229
|
+
To do so, first install PyTest in your environment,
|
|
230
|
+
```bash
|
|
231
|
+
pip install pytest
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
And then run PyTest inside the main directory,
|
|
235
|
+
```bash
|
|
236
|
+
pytest -vv
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
## Compiling the documentation
|
|
241
|
+
|
|
242
|
+
The documentation can be compiled automatically to `docs/qrotor.html` with [Pdoc](https://pdoc.dev/) and [ATON](https://pablogila.github.io/aton), by running:
|
|
243
|
+
```shell
|
|
244
|
+
python3 makedocs.py
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
This runs Pdoc, updating links and pictures, and using the custom theme CSS template from the `css/` folder.
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
# Citation
|
|
254
|
+
|
|
255
|
+
QRotor is currently under development.
|
|
256
|
+
Please cite it if you use it in your research,
|
|
257
|
+
> Pablo Gila-Herranz, *QRotor*, https://pablogila.github.io/qrotor
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
---
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
# License
|
|
264
|
+
|
|
265
|
+
Copyright (C) 2025 Pablo Gila-Herranz
|
|
266
|
+
This program is free software: you can redistribute it and/or modify
|
|
267
|
+
it under the terms of the **GNU Affero General Public License** as published
|
|
268
|
+
by the Free Software Foundation, either version **3** of the License, or
|
|
269
|
+
(at your option) any later version.
|
|
270
|
+
This program is distributed in the hope that it will be useful,
|
|
271
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
272
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
273
|
+
See the attached GNU Affero General Public License for more details.
|
|
274
|
+
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from setuptools import setup, find_packages
|
|
2
2
|
|
|
3
3
|
DESCRIPTION = "QRotor"
|
|
4
|
-
LONG_DESCRIPTION = "QRotor"
|
|
5
4
|
|
|
6
5
|
exec(open('qrotor/_version.py').read())
|
|
7
6
|
|
|
@@ -17,7 +16,7 @@ setup(
|
|
|
17
16
|
long_description = LONG_DESCRIPTION,
|
|
18
17
|
long_description_content_type = 'text/markdown',
|
|
19
18
|
packages = find_packages(),
|
|
20
|
-
install_requires = ['scipy', 'pandas', 'numpy', 'matplotlib', 'aton'],
|
|
19
|
+
install_requires = ['scipy', 'pandas', 'numpy', 'matplotlib', 'aton', 'periodictable'],
|
|
21
20
|
extras_requires = {'dev': ['pytest', 'twine', 'build']},
|
|
22
21
|
python_requires = '>=3',
|
|
23
22
|
license = 'AGPL-3.0',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|