qrotor 4.1.1__tar.gz → 4.1.2__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.1.1 → qrotor-4.1.2}/PKG-INFO +1 -1
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/_version.py +1 -1
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/constants.py +4 -4
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/plot.py +17 -1
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/potential.py +4 -1
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/system.py +1 -1
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor.egg-info/PKG-INFO +1 -1
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor.egg-info/SOURCES.txt +1 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor.egg-info/top_level.txt +1 -0
- qrotor-4.1.2/tests/__init__.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/LICENSE +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/README.md +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/__init__.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/rotate.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/solve.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor/systems.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor.egg-info/dependency_links.txt +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/qrotor.egg-info/requires.txt +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/setup.cfg +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/setup.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/tests/test_constants.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/tests/test_potential.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/tests/test_rotate.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/tests/test_solve.py +0 -0
- {qrotor-4.1.1 → qrotor-4.1.2}/tests/test_system.py +0 -0
|
@@ -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 = [
|
|
@@ -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
|
|
@@ -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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|