qrotor 4.0.0a2__py3-none-any.whl → 4.0.1__py3-none-any.whl

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/_version.py CHANGED
@@ -10,5 +10,5 @@ https://semver.org/
10
10
 
11
11
  """
12
12
 
13
- __version__ = 'v4.0.0a2'
13
+ __version__ = 'v4.0.1'
14
14
 
qrotor/constants.py CHANGED
@@ -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 aton.phys as phys
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)) * phys.AA_to_m
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)) * phys.AA_to_m
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
- I_CH3 = 3 * (phys.atoms['H'].mass * phys.amu_to_kg * r_CH**2)
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 * (phys.atoms['H'].isotope[2].mass * phys.amu_to_kg * r_CH**2)
44
+ I_CD3 = 3 * (periodictable.D.mass * _amu * r_CH**2)
43
45
  """Inertia of CD3, in kg·m^2."""
44
- I_NH3 = 3 * (phys.atoms['H'].mass * phys.amu_to_kg * r_NH**2)
46
+ I_NH3 = 3 * (periodictable.H.mass * _amu * r_NH**2)
45
47
  """Inertia of NH3, in kg·m^2."""
46
- I_ND3 = 3 * (phys.atoms['H'].isotope[2].mass * phys.amu_to_kg * r_NH**2)
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
- B_CH3 = ((phys.hbar**2) / (2 * I_CH3)) * phys.J_to_meV
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 = ((phys.hbar**2) / (2 * I_CD3)) * phys.J_to_meV
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 = ((phys.hbar**2) / (2 * I_NH3)) * phys.J_to_meV
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 = ((phys.hbar**2) / (2 * I_ND3)) * phys.J_to_meV
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
+
qrotor/plot.py CHANGED
@@ -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 * phys.meV_to_ueV for j in y]
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 * phys.meV_to_Ry for j in y]
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
 
qrotor/potential.py CHANGED
@@ -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 * phys.meV_to_eV
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 * phys.meV_to_Ry
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) * phys.eV_to_meV
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) * phys.Ry_to_meV
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'] * phys.Ry_to_eV
246
+ energy_value = content['Energy'] * constants.Ry_to_eV
248
247
  elif energy.lower() in alias.units['meV']:
249
- energy_value = content['Energy'] * phys.Ry_to_meV
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'] * phys.Ry_to_meV
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.0a2
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="40.0%" src="pics/qrotor.png"></p>
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
- # Index
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
+
@@ -0,0 +1,16 @@
1
+ qrotor/__init__.py,sha256=rG2dH4QjsVUOMBhFnv5gXs3QnrUg7fywd5pIDmMBXcQ,246
2
+ qrotor/_version.py,sha256=MdOgAkUR9D2frTc3Jx8g9MXBZxTyDiIlBtprpKhAfes,194
3
+ qrotor/constants.py,sha256=l25-YHxWQPr5RFGl8e0Hpdkc0E4ER03Gj-P9Jmbqelc,3203
4
+ qrotor/plot.py,sha256=SeQX8PM5qPdedmo0DzfGFbA8m_sH2mcK50aTuWXN8HA,13335
5
+ qrotor/potential.py,sha256=4sONrwnJkKy2zyquX6AFpNVLXrRMX9XUJUnuS6eZ9bc,17781
6
+ qrotor/rotate.py,sha256=Wje9Q9SFhDvizz58MzNGBwsmgV-3wN9z2SnUNTIXzeg,8107
7
+ qrotor/solve.py,sha256=tnkE5JYT8wW85gNbOEMgHTnzOZCb8q5xPcJbDI4uOB0,10724
8
+ qrotor/system.py,sha256=onY3HfY2zpRLDJUjBJRX-nJu6YH_qhnPnCW6Uyam_Ws,11453
9
+ qrotor/systems.py,sha256=Hcx0QvMWpaPMfC6HWpkZPPWDyHk9rxWKdAxWNnD2NMg,8184
10
+ qrotor-4.0.1.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
+ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
+ tests/test_qrotor.py,sha256=KL5i1YVFOB5cFc7BXCtbrbBKKMCHyGM-B20m4unz1q0,3457
13
+ qrotor-4.0.1.dist-info/METADATA,sha256=Z92ghlFydfpFiI1XOZ15pfRwQt69_hf9KFP9fHMuDCA,8528
14
+ qrotor-4.0.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
15
+ qrotor-4.0.1.dist-info/top_level.txt,sha256=mLnYs07-amqX4TqbDV2_XvgdpHfgrYmzmYb7dwoh6EQ,13
16
+ qrotor-4.0.1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.8.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
tests/test_qrotor.py CHANGED
@@ -1,4 +1,4 @@
1
- import aton.qrotor as qr
1
+ import qrotor as qr
2
2
  import aton.api as api
3
3
  import aton.txt.extract as extract
4
4
  import aton.file as file
@@ -1,16 +0,0 @@
1
- qrotor/__init__.py,sha256=rG2dH4QjsVUOMBhFnv5gXs3QnrUg7fywd5pIDmMBXcQ,246
2
- qrotor/_version.py,sha256=g_T7BCLBKhDlltJhI3DGl-GbuywjuY69QwH4lAH7PxQ,196
3
- qrotor/constants.py,sha256=q62GbUKy2aojQ_8epIfaJMP1Y_HrT9mVw_9zWhvdCKo,2734
4
- qrotor/plot.py,sha256=xJbreSDIuBNBl71e5XzzVW2PBijgkVZTFl3Fe74hecU,13315
5
- qrotor/potential.py,sha256=VpO0U9UXAfqQE8sdQymSyMfiHEnWluAFksLNJJQ2iB0,17801
6
- qrotor/rotate.py,sha256=Wje9Q9SFhDvizz58MzNGBwsmgV-3wN9z2SnUNTIXzeg,8107
7
- qrotor/solve.py,sha256=tnkE5JYT8wW85gNbOEMgHTnzOZCb8q5xPcJbDI4uOB0,10724
8
- qrotor/system.py,sha256=onY3HfY2zpRLDJUjBJRX-nJu6YH_qhnPnCW6Uyam_Ws,11453
9
- qrotor/systems.py,sha256=Hcx0QvMWpaPMfC6HWpkZPPWDyHk9rxWKdAxWNnD2NMg,8184
10
- qrotor-4.0.0a2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
11
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
- tests/test_qrotor.py,sha256=44uvE1AXMAtbUILA1gLeMi2__8quqcSyv1m3R1f4AP0,3462
13
- qrotor-4.0.0a2.dist-info/METADATA,sha256=6HJo-g8dHqGkEP9exNpFnfz_qYHASbewl07z03FxYxw,5885
14
- qrotor-4.0.0a2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
15
- qrotor-4.0.0a2.dist-info/top_level.txt,sha256=mLnYs07-amqX4TqbDV2_XvgdpHfgrYmzmYb7dwoh6EQ,13
16
- qrotor-4.0.0a2.dist-info/RECORD,,