qrotor 4.1.0__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrotor
3
- Version: 4.1.0
3
+ Version: 4.1.2
4
4
  Summary: QRotor
5
5
  Author: Pablo Gila-Herranz
6
6
  Author-email: pgila001@ikasle.ehu.eus
@@ -8,7 +8,8 @@ Package version is defined here. Follows semantic versioning, as in:
8
8
  More about semantic versioning:
9
9
  https://semver.org/
10
10
 
11
+ ---
11
12
  """
12
13
 
13
- __version__ = 'v4.1.0'
14
+ __version__ = "v4.1.2"
14
15
 
@@ -1,7 +1,7 @@
1
1
  """
2
2
  # Description
3
3
 
4
- Common constants and default inertia values used in the QRotor subpackage.
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
- """Rotational energy of CH3, in meV·s/kg·m^2."""
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
- """Rotational energy of CD3, in meV·s/kg·m^2."""
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
- """Rotational energy of NH3, in meV·s/kg·m^2."""
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
- """Rotational energy of ND3, in meV·s/kg·m^2."""
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 eV to Rydberg energy."""
78
+ """Quick conversion factor from Rydberg to eV energy."""
79
79
  Ry_to_meV = Ry_to_eV * 1000
80
- """Quick conversion factor from meV to Rydberg energy."""
80
+ """Quick conversion factor from Rydberg to meV energy."""
81
81
  eV_to_Ry = 1 / Ry_to_eV
82
- """Quick conversion factor from Rydberg to eV."""
82
+ """Quick conversion factor from eV to Rydberg."""
83
83
  meV_to_Ry = 1 / Ry_to_meV
84
- """Quick conversion factor from Rydberg to meV."""
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
 
@@ -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
- system = systems.as_list(data)
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
- cubic_spline = CubicSpline(grid, V)
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
@@ -61,7 +61,7 @@ class System:
61
61
  if not B:
62
62
  B = self.B
63
63
  self.B: float = B
64
- """Rotational inertia, as in $B=\\frac{\\hbar^2}{2I}$.
64
+ """Kinetic rotational energy, as in $B=\\frac{\\hbar^2}{2I}$.
65
65
 
66
66
  Defaults to the value for a methyl group.
67
67
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qrotor
3
- Version: 4.1.0
3
+ Version: 4.1.2
4
4
  Summary: QRotor
5
5
  Author: Pablo Gila-Herranz
6
6
  Author-email: pgila001@ikasle.ehu.eus
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