qrotor 4.1.0__py3-none-any.whl → 4.1.2__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 +2 -1
- qrotor/constants.py +13 -9
- qrotor/plot.py +17 -1
- qrotor/potential.py +4 -1
- qrotor/system.py +1 -1
- {qrotor-4.1.0.dist-info → qrotor-4.1.2.dist-info}/METADATA +1 -1
- {qrotor-4.1.0.dist-info → qrotor-4.1.2.dist-info}/RECORD +10 -10
- {qrotor-4.1.0.dist-info → qrotor-4.1.2.dist-info}/WHEEL +0 -0
- {qrotor-4.1.0.dist-info → qrotor-4.1.2.dist-info}/licenses/LICENSE +0 -0
- {qrotor-4.1.0.dist-info → qrotor-4.1.2.dist-info}/top_level.txt +0 -0
qrotor/_version.py
CHANGED
qrotor/constants.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""
|
|
2
2
|
# Description
|
|
3
3
|
|
|
4
|
-
Common constants and default inertia values used in
|
|
4
|
+
Common constants and default inertia values used in QRotor.
|
|
5
5
|
|
|
6
6
|
Bond lengths and angles were obtained from MAPbI3, see
|
|
7
7
|
[K. Drużbicki *et al*., Crystal Growth & Design 24, 391–404 (2024)](https://doi.org/10.1021/acs.cgd.3c01112).
|
|
@@ -51,13 +51,13 @@ I_ND3 = 3 * (periodictable.D.mass * _amu * r_NH**2)
|
|
|
51
51
|
# Rotational energy
|
|
52
52
|
_hbar = const.physical_constants['reduced Planck constant'][0]
|
|
53
53
|
B_CH3 = ((_hbar**2) / (2 * I_CH3)) * (1000 / const.eV)
|
|
54
|
-
"""
|
|
54
|
+
"""Kinetic rotational energy of CH3, in meV·s/kg·m^2."""
|
|
55
55
|
B_CD3 = ((_hbar**2) / (2 * I_CD3)) * (1000 / const.eV)
|
|
56
|
-
"""
|
|
56
|
+
"""Kinetic rotational energy of CD3, in meV·s/kg·m^2."""
|
|
57
57
|
B_NH3 = ((_hbar**2) / (2 * I_NH3)) * (1000 / const.eV)
|
|
58
|
-
"""
|
|
58
|
+
"""Kinetic rotational energy of NH3, in meV·s/kg·m^2."""
|
|
59
59
|
B_ND3 = ((_hbar**2) / (2 * I_ND3)) * (1000 / const.eV)
|
|
60
|
-
"""
|
|
60
|
+
"""Kinetic rotational energy of ND3, in meV·s/kg·m^2."""
|
|
61
61
|
|
|
62
62
|
# Potential constants from titov2023 [C1, C2, C3, C4, C5]
|
|
63
63
|
constants_titov2023 = [
|
|
@@ -75,11 +75,15 @@ In meV units.
|
|
|
75
75
|
|
|
76
76
|
# Quick conversion factors
|
|
77
77
|
Ry_to_eV = const.physical_constants['Rydberg constant times hc in eV'][0]
|
|
78
|
-
"""Quick conversion factor from
|
|
78
|
+
"""Quick conversion factor from Rydberg to eV energy."""
|
|
79
79
|
Ry_to_meV = Ry_to_eV * 1000
|
|
80
|
-
"""Quick conversion factor from
|
|
80
|
+
"""Quick conversion factor from Rydberg to meV energy."""
|
|
81
81
|
eV_to_Ry = 1 / Ry_to_eV
|
|
82
|
-
"""Quick conversion factor from
|
|
82
|
+
"""Quick conversion factor from eV to Rydberg."""
|
|
83
83
|
meV_to_Ry = 1 / Ry_to_meV
|
|
84
|
-
"""Quick conversion factor from
|
|
84
|
+
"""Quick conversion factor from meV to Rydberg."""
|
|
85
|
+
cm1_to_meV = (const.h * const.c * 100 / const.e) * 1000
|
|
86
|
+
"""Quick conversion factor from cm$^{-1}$ to meV."""
|
|
87
|
+
meV_to_cm1 = 1/cm1_to_meV
|
|
88
|
+
"""Quick conversion factor from meV to cm$^{-1}$."""
|
|
85
89
|
|
qrotor/plot.py
CHANGED
|
@@ -34,6 +34,8 @@ def potential(
|
|
|
34
34
|
marker='',
|
|
35
35
|
linestyle='-',
|
|
36
36
|
cm:bool=False,
|
|
37
|
+
normalize:bool=False,
|
|
38
|
+
ylim:tuple=None,
|
|
37
39
|
) -> None:
|
|
38
40
|
"""Plot the potential values of `data` (System object, or list of systems).
|
|
39
41
|
|
|
@@ -42,8 +44,13 @@ def potential(
|
|
|
42
44
|
|
|
43
45
|
`marker` and `linestyle` can be a Matplotlib string or list of strings.
|
|
44
46
|
Optionally, the Viridis colormap can be used with `cm = True`.
|
|
47
|
+
|
|
48
|
+
Set `normalize = True` to normalize by their respective `qrotor.system.System.potential_max`.
|
|
49
|
+
This can be useful if you have performed subtractions or similar operations.
|
|
50
|
+
In this case, you might also want to play with `ylim` to adjust the y-axis limits.
|
|
45
51
|
"""
|
|
46
|
-
|
|
52
|
+
data_copy = deepcopy(data)
|
|
53
|
+
system = systems.as_list(data_copy)
|
|
47
54
|
title_str = title if title else (system[0].comment if (system[0].comment and (len(system) == 1 or not system[-1].comment)) else 'Rotational potential energy')
|
|
48
55
|
# Marker as a list
|
|
49
56
|
if isinstance(marker, list):
|
|
@@ -62,6 +69,15 @@ def potential(
|
|
|
62
69
|
plt.title(title_str)
|
|
63
70
|
plt.xlabel('Angle / rad')
|
|
64
71
|
plt.ylabel('Potential energy / meV')
|
|
72
|
+
|
|
73
|
+
if normalize:
|
|
74
|
+
plt.ylabel('Energy / V$_{3}$')
|
|
75
|
+
for s in system:
|
|
76
|
+
s.potential_values = s.potential_values / s.potential_max
|
|
77
|
+
|
|
78
|
+
if ylim:
|
|
79
|
+
plt.ylim(ylim)
|
|
80
|
+
|
|
65
81
|
plt.xticks([-2*np.pi, -3*np.pi/2, -np.pi, -np.pi/2, 0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], [r'$-2\pi$', r'$-\frac{3\pi}{2}$', r'$-\pi$', r'$-\frac{\pi}{2}$', '0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
|
|
66
82
|
|
|
67
83
|
if cm: # Plot using a colormap
|
qrotor/potential.py
CHANGED
|
@@ -372,7 +372,10 @@ def interpolate(system:System) -> System:
|
|
|
372
372
|
grid = system.grid
|
|
373
373
|
gridsize = system.gridsize
|
|
374
374
|
new_grid = np.linspace(0, 2*np.pi, gridsize)
|
|
375
|
-
|
|
375
|
+
# Impose periodic boundary conditions
|
|
376
|
+
grid_periodic = np.append(grid, grid[0] + 2*np.pi)
|
|
377
|
+
V_periodic = np.append(V, V[0])
|
|
378
|
+
cubic_spline = CubicSpline(grid_periodic, V_periodic, bc_type='periodic')
|
|
376
379
|
new_V = cubic_spline(new_grid)
|
|
377
380
|
system.grid = new_grid
|
|
378
381
|
system.potential_values = new_V
|
qrotor/system.py
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
qrotor/__init__.py,sha256=rG2dH4QjsVUOMBhFnv5gXs3QnrUg7fywd5pIDmMBXcQ,246
|
|
2
|
-
qrotor/_version.py,sha256=
|
|
3
|
-
qrotor/constants.py,sha256=
|
|
4
|
-
qrotor/plot.py,sha256=
|
|
5
|
-
qrotor/potential.py,sha256=
|
|
2
|
+
qrotor/_version.py,sha256=gtnQ4qGBlYQr4K9VzdiULHRclyxik47zCja1dRudtyk,198
|
|
3
|
+
qrotor/constants.py,sha256=Q59CU5QrvOyCz-2TFP31GDKJYi7G7LUxbs10ZTMiKIE,3408
|
|
4
|
+
qrotor/plot.py,sha256=s0XYMxQ7BxN_MngU-UAvX5mGk5R8c_Hznw2xFX9-8nI,14028
|
|
5
|
+
qrotor/potential.py,sha256=2HjSDVJWSvwplyH5pq0MMPoQsLIBJbbTwkr350u949I,18491
|
|
6
6
|
qrotor/rotate.py,sha256=Wje9Q9SFhDvizz58MzNGBwsmgV-3wN9z2SnUNTIXzeg,8107
|
|
7
7
|
qrotor/solve.py,sha256=YkOR1SJlpk41PCNEhslv6X3wV1TWMNztT78qX3Pngf0,10722
|
|
8
|
-
qrotor/system.py,sha256=
|
|
8
|
+
qrotor/system.py,sha256=ahYurNUmVOV7B6aZSe7rhcruagj5rW9UClqG-H1vVvY,11454
|
|
9
9
|
qrotor/systems.py,sha256=Hcx0QvMWpaPMfC6HWpkZPPWDyHk9rxWKdAxWNnD2NMg,8184
|
|
10
|
-
qrotor-4.1.
|
|
10
|
+
qrotor-4.1.2.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
11
11
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
12
|
tests/test_constants.py,sha256=YHKkPyZlzjchxxzON_VSNsQdKnpkknsFVoIA6TcUk70,399
|
|
13
13
|
tests/test_potential.py,sha256=_Vq9t9Xm59kNbyYwXlRnvKcxwL7vntD2j14W2aUtF6I,1302
|
|
14
14
|
tests/test_rotate.py,sha256=2On2d1E82hdisFC5DXpaqqYNnteX7ZP3PAnGa_oGm2M,1896
|
|
15
15
|
tests/test_solve.py,sha256=tEjLUZC7oe6LCQD5b2xf2aaK9lu-zI4lzuPXOGR2GAs,861
|
|
16
16
|
tests/test_system.py,sha256=36d-8AdoJdzq0O9_O3s8wwBPGa-M7A86YiHqhhAsCZ8,742
|
|
17
|
-
qrotor-4.1.
|
|
18
|
-
qrotor-4.1.
|
|
19
|
-
qrotor-4.1.
|
|
20
|
-
qrotor-4.1.
|
|
17
|
+
qrotor-4.1.2.dist-info/METADATA,sha256=5oHcJpRWIUcYiIzE5ilaFOWfH0xVy_7klIULdL2WhH0,8719
|
|
18
|
+
qrotor-4.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
+
qrotor-4.1.2.dist-info/top_level.txt,sha256=mLnYs07-amqX4TqbDV2_XvgdpHfgrYmzmYb7dwoh6EQ,13
|
|
20
|
+
qrotor-4.1.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|