From 5c7c642a36bddd1ea033aff856095e9aa17744f2 Mon Sep 17 00:00:00 2001 From: pablogila Date: Thu, 6 Feb 2025 12:38:44 +0100 Subject: [PATCH] qr plot custom titles --- aton/_version.py | 2 +- aton/qrotor/plot.py | 19 +- docs/aton.html | 2 +- docs/aton/_version.html | 4 +- docs/aton/interface.html | 2 +- docs/aton/interface/castep.html | 2 +- docs/aton/interface/phonopy.html | 2 +- docs/aton/interface/qe.html | 2 +- docs/aton/interface/slurm.html | 2 +- docs/aton/phys.html | 2 +- docs/aton/phys/atoms.html | 2 +- docs/aton/phys/functions.html | 2 +- docs/aton/phys/units.html | 2 +- docs/aton/qrotor.html | 2 +- docs/aton/qrotor/constants.html | 2 +- docs/aton/qrotor/plot.html | 744 +++++++++++++++---------------- docs/aton/qrotor/potential.html | 2 +- docs/aton/qrotor/rotate.html | 2 +- docs/aton/qrotor/solve.html | 2 +- docs/aton/qrotor/system.html | 2 +- docs/aton/qrotor/systems.html | 2 +- docs/aton/spx.html | 2 +- docs/aton/spx/classes.html | 2 +- docs/aton/spx/deuterium.html | 2 +- docs/aton/spx/fit.html | 2 +- docs/aton/spx/normalize.html | 2 +- docs/aton/spx/plot.html | 2 +- docs/aton/spx/samples.html | 2 +- docs/aton/st.html | 2 +- docs/aton/st/alias.html | 2 +- docs/aton/st/call.html | 2 +- docs/aton/st/file.html | 2 +- docs/aton/txt.html | 2 +- docs/aton/txt/edit.html | 2 +- docs/aton/txt/extract.html | 2 +- docs/aton/txt/find.html | 2 +- docs/search.js | 2 +- 37 files changed, 416 insertions(+), 419 deletions(-) diff --git a/aton/_version.py b/aton/_version.py index e4d8828..ed62951 100644 --- a/aton/_version.py +++ b/aton/_version.py @@ -10,5 +10,5 @@ """ -__version__ = 'v0.0.22' +__version__ = 'v0.0.23' diff --git a/aton/qrotor/plot.py b/aton/qrotor/plot.py index 34ebb9a..1a3f733 100644 --- a/aton/qrotor/plot.py +++ b/aton/qrotor/plot.py @@ -28,9 +28,7 @@ def potential(system, title:str=None) -> None: """Plot the potential values of a `system` (System object, or list of systems).""" system = systems.as_list(system) - title_str = title if title is not None else 'Rotational potential energy' - if not title and system[0].comment and not system[-1].comment: - title_str = system[0].comment + 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') plt.figure() plt.title(title_str) @@ -41,13 +39,13 @@ def potential(system, title:str=None) -> None: for i in system: plt.plot(i.grid, i.potential_values, marker='', linestyle='-', label=i.comment) - if all(s.comment for s in system): + if all(s.comment for s in system) and len(system) != 1: plt.legend() plt.show() -def energies(data) -> None: +def energies(data, title:str=None) -> None: """Plot the eigenvalues of `data` (System or a list of System objects).""" if isinstance(data, System): var = [data] @@ -61,7 +59,7 @@ def energies(data) -> None: edgecolors = ['tomato', 'purple', 'grey'] V_linestyle = '-' - title = var[0].comment if var[0].comment else 'Energy eigenvalues' + title = title if title else (var[0].comment if var[0].comment else 'Energy eigenvalues') ylabel_text = f'Energy / meV' xlabel_text = 'Angle / radians' @@ -102,12 +100,13 @@ def energies(data) -> None: plt.show() -def reduced_energies(data:list) -> None: +def reduced_energies(data:list, title:str=None) -> None: """Plots the reduced energy of the system E/B vs the reduced potential energy V/B. Takes a `data` list of System objects as input. """ systems.as_list(data) + title = title if title else (data[0].comment if data[0].comment else 'Reduced energies') number_of_levels = data[0].E_levels x = [] for system in data: @@ -119,11 +118,11 @@ def reduced_energies(data:list) -> None: plt.plot(x, y, marker='', linestyle='-') plt.xlabel('V$_{B}$ / B') plt.ylabel('E / B') - plt.title(data[0].comment) + plt.title(title) plt.show() -def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=False): +def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=False, title:str=None): """Plot the wavefunction of a `system` for the specified `levels`. Wavefunctions are squared by default, showing the probabilities; @@ -141,7 +140,7 @@ def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=Fals data = deepcopy(system) eigenvectors = data.eigenvectors - title = data.comment + title = title if title else (data.comment if data.comment else 'System wavefunction') fig, ax1 = plt.subplots() plt.title(title) ax1.set_xlabel('Angle / radians') diff --git a/docs/aton.html b/docs/aton.html index 474a275..fd784f3 100644 --- a/docs/aton.html +++ b/docs/aton.html @@ -98,7 +98,7 @@

Submodules

- + built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdoc 10 11""" 12 -13__version__ = 'v0.0.22' +13__version__ = 'v0.0.23' diff --git a/docs/aton/interface.html b/docs/aton/interface.html index cb39703..627b925 100644 --- a/docs/aton/interface.html +++ b/docs/aton/interface.html @@ -86,7 +86,7 @@

Submodules

- + built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocSubmodules -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocSubmodules -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocIndex 28def potential(system, title:str=None) -> None: 29 """Plot the potential values of a `system` (System object, or list of systems).""" 30 system = systems.as_list(system) - 31 title_str = title if title is not None else 'Rotational potential energy' - 32 if not title and system[0].comment and not system[-1].comment: - 33 title_str = system[0].comment - 34 - 35 plt.figure() - 36 plt.title(title_str) - 37 plt.xlabel('Angle / rad') - 38 plt.ylabel('Potential energy / meV') - 39 plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$']) - 40 - 41 for i in system: - 42 plt.plot(i.grid, i.potential_values, marker='', linestyle='-', label=i.comment) - 43 - 44 if all(s.comment for s in system): - 45 plt.legend() - 46 - 47 plt.show() - 48 - 49 - 50def energies(data) -> None: - 51 """Plot the eigenvalues of `data` (System or a list of System objects).""" - 52 if isinstance(data, System): - 53 var = [data] - 54 else: # Should be a list - 55 systems.as_list(data) - 56 var = data - 57 - 58 V_colors = ['C0'] #... - 59 E_colors = ['red', 'purple', 'grey'] # To extend... - 60 E_linestyles = ['--', ':', '-.'] - 61 edgecolors = ['tomato', 'purple', 'grey'] - 62 - 63 V_linestyle = '-' - 64 title = var[0].comment if var[0].comment else 'Energy eigenvalues' - 65 ylabel_text = f'Energy / meV' - 66 xlabel_text = 'Angle / radians' - 67 - 68 plt.figure(figsize=(10, 6)) - 69 plt.xlabel(xlabel_text) - 70 plt.ylabel(ylabel_text) - 71 plt.title(title) - 72 plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$']) - 73 - 74 unique_potentials = [] - 75 unique_groups = [] - 76 for i, system in enumerate(var): - 77 V_color = V_colors[i % len(V_colors)] - 78 E_color = E_colors[i % len(E_colors)] - 79 E_linestyle = E_linestyles[i % len(E_linestyles)] - 80 edgecolor = edgecolors[i % len(edgecolors)] - 81 - 82 # Plot potential energy if it is unique - 83 if not any(np.array_equal(system.potential_values, value) for value in unique_potentials): - 84 unique_potentials.append(system.potential_values) - 85 plt.plot(system.grid, system.potential_values, color=V_color, linestyle=V_linestyle) - 86 - 87 # Plot eigenvalues - 88 if any(system.eigenvalues): - 89 text_offset = 3 * len(unique_groups) - 90 if system.group not in unique_groups: - 91 unique_groups.append(system.group) - 92 for j, energy in enumerate(system.eigenvalues): - 93 plt.axhline(y=energy, color=E_color, linestyle=E_linestyle) - 94 plt.text(j%3*1.0 + text_offset, energy, f'$E_{{{j}}}$ = {round(energy,4):.04f}', va='top', bbox=dict(edgecolor=edgecolor, boxstyle='round,pad=0.2', facecolor='white', alpha=0.8)) - 95 if len(systems.get_groups(var)) > 1: - 96 plt.plot([], [], color=E_color, label=f'{system.group} Energies') # Add to legend - 97 - 98 if len(systems.get_groups(var)) > 1: - 99 plt.subplots_adjust(right=0.85) -100 plt.legend(bbox_to_anchor=(1.1, 0.5), loc='center', fontsize='small') + 31 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') + 32 + 33 plt.figure() + 34 plt.title(title_str) + 35 plt.xlabel('Angle / rad') + 36 plt.ylabel('Potential energy / meV') + 37 plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$']) + 38 + 39 for i in system: + 40 plt.plot(i.grid, i.potential_values, marker='', linestyle='-', label=i.comment) + 41 + 42 if all(s.comment for s in system) and len(system) != 1: + 43 plt.legend() + 44 + 45 plt.show() + 46 + 47 + 48def energies(data, title:str=None) -> None: + 49 """Plot the eigenvalues of `data` (System or a list of System objects).""" + 50 if isinstance(data, System): + 51 var = [data] + 52 else: # Should be a list + 53 systems.as_list(data) + 54 var = data + 55 + 56 V_colors = ['C0'] #... + 57 E_colors = ['red', 'purple', 'grey'] # To extend... + 58 E_linestyles = ['--', ':', '-.'] + 59 edgecolors = ['tomato', 'purple', 'grey'] + 60 + 61 V_linestyle = '-' + 62 title = title if title else (var[0].comment if var[0].comment else 'Energy eigenvalues') + 63 ylabel_text = f'Energy / meV' + 64 xlabel_text = 'Angle / radians' + 65 + 66 plt.figure(figsize=(10, 6)) + 67 plt.xlabel(xlabel_text) + 68 plt.ylabel(ylabel_text) + 69 plt.title(title) + 70 plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$']) + 71 + 72 unique_potentials = [] + 73 unique_groups = [] + 74 for i, system in enumerate(var): + 75 V_color = V_colors[i % len(V_colors)] + 76 E_color = E_colors[i % len(E_colors)] + 77 E_linestyle = E_linestyles[i % len(E_linestyles)] + 78 edgecolor = edgecolors[i % len(edgecolors)] + 79 + 80 # Plot potential energy if it is unique + 81 if not any(np.array_equal(system.potential_values, value) for value in unique_potentials): + 82 unique_potentials.append(system.potential_values) + 83 plt.plot(system.grid, system.potential_values, color=V_color, linestyle=V_linestyle) + 84 + 85 # Plot eigenvalues + 86 if any(system.eigenvalues): + 87 text_offset = 3 * len(unique_groups) + 88 if system.group not in unique_groups: + 89 unique_groups.append(system.group) + 90 for j, energy in enumerate(system.eigenvalues): + 91 plt.axhline(y=energy, color=E_color, linestyle=E_linestyle) + 92 plt.text(j%3*1.0 + text_offset, energy, f'$E_{{{j}}}$ = {round(energy,4):.04f}', va='top', bbox=dict(edgecolor=edgecolor, boxstyle='round,pad=0.2', facecolor='white', alpha=0.8)) + 93 if len(systems.get_groups(var)) > 1: + 94 plt.plot([], [], color=E_color, label=f'{system.group} Energies') # Add to legend + 95 + 96 if len(systems.get_groups(var)) > 1: + 97 plt.subplots_adjust(right=0.85) + 98 plt.legend(bbox_to_anchor=(1.1, 0.5), loc='center', fontsize='small') + 99 +100 plt.show() 101 -102 plt.show() -103 -104 -105def reduced_energies(data:list) -> None: -106 """Plots the reduced energy of the system E/B vs the reduced potential energy V/B. -107 -108 Takes a `data` list of System objects as input. -109 """ -110 systems.as_list(data) -111 number_of_levels = data[0].E_levels -112 x = [] -113 for system in data: -114 x.append(system.potential_max_B) -115 for i in range(number_of_levels): -116 y = [] -117 for system in data: -118 y.append(system.eigenvalues_B[i]) -119 plt.plot(x, y, marker='', linestyle='-') -120 plt.xlabel('V$_{B}$ / B') -121 plt.ylabel('E / B') -122 plt.title(data[0].comment) -123 plt.show() +102 +103def reduced_energies(data:list, title:str=None) -> None: +104 """Plots the reduced energy of the system E/B vs the reduced potential energy V/B. +105 +106 Takes a `data` list of System objects as input. +107 """ +108 systems.as_list(data) +109 title = title if title else (data[0].comment if data[0].comment else 'Reduced energies') +110 number_of_levels = data[0].E_levels +111 x = [] +112 for system in data: +113 x.append(system.potential_max_B) +114 for i in range(number_of_levels): +115 y = [] +116 for system in data: +117 y.append(system.eigenvalues_B[i]) +118 plt.plot(x, y, marker='', linestyle='-') +119 plt.xlabel('V$_{B}$ / B') +120 plt.ylabel('E / B') +121 plt.title(title) +122 plt.show() +123 124 -125 -126def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=False): -127 """Plot the wavefunction of a `system` for the specified `levels`. -128 -129 Wavefunctions are squared by default, showing the probabilities; -130 To show the actual wavefunctions, set `square = False`. -131 -132 `levels` can be a list of indexes, or the number of levels to plot. -133 -134 Specific wavefunctions can be overlapped with `overlap` as a list with the target indexes. -135 The `overlap` value can also be the max number of wavefunctions to add. -136 All found wavefunctions can be added together with `overlap = True`; -137 but note that this overlap is limited by the number of System.E_levels, -138 that must be specified before solving the system. -139 Setting `overlap` will ignore the `levels` argument. -140 """ -141 data = deepcopy(system) -142 eigenvectors = data.eigenvectors -143 -144 title = data.comment -145 fig, ax1 = plt.subplots() -146 plt.title(title) -147 ax1.set_xlabel('Angle / radians') -148 ax1.set_ylabel('Potential / meV') -149 ax1.set_xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$']) -150 ax1.plot(data.grid, data.potential_values, color='blue', linestyle='-') -151 ax2 = ax1.twinx() -152 ax2.set_yticks([]) -153 ax2.set_ylabel('Squared wavefunction' if square else 'Wavefunction') -154 -155 # Set levels list -156 if isinstance(levels, int) or isinstance(levels, float): -157 levels = [x for x in range(int(levels))] -158 if not isinstance(levels, list): -159 raise ValueError('levels must be an int or a list of ints') -160 # Set overlap if requested -161 if overlap == True and isinstance(overlap, bool): -162 eigenvectors = [np.sum(eigenvectors, axis=0)] -163 levels = [0] -164 show_legend = False -165 elif overlap is not False and (isinstance(overlap, int) or isinstance(overlap, float)): -166 max_int = int(overlap) -167 eigenvectors = [np.sum(eigenvectors[:max_int], axis=0)] -168 levels = [0] -169 show_legend = False -170 elif isinstance(overlap, list): -171 eigenvectors = [np.sum([eigenvectors[i] for i in overlap], axis=0)] -172 levels = [0] -173 show_legend = False -174 else: -175 show_legend = True -176 # Square values if so -177 if square: -178 eigenvectors = [vec**2 for vec in eigenvectors] -179 # Plot the wavefunction -180 for i in levels: -181 ax2.plot(data.grid, eigenvectors[i], linestyle='--', label=f'{i}') -182 if show_legend: -183 fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small', title='Index') -184 -185 plt.show() +125def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=False, title:str=None): +126 """Plot the wavefunction of a `system` for the specified `levels`. +127 +128 Wavefunctions are squared by default, showing the probabilities; +129 To show the actual wavefunctions, set `square = False`. +130 +131 `levels` can be a list of indexes, or the number of levels to plot. +132 +133 Specific wavefunctions can be overlapped with `overlap` as a list with the target indexes. +134 The `overlap` value can also be the max number of wavefunctions to add. +135 All found wavefunctions can be added together with `overlap = True`; +136 but note that this overlap is limited by the number of System.E_levels, +137 that must be specified before solving the system. +138 Setting `overlap` will ignore the `levels` argument. +139 """ +140 data = deepcopy(system) +141 eigenvectors = data.eigenvectors +142 +143 title = title if title else (data.comment if data.comment else 'System wavefunction') +144 fig, ax1 = plt.subplots() +145 plt.title(title) +146 ax1.set_xlabel('Angle / radians') +147 ax1.set_ylabel('Potential / meV') +148 ax1.set_xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$']) +149 ax1.plot(data.grid, data.potential_values, color='blue', linestyle='-') +150 ax2 = ax1.twinx() +151 ax2.set_yticks([]) +152 ax2.set_ylabel('Squared wavefunction' if square else 'Wavefunction') +153 +154 # Set levels list +155 if isinstance(levels, int) or isinstance(levels, float): +156 levels = [x for x in range(int(levels))] +157 if not isinstance(levels, list): +158 raise ValueError('levels must be an int or a list of ints') +159 # Set overlap if requested +160 if overlap == True and isinstance(overlap, bool): +161 eigenvectors = [np.sum(eigenvectors, axis=0)] +162 levels = [0] +163 show_legend = False +164 elif overlap is not False and (isinstance(overlap, int) or isinstance(overlap, float)): +165 max_int = int(overlap) +166 eigenvectors = [np.sum(eigenvectors[:max_int], axis=0)] +167 levels = [0] +168 show_legend = False +169 elif isinstance(overlap, list): +170 eigenvectors = [np.sum([eigenvectors[i] for i in overlap], axis=0)] +171 levels = [0] +172 show_legend = False +173 else: +174 show_legend = True +175 # Square values if so +176 if square: +177 eigenvectors = [vec**2 for vec in eigenvectors] +178 # Plot the wavefunction +179 for i in levels: +180 ax2.plot(data.grid, eigenvectors[i], linestyle='--', label=f'{i}') +181 if show_legend: +182 fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small', title='Index') +183 +184 plt.show() +185 186 -187 -188def convergence(data:list) -> None: -189 """Plot the energy convergence of a `data` list of Systems as a function of the gridsize.""" -190 systems.as_list(data) -191 gridsizes = [system.gridsize for system in data] -192 runtimes = [system.runtime for system in data] -193 deviations = [] # List of lists, containing all eigenvalue deviations for every system -194 E_levels = data[0].E_levels -195 for system in data: -196 deviation_list = [] -197 for i, eigenvalue in enumerate(system.eigenvalues): -198 ideal_E = systems.get_ideal_E(i) -199 deviation = abs(ideal_E - eigenvalue) -200 deviation_list.append(deviation) -201 deviation_list = deviation_list[1:] # Remove ground state -202 deviations.append(deviation_list) -203 # Plotting -204 fig, ax1 = plt.subplots() -205 ax1.set_xlabel('Grid size') -206 ax1.set_ylabel('Error / meV') -207 ax1.set_xscale('log') -208 ax1.set_yscale('log') -209 ax2 = ax1.twinx() -210 ax2.set_ylabel('Runtime / s') -211 ax2.set_yscale('log') -212 ax2.plot(gridsizes, runtimes, color='tab:grey', label='Runtime', linestyle='--') -213 colors = plt.cm.viridis(np.linspace(0, 1, E_levels-1)) -214 for i in range(E_levels-1): -215 if i % 2 == 0: # Ignore even numbers, since those levels are degenerated. -216 continue -217 ax1.plot(gridsizes, [dev[i] for dev in deviations], label=f'$E_{{{int((i+1)/2)}}}$', color=colors[i]) -218 fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small') -219 plt.title(data[0].comment if data[0].comment else 'Energy convergence vs grid size') -220 plt.show() +187def convergence(data:list) -> None: +188 """Plot the energy convergence of a `data` list of Systems as a function of the gridsize.""" +189 systems.as_list(data) +190 gridsizes = [system.gridsize for system in data] +191 runtimes = [system.runtime for system in data] +192 deviations = [] # List of lists, containing all eigenvalue deviations for every system +193 E_levels = data[0].E_levels +194 for system in data: +195 deviation_list = [] +196 for i, eigenvalue in enumerate(system.eigenvalues): +197 ideal_E = systems.get_ideal_E(i) +198 deviation = abs(ideal_E - eigenvalue) +199 deviation_list.append(deviation) +200 deviation_list = deviation_list[1:] # Remove ground state +201 deviations.append(deviation_list) +202 # Plotting +203 fig, ax1 = plt.subplots() +204 ax1.set_xlabel('Grid size') +205 ax1.set_ylabel('Error / meV') +206 ax1.set_xscale('log') +207 ax1.set_yscale('log') +208 ax2 = ax1.twinx() +209 ax2.set_ylabel('Runtime / s') +210 ax2.set_yscale('log') +211 ax2.plot(gridsizes, runtimes, color='tab:grey', label='Runtime', linestyle='--') +212 colors = plt.cm.viridis(np.linspace(0, 1, E_levels-1)) +213 for i in range(E_levels-1): +214 if i % 2 == 0: # Ignore even numbers, since those levels are degenerated. +215 continue +216 ax1.plot(gridsizes, [dev[i] for dev in deviations], label=f'$E_{{{int((i+1)/2)}}}$', color=colors[i]) +217 fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small') +218 plt.title(data[0].comment if data[0].comment else 'Energy convergence vs grid size') +219 plt.show() @@ -388,23 +387,21 @@

Index

29def potential(system, title:str=None) -> None:
 30    """Plot the potential values of a `system` (System object, or list of systems)."""
 31    system = systems.as_list(system)
-32    title_str = title if title is not None else 'Rotational potential energy'
-33    if not title and system[0].comment and not system[-1].comment: 
-34        title_str = system[0].comment
-35
-36    plt.figure()
-37    plt.title(title_str)
-38    plt.xlabel('Angle / rad')
-39    plt.ylabel('Potential energy / meV')
-40    plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
-41    
-42    for i in system:
-43        plt.plot(i.grid, i.potential_values, marker='', linestyle='-', label=i.comment)
-44    
-45    if all(s.comment for s in system):
-46        plt.legend()
-47    
-48    plt.show()
+32    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')
+33
+34    plt.figure()
+35    plt.title(title_str)
+36    plt.xlabel('Angle / rad')
+37    plt.ylabel('Potential energy / meV')
+38    plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
+39    
+40    for i in system:
+41        plt.plot(i.grid, i.potential_values, marker='', linestyle='-', label=i.comment)
+42    
+43    if all(s.comment for s in system) and len(system) != 1:
+44        plt.legend()
+45    
+46    plt.show()
 
@@ -418,65 +415,65 @@

Index

def - energies(data) -> None: + energies(data, title: str = None) -> None:
-
 51def energies(data) -> None:
- 52    """Plot the eigenvalues of `data` (System or a list of System objects)."""
- 53    if isinstance(data, System):
- 54        var = [data]
- 55    else:  # Should be a list
- 56        systems.as_list(data)
- 57        var = data
- 58
- 59    V_colors = ['C0'] #...
- 60    E_colors = ['red', 'purple', 'grey']  # To extend...
- 61    E_linestyles = ['--', ':', '-.']
- 62    edgecolors = ['tomato', 'purple', 'grey']
- 63
- 64    V_linestyle = '-'
- 65    title = var[0].comment if var[0].comment else 'Energy eigenvalues'
- 66    ylabel_text = f'Energy / meV'
- 67    xlabel_text = 'Angle / radians'
- 68
- 69    plt.figure(figsize=(10, 6))
- 70    plt.xlabel(xlabel_text)
- 71    plt.ylabel(ylabel_text)
- 72    plt.title(title)
- 73    plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
- 74
- 75    unique_potentials = []
- 76    unique_groups = []
- 77    for i, system in enumerate(var):
- 78        V_color = V_colors[i % len(V_colors)]
- 79        E_color = E_colors[i % len(E_colors)]
- 80        E_linestyle = E_linestyles[i % len(E_linestyles)]
- 81        edgecolor = edgecolors[i % len(edgecolors)]
- 82
- 83        # Plot potential energy if it is unique
- 84        if not any(np.array_equal(system.potential_values, value) for value in unique_potentials):
- 85            unique_potentials.append(system.potential_values)
- 86            plt.plot(system.grid, system.potential_values, color=V_color, linestyle=V_linestyle)
- 87
- 88        # Plot eigenvalues
- 89        if any(system.eigenvalues):
- 90            text_offset = 3 * len(unique_groups)
- 91            if system.group not in unique_groups:
- 92                unique_groups.append(system.group)
- 93            for j, energy in enumerate(system.eigenvalues):
- 94                plt.axhline(y=energy, color=E_color, linestyle=E_linestyle)
- 95                plt.text(j%3*1.0 + text_offset, energy, f'$E_{{{j}}}$ = {round(energy,4):.04f}', va='top', bbox=dict(edgecolor=edgecolor, boxstyle='round,pad=0.2', facecolor='white', alpha=0.8))
- 96            if len(systems.get_groups(var)) > 1:
- 97                plt.plot([], [], color=E_color, label=f'{system.group} Energies')  # Add to legend
- 98
- 99    if len(systems.get_groups(var)) > 1:
-100        plt.subplots_adjust(right=0.85)
-101        plt.legend(bbox_to_anchor=(1.1, 0.5), loc='center', fontsize='small')
-102
-103    plt.show()
+            
 49def energies(data, title:str=None) -> None:
+ 50    """Plot the eigenvalues of `data` (System or a list of System objects)."""
+ 51    if isinstance(data, System):
+ 52        var = [data]
+ 53    else:  # Should be a list
+ 54        systems.as_list(data)
+ 55        var = data
+ 56
+ 57    V_colors = ['C0'] #...
+ 58    E_colors = ['red', 'purple', 'grey']  # To extend...
+ 59    E_linestyles = ['--', ':', '-.']
+ 60    edgecolors = ['tomato', 'purple', 'grey']
+ 61
+ 62    V_linestyle = '-'
+ 63    title = title if title else (var[0].comment if var[0].comment else 'Energy eigenvalues')
+ 64    ylabel_text = f'Energy / meV'
+ 65    xlabel_text = 'Angle / radians'
+ 66
+ 67    plt.figure(figsize=(10, 6))
+ 68    plt.xlabel(xlabel_text)
+ 69    plt.ylabel(ylabel_text)
+ 70    plt.title(title)
+ 71    plt.xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
+ 72
+ 73    unique_potentials = []
+ 74    unique_groups = []
+ 75    for i, system in enumerate(var):
+ 76        V_color = V_colors[i % len(V_colors)]
+ 77        E_color = E_colors[i % len(E_colors)]
+ 78        E_linestyle = E_linestyles[i % len(E_linestyles)]
+ 79        edgecolor = edgecolors[i % len(edgecolors)]
+ 80
+ 81        # Plot potential energy if it is unique
+ 82        if not any(np.array_equal(system.potential_values, value) for value in unique_potentials):
+ 83            unique_potentials.append(system.potential_values)
+ 84            plt.plot(system.grid, system.potential_values, color=V_color, linestyle=V_linestyle)
+ 85
+ 86        # Plot eigenvalues
+ 87        if any(system.eigenvalues):
+ 88            text_offset = 3 * len(unique_groups)
+ 89            if system.group not in unique_groups:
+ 90                unique_groups.append(system.group)
+ 91            for j, energy in enumerate(system.eigenvalues):
+ 92                plt.axhline(y=energy, color=E_color, linestyle=E_linestyle)
+ 93                plt.text(j%3*1.0 + text_offset, energy, f'$E_{{{j}}}$ = {round(energy,4):.04f}', va='top', bbox=dict(edgecolor=edgecolor, boxstyle='round,pad=0.2', facecolor='white', alpha=0.8))
+ 94            if len(systems.get_groups(var)) > 1:
+ 95                plt.plot([], [], color=E_color, label=f'{system.group} Energies')  # Add to legend
+ 96
+ 97    if len(systems.get_groups(var)) > 1:
+ 98        plt.subplots_adjust(right=0.85)
+ 99        plt.legend(bbox_to_anchor=(1.1, 0.5), loc='center', fontsize='small')
+100
+101    plt.show()
 
@@ -490,31 +487,32 @@

Index

def - reduced_energies(data: list) -> None: + reduced_energies(data: list, title: str = None) -> None:
-
106def reduced_energies(data:list) -> None:
-107    """Plots the reduced energy of the system E/B vs the reduced potential energy V/B.
-108
-109    Takes a `data` list of System objects as input.
-110    """
-111    systems.as_list(data)
-112    number_of_levels = data[0].E_levels
-113    x = []
-114    for system in data:
-115        x.append(system.potential_max_B)
-116    for i in range(number_of_levels):
-117        y = []
-118        for system in data:
-119            y.append(system.eigenvalues_B[i])
-120        plt.plot(x, y, marker='', linestyle='-')
-121    plt.xlabel('V$_{B}$ / B')
-122    plt.ylabel('E / B')
-123    plt.title(data[0].comment)
-124    plt.show()
+            
104def reduced_energies(data:list, title:str=None) -> None:
+105    """Plots the reduced energy of the system E/B vs the reduced potential energy V/B.
+106
+107    Takes a `data` list of System objects as input.
+108    """
+109    systems.as_list(data)
+110    title = title if title else (data[0].comment if data[0].comment else 'Reduced energies')
+111    number_of_levels = data[0].E_levels
+112    x = []
+113    for system in data:
+114        x.append(system.potential_max_B)
+115    for i in range(number_of_levels):
+116        y = []
+117        for system in data:
+118            y.append(system.eigenvalues_B[i])
+119        plt.plot(x, y, marker='', linestyle='-')
+120    plt.xlabel('V$_{B}$ / B')
+121    plt.ylabel('E / B')
+122    plt.title(title)
+123    plt.show()
 
@@ -530,72 +528,72 @@

Index

def - wavefunction( system: aton.qrotor.system.System, square: bool = True, levels=[0, 1, 2], overlap=False): + wavefunction( system: aton.qrotor.system.System, square: bool = True, levels=[0, 1, 2], overlap=False, title: str = None):
-
127def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=False):
-128    """Plot the wavefunction of a `system` for the specified `levels`.
-129
-130    Wavefunctions are squared by default, showing the probabilities;
-131    To show the actual wavefunctions, set `square = False`.
-132
-133    `levels` can be a list of indexes, or the number of levels to plot.
-134
-135    Specific wavefunctions can be overlapped with `overlap` as a list with the target indexes.
-136    The `overlap` value can also be the max number of wavefunctions to add.
-137    All found wavefunctions can be added together with `overlap = True`;
-138    but note that this overlap is limited by the number of System.E_levels,
-139    that must be specified before solving the system.
-140    Setting `overlap` will ignore the `levels` argument.
-141    """
-142    data = deepcopy(system)
-143    eigenvectors = data.eigenvectors
-144
-145    title = data.comment
-146    fig, ax1 = plt.subplots()
-147    plt.title(title)
-148    ax1.set_xlabel('Angle / radians')
-149    ax1.set_ylabel('Potential / meV')
-150    ax1.set_xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
-151    ax1.plot(data.grid, data.potential_values, color='blue', linestyle='-')
-152    ax2 = ax1.twinx()
-153    ax2.set_yticks([])
-154    ax2.set_ylabel('Squared wavefunction' if square else 'Wavefunction')
-155
-156    # Set levels list
-157    if isinstance(levels, int) or isinstance(levels, float):
-158        levels = [x for x in range(int(levels))]
-159    if not isinstance(levels, list):
-160        raise ValueError('levels must be an int or a list of ints')
-161    # Set overlap if requested
-162    if overlap == True and isinstance(overlap, bool):
-163        eigenvectors = [np.sum(eigenvectors, axis=0)]
-164        levels = [0]
-165        show_legend = False
-166    elif overlap is not False and (isinstance(overlap, int) or isinstance(overlap, float)):
-167        max_int = int(overlap)
-168        eigenvectors = [np.sum(eigenvectors[:max_int], axis=0)]
-169        levels = [0]
-170        show_legend = False
-171    elif isinstance(overlap, list):
-172        eigenvectors = [np.sum([eigenvectors[i] for i in overlap], axis=0)]
-173        levels = [0]
-174        show_legend = False
-175    else:
-176        show_legend = True
-177    # Square values if so
-178    if square:
-179        eigenvectors = [vec**2 for vec in eigenvectors]
-180    # Plot the wavefunction
-181    for i in levels:
-182        ax2.plot(data.grid, eigenvectors[i], linestyle='--', label=f'{i}')
-183    if show_legend:
-184        fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small', title='Index')
-185
-186    plt.show()
+            
126def wavefunction(system:System, square:bool=True, levels=[0, 1, 2], overlap=False, title:str=None):
+127    """Plot the wavefunction of a `system` for the specified `levels`.
+128
+129    Wavefunctions are squared by default, showing the probabilities;
+130    To show the actual wavefunctions, set `square = False`.
+131
+132    `levels` can be a list of indexes, or the number of levels to plot.
+133
+134    Specific wavefunctions can be overlapped with `overlap` as a list with the target indexes.
+135    The `overlap` value can also be the max number of wavefunctions to add.
+136    All found wavefunctions can be added together with `overlap = True`;
+137    but note that this overlap is limited by the number of System.E_levels,
+138    that must be specified before solving the system.
+139    Setting `overlap` will ignore the `levels` argument.
+140    """
+141    data = deepcopy(system)
+142    eigenvectors = data.eigenvectors
+143
+144    title = title if title else (data.comment if data.comment else 'System wavefunction')
+145    fig, ax1 = plt.subplots()
+146    plt.title(title)
+147    ax1.set_xlabel('Angle / radians')
+148    ax1.set_ylabel('Potential / meV')
+149    ax1.set_xticks([0, np.pi/2, np.pi, 3*np.pi/2, 2*np.pi], ['0', r'$\frac{\pi}{2}$', r'$\pi$', r'$\frac{3\pi}{2}$', r'$2\pi$'])
+150    ax1.plot(data.grid, data.potential_values, color='blue', linestyle='-')
+151    ax2 = ax1.twinx()
+152    ax2.set_yticks([])
+153    ax2.set_ylabel('Squared wavefunction' if square else 'Wavefunction')
+154
+155    # Set levels list
+156    if isinstance(levels, int) or isinstance(levels, float):
+157        levels = [x for x in range(int(levels))]
+158    if not isinstance(levels, list):
+159        raise ValueError('levels must be an int or a list of ints')
+160    # Set overlap if requested
+161    if overlap == True and isinstance(overlap, bool):
+162        eigenvectors = [np.sum(eigenvectors, axis=0)]
+163        levels = [0]
+164        show_legend = False
+165    elif overlap is not False and (isinstance(overlap, int) or isinstance(overlap, float)):
+166        max_int = int(overlap)
+167        eigenvectors = [np.sum(eigenvectors[:max_int], axis=0)]
+168        levels = [0]
+169        show_legend = False
+170    elif isinstance(overlap, list):
+171        eigenvectors = [np.sum([eigenvectors[i] for i in overlap], axis=0)]
+172        levels = [0]
+173        show_legend = False
+174    else:
+175        show_legend = True
+176    # Square values if so
+177    if square:
+178        eigenvectors = [vec**2 for vec in eigenvectors]
+179    # Plot the wavefunction
+180    for i in levels:
+181        ax2.plot(data.grid, eigenvectors[i], linestyle='--', label=f'{i}')
+182    if show_legend:
+183        fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small', title='Index')
+184
+185    plt.show()
 
@@ -627,39 +625,39 @@

Index

-
189def convergence(data:list) -> None:
-190    """Plot the energy convergence of a `data` list of Systems as a function of the gridsize."""
-191    systems.as_list(data)
-192    gridsizes = [system.gridsize for system in data]
-193    runtimes = [system.runtime for system in data]
-194    deviations = []  # List of lists, containing all eigenvalue deviations for every system
-195    E_levels = data[0].E_levels
-196    for system in data:
-197        deviation_list = []
-198        for i, eigenvalue in enumerate(system.eigenvalues):
-199            ideal_E = systems.get_ideal_E(i)
-200            deviation = abs(ideal_E - eigenvalue)
-201            deviation_list.append(deviation)
-202        deviation_list = deviation_list[1:]  # Remove ground state
-203        deviations.append(deviation_list)
-204    # Plotting
-205    fig, ax1 = plt.subplots()
-206    ax1.set_xlabel('Grid size')
-207    ax1.set_ylabel('Error / meV')
-208    ax1.set_xscale('log')
-209    ax1.set_yscale('log')
-210    ax2 = ax1.twinx()
-211    ax2.set_ylabel('Runtime / s')
-212    ax2.set_yscale('log')
-213    ax2.plot(gridsizes, runtimes, color='tab:grey', label='Runtime', linestyle='--')
-214    colors = plt.cm.viridis(np.linspace(0, 1, E_levels-1))
-215    for i in range(E_levels-1):
-216        if i % 2 == 0:  # Ignore even numbers, since those levels are degenerated.
-217            continue
-218        ax1.plot(gridsizes, [dev[i] for dev in deviations], label=f'$E_{{{int((i+1)/2)}}}$', color=colors[i])
-219    fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small')
-220    plt.title(data[0].comment if data[0].comment else 'Energy convergence vs grid size')
-221    plt.show()
+            
188def convergence(data:list) -> None:
+189    """Plot the energy convergence of a `data` list of Systems as a function of the gridsize."""
+190    systems.as_list(data)
+191    gridsizes = [system.gridsize for system in data]
+192    runtimes = [system.runtime for system in data]
+193    deviations = []  # List of lists, containing all eigenvalue deviations for every system
+194    E_levels = data[0].E_levels
+195    for system in data:
+196        deviation_list = []
+197        for i, eigenvalue in enumerate(system.eigenvalues):
+198            ideal_E = systems.get_ideal_E(i)
+199            deviation = abs(ideal_E - eigenvalue)
+200            deviation_list.append(deviation)
+201        deviation_list = deviation_list[1:]  # Remove ground state
+202        deviations.append(deviation_list)
+203    # Plotting
+204    fig, ax1 = plt.subplots()
+205    ax1.set_xlabel('Grid size')
+206    ax1.set_ylabel('Error / meV')
+207    ax1.set_xscale('log')
+208    ax1.set_yscale('log')
+209    ax2 = ax1.twinx()
+210    ax2.set_ylabel('Runtime / s')
+211    ax2.set_yscale('log')
+212    ax2.plot(gridsizes, runtimes, color='tab:grey', label='Runtime', linestyle='--')
+213    colors = plt.cm.viridis(np.linspace(0, 1, E_levels-1))
+214    for i in range(E_levels-1):
+215        if i % 2 == 0:  # Ignore even numbers, since those levels are degenerated.
+216            continue
+217        ax1.plot(gridsizes, [dev[i] for dev in deviations], label=f'$E_{{{int((i+1)/2)}}}$', color=colors[i])
+218    fig.legend(loc='upper right', bbox_to_anchor=(0.9, 0.88), fontsize='small')
+219    plt.title(data[0].comment if data[0].comment else 'Energy convergence vs grid size')
+220    plt.show()
 
diff --git a/docs/aton/qrotor/potential.html b/docs/aton/qrotor/potential.html index 9c6ec1b..623396d 100644 --- a/docs/aton/qrotor/potential.html +++ b/docs/aton/qrotor/potential.html @@ -104,7 +104,7 @@

API Documentation

-
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocSubmodules -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocSubmodules -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocSubmodules -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdocAPI Documentation -
ATON v0.0.22 documentation
+
ATON v0.0.23 documentation
built with pdoco;o++){for(var r=e[o],s=0;i>s&&(r=this._queue[s](r,o,e),void 0!==r&&null!==r);s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&this.documentStore.isDocStored()!==!1&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n?!0:n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));o.forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t?!0:t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t},t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;;){if(n>o-1||i>r-1)break;s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++)}return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o

\n\n

Welcome to ATON

\n\n

The Ab-iniTiO & Neutron research toolbox,\nor ATON,\nprovides powerful and comprehensive tools\nfor cutting-edge materials research,\nfocused on (but not limited to) neutron science.

\n\n

Just like its ancient Egyptian deity counterpart,\nthis all-in-one Python package contains a range of tools\nfrom INS spectra analysis to ab-initio interfaces\nfor Quantum ESPRESSO,\nPhonopy and\nCASTEP.\nConversion factors and universal constants from the 2022 CODATA\nRecommended Values of the Fundamental Physical Constants are also included.

\n\n

The source code is available on GitHub.

\n\n
\n\n

Installation

\n\n

As always, it is recommended to install your packages in a virtual environment:

\n\n
\n
python3 -m venv .venv\nsource .venv/bin/activate\n
\n
\n\n

With pip

\n\n

The fastest way to install ATON is through pip:

\n\n
\n
pip install aton\n
\n
\n\n

To upgrade to a newer version,

\n\n
\n
pip install aton -U\n
\n
\n\n

From source

\n\n

Optionally, you can install ATON from the GitHub repository.

\n\n

First install the dependencies:

\n\n
\n
pip install pandas numpy scipy matplotlib\n
\n
\n\n

Then clone the repository or download the latest stable release as a ZIP, unzip it, and run inside the ATON/ directory:

\n\n
\n
pip install .\n
\n
\n\n
\n\n

Documentation

\n\n

The full ATON documentation is available online.
\nAn offline version of the documentation is found at docs/aton.html.
\nCode examples are included in the examples/ folder.

\n\n

Interfaces for ab-initio codes

\n\n

The interface module contains Python interfaces for several ab-initio codes.\nThese are powered by the aton.txt module and can be easily extended.

\n\n

aton.interface

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.interface.qeInterface for Quantum ESPRESSO's pw.x module
aton.interface.phonopyInterface for Phonopy calculations
aton.interface.castepInterface for CASTEP calculations
aton.interface.slurmBatch jobs via Slurm
\n\n

Physico-chemical constants

\n\n

The phys module contains physico-chemical definitions.\nValues are accessed directly as phys.value or phys.function().

\n\n

aton.phys

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.phys.unitsPhysical constants and conversion factors
aton.phys.atomsMegadictionary with data for all chemical elements
aton.phys.functionsFunctions to sort and analyse element data
\n\n

Quantum rotations

\n\n

The QRotor module is used to study quantum rotations,\nsuch as those of methyl and amine groups.

\n\n

aton.qrotor

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.qrotor.rotateRotate specific atoms from structural files
aton.qrotor.constantsBond lengths and inertias
aton.qrotor.systemDefinition of the quantum System object
aton.qrotor.systemsFunctions to manage several System objects
aton.qrotor.potentialPotential definitions and loading functions
aton.qrotor.solveSolve rotation eigenvalues and eigenvectors
aton.qrotor.plotPlotting functions
\n\n

Spectra analysis

\n\n

The spx module includes tools for spectral analysis from\nInelastic Neutron Scattering, Raman, Infrared, etc.

\n\n

aton.spx

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.spx.classesClass definitions for the spectra module
aton.spx.fitSpectra fitting functions
aton.spx.normalizeSpectra normalization
aton.spx.plotPlotting
aton.spx.deuteriumDeuteration estimations via INS
aton.spx.samplesSample materials for testing
\n\n

General text edition

\n\n

The txt module handles text files.\nIt powers more complex subpackages,\nsuch as aton.interface.

\n\n

aton.txt

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.txt.findSearch for specific content in text files
aton.txt.editManipulate text files
aton.txt.extractExtract data from raw text strings
\n\n

System tools

\n\n

The st module contains System Tools for common system tasks across subpackages.

\n\n

aton.st

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.st.fileFile manipulation
aton.st.callRun bash scripts and related
aton.st.aliasUseful dictionaries for user input correction
\n\n
\n\n

Contributing

\n\n

If you are interested in opening an issue or a pull request, please feel free to do so on GitHub.
\nFor major changes, please get in touch first to discuss the details.

\n\n

Code style

\n\n

Please try to follow some general guidelines:

\n\n
    \n
  • Use a code style consistent with the rest of the project.
  • \n
  • Include docstrings to document new additions.
  • \n
  • Include automated tests for new features or modifications, see automated testing.
  • \n
  • Arrange function arguments by order of relevance. Most implemented functions follow something similar to function(file, key/s, value/s, optional).
  • \n
\n\n

Automated testing

\n\n

If you are modifying the source code, you should run the automated tests of the ATON/tests/ folder to check that everything works as intended.\nTo do so, first install PyTest in your environment,

\n\n
\n
pip install pytest\n
\n
\n\n

And then run PyTest inside the ATON/ directory,

\n\n
\n
pytest -vv\n
\n
\n\n

Compiling the documentation

\n\n

The documentation can be compiled automatically to docs/aton.html with Pdoc and ATON itself, by running:

\n\n
\n
python3 makedocs.py\n
\n
\n\n

This runs Pdoc, updating links and pictures, and using the custom theme CSS template from the css/ folder.

\n\n
\n\n

Citation

\n\n

ATON development started for the following paper, please cite if you use ATON in your work:
\nCryst. Growth Des. 2024, 24, 391\u2212404

\n\n

License

\n\n

Copyright (C) 2025 Pablo Gila-Herranz
\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.
\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\nSee the attached GNU Affero General Public License for more details.

\n"}, {"fullname": "aton.interface", "modulename": "aton.interface", "kind": "module", "doc": "

Ab-initio interfaces

\n\n

This module contains interfaces for several ab-initio calculation softwares.\nThese interfaces can be easily expanded with the aton.txt module.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.interface.qeInterface for Quantum ESPRESSO's pw.x module
aton.interface.phonopyInterface for Phonopy calculations
aton.interface.castepInterface for CASTEP calculations
aton.interface.slurmBatch jobs via Slurm
\n\n

Examples

\n\n

Quantum ESPRESSO

\n\n

To read the output from a Quantum ESPRESSO pw.x calculation,

\n\n
\n
from aton.interface import qe\n# Read to a dictionary\ncalculation = qe.read_out('relax.out')\ncalculation.keys()  # See the available values\n# Final energy from the calculation\nenergy = calculation['Energy']\n
\n
\n\n

To modify values from an input file,

\n\n
\n
from aton.interface import qe\n# Add a hydrogen atom to a specific position\nqe.add_atom('H  0.10  0.20  0.30')\n# Set the input ecutwfc value\nqe.set_value('relax.in', 'ecutwfc', 60.0)\n
\n
\n\n

Check the full aton.interface.qe API reference for more details.

\n\n

Phonopy

\n\n

To perform a phonon calculation from a relaxed structure via Quantum ESPRESSO,

\n\n
\n
from aton import interface\n# Create the supercell inputs\ninterface.phonopy.make_supercells(dimension='2 2 2')\n# Sbatch to a cluster\ninterface.slurm.sbatch('supercell-', 'template.slurm')\n
\n
\n\n

Check the full aton.interface.phonopy API reference for more details.

\n\n

CASTEP

\n\n

To read output values from a CASTEP calculation,

\n\n
\n
from aton.interface import castep\n# Read the output\noutput = castep.read_castep('calculation.castep')\n# Get the final energy\nenergy = output['Energy']\n
\n
\n\n

Check the full aton.interface.castep API reference for more details.

\n"}, {"fullname": "aton.interface.castep", "modulename": "aton.interface.castep", "kind": "module", "doc": "

Description

\n\n

Functions to work with CASTEP calculation files.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n
read_castep()Output reading
\n\n
\n"}, {"fullname": "aton.interface.castep.read_castep", "modulename": "aton.interface.castep", "qualname": "read_castep", "kind": "function", "doc": "

Reads a CASTEP output file, specified in filename.\nReturns a dictionary with the following keys:\n'Enthalpy' (LBFGS: Final Enthalpy, in kJ/mol),\n'Energy' (Total energy corrected for finite basis set, in eV),\n'Space group', 'Volume' (Angstrom^3), 'Density' (amu/Angstrom^3), 'Density_g' (g/cm^3),\n'A', 'B', 'C' (Angstroms), 'Alpha', 'Beta', 'Gamma' (Degrees).

\n\n

Note that these output keys start with a Capital letter.

\n", "signature": "(filename) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.phonopy", "modulename": "aton.interface.phonopy", "kind": "module", "doc": "

Description

\n\n

Functions to work with Phonopy calculations,\nalong with Quantum ESPRESSO.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n
make_supercells()Build supercell SCF inputs for phonon calculations
\n\n

Examples

\n\n

To create the supercells and run the phonon calculations\nfrom a folder with relax.in and relax.out files,\nusing a template.slurm file,

\n\n
\n
from aton import interface\ninterface.phonopy.make_supercells()\ninterface.slurm.sbatch('supercell-', 'scf.slurm')\n
\n
\n\n
\n"}, {"fullname": "aton.interface.phonopy.make_supercells", "modulename": "aton.interface.phonopy", "qualname": "make_supercells", "kind": "function", "doc": "

Creates the supercell inputs of a given dimension ('2 2 2' by default),\nfrom the relax_in and relax_out files in the folder\n('relax.in', 'relax.out' and CWD by default, respectively),\nneeded for the Phonopy calculations with Quantum ESPRESSO.

\n\n

If slurm_template is present,\nit checks it with aton.interface.slurm.check_template().

\n", "signature": "(\tdimension: str = '2 2 2',\trelax_in: str = 'relax.in',\trelax_out: str = 'relax.out',\tfolder: str = None,\tslurm_template: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe", "modulename": "aton.interface.qe", "kind": "module", "doc": "

Description

\n\n

Tools to work with the pw.x module from Quantum ESPRESSO.

\n\n

Index

\n\n

Input and output reading
\nread_in()
\nread_out()
\nread_dir()
\nread_dirs()

\n\n

Input file manipulation
\nset_value()
\nadd_atom()
\nscf_from_relax()

\n\n

Data extraction
\nget_atom()
\ncount_elements()
\nnormalize_card()
\nto_cartesian()
\nfrom_cartesian()

\n\n

Dicts with input file description
\npw_namelists
\npw_cards

\n\n
\n"}, {"fullname": "aton.interface.qe.read_in", "modulename": "aton.interface.qe", "qualname": "read_in", "kind": "function", "doc": "

Reads a Quantum ESPRESSO input filepath and returns the values as a dict.

\n\n

Dict keys are named after the corresponding variable.\nCARDS are returned as lists, and contain the\ntitle card + parameters in the first item.

\n", "signature": "(filepath) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.read_out", "modulename": "aton.interface.qe", "qualname": "read_out", "kind": "function", "doc": "

Reads a Quantum ESPRESSO output filepath, returns a dict with the output keys.

\n\n

The output keys are:\n'Energy' (Ry), 'Total force' (float), 'Total SCF correction' (float),\n'Runtime' (str), 'JOB DONE' (bool), 'BFGS converged' (bool), 'BFGS failed' (bool),\n'Maxiter reached' (bool), 'Error' (str), 'Success' (bool), 'CELL_PARAMETERS_out' (list of str), 'ATOMIC_POSITIONS_out' (list of str), 'Alat' (bohr), 'Volume' (a.u.^3), 'Density' (g/cm^3).

\n\n

Note that these output keys start with a Capital letter.

\n", "signature": "(filepath) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.read_dir", "modulename": "aton.interface.qe", "qualname": "read_dir", "kind": "function", "doc": "

Takes a folder from a QE calculation, returns a dict with input and output values.

\n\n

Input and output files are determined automatically,\nbut must be specified with in_str and out_str\nif more than one file ends with .in or .out.

\n", "signature": "(folder, in_str: str = '.in', out_str: str = '.out') -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.read_dirs", "modulename": "aton.interface.qe", "qualname": "read_dirs", "kind": "function", "doc": "

Reads recursively QE calculations from all the subfolders inside the given directory.

\n\n

Results are saved to CSV files inside the current directory.\nInput and output files are determined automatically, but must be specified with\nin_str and out_str if more than one file ends with .in or .out.

\n\n

To properly group the calculations per type, saving separated CSVs for each calculation type,\nyou can modify calc_splitter ('_' by default), calc_type_index (0) and calc_id_index (1).\nWith these default values, a subfolder named './CalculationType_CalculationID_AdditionalText/'\nwill be interpreted as follows:

\n\n
    \n
  • Calculation type: 'CalculationType' (The output CSV will be named after this)
  • \n
  • CalculationID: 'CalculationID' (Stored in the 'ID' column of the resulting dataframe)
  • \n
\n\n

If everything fails, the subfolder name will be used for the CSV file.

\n", "signature": "(\tdirectory,\tin_str: str = '.in',\tout_str: str = '.out',\tcalc_splitter='_',\tcalc_type_index=0,\tcalc_id_index=1) -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.set_value", "modulename": "aton.interface.qe", "qualname": "set_value", "kind": "function", "doc": "

Replace the value of a key parameter in an input filepath.

\n\n

Delete parameters with value=''.\nRemember to include the single quotes ' on values that use them.

\n\n

Updating 'ATOMIC_POSITIONS' updates 'nat' automatically,\nand updating 'ATOMIC_SPECIES' updates 'ntyp'.

\n\n

Optionally change indentation with indent, 2 spaces by default.

\n", "signature": "(filepath, key: str, value, indent: str = ' ') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.add_atom", "modulename": "aton.interface.qe", "qualname": "add_atom", "kind": "function", "doc": "

Adds an atom in a given filepath at a specified position.

\n\n

Position must be a string or a list, as follows:\n\"specie:str float float float\" or [specie:str, float, float, float].

\n\n

This method updates automatically other related values,\nsuch as 'ntyp' when updating ATOMIC_SPECIES, etc.

\n\n

Optionally change indentation with indent, 2 spaces by default.

\n", "signature": "(filepath, position, indent=' ') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.get_atom", "modulename": "aton.interface.qe", "qualname": "get_atom", "kind": "function", "doc": "

Takes the approximate position of an atom, and returns the full line from the filepath.

\n\n

It compares the atomic positions rounded up to the specified precision decimals.\nIf return_anyway = True, ignores errors and returns an empty string.

\n", "signature": "(\tfilepath: str,\tposition: list,\tprecision: int = 3,\treturn_anyway: bool = False) -> str:", "funcdef": "def"}, {"fullname": "aton.interface.qe.normalize_card", "modulename": "aton.interface.qe", "qualname": "normalize_card", "kind": "function", "doc": "

Take a matched card, and return it in a normalised format.

\n\n

Optionally change indentation with indent, 0 spaces by default.

\n", "signature": "(card: list, indent='') -> list:", "funcdef": "def"}, {"fullname": "aton.interface.qe.count_elements", "modulename": "aton.interface.qe", "qualname": "count_elements", "kind": "function", "doc": "

Takes ATOMIC_POSITIONS, returns a dict as {element : number of atoms}

\n", "signature": "(atomic_positions) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.scf_from_relax", "modulename": "aton.interface.qe", "qualname": "scf_from_relax", "kind": "function", "doc": "

Create a Quantum ESPRESSO scf.in file from a previous relax calculation.

\n\n

If no folder is provided, the current working directory is used.\nThe relax_in and relax_out files by default are relax.in and relax.out,\nupdate the names if necessary.

\n", "signature": "(\tfolder: str = None,\trelax_in: str = 'relax.in',\trelax_out: str = 'relax.out') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.to_cartesian", "modulename": "aton.interface.qe", "qualname": "to_cartesian", "kind": "function", "doc": "

Converts a given cordinates from crystal lattice vectors to cartesian.

\n\n

Only for ibrav=0. Uses the cell parameters.\nNote that the result is not multiplied by A nor celldm(1).

\n", "signature": "(filepath, coordinates) -> str:", "funcdef": "def"}, {"fullname": "aton.interface.qe.from_cartesian", "modulename": "aton.interface.qe", "qualname": "from_cartesian", "kind": "function", "doc": "

Converts a given cordinates from cartesian to the base of lattice vectors.

\n\n

Only for ibrav=0. Uses the cell parameters.\nNote that the result is not divided by A nor celldm(1).

\n", "signature": "(filepath, coordinates: list) -> str:", "funcdef": "def"}, {"fullname": "aton.interface.qe.pw_namelists", "modulename": "aton.interface.qe", "qualname": "pw_namelists", "kind": "variable", "doc": "

Dictionary with all possible NAMELISTs as keys, and the corresponding variables as values.

\n", "default_value": "{'&CONTROL': ['calculation', 'title', 'verbosity', 'restart_mode', 'wf_collect', 'nstep', 'iprint', 'tstress', 'tprnfor', 'dt', 'outdir', 'wfcdir', 'prefix', 'lkpoint_dir', 'max_seconds', 'etot_conv_thr', 'forc_conv_thr', 'disk_io', 'pseudo_dir', 'tefield', 'dipfield', 'lelfield', 'nberrycyc', 'lorbm', 'lberry', 'gdir', 'nppstr', 'gate', 'twochem', 'lfcp', 'trism'], '&SYSTEM': ['ibrav', 'celldm(1)', 'celldm(2)', 'celldm(3)', 'celldm(4)', 'celldm(5)', 'celldm(6)', 'A', 'B', 'C', 'cosAB', 'cosAC', 'cosBC', 'nat', 'ntyp', 'nbnd', 'nbnd_cond', 'tot_charge', 'starting_charge', 'tot_magnetization', 'starting_magnetization', 'ecutwfc', 'ecutrho', 'ecutfock', 'nr1', 'nr2', 'nr3', 'nr1s', 'nr2s', 'nr3s', 'nosym', 'nosym_evc', 'noinv', 'no_t_rev', 'force_symmorphic', 'use_all_frac', 'occupations', 'one_atom_occupations', 'starting_spin_angle', 'degauss_cond', 'nelec_cond', 'degauss', 'smearing', 'nspin', 'sic_gamma', 'pol_type', 'sic_energy', 'sci_vb', 'sci_cb', 'noncolin', 'ecfixed', 'qcutz', 'q2sigma', 'input_dft', 'ace', 'exx_fraction', 'screening_parameter', 'exxdiv_treatment', 'x_gamma_extrapolation', 'ecutvcutnqx1', 'nqx2', 'nqx3', 'localization_thr', 'Hubbard_occ', 'Hubbard_alpha', 'Hubbard_beta', 'starting_ns_eigenvalue', 'dmft', 'dmft_prefix', 'ensemble_energies', 'edir', 'emaxpos', 'eopreg', 'eamp', 'angle1', 'angle2', 'lforcet', 'constrained_magnetization', 'fixed_magnetization', 'lambda', 'report', 'lspinorb', 'assume_isolated', 'esm_bc', 'esm_w', 'esm_efield', 'esm_nfit', 'lgcscf', 'gcscf_mu', 'gcscf_conv_thr', 'gcscf_beta', 'vdw_corr', 'london', 'london_s6', 'london_c6', 'london_rvdw', 'london_rcut', 'dftd3_version', 'dftd3_threebody', 'ts_vdw_econv_thr', 'ts_vdw_isolated', 'xdm', 'xdm_a1', 'xdm_a2', 'space_group', 'uniqueb', 'origin_choice', 'rhombohedral', 'zgate', 'relaxz', 'block', 'block_1', 'block_2', 'block_height', 'nextffield'], '&ELECTRONS': ['electron_maxstep', 'exx_maxstep', 'scf_must_converge', 'conv_thr', 'adaptive_thr', 'conv_thr_init', 'conv_thr_multi', 'mixing_mode', 'mixing_beta', 'mixing_ndim', 'mixing_fixed_ns', 'diagonalization', 'diago_thr_init', 'diago_cg_maxiter', 'diago_ppcg_maxiter', 'diago_david_ndim', 'diago_rmm_ndim', 'diago_rmm_conv', 'diago_gs_nblock', 'diago_full_acc', 'efield', 'efield_cart', 'efield_phase', 'startingpot', 'startingwfc', 'tqr', 'real_space'], '&IONS': ['ion_positions', 'ion_velocities', 'ion_dynamics', 'pot_extrapolation', 'wfc_extrapolation', 'remove_rigid_rot', 'ion_temperature', 'tempw', 'tolp', 'delta_t', 'nraise', 'refold_pos', 'upscale', 'bfgs_ndim', 'trust_radius_max', 'trust_radius_min', 'trust_radius_ini', 'w_1', 'w_2', 'fire_alpha_init', 'fire_falpha', 'fire_nmin', 'fire_f_inc', 'fire_f_dec', 'fire_dtmax'], '&CELL': ['cell_dynamics', 'press', 'wmass', 'cell_factor', 'press_conv_thrcell_dofree'], '&FCP': ['fcp_mu', 'fcp_dynamics', 'fcp_conv_thr', 'fcp_ndiis', 'fcp_mass', 'fcp_velocity', 'fcp_temperature', 'fcp_tempw', 'fcp_tolp ', 'fcp_delta_t', 'fcp_nraise', 'freeze_all_atoms'], '&RISM': ['nsolv', 'closure', 'tempv', 'ecutsolv', 'solute_lj', 'solute_epsilon', 'solute_sigma', 'starting1d', 'starting3d', 'smear1d', 'smear3d', 'rism1d_maxstep', 'rism3d_maxstep', 'rism1d_conv_thr', 'rism3d_conv_thr', 'mdiis1d_size', 'mdiis3d_size', 'mdiis1d_step', 'mdiis3d_step', 'rism1d_bond_width', 'rism1d_dielectric', 'rism1d_molesize', 'rism1d_nproc', 'rism3d_conv_level', 'rism3d_planar_average', 'laue_nfit', 'laue_expand_right', 'laue_expand_left', 'laue_starting_right', 'laue_starting_left', 'laue_buffer_right', 'laue_buffer_left', 'laue_both_hands', 'laue_wall', 'laue_wall_z', 'laue_wall_rho', 'laue_wall_epsilon', 'laue_wall_sigma', 'laue_wall_lj6']}"}, {"fullname": "aton.interface.qe.pw_cards", "modulename": "aton.interface.qe", "qualname": "pw_cards", "kind": "variable", "doc": "

Dictionary with every possible CARDs as keys, and the corresponding variables as values.

\n", "default_value": "{'ATOMIC_SPECIES': ['X', 'Mass_X', 'PseudoPot_X'], 'ATOMIC_POSITIONS': ['X', 'x', 'y', 'z', 'if_pos(1)', 'if_pos(2)', 'if_pos(3)'], 'K_POINTS': ['nks', 'xk_x', 'xk_y', 'xk_z', 'wk', 'nk1', 'nk2', 'nk3', 'sk1', 'sk2', 'sk3'], 'ADDITIONAL_K_POINTS': ['nks_add', 'k_x', 'k_y', 'k_z', 'wk_'], 'CELL_PARAMETERS': ['v1', 'v2', 'v3'], 'CONSTRAINTS': ['nconstr', 'constr_tol', 'constr_type', 'constr(1)', 'constr(2)', 'constr(3)', 'constr(4)', 'constr_target'], 'OCCUPATIONS': ['f_inp1', 'f_inp2'], 'ATOMIC_VELOCITIES': ['V', 'vx', 'vy', 'vz'], 'ATOMIC_FORCES': ['X', 'fx', 'fy', 'fz'], 'SOLVENTS': ['X', 'Density', 'Molecule', 'X', 'Density_Left', 'Density_Right', 'Molecule'], 'HUBBARD': ['label(1)-manifold(1)', 'u_val(1)', 'label(1)-manifold(1)', 'j0_val(1)', 'paramType(1)', 'label(1)-manifold(1)', 'paramValue(1)', 'label(I)-manifold(I)', 'u_val(I)', 'label(I)-manifold(I)', 'j0_val(I)', 'label(I)-manifold(I)', 'label(J)-manifold(J)', 'I', 'J', 'v_val(I,J)'], 'CELL_PARAMETERS_out': ['v1', 'v2', 'v3'], 'ATOMIC_POSITIONS_out': ['X', 'x', 'y', 'z', 'if_pos(1)', 'if_pos(2)', 'if_pos(3)']}"}, {"fullname": "aton.interface.slurm", "modulename": "aton.interface.slurm", "kind": "module", "doc": "

Description

\n\n

Functions to handle Slurm calls, to run calculations in clusters.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
sbatch()Sbatch all calculations
scancel()Scancel all calculations, or applying some filters
scancel_here()Scancel all calculations running from a specific folder
squeue()Get a Pandas DataFrame with info about the submitted calculations
check_template()Checks that the slurm template is OK, and provides an example if not
\n\n
\n"}, {"fullname": "aton.interface.slurm.sbatch", "modulename": "aton.interface.slurm", "qualname": "sbatch", "kind": "function", "doc": "

Sbatch all the calculations at once.

\n\n

Calculation names should follow prefix_ID.ext,\nwith prefix as the common name across calculations,\nfollowed by the calculation ID, used as JOB_NAME.\nThe extensions from in_ext and out_ext ('.in' and '.out' by default)\nwill be used for the INPUT_FILE and OUTPUT_FILE of the slurm template.

\n\n

The slurm template, template.slurm by default,\nmust contain the keywords JOB_ID, INPUT_FILE and OUTPUT_FILE:

\n\n
#SBATCH --job-name=JOB_NAME\nmpirun pw.x -inp INPUT_FILE > OUTPUT_FILE\n
\n\n

Runs from the specified folder, current working directory if empty.

\n\n

If more control is required, a custom list of files can be specified for sbatching.

\n\n

If testing = True it skips the final sbatching,\njust printing the commands on the screen.

\n", "signature": "(\tprefix: str = '',\ttemplate: str = 'template.slurm',\tin_ext: str = '.in',\tout_ext: str = '.out',\tfolder=None,\tfiles: list = [],\ttesting: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.scancel", "modulename": "aton.interface.slurm", "qualname": "scancel", "kind": "function", "doc": "

Cancel all user jobs.

\n\n

If a particular status string is provided,\nonly the calculations with said status will be cancelled.

\n\n

If a particular text string is provided,\nonly the calculations containing said text in the name will be deleted.

\n\n

If testing = True, it shows the calculations that would be deleted.

\n\n

if the slurm squeue titles are different in your cluster,\nyou can specify them with key_jobid, key_status and key_name.

\n", "signature": "(\tuser: str,\tstatus: str = '',\ttext: str = '',\ttesting: bool = False,\tkey_jobid: str = 'JOBID',\tkey_name: str = 'NAME',\tkey_status: str = 'ST') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.scancel_here", "modulename": "aton.interface.slurm", "qualname": "scancel_here", "kind": "function", "doc": "

Cancel all running jobs in a given folder.

\n\n

If no job is provided, all jobs detected in the current folder will be cancelled.\nThe jobs will be detected from the <prefix>JOBID<sufix> files, slurm-JOBID.out by default.

\n", "signature": "(\tjobs=None,\tfolder=None,\tprefix: str = 'slurm-',\tsufix: str = '.out') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.squeue", "modulename": "aton.interface.slurm", "qualname": "squeue", "kind": "function", "doc": "

Returns a Pandas DataFrame with the jobs from a specific user

\n", "signature": "(user) -> pandas.core.frame.DataFrame:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.check_template", "modulename": "aton.interface.slurm", "qualname": "check_template", "kind": "function", "doc": "

Check the slurm template inside folder.

\n\n

The current working directory is used if folder is not provided.\nIf the file does not exist or is invalid, creates a template_EXAMPLE.slurm file for reference.

\n", "signature": "(template: str = 'template.slurm', folder=None) -> str:", "funcdef": "def"}, {"fullname": "aton.phys", "modulename": "aton.phys", "kind": "module", "doc": "

Physico-chemical constants

\n\n

This subpackage contains universal physical constants,\nas well as chemical data from all known elements.\nIt also includes functions to manage this data.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.phys.unitsUniversal constants and conversion factors
aton.phys.atomsData from all chemical elements
aton.phys.functionsFunctions to sort and manage element data from the aton.phys.atoms dict
\n\n

Examples

\n\n

All values and functions from phys submodules can be\nloaded directly as phys.value or phys.function(),\nas in the example below.

\n\n
\n
from aton import phys\nphys.eV_to_J                     # 1.602176634e-19\nphys.atoms['H'].isotope[2].mass  # 2.0141017779\nphys.split_isotope('He4')        # ('He', 4)\n
\n
\n\n

See the API reference of the specific modules for more information.

\n\n

References

\n\n

aton.phys.units

\n\n

Constant values come from the 2022 CODATA Recommended Values of the Fundamental Physical Constants.

\n\n

Conversion factors for neutron scattering come from\nM. B\u00e9e, \"Quasielastic Neutron scattering\", Adam Hilger, Bristol and Philadelphia, 1988.

\n\n

aton.phys.atoms

\n\n

Atomic mass are in atomic mass units (amu), and come from:\nPure Appl. Chem., Vol. 78, No. 11, pp. 2051-2066, 2006.\nThe following masses are obtained from Wikipedia:\nAc: 227, Np: 237, Pm: 145, Tc: 98.

\n\n

Isotope mass, mass_number and abundance come from:\nJ. R. de Laeter, J. K. B\u00f6hlke, P. De Bi\u00e8vre, H. Hidaka, H. S. Peiser, K. J. R. Rosman\nand P. D. P. Taylor (2003). \"Atomic weights of the elements. Review 2000 (IUPAC Technical Report)\".

\n\n

Total bound scattering cross_section $\\sigma_s$ are in barns (1 b = 100 fm$^2$).\nFrom Felix Fernandez-Alonso, \"Neutron Scattering Fundamentals\", 2013.

\n"}, {"fullname": "aton.phys.atoms", "modulename": "aton.phys.atoms", "kind": "module", "doc": "

Description

\n\n

This module contains the atoms megadictionary,\nwhich contains the properties of all elements.\nIt is managed and updated automatically with aton.phys.functions.

\n\n

The atoms dictionary can be loaded directly as aton.phys.atoms.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
ElementUsed as values in the atoms dict, stores element properties
IsotopeUsed as values in Element.isotope, contains isotope properties
atomsThe dict with data from all elements
\n\n

Examples

\n\n
\n
from aton import phys\naluminium_cross_section = phys.atoms['Al'].cross_section  # 1.503\nHe4_mass = phys.atoms['H'].isotope[4].mass  # 4.0026032497\n
\n
\n\n
\n"}, {"fullname": "aton.phys.atoms.Element", "modulename": "aton.phys.atoms", "qualname": "Element", "kind": "class", "doc": "

Used in the aton.atoms megadictionary to store element data.

\n"}, {"fullname": "aton.phys.atoms.Element.__init__", "modulename": "aton.phys.atoms", "qualname": "Element.__init__", "kind": "function", "doc": "

\n", "signature": "(\tZ: int = None,\tsymbol: str = None,\tname: str = None,\tmass: float = None,\tcross_section: float = None,\tisotope: dict = None)"}, {"fullname": "aton.phys.atoms.Element.Z", "modulename": "aton.phys.atoms", "qualname": "Element.Z", "kind": "variable", "doc": "

Atomic number (Z). Corresponds to the number of protons / electrons.

\n", "annotation": ": int"}, {"fullname": "aton.phys.atoms.Element.symbol", "modulename": "aton.phys.atoms", "qualname": "Element.symbol", "kind": "variable", "doc": "

Standard symbol of the element.

\n", "annotation": ": str"}, {"fullname": "aton.phys.atoms.Element.name", "modulename": "aton.phys.atoms", "qualname": "Element.name", "kind": "variable", "doc": "

Full name.

\n", "annotation": ": str"}, {"fullname": "aton.phys.atoms.Element.mass", "modulename": "aton.phys.atoms", "qualname": "Element.mass", "kind": "variable", "doc": "

Atomic mass, in atomic mass units (amu).

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Element.cross_section", "modulename": "aton.phys.atoms", "qualname": "Element.cross_section", "kind": "variable", "doc": "

Total bound scattering cross section.

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Element.isotope", "modulename": "aton.phys.atoms", "qualname": "Element.isotope", "kind": "variable", "doc": "

Dictionary containing the different Isotope of the element.\nThe keys are the mass number (A).

\n", "annotation": ": dict"}, {"fullname": "aton.phys.atoms.Isotope", "modulename": "aton.phys.atoms", "qualname": "Isotope", "kind": "class", "doc": "

Used in the aton.atoms megadictionary to store isotope data.

\n"}, {"fullname": "aton.phys.atoms.Isotope.__init__", "modulename": "aton.phys.atoms", "qualname": "Isotope.__init__", "kind": "function", "doc": "

\n", "signature": "(\tA: int = None,\tmass: float = None,\tabundance: float = None,\tcross_section: float = None)"}, {"fullname": "aton.phys.atoms.Isotope.A", "modulename": "aton.phys.atoms", "qualname": "Isotope.A", "kind": "variable", "doc": "

Mass number (A) of the isotope.\nCorresponds to the total number of protons + neutrons in the core.

\n", "annotation": ": int"}, {"fullname": "aton.phys.atoms.Isotope.mass", "modulename": "aton.phys.atoms", "qualname": "Isotope.mass", "kind": "variable", "doc": "

Atomic mass of the isotope, in atomic mass units (amu).

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Isotope.abundance", "modulename": "aton.phys.atoms", "qualname": "Isotope.abundance", "kind": "variable", "doc": "

Relative abundance of the isotope.

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Isotope.cross_section", "modulename": "aton.phys.atoms", "qualname": "Isotope.cross_section", "kind": "variable", "doc": "

Total bound scattering cross section of the isotope.

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.atoms", "modulename": "aton.phys.atoms", "qualname": "atoms", "kind": "variable", "doc": "

\n", "default_value": "{'H': <aton.phys.atoms.Element object>, 'He': <aton.phys.atoms.Element object>, 'Li': <aton.phys.atoms.Element object>, 'Be': <aton.phys.atoms.Element object>, 'B': <aton.phys.atoms.Element object>, 'C': <aton.phys.atoms.Element object>, 'N': <aton.phys.atoms.Element object>, 'O': <aton.phys.atoms.Element object>, 'F': <aton.phys.atoms.Element object>, 'Ne': <aton.phys.atoms.Element object>, 'Na': <aton.phys.atoms.Element object>, 'Mg': <aton.phys.atoms.Element object>, 'Al': <aton.phys.atoms.Element object>, 'Si': <aton.phys.atoms.Element object>, 'P': <aton.phys.atoms.Element object>, 'S': <aton.phys.atoms.Element object>, 'Cl': <aton.phys.atoms.Element object>, 'Ar': <aton.phys.atoms.Element object>, 'K': <aton.phys.atoms.Element object>, 'Ca': <aton.phys.atoms.Element object>, 'Sc': <aton.phys.atoms.Element object>, 'Ti': <aton.phys.atoms.Element object>, 'V': <aton.phys.atoms.Element object>, 'Cr': <aton.phys.atoms.Element object>, 'Mn': <aton.phys.atoms.Element object>, 'Fe': <aton.phys.atoms.Element object>, 'Co': <aton.phys.atoms.Element object>, 'Ni': <aton.phys.atoms.Element object>, 'Cu': <aton.phys.atoms.Element object>, 'Zn': <aton.phys.atoms.Element object>, 'Ga': <aton.phys.atoms.Element object>, 'Ge': <aton.phys.atoms.Element object>, 'As': <aton.phys.atoms.Element object>, 'Se': <aton.phys.atoms.Element object>, 'Br': <aton.phys.atoms.Element object>, 'Kr': <aton.phys.atoms.Element object>, 'Rb': <aton.phys.atoms.Element object>, 'Sr': <aton.phys.atoms.Element object>, 'Y': <aton.phys.atoms.Element object>, 'Zr': <aton.phys.atoms.Element object>, 'Nb': <aton.phys.atoms.Element object>, 'Mo': <aton.phys.atoms.Element object>, 'Tc': <aton.phys.atoms.Element object>, 'Ru': <aton.phys.atoms.Element object>, 'Rh': <aton.phys.atoms.Element object>, 'Pd': <aton.phys.atoms.Element object>, 'Ag': <aton.phys.atoms.Element object>, 'Cd': <aton.phys.atoms.Element object>, 'In': <aton.phys.atoms.Element object>, 'Sn': <aton.phys.atoms.Element object>, 'Sb': <aton.phys.atoms.Element object>, 'Te': <aton.phys.atoms.Element object>, 'I': <aton.phys.atoms.Element object>, 'Xe': <aton.phys.atoms.Element object>, 'Cs': <aton.phys.atoms.Element object>, 'Ba': <aton.phys.atoms.Element object>, 'La': <aton.phys.atoms.Element object>, 'Ce': <aton.phys.atoms.Element object>, 'Pr': <aton.phys.atoms.Element object>, 'Nd': <aton.phys.atoms.Element object>, 'Pm': <aton.phys.atoms.Element object>, 'Sm': <aton.phys.atoms.Element object>, 'Eu': <aton.phys.atoms.Element object>, 'Gd': <aton.phys.atoms.Element object>, 'Tb': <aton.phys.atoms.Element object>, 'Dy': <aton.phys.atoms.Element object>, 'Ho': <aton.phys.atoms.Element object>, 'Er': <aton.phys.atoms.Element object>, 'Tm': <aton.phys.atoms.Element object>, 'Yb': <aton.phys.atoms.Element object>, 'Lu': <aton.phys.atoms.Element object>, 'Hf': <aton.phys.atoms.Element object>, 'Ta': <aton.phys.atoms.Element object>, 'W': <aton.phys.atoms.Element object>, 'Re': <aton.phys.atoms.Element object>, 'Os': <aton.phys.atoms.Element object>, 'Ir': <aton.phys.atoms.Element object>, 'Pt': <aton.phys.atoms.Element object>, 'Au': <aton.phys.atoms.Element object>, 'Hg': <aton.phys.atoms.Element object>, 'Tl': <aton.phys.atoms.Element object>, 'Pb': <aton.phys.atoms.Element object>, 'Bi': <aton.phys.atoms.Element object>, 'Po': <aton.phys.atoms.Element object>, 'At': <aton.phys.atoms.Element object>, 'Rn': <aton.phys.atoms.Element object>, 'Fr': <aton.phys.atoms.Element object>, 'Ra': <aton.phys.atoms.Element object>, 'Ac': <aton.phys.atoms.Element object>, 'Th': <aton.phys.atoms.Element object>, 'Pa': <aton.phys.atoms.Element object>, 'U': <aton.phys.atoms.Element object>, 'Np': <aton.phys.atoms.Element object>, 'Pu': <aton.phys.atoms.Element object>, 'Am': <aton.phys.atoms.Element object>, 'Cm': <aton.phys.atoms.Element object>, 'Bk': <aton.phys.atoms.Element object>, 'Cf': <aton.phys.atoms.Element object>, 'Es': <aton.phys.atoms.Element object>, 'Fm': <aton.phys.atoms.Element object>, 'Md': <aton.phys.atoms.Element object>, 'No': <aton.phys.atoms.Element object>, 'Lr': <aton.phys.atoms.Element object>, 'Rf': <aton.phys.atoms.Element object>, 'Db': <aton.phys.atoms.Element object>, 'Sg': <aton.phys.atoms.Element object>, 'Bh': <aton.phys.atoms.Element object>, 'Hs': <aton.phys.atoms.Element object>, 'Mt': <aton.phys.atoms.Element object>, 'Ds': <aton.phys.atoms.Element object>, 'Rg': <aton.phys.atoms.Element object>, 'Cn': <aton.phys.atoms.Element object>, 'Uut': <aton.phys.atoms.Element object>, 'Uuq': <aton.phys.atoms.Element object>, 'Uup': <aton.phys.atoms.Element object>, 'Uuh': <aton.phys.atoms.Element object>, 'Uus': <aton.phys.atoms.Element object>, 'Uuo': <aton.phys.atoms.Element object>}"}, {"fullname": "aton.phys.functions", "modulename": "aton.phys.functions", "kind": "module", "doc": "

Description

\n\n

This module contains functions to sort and analyse\nchemical data using the aton.phys.atoms megadictionary,\nwhich contains the properties of all elements.\nIt also contains the tools needed to\nautomatically update said megadictionary.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
export_atoms()Used to update and export the aton.phys.atoms dict
split_isotope()Splits element name and mass number
allowed_isotopes()Returns the available mass numbers for a given element
\n\n

Examples

\n\n

All functions can be called from the phys subpackage directly, as:

\n\n
\n
from aton import phys\nphys.split_isotope('He4')    # (He, 4)\nphys.allowed_isotopes('Li')  # (6, 7)\n
\n
\n\n
\n"}, {"fullname": "aton.phys.functions.export_atoms", "modulename": "aton.phys.functions", "qualname": "export_atoms", "kind": "function", "doc": "

Export a dictionary of chemical elements to a python file.

\n\n

This is used to build and update the aton.atoms megadictionary, that contains\nall the element data, such as masses, cross-sections, etc.\nThe atoms.py file must be modified here.

\n", "signature": "(\tatoms: dict = {'H': <aton.phys.atoms.Element object>, 'He': <aton.phys.atoms.Element object>, 'Li': <aton.phys.atoms.Element object>, 'Be': <aton.phys.atoms.Element object>, 'B': <aton.phys.atoms.Element object>, 'C': <aton.phys.atoms.Element object>, 'N': <aton.phys.atoms.Element object>, 'O': <aton.phys.atoms.Element object>, 'F': <aton.phys.atoms.Element object>, 'Ne': <aton.phys.atoms.Element object>, 'Na': <aton.phys.atoms.Element object>, 'Mg': <aton.phys.atoms.Element object>, 'Al': <aton.phys.atoms.Element object>, 'Si': <aton.phys.atoms.Element object>, 'P': <aton.phys.atoms.Element object>, 'S': <aton.phys.atoms.Element object>, 'Cl': <aton.phys.atoms.Element object>, 'Ar': <aton.phys.atoms.Element object>, 'K': <aton.phys.atoms.Element object>, 'Ca': <aton.phys.atoms.Element object>, 'Sc': <aton.phys.atoms.Element object>, 'Ti': <aton.phys.atoms.Element object>, 'V': <aton.phys.atoms.Element object>, 'Cr': <aton.phys.atoms.Element object>, 'Mn': <aton.phys.atoms.Element object>, 'Fe': <aton.phys.atoms.Element object>, 'Co': <aton.phys.atoms.Element object>, 'Ni': <aton.phys.atoms.Element object>, 'Cu': <aton.phys.atoms.Element object>, 'Zn': <aton.phys.atoms.Element object>, 'Ga': <aton.phys.atoms.Element object>, 'Ge': <aton.phys.atoms.Element object>, 'As': <aton.phys.atoms.Element object>, 'Se': <aton.phys.atoms.Element object>, 'Br': <aton.phys.atoms.Element object>, 'Kr': <aton.phys.atoms.Element object>, 'Rb': <aton.phys.atoms.Element object>, 'Sr': <aton.phys.atoms.Element object>, 'Y': <aton.phys.atoms.Element object>, 'Zr': <aton.phys.atoms.Element object>, 'Nb': <aton.phys.atoms.Element object>, 'Mo': <aton.phys.atoms.Element object>, 'Tc': <aton.phys.atoms.Element object>, 'Ru': <aton.phys.atoms.Element object>, 'Rh': <aton.phys.atoms.Element object>, 'Pd': <aton.phys.atoms.Element object>, 'Ag': <aton.phys.atoms.Element object>, 'Cd': <aton.phys.atoms.Element object>, 'In': <aton.phys.atoms.Element object>, 'Sn': <aton.phys.atoms.Element object>, 'Sb': <aton.phys.atoms.Element object>, 'Te': <aton.phys.atoms.Element object>, 'I': <aton.phys.atoms.Element object>, 'Xe': <aton.phys.atoms.Element object>, 'Cs': <aton.phys.atoms.Element object>, 'Ba': <aton.phys.atoms.Element object>, 'La': <aton.phys.atoms.Element object>, 'Ce': <aton.phys.atoms.Element object>, 'Pr': <aton.phys.atoms.Element object>, 'Nd': <aton.phys.atoms.Element object>, 'Pm': <aton.phys.atoms.Element object>, 'Sm': <aton.phys.atoms.Element object>, 'Eu': <aton.phys.atoms.Element object>, 'Gd': <aton.phys.atoms.Element object>, 'Tb': <aton.phys.atoms.Element object>, 'Dy': <aton.phys.atoms.Element object>, 'Ho': <aton.phys.atoms.Element object>, 'Er': <aton.phys.atoms.Element object>, 'Tm': <aton.phys.atoms.Element object>, 'Yb': <aton.phys.atoms.Element object>, 'Lu': <aton.phys.atoms.Element object>, 'Hf': <aton.phys.atoms.Element object>, 'Ta': <aton.phys.atoms.Element object>, 'W': <aton.phys.atoms.Element object>, 'Re': <aton.phys.atoms.Element object>, 'Os': <aton.phys.atoms.Element object>, 'Ir': <aton.phys.atoms.Element object>, 'Pt': <aton.phys.atoms.Element object>, 'Au': <aton.phys.atoms.Element object>, 'Hg': <aton.phys.atoms.Element object>, 'Tl': <aton.phys.atoms.Element object>, 'Pb': <aton.phys.atoms.Element object>, 'Bi': <aton.phys.atoms.Element object>, 'Po': <aton.phys.atoms.Element object>, 'At': <aton.phys.atoms.Element object>, 'Rn': <aton.phys.atoms.Element object>, 'Fr': <aton.phys.atoms.Element object>, 'Ra': <aton.phys.atoms.Element object>, 'Ac': <aton.phys.atoms.Element object>, 'Th': <aton.phys.atoms.Element object>, 'Pa': <aton.phys.atoms.Element object>, 'U': <aton.phys.atoms.Element object>, 'Np': <aton.phys.atoms.Element object>, 'Pu': <aton.phys.atoms.Element object>, 'Am': <aton.phys.atoms.Element object>, 'Cm': <aton.phys.atoms.Element object>, 'Bk': <aton.phys.atoms.Element object>, 'Cf': <aton.phys.atoms.Element object>, 'Es': <aton.phys.atoms.Element object>, 'Fm': <aton.phys.atoms.Element object>, 'Md': <aton.phys.atoms.Element object>, 'No': <aton.phys.atoms.Element object>, 'Lr': <aton.phys.atoms.Element object>, 'Rf': <aton.phys.atoms.Element object>, 'Db': <aton.phys.atoms.Element object>, 'Sg': <aton.phys.atoms.Element object>, 'Bh': <aton.phys.atoms.Element object>, 'Hs': <aton.phys.atoms.Element object>, 'Mt': <aton.phys.atoms.Element object>, 'Ds': <aton.phys.atoms.Element object>, 'Rg': <aton.phys.atoms.Element object>, 'Cn': <aton.phys.atoms.Element object>, 'Uut': <aton.phys.atoms.Element object>, 'Uuq': <aton.phys.atoms.Element object>, 'Uup': <aton.phys.atoms.Element object>, 'Uuh': <aton.phys.atoms.Element object>, 'Uus': <aton.phys.atoms.Element object>, 'Uuo': <aton.phys.atoms.Element object>},\tfilename='exported_atoms.py') -> None:", "funcdef": "def"}, {"fullname": "aton.phys.functions.split_isotope", "modulename": "aton.phys.functions", "qualname": "split_isotope", "kind": "function", "doc": "

Split the name of an isotope into the element and the mass number, eg. He4 -> He, 4.

\n\n

If the isotope is not found in the aton.atoms megadictionary it raises an error,\ninforming of the allowed mass numbers (A) values for the given element.

\n", "signature": "(name: str) -> tuple:", "funcdef": "def"}, {"fullname": "aton.phys.functions.allowed_isotopes", "modulename": "aton.phys.functions", "qualname": "allowed_isotopes", "kind": "function", "doc": "

Return a list with the allowed mass numbers (A) of a given element.

\n\n

These mass numbers are used as isotope keys in the aton.atoms megadictionary.

\n", "signature": "(element) -> list:", "funcdef": "def"}, {"fullname": "aton.phys.units", "modulename": "aton.phys.units", "kind": "module", "doc": "

Description

\n\n

This module contains the constants from the \n2022 CODATA\nRecommended Values of the Fundamental Physical Constants.

\n\n

It also contains useful conversion factors for neutron scattering,\nfrom M. B\u00e9e, \"Quasielastic Neutron scattering\", Adam Hilger, Bristol and Philadelphia, 1988.

\n\n

Index

\n\n\n\n

Examples

\n\n

Units and constants are named as their standard symbol, removing any / divider in between.\nInverse of a unit or constant X, as in 1/X or X$^{-1}$, is expressed as X1.

\n\n

Universal constant names contain\nromanized greek letters,\nexcept for $\\mu$ which is used as u.

\n\n

Some examples:

\n\n
\n
from aton.phys import *\n# Constants\nh     # Planck constant\nhbar  # reduced Planck constant\na     # fine-structure constant (alpha)\nue    # electron magnetic moment (mu e)\nmn    # neutron mass\nmnc2  # neutron mass energy equivalent\n# Conversions\n# meV to 1/cm\nenergy_in_cm1 = energy_in_meV * meV_to_cm1\n# Bohr to Angstroms\ndistance_in_angstroms = distance_in_bohr * bohr_to_A\n# m/s to rad/s  (used in neutron scattering)\nvelocity_in_rads = velocity_in_ms * ms_to_rads\n
\n
\n\n
\n\n

Fundamental Physical Constants

\n\n

Using SI units unless stated otherwise.

\n\n

Universal

\n"}, {"fullname": "aton.phys.units.c", "modulename": "aton.phys.units", "qualname": "c", "kind": "variable", "doc": "

$c$ | speed of light in vacuum / natural unit of velocity, in m/s

\n", "default_value": "299792458"}, {"fullname": "aton.phys.units.u0", "modulename": "aton.phys.units", "qualname": "u0", "kind": "variable", "doc": "

$\\mu_0$ | vacuum magnetic permeability, in N\u00b7A$^{-2}$ ($4\\pi\\alpha\\hbar/e^2 c$)

\n", "default_value": "1.25663706127e-06"}, {"fullname": "aton.phys.units.e0", "modulename": "aton.phys.units", "qualname": "e0", "kind": "variable", "doc": "

$\\epsilon_0$ | vacuum electric permittivity, in F\u00b7m$^{-1}$ ($1/\\mu_0 c^2$)

\n", "default_value": "1.25663706127e-06"}, {"fullname": "aton.phys.units.Z0", "modulename": "aton.phys.units", "qualname": "Z0", "kind": "variable", "doc": "

$Z_0$ | characteristic impedance of vacuum, in $\\Omega$ ($\\mu_0 c$)

\n", "default_value": "376.730313412"}, {"fullname": "aton.phys.units.G", "modulename": "aton.phys.units", "qualname": "G", "kind": "variable", "doc": "

$G$ | Newtonian constant of gravitation, in m$^3$\u00b7kg$^{-1}$\u00b7s$^{-1}$

\n", "default_value": "6.6743e-11"}, {"fullname": "aton.phys.units.h", "modulename": "aton.phys.units", "qualname": "h", "kind": "variable", "doc": "

$h$ | Planck constant, in J\u00b7s

\n", "default_value": "6.62607015e-34"}, {"fullname": "aton.phys.units.h_eV", "modulename": "aton.phys.units", "qualname": "h_eV", "kind": "variable", "doc": "

$h$ | Planck constant, in eV\u00b7s

\n", "default_value": "4.135667696923859e-15"}, {"fullname": "aton.phys.units.hbar", "modulename": "aton.phys.units", "qualname": "hbar", "kind": "variable", "doc": "

$\\hbar$ | reduced Planck constant / natural unit of action, in J\u00b7s

\n", "default_value": "1.0545718176461565e-34"}, {"fullname": "aton.phys.units.hbar_eV", "modulename": "aton.phys.units", "qualname": "hbar_eV", "kind": "variable", "doc": "

$\\hbar$ | reduced Planck constant, in eV\u00b7s

\n\n
\n\n

Electromagnetic

\n", "default_value": "6.582119569509066e-16"}, {"fullname": "aton.phys.units.e", "modulename": "aton.phys.units", "qualname": "e", "kind": "variable", "doc": "

$e$ | elementary charge, in C

\n", "default_value": "1.602176634e-19"}, {"fullname": "aton.phys.units.P0", "modulename": "aton.phys.units", "qualname": "P0", "kind": "variable", "doc": "

$\\Phi_0$ | magnetic flux quantum, in Wb ($2\\pi\\hbar/(2e)$)

\n", "default_value": "2.067833848e-15"}, {"fullname": "aton.phys.units.G0", "modulename": "aton.phys.units", "qualname": "G0", "kind": "variable", "doc": "

$G_0$ | conductance quantum, in S ($2e^2/2\\pi h$)

\n", "default_value": "7.748091729e-05"}, {"fullname": "aton.phys.units.KJ", "modulename": "aton.phys.units", "qualname": "KJ", "kind": "variable", "doc": "

$K_J$ | Josephson constant, in Hz\u00b7V$^{-1}$ (2e/h)

\n", "default_value": "483597848400000.0"}, {"fullname": "aton.phys.units.RK", "modulename": "aton.phys.units", "qualname": "RK", "kind": "variable", "doc": "

$R_K$ | von Klitzing constant, in $\\Omega$ ($\\mu_0 c/2\\alpha = 2\\pi\\hbar/e^2$)

\n", "default_value": "25812.80745"}, {"fullname": "aton.phys.units.uB", "modulename": "aton.phys.units", "qualname": "uB", "kind": "variable", "doc": "

$\\mu_B$ | Bohr magneton, in J\u00b7T$^{-1}$ ($e\\hbar / 2m_e$)

\n", "default_value": "9.2740100657e-24"}, {"fullname": "aton.phys.units.uN", "modulename": "aton.phys.units", "qualname": "uN", "kind": "variable", "doc": "

$\\mu_N$ | nuclear magneton, in J\u00b7T$^{-1}$ ($e\\hbar / 2m_p$)

\n\n
\n\n

Atomic and nuclear

\n\n

General

\n", "default_value": "5.0507837393e-27"}, {"fullname": "aton.phys.units.a", "modulename": "aton.phys.units", "qualname": "a", "kind": "variable", "doc": "

$\\alpha$ | fine-structure constant ($e^2 / 4 \\pi \\epsilon_0 \\hbar c$)

\n", "default_value": "0.0072973525643"}, {"fullname": "aton.phys.units.a1", "modulename": "aton.phys.units", "qualname": "a1", "kind": "variable", "doc": "

$\\alpha^{-1}$ | inverse fine-structure constant

\n", "default_value": "137.035999177"}, {"fullname": "aton.phys.units.cRinf", "modulename": "aton.phys.units", "qualname": "cRinf", "kind": "variable", "doc": "

$cR\\infty$ | Rydberg frequency, in Hz ($\\alpha^2m_e c^2/2h = E_h/2h$)

\n", "default_value": "3289841960250000.0"}, {"fullname": "aton.phys.units.Rinf", "modulename": "aton.phys.units", "qualname": "Rinf", "kind": "variable", "doc": "

$R\\infty$ | Rydberg constant, in $[m^{-1}]^a$

\n", "default_value": "10973731.568157"}, {"fullname": "aton.phys.units.a0", "modulename": "aton.phys.units", "qualname": "a0", "kind": "variable", "doc": "

$a_0$ | Bohr radius, in m

\n", "default_value": "5.29177210544e-11"}, {"fullname": "aton.phys.units.Eh", "modulename": "aton.phys.units", "qualname": "Eh", "kind": "variable", "doc": "

$E_h$ | Hartree energy, in J ($\\alpha^2m_ec^2=e^2/4\\pi\\epsilon_0a_0=2h c R_{\\infty}$)

\n\n
\n\n

Electron

\n", "default_value": "4.359744722206e-18"}, {"fullname": "aton.phys.units.me", "modulename": "aton.phys.units", "qualname": "me", "kind": "variable", "doc": "

$m_e$ | electron mass / natural unit of mass, in kg

\n", "default_value": "-21.8906162861"}, {"fullname": "aton.phys.units.me_uma", "modulename": "aton.phys.units", "qualname": "me_uma", "kind": "variable", "doc": "

$m_e$ | electron mass, in uma

\n", "default_value": "0.0005485799090441"}, {"fullname": "aton.phys.units.mec2", "modulename": "aton.phys.units", "qualname": "mec2", "kind": "variable", "doc": "

$m_e c^2$ | electron mass energy equivalent / natural unit of energy, in J

\n", "default_value": "8.187105788e-14"}, {"fullname": "aton.phys.units.mec2_eV", "modulename": "aton.phys.units", "qualname": "mec2_eV", "kind": "variable", "doc": "

$m_e c^2$ | electron mass energy equivalent, in eV

\n", "default_value": "510998.95069"}, {"fullname": "aton.phys.units.lC", "modulename": "aton.phys.units", "qualname": "lC", "kind": "variable", "doc": "

$\\lambda_C$ | Compton wavelength, in $[m]^a$

\n", "default_value": "2.42631023538e-12"}, {"fullname": "aton.phys.units.re", "modulename": "aton.phys.units", "qualname": "re", "kind": "variable", "doc": "

$r_e$ | classical electron radius, in m ($\\alpha^2 a_0$)

\n", "default_value": "2.8179403205e-15"}, {"fullname": "aton.phys.units.se", "modulename": "aton.phys.units", "qualname": "se", "kind": "variable", "doc": "

$\\sigma_e$ | Thomson cross section, in m$^2$ ($(8\\pi / 3)r_e^2$)

\n", "default_value": "6.6524587051e-29"}, {"fullname": "aton.phys.units.ue", "modulename": "aton.phys.units", "qualname": "ue", "kind": "variable", "doc": "

$\\mu_e$ | electron magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Proton

\n", "default_value": "-9.2847646917e-24"}, {"fullname": "aton.phys.units.mp", "modulename": "aton.phys.units", "qualname": "mp", "kind": "variable", "doc": "

$m_p$ | proton mass, in kg

\n", "default_value": "-25.32737807405"}, {"fullname": "aton.phys.units.mp_uma", "modulename": "aton.phys.units", "qualname": "mp_uma", "kind": "variable", "doc": "

$m_p$ | proton mass, in uma

\n", "default_value": "1.0072764665789"}, {"fullname": "aton.phys.units.mpc2", "modulename": "aton.phys.units", "qualname": "mpc2", "kind": "variable", "doc": "

$m_p c^2$ | proton mass energy equivalent, in J

\n", "default_value": "1.50327761802e-10"}, {"fullname": "aton.phys.units.mpc2_eV", "modulename": "aton.phys.units", "qualname": "mpc2_eV", "kind": "variable", "doc": "

$m_p c^2$ | proton mass energy equivalent, in eV

\n", "default_value": "938272089.43"}, {"fullname": "aton.phys.units.mpme", "modulename": "aton.phys.units", "qualname": "mpme", "kind": "variable", "doc": "

$m_p/m_e$ | proton-electron mass ratio

\n", "default_value": "1836.152673426"}, {"fullname": "aton.phys.units.lCp", "modulename": "aton.phys.units", "qualname": "lCp", "kind": "variable", "doc": "

$\\lambda_{C,p}$ | proton Compton wavelength, in $[m]^a$

\n", "default_value": "1.3214098536e-15"}, {"fullname": "aton.phys.units.rp", "modulename": "aton.phys.units", "qualname": "rp", "kind": "variable", "doc": "

$r_p$ | proton rms charge radius, in m

\n", "default_value": "8.4075e-16"}, {"fullname": "aton.phys.units.up", "modulename": "aton.phys.units", "qualname": "up", "kind": "variable", "doc": "

$\\mu_p$ | proton magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Neutron

\n", "default_value": "1.41060679545e-26"}, {"fullname": "aton.phys.units.mn", "modulename": "aton.phys.units", "qualname": "mn", "kind": "variable", "doc": "

$m_n$ | neutron mass, in kg

\n", "default_value": "1.67492750056e-27"}, {"fullname": "aton.phys.units.mn_uma", "modulename": "aton.phys.units", "qualname": "mn_uma", "kind": "variable", "doc": "

$m_n$ | neutron mass, in uma

\n", "default_value": "1.00866491606"}, {"fullname": "aton.phys.units.mnc2", "modulename": "aton.phys.units", "qualname": "mnc2", "kind": "variable", "doc": "

$m_n c^2$ | neutron mass energy equivalent, in J

\n", "default_value": "1.50534976514e-10"}, {"fullname": "aton.phys.units.mnc2_eV", "modulename": "aton.phys.units", "qualname": "mnc2_eV", "kind": "variable", "doc": "

$m_n c^2$ | neutron mass energy equivalent, in eV

\n", "default_value": "939565421.94"}, {"fullname": "aton.phys.units.lCn", "modulename": "aton.phys.units", "qualname": "lCn", "kind": "variable", "doc": "

$\\lambda_{C,n}$ | neutron compton wavelength, in $[m]^a$

\n", "default_value": "1.31959090382e-15"}, {"fullname": "aton.phys.units.un", "modulename": "aton.phys.units", "qualname": "un", "kind": "variable", "doc": "

$\\mu_n$ | neutron magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Deuteron

\n", "default_value": "-9.6623653e-27"}, {"fullname": "aton.phys.units.md", "modulename": "aton.phys.units", "qualname": "md", "kind": "variable", "doc": "

$m_d$ | deuteron mass, in kg

\n", "default_value": "3.3435837768e-27"}, {"fullname": "aton.phys.units.md_uma", "modulename": "aton.phys.units", "qualname": "md_uma", "kind": "variable", "doc": "

$m_d$ | deuteron mass, in uma

\n", "default_value": "2.013553212544"}, {"fullname": "aton.phys.units.mdc2", "modulename": "aton.phys.units", "qualname": "mdc2", "kind": "variable", "doc": "

$m_d c^2$ | deuteron mass energy equivalent, in J

\n", "default_value": "3.00506323491e-10"}, {"fullname": "aton.phys.units.mdc2_eV", "modulename": "aton.phys.units", "qualname": "mdc2_eV", "kind": "variable", "doc": "

$m_d c^2$ | deuteron mass energy equivalent, in eV

\n", "default_value": "1875612945"}, {"fullname": "aton.phys.units.rd", "modulename": "aton.phys.units", "qualname": "rd", "kind": "variable", "doc": "

$r_d$ | deuteron rms charge radius, in m

\n", "default_value": "2.12778e-15"}, {"fullname": "aton.phys.units.ud", "modulename": "aton.phys.units", "qualname": "ud", "kind": "variable", "doc": "

$\\mu_d$ | deuteron magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Alpha particle

\n", "default_value": "4.330735087e-27"}, {"fullname": "aton.phys.units.ma", "modulename": "aton.phys.units", "qualname": "ma", "kind": "variable", "doc": "

$m_\\alpha$ | alpha particle mass, in kg

\n", "default_value": "6.644657345e-27"}, {"fullname": "aton.phys.units.mac2", "modulename": "aton.phys.units", "qualname": "mac2", "kind": "variable", "doc": "

$m_\\alpha$ | alpha particle mass energy equivalent, in J

\n", "default_value": "5.9719201997e-10"}, {"fullname": "aton.phys.units.mac2_eV", "modulename": "aton.phys.units", "qualname": "mac2_eV", "kind": "variable", "doc": "

$m_\\alpha$ | alpha particle mass energy equivalent, in eV

\n", "default_value": "3727379411.8"}, {"fullname": "aton.phys.units.ra", "modulename": "aton.phys.units", "qualname": "ra", "kind": "variable", "doc": "

$r_\\alpha$ | alpha particle rms charge radius, in m

\n\n
\n\n

Physicochemical

\n", "default_value": "1.6785e-15"}, {"fullname": "aton.phys.units.NA", "modulename": "aton.phys.units", "qualname": "NA", "kind": "variable", "doc": "

$N_A$ | Avogadro constant, in mol$^{-1}$

\n", "default_value": "6.02214076e+23"}, {"fullname": "aton.phys.units.k", "modulename": "aton.phys.units", "qualname": "k", "kind": "variable", "doc": "

$k$ | Boltzmann constant, in J\u00b7K$^{-1}$

\n", "default_value": "1.380649e-23"}, {"fullname": "aton.phys.units.k_eV", "modulename": "aton.phys.units", "qualname": "k_eV", "kind": "variable", "doc": "

$k$ | Boltzmann constant, in eV\u00b7K$^{-1}$

\n", "default_value": "8.617333262e-05"}, {"fullname": "aton.phys.units.mu", "modulename": "aton.phys.units", "qualname": "mu", "kind": "variable", "doc": "

$m_u$ | atomic mass constant / unified atomic mass unit, in kg ($\\frac{1}{12}m(^{12}C)$)

\n", "default_value": "1.66053906892e-27"}, {"fullname": "aton.phys.units.muc2", "modulename": "aton.phys.units", "qualname": "muc2", "kind": "variable", "doc": "

$m_u c^2$ | atomic mass constant energy equivalent, in J

\n", "default_value": "1.49241808768e-10"}, {"fullname": "aton.phys.units.muc2_eV", "modulename": "aton.phys.units", "qualname": "muc2_eV", "kind": "variable", "doc": "

$m_u c^2$ | atomic mass constant energy equivalent, in eV

\n", "default_value": "931494103.72"}, {"fullname": "aton.phys.units.R", "modulename": "aton.phys.units", "qualname": "R", "kind": "variable", "doc": "

$R$ | molar gas constant, in J\u00b7mol$^{-1}$K$^{-1}$ ($N_A k$)

\n", "default_value": "8.314462618"}, {"fullname": "aton.phys.units.F", "modulename": "aton.phys.units", "qualname": "F", "kind": "variable", "doc": "

$F$ | Faraday constant, in C\u00b7mol$^{-1}$ ($N_A e$)

\n", "default_value": "96485.33212"}, {"fullname": "aton.phys.units.s", "modulename": "aton.phys.units", "qualname": "s", "kind": "variable", "doc": "

$\\sigma$ | Stefan-Boltzmann constant, in W\u00b7m$^{-2}$\u00b7K$^{-4}$ ($(\\pi^2/60)k^4 /\\hbar^3 c^2$)

\n\n
\n\n

Conversion factors

\n\n

Energy

\n", "default_value": "5.670374419e-08"}, {"fullname": "aton.phys.units.Ry_to_eV", "modulename": "aton.phys.units", "qualname": "Ry_to_eV", "kind": "variable", "doc": "

\n", "default_value": "13.60569312299"}, {"fullname": "aton.phys.units.Ry_to_meV", "modulename": "aton.phys.units", "qualname": "Ry_to_meV", "kind": "variable", "doc": "

\n", "default_value": "13605.69312299"}, {"fullname": "aton.phys.units.Ry_to_J", "modulename": "aton.phys.units", "qualname": "Ry_to_J", "kind": "variable", "doc": "

\n", "default_value": "2.179872361103e-18"}, {"fullname": "aton.phys.units.eV_to_Ry", "modulename": "aton.phys.units", "qualname": "eV_to_Ry", "kind": "variable", "doc": "

\n", "default_value": "0.07349864435133158"}, {"fullname": "aton.phys.units.eV_to_J", "modulename": "aton.phys.units", "qualname": "eV_to_J", "kind": "variable", "doc": "

\n", "default_value": "1.602176634e-19"}, {"fullname": "aton.phys.units.eV_to_meV", "modulename": "aton.phys.units", "qualname": "eV_to_meV", "kind": "variable", "doc": "

\n", "default_value": "1000.0"}, {"fullname": "aton.phys.units.meV_to_eV", "modulename": "aton.phys.units", "qualname": "meV_to_eV", "kind": "variable", "doc": "

\n", "default_value": "0.001"}, {"fullname": "aton.phys.units.meV_to_Ry", "modulename": "aton.phys.units", "qualname": "meV_to_Ry", "kind": "variable", "doc": "

\n", "default_value": "7.349864435133159e-05"}, {"fullname": "aton.phys.units.meV_to_J", "modulename": "aton.phys.units", "qualname": "meV_to_J", "kind": "variable", "doc": "

\n", "default_value": "1.602176634e-22"}, {"fullname": "aton.phys.units.meV_to_A", "modulename": "aton.phys.units", "qualname": "meV_to_A", "kind": "variable", "doc": "

\n", "default_value": "9.045"}, {"fullname": "aton.phys.units.meV_to_A1", "modulename": "aton.phys.units", "qualname": "meV_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.6947"}, {"fullname": "aton.phys.units.meV_to_ms", "modulename": "aton.phys.units", "qualname": "meV_to_ms", "kind": "variable", "doc": "

\n", "default_value": "437.4"}, {"fullname": "aton.phys.units.meV_to_K", "modulename": "aton.phys.units", "qualname": "meV_to_K", "kind": "variable", "doc": "

\n", "default_value": "11.604"}, {"fullname": "aton.phys.units.meV_to_THz", "modulename": "aton.phys.units", "qualname": "meV_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.2418"}, {"fullname": "aton.phys.units.meV_to_rads", "modulename": "aton.phys.units", "qualname": "meV_to_rads", "kind": "variable", "doc": "

\n", "default_value": "1519000000000.0"}, {"fullname": "aton.phys.units.meV_to_cm1", "modulename": "aton.phys.units", "qualname": "meV_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "8.0655"}, {"fullname": "aton.phys.units.meV_to_kJmol", "modulename": "aton.phys.units", "qualname": "meV_to_kJmol", "kind": "variable", "doc": "

\n", "default_value": "0.0965"}, {"fullname": "aton.phys.units.cal_to_J", "modulename": "aton.phys.units", "qualname": "cal_to_J", "kind": "variable", "doc": "

\n", "default_value": "4.184"}, {"fullname": "aton.phys.units.kcal_to_J", "modulename": "aton.phys.units", "qualname": "kcal_to_J", "kind": "variable", "doc": "

\n", "default_value": "4184.0"}, {"fullname": "aton.phys.units.J_to_eV", "modulename": "aton.phys.units", "qualname": "J_to_eV", "kind": "variable", "doc": "

\n", "default_value": "6.241509074460763e+18"}, {"fullname": "aton.phys.units.J_to_meV", "modulename": "aton.phys.units", "qualname": "J_to_meV", "kind": "variable", "doc": "

\n", "default_value": "6.241509074460763e+21"}, {"fullname": "aton.phys.units.J_to_Ry", "modulename": "aton.phys.units", "qualname": "J_to_Ry", "kind": "variable", "doc": "

\n", "default_value": "4.5874245567938074e+17"}, {"fullname": "aton.phys.units.J_to_cal", "modulename": "aton.phys.units", "qualname": "J_to_cal", "kind": "variable", "doc": "

\n", "default_value": "0.2390057361376673"}, {"fullname": "aton.phys.units.J_to_kcal", "modulename": "aton.phys.units", "qualname": "J_to_kcal", "kind": "variable", "doc": "

\n", "default_value": "0.0002390057361376673"}, {"fullname": "aton.phys.units.kJmol_to_A", "modulename": "aton.phys.units", "qualname": "kJmol_to_A", "kind": "variable", "doc": "

\n", "default_value": "2.809"}, {"fullname": "aton.phys.units.kJmol_to_A1", "modulename": "aton.phys.units", "qualname": "kJmol_to_A1", "kind": "variable", "doc": "

\n", "default_value": "2.237"}, {"fullname": "aton.phys.units.kJmol_to_ms", "modulename": "aton.phys.units", "qualname": "kJmol_to_ms", "kind": "variable", "doc": "

\n", "default_value": "1408.0"}, {"fullname": "aton.phys.units.kJmol_to_K", "modulename": "aton.phys.units", "qualname": "kJmol_to_K", "kind": "variable", "doc": "

\n", "default_value": "120.3"}, {"fullname": "aton.phys.units.kJmol_to_THz", "modulename": "aton.phys.units", "qualname": "kJmol_to_THz", "kind": "variable", "doc": "

\n", "default_value": "2.506"}, {"fullname": "aton.phys.units.kJmol_to_rads", "modulename": "aton.phys.units", "qualname": "kJmol_to_rads", "kind": "variable", "doc": "

\n", "default_value": "15750000000000.0"}, {"fullname": "aton.phys.units.kJmol_to_cm1", "modulename": "aton.phys.units", "qualname": "kJmol_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "83.59"}, {"fullname": "aton.phys.units.kJmol_to_meV", "modulename": "aton.phys.units", "qualname": "kJmol_to_meV", "kind": "variable", "doc": "
\n\n

Distance

\n", "default_value": "10.36"}, {"fullname": "aton.phys.units.A_to_m", "modulename": "aton.phys.units", "qualname": "A_to_m", "kind": "variable", "doc": "

\n", "default_value": "1e-10"}, {"fullname": "aton.phys.units.m_to_A", "modulename": "aton.phys.units", "qualname": "m_to_A", "kind": "variable", "doc": "

\n", "default_value": "10000000000.0"}, {"fullname": "aton.phys.units.bohr_to_m", "modulename": "aton.phys.units", "qualname": "bohr_to_m", "kind": "variable", "doc": "

\n", "default_value": "5.29177210544e-11"}, {"fullname": "aton.phys.units.m_to_bohr", "modulename": "aton.phys.units", "qualname": "m_to_bohr", "kind": "variable", "doc": "

\n", "default_value": "18897261259.077824"}, {"fullname": "aton.phys.units.A_to_bohr", "modulename": "aton.phys.units", "qualname": "A_to_bohr", "kind": "variable", "doc": "

\n", "default_value": "1.8897261259077824"}, {"fullname": "aton.phys.units.bohr_to_A", "modulename": "aton.phys.units", "qualname": "bohr_to_A", "kind": "variable", "doc": "
\n\n

Mass

\n", "default_value": "0.529177210544"}, {"fullname": "aton.phys.units.kg_to_g", "modulename": "aton.phys.units", "qualname": "kg_to_g", "kind": "variable", "doc": "

\n", "default_value": "1000.0"}, {"fullname": "aton.phys.units.g_to_kg", "modulename": "aton.phys.units", "qualname": "g_to_kg", "kind": "variable", "doc": "

\n", "default_value": "0.001"}, {"fullname": "aton.phys.units.amu_to_kg", "modulename": "aton.phys.units", "qualname": "amu_to_kg", "kind": "variable", "doc": "

\n", "default_value": "1.6605390666e-27"}, {"fullname": "aton.phys.units.kg_to_amu", "modulename": "aton.phys.units", "qualname": "kg_to_amu", "kind": "variable", "doc": "
\n\n

Pressure

\n", "default_value": "6.022140762081123e+26"}, {"fullname": "aton.phys.units.Pa_to_bar", "modulename": "aton.phys.units", "qualname": "Pa_to_bar", "kind": "variable", "doc": "

\n", "default_value": "1e-05"}, {"fullname": "aton.phys.units.bar_to_Pa", "modulename": "aton.phys.units", "qualname": "bar_to_Pa", "kind": "variable", "doc": "

\n", "default_value": "99999.99999999999"}, {"fullname": "aton.phys.units.GPa_to_Pa", "modulename": "aton.phys.units", "qualname": "GPa_to_Pa", "kind": "variable", "doc": "

\n", "default_value": "1000000000.0"}, {"fullname": "aton.phys.units.Pa_to_GPa", "modulename": "aton.phys.units", "qualname": "Pa_to_GPa", "kind": "variable", "doc": "

\n", "default_value": "1e-09"}, {"fullname": "aton.phys.units.kbar_to_bar", "modulename": "aton.phys.units", "qualname": "kbar_to_bar", "kind": "variable", "doc": "

\n", "default_value": "1000.0"}, {"fullname": "aton.phys.units.bar_to_kbar", "modulename": "aton.phys.units", "qualname": "bar_to_kbar", "kind": "variable", "doc": "

\n", "default_value": "0.001"}, {"fullname": "aton.phys.units.GPa_to_kbar", "modulename": "aton.phys.units", "qualname": "GPa_to_kbar", "kind": "variable", "doc": "

\n", "default_value": "10.0"}, {"fullname": "aton.phys.units.kbar_to_GPa", "modulename": "aton.phys.units", "qualname": "kbar_to_GPa", "kind": "variable", "doc": "
\n\n

Time

\n", "default_value": "0.1"}, {"fullname": "aton.phys.units.H_to_s", "modulename": "aton.phys.units", "qualname": "H_to_s", "kind": "variable", "doc": "

\n", "default_value": "3600.0"}, {"fullname": "aton.phys.units.s_to_H", "modulename": "aton.phys.units", "qualname": "s_to_H", "kind": "variable", "doc": "
\n\n

Wavelength

\n", "default_value": "0.0002777777777777778"}, {"fullname": "aton.phys.units.A_to_A1", "modulename": "aton.phys.units", "qualname": "A_to_A1", "kind": "variable", "doc": "

\n", "default_value": "6.28318"}, {"fullname": "aton.phys.units.A_to_ms", "modulename": "aton.phys.units", "qualname": "A_to_ms", "kind": "variable", "doc": "

\n", "default_value": "3956"}, {"fullname": "aton.phys.units.A_to_K", "modulename": "aton.phys.units", "qualname": "A_to_K", "kind": "variable", "doc": "

\n", "default_value": "949.3"}, {"fullname": "aton.phys.units.A_to_THz", "modulename": "aton.phys.units", "qualname": "A_to_THz", "kind": "variable", "doc": "

\n", "default_value": "19.78"}, {"fullname": "aton.phys.units.A_to_rads", "modulename": "aton.phys.units", "qualname": "A_to_rads", "kind": "variable", "doc": "

\n", "default_value": "124300000000000.0"}, {"fullname": "aton.phys.units.A_to_cm1", "modulename": "aton.phys.units", "qualname": "A_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "659.8"}, {"fullname": "aton.phys.units.A_to_meV", "modulename": "aton.phys.units", "qualname": "A_to_meV", "kind": "variable", "doc": "

\n", "default_value": "81.805"}, {"fullname": "aton.phys.units.A_to_kJmol", "modulename": "aton.phys.units", "qualname": "A_to_kJmol", "kind": "variable", "doc": "
\n\n

Wavevector

\n", "default_value": "7.893"}, {"fullname": "aton.phys.units.A1_to_A", "modulename": "aton.phys.units", "qualname": "A1_to_A", "kind": "variable", "doc": "

\n", "default_value": "6.28318"}, {"fullname": "aton.phys.units.A1_to_ms", "modulename": "aton.phys.units", "qualname": "A1_to_ms", "kind": "variable", "doc": "

\n", "default_value": "629.6"}, {"fullname": "aton.phys.units.A1_to_K", "modulename": "aton.phys.units", "qualname": "A1_to_K", "kind": "variable", "doc": "

\n", "default_value": "24.046"}, {"fullname": "aton.phys.units.A1_to_THz", "modulename": "aton.phys.units", "qualname": "A1_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.501"}, {"fullname": "aton.phys.units.A1_to_rads", "modulename": "aton.phys.units", "qualname": "A1_to_rads", "kind": "variable", "doc": "

\n", "default_value": "3148000000000.0"}, {"fullname": "aton.phys.units.A1_to_cm1", "modulename": "aton.phys.units", "qualname": "A1_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "16.71"}, {"fullname": "aton.phys.units.A1_to_meV", "modulename": "aton.phys.units", "qualname": "A1_to_meV", "kind": "variable", "doc": "

\n", "default_value": "2.072"}, {"fullname": "aton.phys.units.A1_to_kJmol", "modulename": "aton.phys.units", "qualname": "A1_to_kJmol", "kind": "variable", "doc": "
\n\n

Velocity

\n", "default_value": "0.1999"}, {"fullname": "aton.phys.units.ms_to_A", "modulename": "aton.phys.units", "qualname": "ms_to_A", "kind": "variable", "doc": "

\n", "default_value": "3956"}, {"fullname": "aton.phys.units.ms_to_A1", "modulename": "aton.phys.units", "qualname": "ms_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.001589"}, {"fullname": "aton.phys.units.ms_to_K", "modulename": "aton.phys.units", "qualname": "ms_to_K", "kind": "variable", "doc": "

\n", "default_value": "606600.0"}, {"fullname": "aton.phys.units.ms_to_THz", "modulename": "aton.phys.units", "qualname": "ms_to_THz", "kind": "variable", "doc": "

\n", "default_value": "1.265e-06"}, {"fullname": "aton.phys.units.ms_to_rads", "modulename": "aton.phys.units", "qualname": "ms_to_rads", "kind": "variable", "doc": "

\n", "default_value": "7948000.0"}, {"fullname": "aton.phys.units.ms_to_cm1", "modulename": "aton.phys.units", "qualname": "ms_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "4.216e-05"}, {"fullname": "aton.phys.units.ms_to_meV", "modulename": "aton.phys.units", "qualname": "ms_to_meV", "kind": "variable", "doc": "

\n", "default_value": "5.227e-06"}, {"fullname": "aton.phys.units.ms_to_kJmol", "modulename": "aton.phys.units", "qualname": "ms_to_kJmol", "kind": "variable", "doc": "
\n\n

Temperature

\n", "default_value": "5.044e-07"}, {"fullname": "aton.phys.units.K_to_A", "modulename": "aton.phys.units", "qualname": "K_to_A", "kind": "variable", "doc": "

\n", "default_value": "30.81"}, {"fullname": "aton.phys.units.K_to_A1", "modulename": "aton.phys.units", "qualname": "K_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.2039"}, {"fullname": "aton.phys.units.K_to_ms", "modulename": "aton.phys.units", "qualname": "K_to_ms", "kind": "variable", "doc": "

\n", "default_value": "128.4"}, {"fullname": "aton.phys.units.K_to_THz", "modulename": "aton.phys.units", "qualname": "K_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.02084"}, {"fullname": "aton.phys.units.K_to_rads", "modulename": "aton.phys.units", "qualname": "K_to_rads", "kind": "variable", "doc": "

\n", "default_value": "130900000000.0"}, {"fullname": "aton.phys.units.K_to_cm1", "modulename": "aton.phys.units", "qualname": "K_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "0.695"}, {"fullname": "aton.phys.units.K_to_meV", "modulename": "aton.phys.units", "qualname": "K_to_meV", "kind": "variable", "doc": "

\n", "default_value": "0.08617"}, {"fullname": "aton.phys.units.K_to_kJmol", "modulename": "aton.phys.units", "qualname": "K_to_kJmol", "kind": "variable", "doc": "
\n\n

Temperature scales

\n\n

Note that to change between temperature scales,\nthese constants must be added instead of multiplied.

\n", "default_value": "0.008314"}, {"fullname": "aton.phys.units.C_to_K_scale", "modulename": "aton.phys.units", "qualname": "C_to_K_scale", "kind": "variable", "doc": "

\n", "default_value": "273.15"}, {"fullname": "aton.phys.units.K_to_C_scale", "modulename": "aton.phys.units", "qualname": "K_to_C_scale", "kind": "variable", "doc": "
\n\n

Frequency

\n", "default_value": "-273.15"}, {"fullname": "aton.phys.units.THz_to_A", "modulename": "aton.phys.units", "qualname": "THz_to_A", "kind": "variable", "doc": "

\n", "default_value": "4.4475"}, {"fullname": "aton.phys.units.THz_to_A1", "modulename": "aton.phys.units", "qualname": "THz_to_A1", "kind": "variable", "doc": "

\n", "default_value": "1.4127"}, {"fullname": "aton.phys.units.THz_to_ms", "modulename": "aton.phys.units", "qualname": "THz_to_ms", "kind": "variable", "doc": "

\n", "default_value": "889.5"}, {"fullname": "aton.phys.units.THz_to_K", "modulename": "aton.phys.units", "qualname": "THz_to_K", "kind": "variable", "doc": "

\n", "default_value": "48.0"}, {"fullname": "aton.phys.units.THz_to_rads", "modulename": "aton.phys.units", "qualname": "THz_to_rads", "kind": "variable", "doc": "

\n", "default_value": "6283000000000.0"}, {"fullname": "aton.phys.units.THz_to_cm1", "modulename": "aton.phys.units", "qualname": "THz_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "33.36"}, {"fullname": "aton.phys.units.THz_to_meV", "modulename": "aton.phys.units", "qualname": "THz_to_meV", "kind": "variable", "doc": "

\n", "default_value": "4.136"}, {"fullname": "aton.phys.units.THz_to_kJmol", "modulename": "aton.phys.units", "qualname": "THz_to_kJmol", "kind": "variable", "doc": "
\n\n

Angular frequency

\n", "default_value": "0.399"}, {"fullname": "aton.phys.units.rads_to_A", "modulename": "aton.phys.units", "qualname": "rads_to_A", "kind": "variable", "doc": "

\n", "default_value": "11150000.0"}, {"fullname": "aton.phys.units.rads_to_A1", "modulename": "aton.phys.units", "qualname": "rads_to_A1", "kind": "variable", "doc": "

\n", "default_value": "5.64e-07"}, {"fullname": "aton.phys.units.rads_to_ms", "modulename": "aton.phys.units", "qualname": "rads_to_ms", "kind": "variable", "doc": "

\n", "default_value": "0.0003549"}, {"fullname": "aton.phys.units.rads_to_K", "modulename": "aton.phys.units", "qualname": "rads_to_K", "kind": "variable", "doc": "

\n", "default_value": "7.64e-12"}, {"fullname": "aton.phys.units.rads_to_THz", "modulename": "aton.phys.units", "qualname": "rads_to_THz", "kind": "variable", "doc": "

\n", "default_value": "1.592e-13"}, {"fullname": "aton.phys.units.rads_to_cm1", "modulename": "aton.phys.units", "qualname": "rads_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "5.309e-12"}, {"fullname": "aton.phys.units.rads_to_meV", "modulename": "aton.phys.units", "qualname": "rads_to_meV", "kind": "variable", "doc": "

\n", "default_value": "6.582e-13"}, {"fullname": "aton.phys.units.rads_to_kJmol", "modulename": "aton.phys.units", "qualname": "rads_to_kJmol", "kind": "variable", "doc": "
\n\n

Wavenumber

\n", "default_value": "6.351e-14"}, {"fullname": "aton.phys.units.cm1_to_A", "modulename": "aton.phys.units", "qualname": "cm1_to_A", "kind": "variable", "doc": "

\n", "default_value": "25.69"}, {"fullname": "aton.phys.units.cm1_to_A1", "modulename": "aton.phys.units", "qualname": "cm1_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.2446"}, {"fullname": "aton.phys.units.cm1_to_ms", "modulename": "aton.phys.units", "qualname": "cm1_to_ms", "kind": "variable", "doc": "

\n", "default_value": "154.01"}, {"fullname": "aton.phys.units.cm1_to_K", "modulename": "aton.phys.units", "qualname": "cm1_to_K", "kind": "variable", "doc": "

\n", "default_value": "1.439"}, {"fullname": "aton.phys.units.cm1_to_THz", "modulename": "aton.phys.units", "qualname": "cm1_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.02998"}, {"fullname": "aton.phys.units.cm1_to_rads", "modulename": "aton.phys.units", "qualname": "cm1_to_rads", "kind": "variable", "doc": "

\n", "default_value": "188400000000.0"}, {"fullname": "aton.phys.units.cm1_to_meV", "modulename": "aton.phys.units", "qualname": "cm1_to_meV", "kind": "variable", "doc": "

\n", "default_value": "0.12398487384539086"}, {"fullname": "aton.phys.units.cm1_to_kJmol", "modulename": "aton.phys.units", "qualname": "cm1_to_kJmol", "kind": "variable", "doc": "

\n", "default_value": "0.01196"}, {"fullname": "aton.qrotor", "modulename": "aton.qrotor", "kind": "module", "doc": "

QRotor

\n\n

The QRotor module is used to study the energy levels and wavefunctions of quantum rotations,\nsuch as those of methyl and amine groups.\nThese quantum systems are represented by the qrotor.System() object.

\n\n

QRotor can obtain custom potentials from DFT,\nwhich are used to solve the quantum system.

\n\n

This module uses meV as the default unit in the calculations.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.qrotor.systemDefinition of the quantum System object
aton.qrotor.systemsFunctions to manage several System objects, such as a list of systems
aton.qrotor.rotateRotate specific atoms from structural files
aton.qrotor.constantsBond lengths and inertias
aton.qrotor.potentialPotential definitions and loading functions
aton.qrotor.solveSolve rotation eigenvalues and eigenvectors
aton.qrotor.plotPlotting functions
\n\n

Examples

\n\n

Solving quantum rotational systems

\n\n

A basic calculation of the eigenvalues for a zero potential goes as follows:

\n\n
\n
import aton.qrotor as qr\nsystem = qr.System()\nsystem.gridsize = 200000  # Size of the potential grid\nsystem.B = 1  # Rotational inertia\nsystem.potential_name = 'zero'\nsystem.solve()\nsystem.eigenvalues\n# [0.0, 1.0, 1.0, 4.0, 4.0, 9.0, 9.0, ...]  # approx values\n
\n
\n\n

The accuracy of the calculation increases with bigger gridsizes,\nbut note that the runtime increases exponentially.

\n\n

The same calculation can be performed for a methyl group,\nin a cosine potential of amplitude 30 meV:

\n\n
\n
import aton.qrotor as qr\nsystem = qr.System()\nsystem.gridsize = 200000  # Size of the potential grid\nsystem.B = qr.B_CH3  # Rotational inertia of a methyl group\nsystem.potential_name = 'cosine'\nsystem.potential_constants = [0, 30, 3, 0]  # Offset, max, frequency, phase (for cosine potential)\nsystem.solve()\n# Plot potential and eigenvalues\nqr.plot.energies(system)\n# Plot the first wavefunctions\nqr.plot.wavefunction(system, levels=[0,1,2], square=True)\n
\n
\n\n

Custom potentials from DFT

\n\n

QRotor can be used to obtain custom rotational potentials from DFT calculations.\nUsing Quantum ESPRESSO, running an SCF calculation for a methyl rotation every 10 degrees:

\n\n
\n
import aton.qrotor as qr\nfrom aton import interface\n# Approx crystal positions of the atoms to rotate\natoms = [\n    '1.101   1.204   1.307'\n    '2.102   2.205   2.308'\n    '3.103   3.206   3.309'\n]\n# Create the input SCF files, saving the filenames to a list\nscf_files = qr.rotate.structure_qe('molecule.in', positions=atoms, angle=10, repeat=True)\n# Run the Quantum ESPRESSO calculations\ninterface.slurm.sbatch(files=scf_files)\n
\n
\n\n

To load the calculated potential to a QRotor System,

\n\n
\n
# Create a 'potential.dat' file with the potential as a function of the angle\nqr.potential.from_qe()\n# Load to the system\nsystem = qr.potential.load()\n# Solve the system, interpolating to a bigger gridsize\nsystem.B = qr.B_CH3\nsystem.solve(200000)\nqr.plot.energies(system)\n
\n
\n\n

Check the API documentation for more details.

\n"}, {"fullname": "aton.qrotor.constants", "modulename": "aton.qrotor.constants", "kind": "module", "doc": "

Description

\n\n

Common constants and default inertia values used in the QRotor subpackage.

\n\n

Bond lengths and angles were obtained from MAPbI3,\nsee Cryst. Growth Des. 2024, 24, 391\u2212404.

\n\n
\n"}, {"fullname": "aton.qrotor.constants.distance_CH", "modulename": "aton.qrotor.constants", "qualname": "distance_CH", "kind": "variable", "doc": "

Distance of the C-H bond, in Angstroms.

\n", "default_value": "1.09285"}, {"fullname": "aton.qrotor.constants.distance_NH", "modulename": "aton.qrotor.constants", "qualname": "distance_NH", "kind": "variable", "doc": "

Distance of the N-H bond, in Angstroms.

\n", "default_value": "1.040263"}, {"fullname": "aton.qrotor.constants.angle_CH_external", "modulename": "aton.qrotor.constants", "qualname": "angle_CH_external", "kind": "variable", "doc": "

External angle of the X-C-H bond, in degrees.

\n", "default_value": "108.7223"}, {"fullname": "aton.qrotor.constants.angle_NH_external", "modulename": "aton.qrotor.constants", "qualname": "angle_NH_external", "kind": "variable", "doc": "

External angle of the X-N-H bond, in degrees.

\n", "default_value": "111.29016"}, {"fullname": "aton.qrotor.constants.angle_CH", "modulename": "aton.qrotor.constants", "qualname": "angle_CH", "kind": "variable", "doc": "

Internal angle of the X-C-H bond, in degrees.

\n", "default_value": "71.2777"}, {"fullname": "aton.qrotor.constants.angle_NH", "modulename": "aton.qrotor.constants", "qualname": "angle_NH", "kind": "variable", "doc": "

Internal angle of the X-N-H bond, in degrees.

\n", "default_value": "68.70984"}, {"fullname": "aton.qrotor.constants.r_CH", "modulename": "aton.qrotor.constants", "qualname": "r_CH", "kind": "variable", "doc": "

Rotation radius of the methyl group, in meters.

\n", "default_value": "np.float64(1.0350223020441665e-10)"}, {"fullname": "aton.qrotor.constants.r_NH", "modulename": "aton.qrotor.constants", "qualname": "r_NH", "kind": "variable", "doc": "

Rotation radius of the amine group, in meters.

\n", "default_value": "np.float64(9.69268793902999e-11)"}, {"fullname": "aton.qrotor.constants.I_CH3", "modulename": "aton.qrotor.constants", "qualname": "I_CH3", "kind": "variable", "doc": "

Inertia of CH3, in kg\u00b7m^2.

\n", "default_value": "np.float64(5.37903596799128e-47)"}, {"fullname": "aton.qrotor.constants.I_CD3", "modulename": "aton.qrotor.constants", "qualname": "I_CD3", "kind": "variable", "doc": "

Inertia of CD3, in kg\u00b7m^2.

\n", "default_value": "np.float64(1.0748582164136045e-46)"}, {"fullname": "aton.qrotor.constants.I_NH3", "modulename": "aton.qrotor.constants", "qualname": "I_NH3", "kind": "variable", "doc": "

Inertia of NH3, in kg\u00b7m^2.

\n", "default_value": "np.float64(4.717299973303422e-47)"}, {"fullname": "aton.qrotor.constants.I_ND3", "modulename": "aton.qrotor.constants", "qualname": "I_ND3", "kind": "variable", "doc": "

Inertia of ND3, in kg\u00b7m^2.

\n", "default_value": "np.float64(9.426277618824576e-47)"}, {"fullname": "aton.qrotor.constants.B_CH3", "modulename": "aton.qrotor.constants", "qualname": "B_CH3", "kind": "variable", "doc": "

Rotational energy of CH3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.6452195002679675)"}, {"fullname": "aton.qrotor.constants.B_CD3", "modulename": "aton.qrotor.constants", "qualname": "B_CD3", "kind": "variable", "doc": "

Rotational energy of CD3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.32289457773984676)"}, {"fullname": "aton.qrotor.constants.B_NH3", "modulename": "aton.qrotor.constants", "qualname": "B_NH3", "kind": "variable", "doc": "

Rotational energy of NH3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.7357299554474442)"}, {"fullname": "aton.qrotor.constants.B_ND3", "modulename": "aton.qrotor.constants", "qualname": "B_ND3", "kind": "variable", "doc": "

Rotational energy of ND3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.36818976053280467)"}, {"fullname": "aton.qrotor.constants.constants_titov2023", "modulename": "aton.qrotor.constants", "qualname": "constants_titov2023", "kind": "variable", "doc": "

Potential constants from\nK. Titov et al., Phys. Rev. Mater. 7, 073402 (2023)\nfor the aton.qrotor.potential.titov2023 potential.\nIn meV units.

\n", "default_value": "[[2.786, 0.013, -1.5284, -0.0037, -1.2791], [2.6507, 0.0158, -1.4111, -0.0007, -1.2547], [2.1852, 0.0164, -1.0017, 0.0003, -1.2061], [5.9109, 0.0258, -7.0152, -0.0168, 1.0213], [1.4526, 0.0134, -0.3196, 0.0005, -1.1461]]"}, {"fullname": "aton.qrotor.plot", "modulename": "aton.qrotor.plot", "kind": "module", "doc": "

Description

\n\n

This module provides straightforward functions to plot QRotor data.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
potential()Potential values as a function of the angle
energies()Calculated eigenvalues
reduced_energies()Reduced energies E/B as a function of the reduced potential V/B
wavefunction()Selected wavefunctions or squared wavefunctions of a system
convergence()Energy convergence
\n\n
\n"}, {"fullname": "aton.qrotor.plot.potential", "modulename": "aton.qrotor.plot", "qualname": "potential", "kind": "function", "doc": "

Plot the potential values of a system (System object, or list of systems).

\n", "signature": "(system, title: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.energies", "modulename": "aton.qrotor.plot", "qualname": "energies", "kind": "function", "doc": "

Plot the eigenvalues of data (System or a list of System objects).

\n", "signature": "(data) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.reduced_energies", "modulename": "aton.qrotor.plot", "qualname": "reduced_energies", "kind": "function", "doc": "

Plots the reduced energy of the system E/B vs the reduced potential energy V/B.

\n\n

Takes a data list of System objects as input.

\n", "signature": "(data: list) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.wavefunction", "modulename": "aton.qrotor.plot", "qualname": "wavefunction", "kind": "function", "doc": "

Plot the wavefunction of a system for the specified levels.

\n\n

Wavefunctions are squared by default, showing the probabilities;\nTo show the actual wavefunctions, set square = False.

\n\n

levels can be a list of indexes, or the number of levels to plot.

\n\n

Specific wavefunctions can be overlapped with overlap as a list with the target indexes.\nThe overlap value can also be the max number of wavefunctions to add.\nAll found wavefunctions can be added together with overlap = True;\nbut note that this overlap is limited by the number of System.E_levels,\nthat must be specified before solving the system.\nSetting overlap will ignore the levels argument.

\n", "signature": "(\tsystem: aton.qrotor.system.System,\tsquare: bool = True,\tlevels=[0, 1, 2],\toverlap=False):", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.convergence", "modulename": "aton.qrotor.plot", "qualname": "convergence", "kind": "function", "doc": "

Plot the energy convergence of a data list of Systems as a function of the gridsize.

\n", "signature": "(data: list) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential", "modulename": "aton.qrotor.potential", "kind": "module", "doc": "

Description

\n\n

This module contains functions to calculate the actual potential_values of the system.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
save()Save the potential from a System to a data file
load()Load a System with a custom potential from a potential data file
from_qe()Creates a potential data file from Quantum ESPRESSO outputs
interpolate()Interpolates the current System.potential_values to a new System.gridsize
solve()Solve the potential values based on the potential name
\n\n

A sinthetic potential can be created by specifying its name in System.potential_name,\nalong with the corresponding System.potential_constants if required.\nAvailable potentials are:

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
zero()Zero potential
sine()Sine potential
cosine()Cosine potential
titov2023()Potential of the hindered methyl rotor, as in titov2023.
\n\n
\n"}, {"fullname": "aton.qrotor.potential.save", "modulename": "aton.qrotor.potential", "qualname": "save", "kind": "function", "doc": "

Save the rotational potential from a system to a potential data file.

\n\n

The output filepath contains angle and energy columns,\nin degrees and meVs by default.\nThe units can be changed with angle and energy,\nbut only change these defaults if you know what you are doing.

\n", "signature": "(\tsystem: aton.qrotor.system.System,\tfilepath: str = 'potential.dat',\tangle: str = 'deg',\tenergy: str = 'meV') -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.load", "modulename": "aton.qrotor.potential", "qualname": "load", "kind": "function", "doc": "

Read a rotational potential energy dataset.

\n\n

The input file in filepath should contain two columns with angle and potential energy values.\nDegrees and meV are assumed as default units unless stated in angle and energy.\nUnits will be converted automatically to radians and meV.

\n\n

An optional comment can be included in the output System.

\n\n

A previous System object can be provided through system to update its potential values.

\n", "signature": "(\tfilepath: str = 'potential.dat',\tcomment: str = None,\tsystem: aton.qrotor.system.System = None,\tangle: str = 'deg',\tenergy: str = 'meV') -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.from_qe", "modulename": "aton.qrotor.potential", "qualname": "from_qe", "kind": "function", "doc": "

Creates a potential data file from Quantum ESPRESSO outputs.

\n\n

The angle in degrees is extracted from the output filenames,\nwhich must follow whatever_ANGLE.out.

\n\n

Outputs from SCF calculations must be located in the provided folder (CWD if None).\nFiles can be filtered by those containing the specified include filters,\nexcluding those containing any string from the exclude list. \nThe output filepath name is 'potential.dat' by default.

\n\n

Energy values are saved to meV by dafault, unless specified in energy.\nOnly change the energy units if you know what you are doing;\nremember that default energy units in QRotor are meV!

\n", "signature": "(\tfolder=None,\tfilepath: str = 'potential.dat',\tinclude: list = ['.out'],\texclude: list = ['slurm-'],\tenergy: str = 'meV',\tcomment: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.interpolate", "modulename": "aton.qrotor.potential", "qualname": "interpolate", "kind": "function", "doc": "

Interpolates the current System.potential_values\nto a new grid of size System.gridsize.

\n", "signature": "(system: aton.qrotor.system.System) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.solve", "modulename": "aton.qrotor.potential", "qualname": "solve", "kind": "function", "doc": "

Solves System.potential_values\naccording to the System.potential_name,\nreturning the new potential_values.\nAvaliable potential names are zero, sine and titov2023.

\n\n

If System.potential_name is not present or not recognised,\nthe current System.potential_values are used.

\n\n

This function provides basic solving of the potential energy function.\nTo interpolate to a new gridsize and correct the potential offset after solving,\ncheck aton.qrotor.solve.potential().

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.zero", "modulename": "aton.qrotor.potential", "qualname": "zero", "kind": "function", "doc": "

Zero potential.

\n\n

$V(x) = 0$

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.sine", "modulename": "aton.qrotor.potential", "qualname": "sine", "kind": "function", "doc": "

Sine potential.

\n\n

$V(x) = C_0 + \\frac{C_1}{2} sin(x C_2 + C_3)$
\nWith $C_0$ as the potential offset,\n$C_1$ as the max potential value (without considering the offset),\n$C_2$ as the frequency, and $C_3$ as the phase.\nIf no System.potential_constants are provided, defaults to $sin(3x)$

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.cosine", "modulename": "aton.qrotor.potential", "qualname": "cosine", "kind": "function", "doc": "

Cosine potential.

\n\n

$V(x) = C_0 + \\frac{C_1}{2} cos(x C_2 + C_3)$
\nWith $C_0$ as the potential offset,\n$C_1$ as the max potential value (without considering the offset),\n$C_2$ as the frequency, and $C_3$ as the phase.\nIf no System.potential_constants are provided, defaults to $cos(3x)$

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.titov2023", "modulename": "aton.qrotor.potential", "qualname": "titov2023", "kind": "function", "doc": "

Potential energy function of the hindered methyl rotor, from\nK. Titov et al., Phys. Rev. Mater. 7, 073402 (2023).

\n\n

$V(x) = C_0 + C_1 sin(3x) + C_2 cos(3x) + C_3 sin(6x) + C_4 cos(6x)$
\nDefault constants are aton.qrotor.constants.constants_titov2023[0].

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.rotate", "modulename": "aton.qrotor.rotate", "kind": "module", "doc": "

Description

\n\n

This submodule contains tools to rotate molecular structures.\nWorks with Quantum ESPRESSO input files.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n
structure_qe()Rotate specific atoms from a Quantum ESPRESSO input file
rotate_coords()Rotate a specific list of coordinates
\n\n
\n"}, {"fullname": "aton.qrotor.rotate.structure_qe", "modulename": "aton.qrotor.rotate", "qualname": "structure_qe", "kind": "function", "doc": "

Rotates atoms from a Quantum ESPRESSO input file.

\n\n

Takes a filepath with a molecular structure, and three or more atomic positions (list).\nThese input positions can be approximate, and are used to identify the target atoms.\nThe decimal precision in the search for these positions is controlled by precision.

\n\n

It rotates the atoms by a specific angle in degrees.\nAdditionally, if repeat = True it repeats the same rotation over the whole circunference.\nFinally, it writes the rotated structure(s) to a new structural file(s).\nReturns a list with the output filename(s).

\n\n

By default, the rotation axis is defined by the perpendicular vector\npassing through the geometrical center of the first three points.\nTo override this and instead use the vector between the first two atoms\nas the rotation axis, set use_centroid = False.

\n\n

To debug, show_axis = True adds two additional helium atoms as the rotation vector.

\n", "signature": "(\tfilepath: str,\tpositions: list,\tangle: float,\trepeat: bool = False,\tprecision: int = 3,\tuse_centroid: bool = True,\tshow_axis: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.rotate.rotate_coords", "modulename": "aton.qrotor.rotate", "qualname": "rotate_coords", "kind": "function", "doc": "

Rotates geometrical coordinates.

\n\n

Takes a list of atomic positions in cartesian coordinates, as\n[[x1,y1,z1], [x2,y2,z2], [x3,y3,z3], [etc].\nThen rotates said coordinates by a given angle in degrees.\nReturns a list with the updated positions.

\n\n

By default, the rotation axis is defined by the perpendicular vector\npassing through the geometrical center of the first three points.\nTo override this and use the vector between the first two atoms\nas the rotation axis, set use_centroid = False.

\n\n

If show_axis = True it returns two additional coordinates at the end of the list,\nwith the centroid and the rotation vector. Only works with use_centroid = True.

\n", "signature": "(\tpositions: list,\tangle: float,\tuse_centroid: bool = True,\tshow_axis: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve", "modulename": "aton.qrotor.solve", "kind": "module", "doc": "

Description

\n\n

This module is used to solve the hamiltonian eigenvalues and eigenvectors for a given quantum system.\nSparse matrices are used to achieve optimal performance.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
energies()Solve the quantum system, including eigenvalues and eigenvectors
potential()Solve the potential values of the system
schrodinger()Solve the Schr\u00f6diger equation for the system
hamiltonian_matrix()Calculate the hamiltonian matrix of the system
laplacian_matrix()Calculate the second derivative matrix for a given grid
\n\n
\n"}, {"fullname": "aton.qrotor.solve.energies", "modulename": "aton.qrotor.solve", "qualname": "energies", "kind": "function", "doc": "

Solves the quantum system.

\n\n

This includes solving the potential, the eigenvalues and the eigenvectors.

\n\n

The resulting System object is saved with pickle to filename if specified.

\n", "signature": "(\tsystem: aton.qrotor.system.System,\tfilename: str = None) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.potential", "modulename": "aton.qrotor.solve", "qualname": "potential", "kind": "function", "doc": "

Solves the potential values of the system.

\n\n

It interpolates the potential if system.gridsize is larger than the current grid.\nIt solves the potential according to the potential name,\nby calling aton.qrotor.potential.solve().\nThen it applies extra operations, such as removing the potential offset\nif system.correct_potential_offset = True.

\n", "signature": "(system: aton.qrotor.system.System) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.schrodinger", "modulename": "aton.qrotor.solve", "qualname": "schrodinger", "kind": "function", "doc": "

Solves the Schr\u00f6dinger equation for a given system.

\n\n

Uses ARPACK in shift-inverse mode to solve the hamiltonian sparse matrix.

\n", "signature": "(system: aton.qrotor.system.System) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.hamiltonian_matrix", "modulename": "aton.qrotor.solve", "qualname": "hamiltonian_matrix", "kind": "function", "doc": "

Calculates the Hamiltonian matrix for a given system.

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.laplacian_matrix", "modulename": "aton.qrotor.solve", "qualname": "laplacian_matrix", "kind": "function", "doc": "

Calculates the Laplacian (second derivative) matrix for a given grid.

\n", "signature": "(grid):", "funcdef": "def"}, {"fullname": "aton.qrotor.system", "modulename": "aton.qrotor.system", "kind": "module", "doc": "

Description

\n\n

The System object contains all the information needed for a single QRotor calculation.\nThis class can be loaded directly as aton.qrotor.System().

\n\n
\n"}, {"fullname": "aton.qrotor.system.System", "modulename": "aton.qrotor.system", "qualname": "System", "kind": "class", "doc": "

Quantum system.

\n\n

Contains all the data for a single QRotor calculation, with both inputs and outputs.

\n"}, {"fullname": "aton.qrotor.system.System.__init__", "modulename": "aton.qrotor.system", "qualname": "System.__init__", "kind": "function", "doc": "

\n", "signature": "(\tcomment: str = None,\tgroup: str = 'CH3',\tE_levels: int = 15,\tcorrect_potential_offset: bool = True,\tsave_eigenvectors: bool = True,\tgridsize: int = None,\tgrid=[],\tB: float = None,\tpotential_name: str = '',\tpotential_constants: list = None,\tpotential_values=[])"}, {"fullname": "aton.qrotor.system.System.version", "modulename": "aton.qrotor.system", "qualname": "System.version", "kind": "variable", "doc": "

Version of the package used to generate the data.

\n"}, {"fullname": "aton.qrotor.system.System.comment", "modulename": "aton.qrotor.system", "qualname": "System.comment", "kind": "variable", "doc": "

Custom comment for the dataset.

\n", "annotation": ": str"}, {"fullname": "aton.qrotor.system.System.group", "modulename": "aton.qrotor.system", "qualname": "System.group", "kind": "variable", "doc": "

Chemical group, methyl or amine: 'CH3', 'CD3', 'NH3', 'ND3'.

\n", "annotation": ": str"}, {"fullname": "aton.qrotor.system.System.E_levels", "modulename": "aton.qrotor.system", "qualname": "System.E_levels", "kind": "variable", "doc": "

Number of energy levels to be studied.

\n", "annotation": ": int"}, {"fullname": "aton.qrotor.system.System.correct_potential_offset", "modulename": "aton.qrotor.system", "qualname": "System.correct_potential_offset", "kind": "variable", "doc": "

Correct the potential offset as V - min(V) or not.

\n", "annotation": ": bool"}, {"fullname": "aton.qrotor.system.System.save_eigenvectors", "modulename": "aton.qrotor.system", "qualname": "System.save_eigenvectors", "kind": "variable", "doc": "

Save or not the eigenvectors. Final file size will be bigger.

\n", "annotation": ": bool"}, {"fullname": "aton.qrotor.system.System.gridsize", "modulename": "aton.qrotor.system", "qualname": "System.gridsize", "kind": "variable", "doc": "

Number of points in the grid.

\n", "annotation": ": int"}, {"fullname": "aton.qrotor.system.System.grid", "modulename": "aton.qrotor.system", "qualname": "System.grid", "kind": "variable", "doc": "

The grid with the points to be used in the calculation.

\n\n

Can be set automatically over $2 \\pi$ with System.set_grid().\nUnits must be in radians.

\n"}, {"fullname": "aton.qrotor.system.System.B", "modulename": "aton.qrotor.system", "qualname": "System.B", "kind": "variable", "doc": "

Rotational inertia, as in $B=\\frac{\\hbar^2}{2I}$.

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_name", "modulename": "aton.qrotor.system", "qualname": "System.potential_name", "kind": "variable", "doc": "

Name of the desired potential: 'zero', 'titov2023', 'test'...\nIf empty or unrecognised, the custom potential values inside System.potential_values will be used.

\n", "annotation": ": str"}, {"fullname": "aton.qrotor.system.System.potential_constants", "modulename": "aton.qrotor.system", "qualname": "System.potential_constants", "kind": "variable", "doc": "

List of constants to be used in the calculation of the potential energy, in the aton.qrotor.potential module.

\n", "annotation": ": list"}, {"fullname": "aton.qrotor.system.System.potential_values", "modulename": "aton.qrotor.system", "qualname": "System.potential_values", "kind": "variable", "doc": "

Numpy ndarray with the potential values for each point in the grid.

\n\n

Can be calculated with a function available in the qrotor.potential module,\nor loaded externally with the qrotor.potential.load() function.\nPotential energy units must be in meV.

\n"}, {"fullname": "aton.qrotor.system.System.potential_offset", "modulename": "aton.qrotor.system", "qualname": "System.potential_offset", "kind": "variable", "doc": "

min(V) before offset correction when correct_potential_offset = True

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_min", "modulename": "aton.qrotor.system", "qualname": "System.potential_min", "kind": "variable", "doc": "

min(V)

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_max", "modulename": "aton.qrotor.system", "qualname": "System.potential_max", "kind": "variable", "doc": "

max(V)

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_max_B", "modulename": "aton.qrotor.system", "qualname": "System.potential_max_B", "kind": "variable", "doc": "

Reduced potential_max, in units of B.

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.eigenvalues", "modulename": "aton.qrotor.system", "qualname": "System.eigenvalues", "kind": "variable", "doc": "

Calculated eigenvalues of the system. Should be in meV.

\n"}, {"fullname": "aton.qrotor.system.System.eigenvalues_B", "modulename": "aton.qrotor.system", "qualname": "System.eigenvalues_B", "kind": "variable", "doc": "

Reduced eigenvalues, in units of B.

\n"}, {"fullname": "aton.qrotor.system.System.eigenvectors", "modulename": "aton.qrotor.system", "qualname": "System.eigenvectors", "kind": "variable", "doc": "

Eigenvectors, if save_eigenvectors is True. Beware of the file size.

\n"}, {"fullname": "aton.qrotor.system.System.energy_barrier", "modulename": "aton.qrotor.system", "qualname": "System.energy_barrier", "kind": "variable", "doc": "

max(V) - min(eigenvalues)

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.first_transition", "modulename": "aton.qrotor.system", "qualname": "System.first_transition", "kind": "variable", "doc": "

eigenvalues[1] - eigenvalues[0]

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.runtime", "modulename": "aton.qrotor.system", "qualname": "System.runtime", "kind": "variable", "doc": "

Time taken to solve the eigenvalues.

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.summary", "modulename": "aton.qrotor.system", "qualname": "System.summary", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.set_grid", "modulename": "aton.qrotor.system", "qualname": "System.set_grid", "kind": "function", "doc": "

Sets the System.grid to the specified gridsize from 0 to $2\\pi$.

\n\n

If the system had a previous grid and potential values,\nit will interpolate those values to the new gridsize,\nusing aton.qrotor.potential.interpolate().

\n", "signature": "(self, gridsize: int = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.set_group", "modulename": "aton.qrotor.system", "qualname": "System.set_group", "kind": "function", "doc": "

Normalise System.group name, and set System.B based on it.

\n", "signature": "(self, group: str = None, B: float = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.solve", "modulename": "aton.qrotor.system", "qualname": "System.solve", "kind": "function", "doc": "

Solves the quantum system.

\n\n

The potential can be interpolated to a new_gridsize.

\n\n

Same as running aton.qrotor.solve.energies(System).

\n", "signature": "(self, new_gridsize: int = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.reduce_size", "modulename": "aton.qrotor.system", "qualname": "System.reduce_size", "kind": "function", "doc": "

Discard data that takes too much space,\nlike eigenvectors, potential values and grids.

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.qrotor.systems", "modulename": "aton.qrotor.systems", "kind": "module", "doc": "

Description

\n\n

This module contains utility functions to handle multiple aton.qrotor.system calculations.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
as_list()Ensures that a list only contains System objects
get_energies()Get the eigenvalues from all systems
get_gridsizes()Get all gridsizes
get_runtimes()Get all runtimes
get_groups()Get the chemical groups in use
sort_by_gridsize()Sort systems by gridsize
reduce_size()Discard data that takes too much space
get_ideal_E()Calculate the ideal energy for a specified level
\n\n
\n"}, {"fullname": "aton.qrotor.systems.as_list", "modulename": "aton.qrotor.systems", "qualname": "as_list", "kind": "function", "doc": "

Ensures that systems is a list of System objects.

\n\n

If it is a System, returns a list with that System as the only element.\nIf it is neither a list nor a System,\nor if the list does not contain only System objects,\nit raises an error.

\n", "signature": "(systems) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_energies", "modulename": "aton.qrotor.systems", "qualname": "get_energies", "kind": "function", "doc": "

Get a list with all eigenvalues from all systems.

\n\n

If no eigenvalues are present for a particular system, appends None.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_gridsizes", "modulename": "aton.qrotor.systems", "qualname": "get_gridsizes", "kind": "function", "doc": "

Get a list with all gridsize values.

\n\n

If no gridsize value is present for a particular system, appends None.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_runtimes", "modulename": "aton.qrotor.systems", "qualname": "get_runtimes", "kind": "function", "doc": "

Returns a list with all runtime values.

\n\n

If no runtime value is present for a particular system, appends None.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_groups", "modulename": "aton.qrotor.systems", "qualname": "get_groups", "kind": "function", "doc": "

Returns a list with all System.group values.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.sort_by_gridsize", "modulename": "aton.qrotor.systems", "qualname": "sort_by_gridsize", "kind": "function", "doc": "

Sorts a list of System objects by System.gridsize.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.reduce_size", "modulename": "aton.qrotor.systems", "qualname": "reduce_size", "kind": "function", "doc": "

Discard data that takes too much space.

\n\n

Removes eigenvectors, potential values and grids,\nfor all System values inside the systems list.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_ideal_E", "modulename": "aton.qrotor.systems", "qualname": "get_ideal_E", "kind": "function", "doc": "

Calculates the ideal energy for a specified E_level.

\n\n

To be used in convergence tests with potential_name = 'zero'.

\n", "signature": "(E_level: int) -> int:", "funcdef": "def"}, {"fullname": "aton.spx", "modulename": "aton.spx", "kind": "module", "doc": "

Spectra analysis

\n\n

This module contains spectral analysis tools.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.spx.classesDefinition of the Spectra, Plotting and Material classes, instantiated as aton.spx.Class()
aton.spx.fitSpectral fitting functions
aton.spx.normalizeSpectra normalisation
aton.spx.deuteriumDeuteration estimation functions
aton.spx.samplesMaterial definition examples
aton.spx.plotSpectra plotting, as aton.spx.plot(Spectra)
\n\n

Examples

\n\n

To load two INS spectra CSV files with cm$^{-1}$ as input units,\nand plot them in meV units, normalizing their heights over the range from 20 to 50 meV:

\n\n
\n
from aton import spx\n# Set plotting parameters\nplotting_options = spx.Plotting(\n    title     = 'Calculated INS',\n    )\n# Load the spectral data\nins = spx.Spectra(\n    type     = 'INS',\n    files    = ['example_1.csv', 'example_2.csv'],\n    units_in = 'cm-1',\n    units    = 'meV',\n    plotting = plotting_options,\n    )\n# Normalize the spectra\nspx.height(spectra=ins, range=[20, 50])\n# Plot the spectra\nspx.plot(ins)\n
\n
\n\n

More examples in the Aton/examples/ folder.

\n"}, {"fullname": "aton.spx.classes", "modulename": "aton.spx.classes", "kind": "module", "doc": "

Description

\n\n

This module contains common classes used to load and manipulate spectral data.\nAny class can be instantiated directly from the aton.spx module,\nas aton.spx.Class().

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
SpectraUsed to load and process spectral data
PlottingStores plotting options, used in Spectra.plotting
MaterialUsed to store and calculate material parameters, such as molar masses and neutron cross sections
\n\n

Examples

\n\n

To load two INS spectra CSV files with cm$^{-1}$ as input units,\nconverting them to meV units, and finally plotting them:

\n\n
\n
from aton import spx\nins = spx.Spectra(\n    type     = 'ins',\n    files    = ['example_1.csv', 'example_2.csv'],\n    units_in = 'cm-1',\n    units    = 'meV',\n    )\nspx.plot(ins)\n
\n
\n\n

Check more use examples in the ATON/examples/ folder.

\n\n
\n"}, {"fullname": "aton.spx.classes.Plotting", "modulename": "aton.spx.classes", "qualname": "Plotting", "kind": "class", "doc": "

Stores plotting options, read by aton.spx.plot

\n"}, {"fullname": "aton.spx.classes.Plotting.__init__", "modulename": "aton.spx.classes", "qualname": "Plotting.__init__", "kind": "function", "doc": "

Default values can be overwritten when initializing the Plotting object.

\n", "signature": "(\ttitle: str = None,\txlim=None,\tylim=None,\tmargins: list = [0, 0],\toffset=True,\tscaling: float = 1.0,\tvline: list = None,\tvline_error: list = None,\tfigsize: tuple = None,\tlog_xscale: bool = False,\tshow_yticks: bool = False,\txlabel: str = None,\tylabel: str = None,\tlegend=None,\tlegend_title: str = None,\tlegend_size='medium',\tlegend_loc='best',\tsave_as: str = None)"}, {"fullname": "aton.spx.classes.Plotting.title", "modulename": "aton.spx.classes", "qualname": "Plotting.title", "kind": "variable", "doc": "

Title of the plot. Set it to an empty string to remove the title.

\n"}, {"fullname": "aton.spx.classes.Plotting.xlim", "modulename": "aton.spx.classes", "qualname": "Plotting.xlim", "kind": "variable", "doc": "

List with the x-limits of the plot, as in [xlim_low, xlim_top].

\n"}, {"fullname": "aton.spx.classes.Plotting.ylim", "modulename": "aton.spx.classes", "qualname": "Plotting.ylim", "kind": "variable", "doc": "

List with the y-limits of the plot, as in [ylim_low, ylim_top].

\n"}, {"fullname": "aton.spx.classes.Plotting.margins", "modulename": "aton.spx.classes", "qualname": "Plotting.margins", "kind": "variable", "doc": "

List with additional margins at the bottom and top of the plot, as in [low_margin, top_margin].

\n"}, {"fullname": "aton.spx.classes.Plotting.offset", "modulename": "aton.spx.classes", "qualname": "Plotting.offset", "kind": "variable", "doc": "

If True, the plots will be separated automatically.

\n\n

It can be set to a float, to equally offset the plots by a given value.

\n"}, {"fullname": "aton.spx.classes.Plotting.scaling", "modulename": "aton.spx.classes", "qualname": "Plotting.scaling", "kind": "variable", "doc": "

Scaling factor

\n"}, {"fullname": "aton.spx.classes.Plotting.vline", "modulename": "aton.spx.classes", "qualname": "Plotting.vline", "kind": "variable", "doc": "

Vertical line/s to plot. Can be an int or float with the x-position, or a list with several ones.

\n"}, {"fullname": "aton.spx.classes.Plotting.vline_error", "modulename": "aton.spx.classes", "qualname": "Plotting.vline_error", "kind": "variable", "doc": "

Plot a shaded area of the specified width around the vertical lines specified at vline.

\n\n

It can be an array of the same length as vline, or a single value to be applied to all.

\n"}, {"fullname": "aton.spx.classes.Plotting.figsize", "modulename": "aton.spx.classes", "qualname": "Plotting.figsize", "kind": "variable", "doc": "

Tuple with the figure size, as in matplotlib.

\n"}, {"fullname": "aton.spx.classes.Plotting.log_xscale", "modulename": "aton.spx.classes", "qualname": "Plotting.log_xscale", "kind": "variable", "doc": "

If true, plot the x-axis in logarithmic scale.

\n"}, {"fullname": "aton.spx.classes.Plotting.show_yticks", "modulename": "aton.spx.classes", "qualname": "Plotting.show_yticks", "kind": "variable", "doc": "

Show or not the yticks on the plot.

\n"}, {"fullname": "aton.spx.classes.Plotting.xlabel", "modulename": "aton.spx.classes", "qualname": "Plotting.xlabel", "kind": "variable", "doc": "

Custom label of the x-axis.

\n\n

If None, the default label will be used.\nSet to '' to remove the label of the horizontal axis.

\n"}, {"fullname": "aton.spx.classes.Plotting.ylabel", "modulename": "aton.spx.classes", "qualname": "Plotting.ylabel", "kind": "variable", "doc": "

Custom label of the y-axis.

\n\n

If None, the default label will be used.\nSet to '' to remove the label of the vertical axis.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend", "modulename": "aton.spx.classes", "qualname": "Plotting.legend", "kind": "variable", "doc": "

Legend of the plot.

\n\n

If None, the filenames will be used as legend.\nCan be a bool to show or hide the plot legend.\nIt can also be an array containing the strings to display;\nin that case, elements set to False will not be displayed.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend_title", "modulename": "aton.spx.classes", "qualname": "Plotting.legend_title", "kind": "variable", "doc": "

Title of the legend, defaults to None.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend_size", "modulename": "aton.spx.classes", "qualname": "Plotting.legend_size", "kind": "variable", "doc": "

Size of the legend, as in matplotlib. Defaults to 'medium'.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend_loc", "modulename": "aton.spx.classes", "qualname": "Plotting.legend_loc", "kind": "variable", "doc": "

Location of the legend, as in matplotlib. Defaults to 'best'.

\n"}, {"fullname": "aton.spx.classes.Plotting.save_as", "modulename": "aton.spx.classes", "qualname": "Plotting.save_as", "kind": "variable", "doc": "

Filename to save the plot. None by default.

\n"}, {"fullname": "aton.spx.classes.Spectra", "modulename": "aton.spx.classes", "qualname": "Spectra", "kind": "class", "doc": "

Spectra object. Used to load and process spectral data.

\n\n

Most functions in the aton.spx module receive this object as input.

\n"}, {"fullname": "aton.spx.classes.Spectra.__init__", "modulename": "aton.spx.classes", "qualname": "Spectra.__init__", "kind": "function", "doc": "

All values can be set when initializing the Spectra object.

\n", "signature": "(\ttype: str = None,\tcomment: str = None,\tfiles=None,\tdfs=None,\tunits=None,\tunits_in=None,\tplotting: aton.spx.classes.Plotting = <aton.spx.classes.Plotting object>)"}, {"fullname": "aton.spx.classes.Spectra.type", "modulename": "aton.spx.classes", "qualname": "Spectra.type", "kind": "variable", "doc": "

Type of the spectra: 'INS', 'ATR', or 'RAMAN'.

\n"}, {"fullname": "aton.spx.classes.Spectra.comment", "modulename": "aton.spx.classes", "qualname": "Spectra.comment", "kind": "variable", "doc": "

Custom comment. If Plotting.title is None, it will be the title of the plot.

\n"}, {"fullname": "aton.spx.classes.Spectra.files", "modulename": "aton.spx.classes", "qualname": "Spectra.files", "kind": "variable", "doc": "

List containing the files with the spectral data.

\n\n

Loaded automatically to dfs with Pandas at initialization.\nIn order for Pandas to read the files properly, note that the column lines must start by #.\nAny additional line that is not data must be removed or commented with #.\nCSV files must be formatted with the first column as the energy or energy transfer,\nand the second column with the intensity or absorbance, depending on the case.\nAn additional third 'Error' column can be used.

\n"}, {"fullname": "aton.spx.classes.Spectra.dfs", "modulename": "aton.spx.classes", "qualname": "Spectra.dfs", "kind": "variable", "doc": "

List containing the pandas dataframes with the spectral data.

\n\n

Loaded automatically from files at initialization.

\n"}, {"fullname": "aton.spx.classes.Spectra.units", "modulename": "aton.spx.classes", "qualname": "Spectra.units", "kind": "variable", "doc": "

Target units of the spectral data.

\n\n

Can be 'meV' or 'cm-1'.

\n"}, {"fullname": "aton.spx.classes.Spectra.units_in", "modulename": "aton.spx.classes", "qualname": "Spectra.units_in", "kind": "variable", "doc": "

Input units of the spectral data, used in the input CSV files.

\n\n

Can be 'meV' or 'cm-1'.\nIf the input CSV files have different units,\nit can also be set as a list of the same length of the number of input files,\neg. ['meV', 'cm-1', 'cm-1'].

\n"}, {"fullname": "aton.spx.classes.Spectra.plotting", "modulename": "aton.spx.classes", "qualname": "Spectra.plotting", "kind": "variable", "doc": "

Plotting object, used to set the plotting options.

\n"}, {"fullname": "aton.spx.classes.Spectra.set_units", "modulename": "aton.spx.classes", "qualname": "Spectra.set_units", "kind": "function", "doc": "

Method to change between spectral units. ALWAYS use this method to do that.

\n\n

For example, to change to meV from cm-1:

\n\n
\n
Spectra.set_units('meV', 'cm-1')\n
\n
\n", "signature": "(self, units, units_in=None, default_unit='cm-1'):", "funcdef": "def"}, {"fullname": "aton.spx.classes.Material", "modulename": "aton.spx.classes", "qualname": "Material", "kind": "class", "doc": "

Material class.

\n\n

Used to calculate molar masses and cross sections,\nand to pass data to different analysis functions\nsuch as aton.spectra.deuterium.impulse_approx().

\n"}, {"fullname": "aton.spx.classes.Material.__init__", "modulename": "aton.spx.classes", "qualname": "Material.__init__", "kind": "function", "doc": "

All values can be set when initializing the Material object.\nHowever, it is recommended to only set the elements and the grams,\nand optionally the name, and calculate the rest with Material.set().

\n", "signature": "(\telements: dict,\tname: str = None,\tgrams: float = None,\tgrams_error: float = None,\tmols: float = None,\tmols_error: float = None,\tmolar_mass: float = None,\tcross_section: float = None,\tpeaks: dict = None)"}, {"fullname": "aton.spx.classes.Material.elements", "modulename": "aton.spx.classes", "qualname": "Material.elements", "kind": "variable", "doc": "

Dict of atoms in the material, as in {'H': 6, 'C':1, 'N':1}.

\n\n

Isotopes can be expressed as 'H2', 'He4', etc. with the atom symbol + isotope mass number.

\n"}, {"fullname": "aton.spx.classes.Material.name", "modulename": "aton.spx.classes", "qualname": "Material.name", "kind": "variable", "doc": "

String with the name of the material.

\n"}, {"fullname": "aton.spx.classes.Material.grams", "modulename": "aton.spx.classes", "qualname": "Material.grams", "kind": "variable", "doc": "

Mass, in grams.

\n"}, {"fullname": "aton.spx.classes.Material.grams_error", "modulename": "aton.spx.classes", "qualname": "Material.grams_error", "kind": "variable", "doc": "

Error of the measured mass in grams.

\n\n

Set automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.mols", "modulename": "aton.spx.classes", "qualname": "Material.mols", "kind": "variable", "doc": "

Number of moles.

\n\n

Set automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.mols_error", "modulename": "aton.spx.classes", "qualname": "Material.mols_error", "kind": "variable", "doc": "

Error of the number of moles.

\n\n

Set automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.molar_mass", "modulename": "aton.spx.classes", "qualname": "Material.molar_mass", "kind": "variable", "doc": "

Molar mass of the material, in mol/g.

\n\n

Calculated automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.cross_section", "modulename": "aton.spx.classes", "qualname": "Material.cross_section", "kind": "variable", "doc": "

Neutron total bound scattering cross section, in barns.

\n\n

Calculated automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.peaks", "modulename": "aton.spx.classes", "qualname": "Material.peaks", "kind": "variable", "doc": "

Dict with interesting peaks that you might want to store for later use.

\n"}, {"fullname": "aton.spx.classes.Material.set", "modulename": "aton.spx.classes", "qualname": "Material.set", "kind": "function", "doc": "

Set the molar mass, cross section and errors of the material.

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.spx.classes.Material.print", "modulename": "aton.spx.classes", "qualname": "Material.print", "kind": "function", "doc": "

Print a summary with the material information.

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.spx.deuterium", "modulename": "aton.spx.deuterium", "kind": "module", "doc": "

Description

\n\n

This module contains methods to calculate deuteration levels from different spectra.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n
impulse_approx()Calculate the deuteration levels from INS spectra with the Impulse Approximation
peaks_mapbi3()Estimates CH$_3$NH$_3$PbI$_3$ deuteration by integrating the INS disrotatory peaks
\n\n
\n"}, {"fullname": "aton.spx.deuterium.impulse_approx", "modulename": "aton.spx.deuterium", "qualname": "impulse_approx", "kind": "function", "doc": "

Calculate the deuteration levels from INS spectra\nwith the Impulse Approximation, see\nhttps://www.tandfonline.com/doi/full/10.1080/00018732.2017.1317963.

\n\n

Protonated and deuterated materials must be specified\nas aton.spectra.classes.Material objects.\nNote that this approximation is very sensitive to the mass sample.\nThe threshold controls the start of the plateau (in meV)\nto start considering Deep Inelastic Neutron Scattering (DINS).\nThe protonated and deuterated dataframe indexes are specified\nby H_df_index and D_df_index, respectively.

\n\n

In this approximation, the ideal ratio between\nthe cross-sections and the experimental ratio between\nthe pleteaus at high energies should be the same:\n$$\n\\frac{\\text{plateau_D}}{\\text{plateau_H}} \\approx \\frac{\\text{cross_section_D}}{\\text{cross_section_H}}\n$$\nTaking this into account, the deuteration is estimated as:\n$$\n\\text{Deuteration} = \\frac{1-\\text{real_ratio}}{1-\\text{ideal_ratio}}\n$$

\n", "signature": "(\tins: aton.spx.classes.Spectra,\tmaterial_H: aton.spx.classes.Material,\tmaterial_D: aton.spx.classes.Material,\tthreshold: float = 600,\tH_df_index: int = 0,\tD_df_index: int = 1) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.deuterium.peaks_mapbi3", "modulename": "aton.spx.deuterium", "qualname": "peaks_mapbi3", "kind": "function", "doc": "

Estimates CH$_3$NH$_3$PbI$_3$ deuteration by integrating the INS disrotatory peaks.

\n\n

The INS disrotatory peaks of CH3NH3 appear at ~38 meV for the fully protonated sample.\nNote that peaks must be a dictionary with the peak limits\nand the baseline, as in the example below:

\n\n
\n
peaks = {\n    'baseline' : None,\n    'baseline_error' : None,\n    'h6d0' : [41, 43],\n    'h5d1' : [41, 43],\n    'h4d2' : [41, 43],\n    'h3d3' : [34.7, 37.3],\n    'h2d4' : [31.0, 33.0],\n    'h1d5' : [28.0, 30.5],\n    'h0d6' : [26.5, 28.0],\n    }\n
\n
\n\n

Peak keywords required for selective deuteration (only C or only N):\nh6d0, h5d1, h4d2, h3d3.

\n\n

Additional peak keywords required for total deuteration:\nh2d4, h1d5, h0d6.

\n\n

If some peak is not present in your sample,\njust set the limits to a small baseline plateau.

\n", "signature": "(ins: aton.spx.classes.Spectra, peaks: dict, df_index: int = 0) -> str:", "funcdef": "def"}, {"fullname": "aton.spx.fit", "modulename": "aton.spx.fit", "kind": "module", "doc": "

Description

\n\n

This module contains functions for fitting and analyzing spectral data.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
plateau()Fit the mean value and the error of a plateau
area_under_peak()Calculate the area under a given peak
ratio_areas()Check the ratio between two areas
mean()Get the mean and standard deviation of a list of values
\n\n
\n"}, {"fullname": "aton.spx.fit.plateau", "modulename": "aton.spx.fit", "qualname": "plateau", "kind": "function", "doc": "

Fit the mean value and the error of a plateau in a aton.spectra.Spectra object.

\n\n

Use as aton.spx.fit.plateau(spectra, cuts=[low_cut, high_cut], df_index=0).

\n\n

If aton.spx.classes.Spectra.dfs[df_index] has an 'Error' column, those errors are also taken into account\nalong with the standard deviation of the mean, else only the standard deviation is considered.\nThis is the case if your dataset had a third column with the errors\nwhen you imported the aton.spx.classes.Spectra object.

\n\n

Note that cuts, low_cut and/or top_cut can be set to None.

\n", "signature": "(spectra: aton.spx.classes.Spectra, cuts=None, df_index: int = 0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.fit.area_under_peak", "modulename": "aton.spx.fit", "qualname": "area_under_peak", "kind": "function", "doc": "

Calculate the area under a given peak.

\n\n

Peaks must be defined as peak:list=[xmin, xmax, baseline=0, baseline_error=0].\nIf the dataset has no Error column, the error for each point is assumed to be the same\nas the baseline error if errors_as_in_baseline=True, otherwise it is assumed to be zero.\nIf min_as_baseline=True and baseline=0, the baseline is assumed to be the minimum value.\nAlso, if min_as_baseline=True and there are negative areas even after applying the baseline,\nthe baseline will be corrected to the minimum value.

\n", "signature": "(\tspectra: aton.spx.classes.Spectra,\tpeak: list,\tdf_index: int = 0,\terrors_as_in_baseline: bool = True,\tmin_as_baseline: bool = False) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.fit.ratio_areas", "modulename": "aton.spx.fit", "qualname": "ratio_areas", "kind": "function", "doc": "

Check the ratio between two areas, e.g. to estimate deuteration levels from ATR data.

\n\n

The ratio is calculated as area / area_total. This behavior is modified if inverse_ratio = True,\nso that the ratio is calculated as (area_total - area) / area_total.\nNote that changing the ratio calculation also affects the error propagation.

\n", "signature": "(\tarea: float,\tarea_total: float,\tarea_error: float = 0.0,\tarea_total_error: float = 0.0,\tinverse_ratio: bool = False) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.fit.mean", "modulename": "aton.spx.fit", "qualname": "mean", "kind": "function", "doc": "

Takes an array of numerical values and returns the mean and standard deviation.

\n\n

It is calculated with numpy as:

\n\n

$\\sigma_{x}=\\sqrt{\\frac{\\sum{(x_{i}-{\\overline{x}})^2}}{N-\\text{ddof}}}$

\n\n

where ddof are the delta degrees_of_freedom, zero by default.\nSet it to 1 for a corrected sample standard deviation (low N cases),\nsee more details here.

\n\n

The mean is rounded up to the order of the error by default. To override this behaviour, set rounded=False.

\n", "signature": "(array: list, rounded: bool = True, degrees_of_freedom=0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.normalize", "modulename": "aton.spx.normalize", "kind": "module", "doc": "

Description

\n\n

This module contains functions to normalize data and other variables.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
height()Normalize a spectra by height
area()Normalize a spectra by the area under the datasets
unit_str()Normalize a unit string from user input
\n\n
\n"}, {"fullname": "aton.spx.normalize.height", "modulename": "aton.spx.normalize", "qualname": "height", "kind": "function", "doc": "

Normalize a set of spectra by height.

\n\n

By default it normalises the spectra over the entire range.\nThis can be modified by setting a specific range,\nas in range = [x_min, x_max] with axis = 'x'.\nIt can also normalise over manual y-positions,\nfor example for peaks with different baselines.\nThis can be done by settingch axis='y', and\nrange = [[y_min_1, y_max_1], ..., [y_min_N, y_max_N]].

\n\n

Heights are normalised with respect to the\nreference dataframe df_index, the first one by default.

\n", "signature": "(\tspectra: aton.spx.classes.Spectra,\trange: list = None,\taxis: str = 'x',\tdf_index: int = 0) -> aton.spx.classes.Spectra:", "funcdef": "def"}, {"fullname": "aton.spx.normalize.area", "modulename": "aton.spx.normalize", "qualname": "area", "kind": "function", "doc": "

Normalize spectra by the area under the datasets.

\n", "signature": "(\tspectra: aton.spx.classes.Spectra,\trange: list = None,\tdf_index: int = 0) -> aton.spx.classes.Spectra:", "funcdef": "def"}, {"fullname": "aton.spx.normalize.unit_str", "modulename": "aton.spx.normalize", "qualname": "unit_str", "kind": "function", "doc": "

Normalize unit string from user input.

\n", "signature": "(unit: str):", "funcdef": "def"}, {"fullname": "aton.spx.plot", "modulename": "aton.spx.plot", "kind": "module", "doc": "

Description

\n\n

This module contains the plot() function,\nused to plot aton.spx.classes.Spectra data,\ncontaining optional aton.spx.classes.Plotting parameters.

\n\n

It is used as aton.spx.plot(Spectra)

\n\n
\n"}, {"fullname": "aton.spx.plot.plot", "modulename": "aton.spx.plot", "qualname": "plot", "kind": "function", "doc": "

Plots a spectra.

\n\n

Optional aton.spectra.classes.Plotting attributes can be used.

\n", "signature": "(spectra: aton.spx.classes.Spectra):", "funcdef": "def"}, {"fullname": "aton.spx.samples", "modulename": "aton.spx.samples", "kind": "module", "doc": "

Description

\n\n

This module contains premade examples of material compositions, for testing purposes.\nThe aton.spx.classes.Material.grams is yet to be provided,\nbefore setting the material as aton.spx.Material.set().

\n\n
\n"}, {"fullname": "aton.spx.samples.CH3NH3PbI3", "modulename": "aton.spx.samples", "qualname": "CH3NH3PbI3", "kind": "variable", "doc": "

CH$_3$NH$_3$PbI$_3$

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CD3ND3PbI3", "modulename": "aton.spx.samples", "qualname": "CD3ND3PbI3", "kind": "variable", "doc": "

CD$_3$ND$_3$PbI$_3$.

\n\n

With experimental values of the partially-deuterated amine peaks\nfor the disrotatory mode of MAPbI3's methylammonium.\nMeasured at TOSCA, ISIS RAL, UK, May 2024.

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CH3ND3PbI3", "modulename": "aton.spx.samples", "qualname": "CH3ND3PbI3", "kind": "variable", "doc": "

CH$_3$ND$_3$PbI$_3$.

\n\n

With experimental values of the partially-deuterated amine peaks\nfor the disrotatory mode of MAPbI3's methylammonium.\nMeasured at TOSCA, ISIS RAL, UK, May 2024.

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CD3NH3PbI3", "modulename": "aton.spx.samples", "qualname": "CD3NH3PbI3", "kind": "variable", "doc": "

CD$_3$NH$_3$PbI$_3$

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CH3NH3I", "modulename": "aton.spx.samples", "qualname": "CH3NH3I", "kind": "variable", "doc": "

CH$_3$NH$_3$I

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CH3ND3I", "modulename": "aton.spx.samples", "qualname": "CH3ND3I", "kind": "variable", "doc": "

CH$_3$ND$_3$I

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.st", "modulename": "aton.st", "kind": "module", "doc": "

System Tools

\n\n

Common system tools across all ATON subpackages.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.st.fileFile manipulation
aton.st.callRun bash scripts and related
aton.st.aliasUseful dictionaries for user input correction
\n"}, {"fullname": "aton.st.alias", "modulename": "aton.st.alias", "kind": "module", "doc": "

Description

\n\n

This module contains common dictionaries to normalise and correct user inputs.\nAll values can be found in lowercase, to allow comparison with the string.lower() method.

\n\n

Index

\n\n

units
\nspatial
\nexperiments
\nfiles
\nboolean
\nmath

\n\n

Examples

\n\n
\n
unit = 'Electronvolts'\nif unit.lower() in aton.alias.units['eV']:\n    ... do stuff ...\n
\n
\n\n
\n"}, {"fullname": "aton.st.alias.units", "modulename": "aton.st.alias", "qualname": "units", "kind": "variable", "doc": "

Dict with unit names.

\n", "annotation": ": dict", "default_value": "{'mol': ['mol', 'mols', 'mole', 'moles'], 'g': ['g', 'gram', 'grams'], 'kg': ['kg', 'kilogram', 'kilograms'], 'amu': ['amu', 'atomicmassunit', 'atomicmassunits'], 'eV': ['eV', 'ev', 'electronvolt', 'electronvolts'], 'meV': ['meV', 'mev', 'millielectronvolt', 'millielectronvolts'], 'J': ['J', 'j', 'joule', 'joules'], 'cal': ['cal', 'calorie', 'calories'], 'kcal': ['kcal', 'kilocalorie', 'kilocalories'], 'Ry': ['Ry', 'ry', 'rydberg', 'rydbergs'], 'cm-1': ['cm^{-1}', 'cm1', 'cm-1', 'cm^-1'], 'cm': ['cm', 'centimeter', 'centimeters'], 'A': ['A', 'a', 'aa', 'angstrom', 'angstroms', 'armstrong', 'armstrongs'], 'bohr': ['bohr', 'bohrs', 'bohrradii'], 'm': ['m', 'meter', 'meters'], 'deg': ['deg', 'degree', 'degrees'], 'rad': ['rad', 'radian', 'radians'], 'bar': ['bar', 'bars'], 'kbar': ['kbar', 'kilobar', 'kilobars'], 'Pa': ['Pa', 'pa', 'pascal', 'pascals'], 'GPa': ['GPa', 'gpa', 'gigapascal', 'gigapascals'], 's': ['s', 'second', 'seconds'], 'H': ['H', 'h', 'hour', 'hours']}"}, {"fullname": "aton.st.alias.spatial", "modulename": "aton.st.alias", "qualname": "spatial", "kind": "variable", "doc": "

Dict with different spatial parameters. Values must be compared to string.lower().

\n", "annotation": ": dict", "default_value": "{'height': ['height', 'h'], 'area': ['area', 'a'], 'volume': ['volume', 'vol'], 'x': ['x', 'horizontal', 'h'], 'y': ['y', 'vertical', 'v'], 'z': ['z']}"}, {"fullname": "aton.st.alias.chemical", "modulename": "aton.st.alias", "qualname": "chemical", "kind": "variable", "doc": "

Dict with chemical groups.

\n", "annotation": ": dict", "default_value": "{'CH3': ['ch', 'CH', 'ch3', 'CH3', 'methyl'], 'NH3': ['nh', 'NH', 'nh3', 'NH3', 'amine'], 'CD3': ['cd', 'CD', 'cd3', 'CD3', 'deuterated methyl'], 'ND3': ['nd', 'ND', 'nd3', 'ND3', 'deuterated amine']}"}, {"fullname": "aton.st.alias.experiments", "modulename": "aton.st.alias", "qualname": "experiments", "kind": "variable", "doc": "

Dictionary with the available experiment types. Values must be compared to string.lower().

\n", "annotation": ": dict", "default_value": "{'ins': ['ins', 'inelasticneutronscattering', 'inelastic neutron scattering'], 'atr': ['atr', 'ftir', 'attenuatedtotalreflection', 'attenuated total reflection'], 'raman': ['raman'], 'qens': ['qens', 'quasielasticneutronscattering', 'quasielastic neutron scattering', 'quasi elastic neutron scattering']}"}, {"fullname": "aton.st.alias.files", "modulename": "aton.st.alias", "qualname": "files", "kind": "variable", "doc": "

Strings related to files. Values must be compared to string.lower().

\n", "annotation": ": dict", "default_value": "{'file': ['file', 'files', 'f', 'filepath', 'file path', 'filename', 'file name'], 'dir': ['dir', 'directory', 'd', 'folder'], 'error': ['error', 'errors', 'e', 'err']}"}, {"fullname": "aton.st.alias.boolean", "modulename": "aton.st.alias", "qualname": "boolean", "kind": "variable", "doc": "

Strings with booleans such as 'yes' / 'no'.

\n", "annotation": ": dict", "default_value": "{True: ['yes', 'YES', 'Yes', 'Y', 'y', 'T', 'True', 'TRUE', 't', 'true', 'Si', 'SI', 'si', 'S', 's'], False: ['no', 'NO', 'No', 'N', 'n', 'F', 'False', 'FALSE', 'f', 'false']}"}, {"fullname": "aton.st.alias.math", "modulename": "aton.st.alias", "qualname": "math", "kind": "variable", "doc": "

Math-related strings.

\n", "annotation": ": dict", "default_value": "{'sin': ['sin', 'sen', 'sine', 'seno'], 'cos': ['cos', 'cosine', 'coseno'], 'tg': ['tg', 'tangent', 'tangente'], '0': ['zero', 'cero', '0']}"}, {"fullname": "aton.st.call", "modulename": "aton.st.call", "kind": "module", "doc": "

Description

\n\n

Functions to handle bash calls and related operations on Linux systems.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
bash()Run a bash shell commands
git()Automatically update a Git repository
here()Runs the rest of the script inside a given folder
\n\n
\n"}, {"fullname": "aton.st.call.bash", "modulename": "aton.st.call", "qualname": "bash", "kind": "function", "doc": "

Run a bash shell commands.

\n\n

A given command will be executed inside an optional cwd directory.\nIf empty, the current working directory will be used.\nPrints the running command and outputs by default, override this with verbose=False.\nReturns the result of the command used, except for when\nerrors are raised automatically; set return_anyway=True to override this.

\n", "signature": "(\tcommand: str,\tcwd=None,\tverbose: bool = True,\treturn_anyway: bool = False):", "funcdef": "def"}, {"fullname": "aton.st.call.git", "modulename": "aton.st.call", "qualname": "git", "kind": "function", "doc": "

Automatically update a Git repository

\n", "signature": "(path=None, verbose=True, message=None, tag=None) -> None:", "funcdef": "def"}, {"fullname": "aton.st.call.here", "modulename": "aton.st.call", "qualname": "here", "kind": "function", "doc": "

Runs the rest of the script inside the specified folder.

\n\n

If none is provided, it runs from the same directory where the current script lies.\nThis is really useful to run scripts from the VSCode terminal, etc.\nReturns the path of the used folder, or the path of the script if folder is not provided.

\n\n

Note that this changes not only the working directory of your script,\nbut also of other scripts that import and run your script.

\n", "signature": "(folder=None) -> str:", "funcdef": "def"}, {"fullname": "aton.st.file", "modulename": "aton.st.file", "kind": "module", "doc": "

Description

\n\n

Functions to move files around.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
get()Check that a file exists, and return the full path
get_list()Get a list of the files inside a folder, applying optional filters
get_dir()Get the full path of a folder or the cwd
copy()Copy file
move()Move file
remove()Remove file or folder
rename_on_folder()Batch rename files from a folder
rename_on_folders()Barch rename files from subfolders
copy_to_folders()Copy files to individual subfolders
save()Save a Python object to a binary file, as .aton
load()Load a Python object from a binary file, as .aton
\n\n
\n"}, {"fullname": "aton.st.file.get", "modulename": "aton.st.file", "qualname": "get", "kind": "function", "doc": "

Check if filepath exists, and returns its full path.

\n\n

Raises an error if the file is not found,\nunless return_anyway = True, in which case it returns None.\nThis can be used to personalize errors.

\n\n

If the provided string is a directory, it checks the files inside it.\nif there is only one file inside, it returns said file;\nif there are more files, it tries to filter them with the include filters\n(string or list of strings) to return a single file.\nIf this fails, try using more strict filters to return a single file.

\n", "signature": "(filepath, include=None, return_anyway: bool = False) -> str:", "funcdef": "def"}, {"fullname": "aton.st.file.get_list", "modulename": "aton.st.file", "qualname": "get_list", "kind": "function", "doc": "

Return the files inside a folder, applying optional filters.

\n\n

Only filenames containing all strings in the include list will be returned.\nFilenames containing any string from the exclude list will be ignored.

\n\n

The full paths are returned by default; to get only the base names, set abspath = False.\nThe CWD folder is used by default if no folder is provided.\nIt also returns folders if also_folders = True.

\n", "signature": "(\tfolder: str = None,\tinclude=None,\texclude=None,\tabspath: bool = True,\talso_folders: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.st.file.get_dir", "modulename": "aton.st.file", "qualname": "get_dir", "kind": "function", "doc": "

Returns the full path of folder or the parent folder if it's a file. If none is provided, the current working directory is returned.

\n", "signature": "(folder=None) -> str:", "funcdef": "def"}, {"fullname": "aton.st.file.copy", "modulename": "aton.st.file", "qualname": "copy", "kind": "function", "doc": "

Copies old file to new file

\n", "signature": "(old: str, new: str) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.move", "modulename": "aton.st.file", "qualname": "move", "kind": "function", "doc": "

Moves old file to new file.

\n", "signature": "(old: str, new: str) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.remove", "modulename": "aton.st.file", "qualname": "remove", "kind": "function", "doc": "

Removes the given file or folder at filepath.

\n\n
\n

WARNING: Removing stuff is always dangerous, be careful!

\n
\n", "signature": "(filepath: str) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.rename_on_folder", "modulename": "aton.st.file", "qualname": "rename_on_folder", "kind": "function", "doc": "

Batch renames files in the given folder.

\n\n

Replaces the old string by new string.\nIf no folder is provided, the current working directory is used.

\n", "signature": "(old: str, new: str, folder=None) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.rename_on_folders", "modulename": "aton.st.file", "qualname": "rename_on_folders", "kind": "function", "doc": "

Renames the files inside the subfolders in the parent folder.

\n\n

Renames from an old string to the new string.\nIf no folder is provided, the current working directory is used.

\n", "signature": "(old: str, new: str, folder=None) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.copy_to_folders", "modulename": "aton.st.file", "qualname": "copy_to_folders", "kind": "function", "doc": "

Copies the files from the parent folder with the given extension to individual subfolders.

\n\n

The subfolders are named as the original files,\nremoving the strings from the strings_to_delete list.\nIf no folder is provided, it runs in the current working directory.

\n", "signature": "(folder=None, extension: str = None, strings_to_delete: list = []) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.save", "modulename": "aton.st.file", "qualname": "save", "kind": "function", "doc": "

Save a Python object in the current working directory as a binary *.aton file.

\n", "signature": "(object, filename: str = None):", "funcdef": "def"}, {"fullname": "aton.st.file.load", "modulename": "aton.st.file", "qualname": "load", "kind": "function", "doc": "

Load a Python object from a binary *.aton file.

\n\n

Use only if you trust the person who sent you the file!

\n", "signature": "(filepath: str = 'data.aton'):", "funcdef": "def"}, {"fullname": "aton.txt", "modulename": "aton.txt", "kind": "module", "doc": "

General text operations

\n\n

This subpackage contains tools for general text operations.\nIt provides the basic functionality that powers more complex subpackages,\nsuch as aton.interface.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.txt.findSearch for specific content from a text file
aton.txt.editEdit specific content from a text file
aton.txt.extractExtract data from raw text strings
\n\n

Examples

\n\n

The following example shows how to find a value in a text file, extract it and paste it into another file using the txt subpackage:

\n\n
\n
from aton import txt\n# Get an array with all matches\nalat_lines = txt.find.lines('relax.out', 'Lattice parameter =')\n# Extract the numerical value of the last match\nalat = txt.extract.number(alat_lines[-1], 'Lattice parameter')\n# Paste it into another file\ntxt.edit.replace_line('scf.in', 'Lattice parameter =', f'Lattice parameter ='{alat})\n
\n
\n\n

Advanced usage such as regular expression matching or\nadditional line extraction is detailed in the API documentation.

\n"}, {"fullname": "aton.txt.edit", "modulename": "aton.txt.edit", "kind": "module", "doc": "

Description

\n\n

Functions to manipulate the content of text files.

\n\n

Index

\n\n

insert_at()
\ninsert_under()
\nreplace()
\nreplace_line()
\nreplace_between()
\ndelete_under()
\ncorrect_with_dict()
\nfrom_template()

\n\n
\n"}, {"fullname": "aton.txt.edit.insert_at", "modulename": "aton.txt.edit", "qualname": "insert_at", "kind": "function", "doc": "

Inserts a text in the line with position index of a given filepath.

\n\n

If position is negative, starts from the end of the file.

\n", "signature": "(filepath, text: str, position: int) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.insert_under", "modulename": "aton.txt.edit", "qualname": "insert_under", "kind": "function", "doc": "

Inserts a text under the line(s) containing the key in filepath.

\n\n

The keyword can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

By default all matches are inserted with insertions=0,\nbut it can insert only a specific number of matches\nwith positive numbers (1, 2...), or starting from the bottom with negative numbers.

\n\n

The text can be introduced after a specific number of lines after the match,\nchanging the value skips. Negative integers introduce the text in the previous lines.

\n", "signature": "(\tfilepath,\tkey: str,\ttext: str,\tinsertions: int = 0,\tskips: int = 0,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.replace", "modulename": "aton.txt.edit", "qualname": "replace", "kind": "function", "doc": "

Replaces the key with text in filepath.

\n\n

It can also be used to delete the keyword with text=''.\nTo search with regular expressions, set regex=True.

\n\n

The value replacements specifies the number of replacements to perform:\n1 to replace only the first keyword found, 2, 3...\nUse negative values to replace from the end of the file,\neg. to replace the last found key, use replacements=-1.\nTo replace all values, set replacements = 0, which is the value by default.

\n\n
line... key ...line -> line... text ...line\n
\n", "signature": "(\tfilepath: str,\tkey: str,\ttext: str,\treplacements: int = 0,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.replace_line", "modulename": "aton.txt.edit", "qualname": "replace_line", "kind": "function", "doc": "

Replaces the entire line(s) containing the key with the text in filepath.

\n\n

It can be used to delete line(s) by setting text=''.\nRegular expressions can be used with regex=True.

\n\n

The value replacements specifies the number of lines to replace:\n1 to replace only the first line with the keyword, 2, 3...\nUse negative values to replace from the end of the file,\ne.g., to replace only the last line containing the keyword, use replacements = -1.\nTo replace all lines, set replacements = 0, which is the value by default.

\n\n

The default line to replace is the matching line,\nbut it can be any other specific line after or before the matching line;\nthis is indicated with skips as a positive or negative integer.

\n\n

More lines can be replaced with additional lines (int).\nNote that the matched line plus the additional lines\nwill be replaced, this is, additional lines +1.

\n", "signature": "(\tfilepath: str,\tkey: str,\ttext: str,\treplacements: int = 0,\tskips: int = 0,\tadditional: int = 0,\tregex: bool = False,\traise_errors: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.replace_between", "modulename": "aton.txt.edit", "qualname": "replace_between", "kind": "function", "doc": "

Replace with text between keywords key1 and key2 in filepath.

\n\n

It can be used to delete the text between the keys by setting text=''.\nRegular expressions can be used by setting regex=True.

\n\n

Key lines are also deleted if delete_keys=True.

\n\n

Only the first matches of the keywords are used by default;\nyou can use the last ones with from_end = True.

\n\n
lines...\nkey1\ntext\nkey2\nlines...\n
\n", "signature": "(\tfilepath: str,\tkey1: str,\tkey2: str,\ttext: str,\tdelete_keys: bool = False,\tfrom_end: bool = False,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.delete_under", "modulename": "aton.txt.edit", "qualname": "delete_under", "kind": "function", "doc": "

Deletes all the content under the line containing the key in filepath.

\n\n

The keyword can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

By default the first match is used; it can be any positive integer (0 is treated as 1!),\nincluding negative integers to select a match starting from the end of the file.

\n\n

The content can be deleted after a specific number of lines after the match,\nchanging the value skips, that skips the specified number of lines.\nNegative integers start deleting the content from the previous lines.

\n", "signature": "(\tfilepath,\tkey: str,\tmatch: int = 1,\tskips: int = 0,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.correct_with_dict", "modulename": "aton.txt.edit", "qualname": "correct_with_dict", "kind": "function", "doc": "

Corrects the given text file filepath using a correct dictionary.

\n", "signature": "(filepath: str, correct: dict) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.from_template", "modulename": "aton.txt.edit", "qualname": "from_template", "kind": "function", "doc": "

Creates new file from old, replacing values from a correct dict, inserting a comment on top.

\n", "signature": "(old: str, new: str, correct: dict = None, comment: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.extract", "modulename": "aton.txt.extract", "kind": "module", "doc": "

Description

\n\n

Functions to extract data from raw text strings.

\n\n

Index

\n\n

number()
\nstring()
\ncolumn()
\ncoords()
\nelement()

\n\n

Examples

\n\n

To extract a float value from a string,

\n\n
\n
from aton import txt\nline = 'energy =   500.0 Ry'\ntxt.extract.number(line, 'energy')\n# 500.0  (float output)\n
\n
\n\n

To extract a text value, after and before specific strings,

\n\n
\n
line = 'energy =   500.0 Ry were calculated'\ntxt.extract.string(line, 'energy', 'were')\n# '500.0 Ry'  (String output)\n
\n
\n\n

To extract a value from a specific column,

\n\n
\n
# Name, Energy, Force, Error\nline = 'Testing    1.1    1.2    0.3'\nenergy = txt.extract.column(line, 1)\n# '1.1'  (String output)\n
\n
\n\n

To extract coordinates,

\n\n
\n
line = ' He  0.10  0.20  0.30 '\ntxt.extract.coords(line)\n# [0.1, 0.2, 0.3]  (List of floats)\n
\n
\n\n

To extract chemical elements,

\n\n
\n
line = ' He4  0.10  Ag  0.20  Pb  0.30 '\nfirst_element = txt.extract.element(line, 0)\n# 'He4'\nthird_element = txt.extract.element(line, 2)\n# 'Pb'\n
\n
\n\n
\n"}, {"fullname": "aton.txt.extract.number", "modulename": "aton.txt.extract", "qualname": "number", "kind": "function", "doc": "

Extracts the float value of a given name variable from a raw text.

\n", "signature": "(text: str, name: str = '') -> float:", "funcdef": "def"}, {"fullname": "aton.txt.extract.string", "modulename": "aton.txt.extract", "qualname": "string", "kind": "function", "doc": "

Extracts the text value of a given name variable from a raw string. Stops before an optional stop string.

\n\n

Removes leading and trailing commas by default, change this with strip = False.

\n", "signature": "(text: str, name: str = '', stop: str = '', strip: bool = True) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.extract.column", "modulename": "aton.txt.extract", "qualname": "column", "kind": "function", "doc": "

Extracts the desired column index of a given string (0 by default).

\n", "signature": "(text: str, column: int = 0) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.extract.coords", "modulename": "aton.txt.extract", "qualname": "coords", "kind": "function", "doc": "

Returns a list with the float coordinates expressed in a given text string.

\n", "signature": "(text: str) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.extract.element", "modulename": "aton.txt.extract", "qualname": "element", "kind": "function", "doc": "

Extract a chemical element from a raw text string.

\n\n

If there are several elements, you can return a specific index match (positive, 0 by default).\nAllows for standard elements (H, He, Na...) and isotopes (H2, He4...).

\n", "signature": "(text: str, index: int = 0) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.find", "modulename": "aton.txt.find", "kind": "module", "doc": "

Description

\n\n

Functions to search for specific content inside text files.

\n\n

Index

\n\n

Find and return specific text strings from a file
\nlines()
\nbetween()

\n\n

Find the (start, end) position of specific strings in a file
\npos()
\npos_regex()
\nnext_pos()
\nnext_pos_regex()
\nline_pos()
\nbetween_pos()

\n\n

Examples

\n\n

To find the lines containing the word 'key', plus an additional line below,

\n\n
\n
from aton import txt\n# with split = False\ntxt.find.lines(filepath=file, key='key', additional=1)\n    # ['line with key 1\\nline below first match',\n    #  'line with key 2\\nline below second match]\n# with split = True\ntxt.find.lines(filepath=file, key='key', additional=1, split=True)\n    # ['line with key 1',\n    # 'line below first match',\n    # 'line with key 2',\n    # 'line below second match]\n
\n
\n\n

To find the text between the lines containing the words 'first' and 'second',

\n\n
\n
from aton import txt\ntxt.find.between(filepath=file, key1='first', key2='second')\n    # 'first line\\nadditional\\nlines\\nin\\nbetween\\nsecond line'\n
\n
\n\n
\n"}, {"fullname": "aton.txt.find.lines", "modulename": "aton.txt.find", "qualname": "lines", "kind": "function", "doc": "

Returns a list with the matches containing the key string in filepath.

\n\n

If no match is found, returns an empty list.

\n\n

To use regular expressions in the search, set regex=True\n(deactivated by default).

\n\n

The value matches specifies the max number of matches to be returned.\nDefaults to 0 to return all possible matches. Set it to 1 to return only one match,\nor to negative integers to start the search from the end of the file upwards.

\n\n

The value additional specifies the number of additional lines\nbelow the target line that are also returned;\n2 to return the found line plus two additional lines below, etc.\nNegative values return the specified number of lines before the target line.\nThe original ordering from the file is preserved.\nDefaults to additional=0, only returning the target line.\nBy default, the additional lines are returned\nin the same list item as the match separated by a \\n,\nunless split=True, in which case these additional lines\nare splitted and added as additional items in the list.

\n", "signature": "(\tfilepath: str,\tkey: str,\tmatches: int = 0,\tadditional: int = 0,\tsplit: bool = False,\tregex: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.find.between", "modulename": "aton.txt.find", "qualname": "between", "kind": "function", "doc": "

Returns the content between the lines with key1 and key2 in filepath.

\n\n

Keywords can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

Key lines are omited by default, but can be returned with include_keys=True.

\n\n

If there is more than one match, only the first one is considered by default;\nset match (int) to specify a particular match (1, 2... 0 is considered as 1!).\nUse negative numbers to start from the end of the file.

\n\n

If no match is found, returns an empty string.

\n\n

If key2 is not found, it returns all the text from key1 to the end of the file.

\n", "signature": "(\tfilepath: str,\tkey1: str,\tkey2: str,\tinclude_keys: bool = True,\tmatch: int = 1,\tregex: bool = False) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.find.pos", "modulename": "aton.txt.find", "qualname": "pos", "kind": "function", "doc": "

Returns a list with the positions of the key in filepath.

\n\n

If no match is found, returns an empty list.

\n\n

The filepath can be a file or a memory mapped file.

\n\n

The value matches specifies the max number of matches to return.\nDefaults to 0 to return all possible matches.\nSet it to 1 to return only one match,\n2 to get the first two matches, etc.\nYou can also set it to negative integers to start\nsearching from the end of the file upwards.

\n\n

This method is faster than pos_regex(),\nbut does not search for regular expressions.

\n", "signature": "(filepath, key: str, matches: int = 0) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.find.pos_regex", "modulename": "aton.txt.find", "qualname": "pos_regex", "kind": "function", "doc": "

Returns a list of the positions of a key in a given filepath (actual file, not mmapped!).

\n\n

The value matches specifies the max number of matches to return.\nDefaults to 0 to return all possible matches. Set it to 1 to return only one match,\nor to negative integers to start searching from the end of the file upwards.

\n\n

For big files, this method is slower than pos(), but it can search for regular expressions.

\n", "signature": "(filepath, key: str, matches: int = 0) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.find.next_pos", "modulename": "aton.txt.find", "qualname": "next_pos", "kind": "function", "doc": "

Get the next position of the key in the filepath (file or mmapped file), starting from an initial position tuple.

\n\n

The match number specifies the nonzero index of the next match to return (1, 2... 0 is considered as 1!).\nIt can be negative to search backwards from the initial position.\nThe last known positions will be returned if no more matches are found.

\n\n

This method is specific for normal strings.\nTo use regular expressions, check next_pos_regex().

\n", "signature": "(filepath, position: tuple, key: str, match: int = 1) -> tuple:", "funcdef": "def"}, {"fullname": "aton.txt.find.next_pos_regex", "modulename": "aton.txt.find", "qualname": "next_pos_regex", "kind": "function", "doc": "

Get the next position of the key in the filepath (actual file, not mmapped!), starting from an initial position tuple.

\n\n

The match number specifies the next match to return (1, 2... 0 is considered as 1!).\nIt can be negative to search backwards from the initial position.\nThis method is specific for regular expressions.

\n\n

For normal strings, check the faster next_pos() method.

\n", "signature": "(filepath, position: tuple, key: str, match: int = 0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.txt.find.line_pos", "modulename": "aton.txt.find", "qualname": "line_pos", "kind": "function", "doc": "

Get the position of the full line containing the position tuple in filepath (whether file or memory mapped file).

\n\n

A specific line below can be returned with skips being a natural int,\nor previous lines with negative values.

\n", "signature": "(filepath, position: tuple, skips: int = 0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.txt.find.between_pos", "modulename": "aton.txt.find", "qualname": "between_pos", "kind": "function", "doc": "

Returns the positions of the content between the lines containing key1 and key2 in the filepath.

\n\n

Keywords can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

Key lines are omited by default, but can be returned with include_keys=True.

\n\n

If there is more than one match, only the first one is considered by default;\nset match number to specify a particular match (1, 2... 0 is considered as 1!).\nUse negative numbers to start from the end of the file.

\n\n

If key2 is not found, it returns the text position from key1 to the end of the file.

\n", "signature": "(\tfilepath,\tkey1: str,\tkey2: str,\tinclude_keys: bool = True,\tmatch: int = 1,\tregex: bool = False) -> tuple:", "funcdef": "def"}]; + /** pdoc search index */const docs = [{"fullname": "aton", "modulename": "aton", "kind": "module", "doc": "

\n\n

Welcome to ATON

\n\n

The Ab-iniTiO & Neutron research toolbox,\nor ATON,\nprovides powerful and comprehensive tools\nfor cutting-edge materials research,\nfocused on (but not limited to) neutron science.

\n\n

Just like its ancient Egyptian deity counterpart,\nthis all-in-one Python package contains a range of tools\nfrom INS spectra analysis to ab-initio interfaces\nfor Quantum ESPRESSO,\nPhonopy and\nCASTEP.\nConversion factors and universal constants from the 2022 CODATA\nRecommended Values of the Fundamental Physical Constants are also included.

\n\n

The source code is available on GitHub.

\n\n
\n\n

Installation

\n\n

As always, it is recommended to install your packages in a virtual environment:

\n\n
\n
python3 -m venv .venv\nsource .venv/bin/activate\n
\n
\n\n

With pip

\n\n

The fastest way to install ATON is through pip:

\n\n
\n
pip install aton\n
\n
\n\n

To upgrade to a newer version,

\n\n
\n
pip install aton -U\n
\n
\n\n

From source

\n\n

Optionally, you can install ATON from the GitHub repository.

\n\n

First install the dependencies:

\n\n
\n
pip install pandas numpy scipy matplotlib\n
\n
\n\n

Then clone the repository or download the latest stable release as a ZIP, unzip it, and run inside the ATON/ directory:

\n\n
\n
pip install .\n
\n
\n\n
\n\n

Documentation

\n\n

The full ATON documentation is available online.
\nAn offline version of the documentation is found at docs/aton.html.
\nCode examples are included in the examples/ folder.

\n\n

Interfaces for ab-initio codes

\n\n

The interface module contains Python interfaces for several ab-initio codes.\nThese are powered by the aton.txt module and can be easily extended.

\n\n

aton.interface

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.interface.qeInterface for Quantum ESPRESSO's pw.x module
aton.interface.phonopyInterface for Phonopy calculations
aton.interface.castepInterface for CASTEP calculations
aton.interface.slurmBatch jobs via Slurm
\n\n

Physico-chemical constants

\n\n

The phys module contains physico-chemical definitions.\nValues are accessed directly as phys.value or phys.function().

\n\n

aton.phys

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.phys.unitsPhysical constants and conversion factors
aton.phys.atomsMegadictionary with data for all chemical elements
aton.phys.functionsFunctions to sort and analyse element data
\n\n

Quantum rotations

\n\n

The QRotor module is used to study quantum rotations,\nsuch as those of methyl and amine groups.

\n\n

aton.qrotor

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.qrotor.rotateRotate specific atoms from structural files
aton.qrotor.constantsBond lengths and inertias
aton.qrotor.systemDefinition of the quantum System object
aton.qrotor.systemsFunctions to manage several System objects
aton.qrotor.potentialPotential definitions and loading functions
aton.qrotor.solveSolve rotation eigenvalues and eigenvectors
aton.qrotor.plotPlotting functions
\n\n

Spectra analysis

\n\n

The spx module includes tools for spectral analysis from\nInelastic Neutron Scattering, Raman, Infrared, etc.

\n\n

aton.spx

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.spx.classesClass definitions for the spectra module
aton.spx.fitSpectra fitting functions
aton.spx.normalizeSpectra normalization
aton.spx.plotPlotting
aton.spx.deuteriumDeuteration estimations via INS
aton.spx.samplesSample materials for testing
\n\n

General text edition

\n\n

The txt module handles text files.\nIt powers more complex subpackages,\nsuch as aton.interface.

\n\n

aton.txt

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.txt.findSearch for specific content in text files
aton.txt.editManipulate text files
aton.txt.extractExtract data from raw text strings
\n\n

System tools

\n\n

The st module contains System Tools for common system tasks across subpackages.

\n\n

aton.st

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.st.fileFile manipulation
aton.st.callRun bash scripts and related
aton.st.aliasUseful dictionaries for user input correction
\n\n
\n\n

Contributing

\n\n

If you are interested in opening an issue or a pull request, please feel free to do so on GitHub.
\nFor major changes, please get in touch first to discuss the details.

\n\n

Code style

\n\n

Please try to follow some general guidelines:

\n\n
    \n
  • Use a code style consistent with the rest of the project.
  • \n
  • Include docstrings to document new additions.
  • \n
  • Include automated tests for new features or modifications, see automated testing.
  • \n
  • Arrange function arguments by order of relevance. Most implemented functions follow something similar to function(file, key/s, value/s, optional).
  • \n
\n\n

Automated testing

\n\n

If you are modifying the source code, you should run the automated tests of the ATON/tests/ folder to check that everything works as intended.\nTo do so, first install PyTest in your environment,

\n\n
\n
pip install pytest\n
\n
\n\n

And then run PyTest inside the ATON/ directory,

\n\n
\n
pytest -vv\n
\n
\n\n

Compiling the documentation

\n\n

The documentation can be compiled automatically to docs/aton.html with Pdoc and ATON itself, by running:

\n\n
\n
python3 makedocs.py\n
\n
\n\n

This runs Pdoc, updating links and pictures, and using the custom theme CSS template from the css/ folder.

\n\n
\n\n

Citation

\n\n

ATON development started for the following paper, please cite if you use ATON in your work:
\nCryst. Growth Des. 2024, 24, 391\u2212404

\n\n

License

\n\n

Copyright (C) 2025 Pablo Gila-Herranz
\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.
\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\nSee the attached GNU Affero General Public License for more details.

\n"}, {"fullname": "aton.interface", "modulename": "aton.interface", "kind": "module", "doc": "

Ab-initio interfaces

\n\n

This module contains interfaces for several ab-initio calculation softwares.\nThese interfaces can be easily expanded with the aton.txt module.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.interface.qeInterface for Quantum ESPRESSO's pw.x module
aton.interface.phonopyInterface for Phonopy calculations
aton.interface.castepInterface for CASTEP calculations
aton.interface.slurmBatch jobs via Slurm
\n\n

Examples

\n\n

Quantum ESPRESSO

\n\n

To read the output from a Quantum ESPRESSO pw.x calculation,

\n\n
\n
from aton.interface import qe\n# Read to a dictionary\ncalculation = qe.read_out('relax.out')\ncalculation.keys()  # See the available values\n# Final energy from the calculation\nenergy = calculation['Energy']\n
\n
\n\n

To modify values from an input file,

\n\n
\n
from aton.interface import qe\n# Add a hydrogen atom to a specific position\nqe.add_atom('H  0.10  0.20  0.30')\n# Set the input ecutwfc value\nqe.set_value('relax.in', 'ecutwfc', 60.0)\n
\n
\n\n

Check the full aton.interface.qe API reference for more details.

\n\n

Phonopy

\n\n

To perform a phonon calculation from a relaxed structure via Quantum ESPRESSO,

\n\n
\n
from aton import interface\n# Create the supercell inputs\ninterface.phonopy.make_supercells(dimension='2 2 2')\n# Sbatch to a cluster\ninterface.slurm.sbatch('supercell-', 'template.slurm')\n
\n
\n\n

Check the full aton.interface.phonopy API reference for more details.

\n\n

CASTEP

\n\n

To read output values from a CASTEP calculation,

\n\n
\n
from aton.interface import castep\n# Read the output\noutput = castep.read_castep('calculation.castep')\n# Get the final energy\nenergy = output['Energy']\n
\n
\n\n

Check the full aton.interface.castep API reference for more details.

\n"}, {"fullname": "aton.interface.castep", "modulename": "aton.interface.castep", "kind": "module", "doc": "

Description

\n\n

Functions to work with CASTEP calculation files.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n
read_castep()Output reading
\n\n
\n"}, {"fullname": "aton.interface.castep.read_castep", "modulename": "aton.interface.castep", "qualname": "read_castep", "kind": "function", "doc": "

Reads a CASTEP output file, specified in filename.\nReturns a dictionary with the following keys:\n'Enthalpy' (LBFGS: Final Enthalpy, in kJ/mol),\n'Energy' (Total energy corrected for finite basis set, in eV),\n'Space group', 'Volume' (Angstrom^3), 'Density' (amu/Angstrom^3), 'Density_g' (g/cm^3),\n'A', 'B', 'C' (Angstroms), 'Alpha', 'Beta', 'Gamma' (Degrees).

\n\n

Note that these output keys start with a Capital letter.

\n", "signature": "(filename) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.phonopy", "modulename": "aton.interface.phonopy", "kind": "module", "doc": "

Description

\n\n

Functions to work with Phonopy calculations,\nalong with Quantum ESPRESSO.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n
make_supercells()Build supercell SCF inputs for phonon calculations
\n\n

Examples

\n\n

To create the supercells and run the phonon calculations\nfrom a folder with relax.in and relax.out files,\nusing a template.slurm file,

\n\n
\n
from aton import interface\ninterface.phonopy.make_supercells()\ninterface.slurm.sbatch('supercell-', 'scf.slurm')\n
\n
\n\n
\n"}, {"fullname": "aton.interface.phonopy.make_supercells", "modulename": "aton.interface.phonopy", "qualname": "make_supercells", "kind": "function", "doc": "

Creates the supercell inputs of a given dimension ('2 2 2' by default),\nfrom the relax_in and relax_out files in the folder\n('relax.in', 'relax.out' and CWD by default, respectively),\nneeded for the Phonopy calculations with Quantum ESPRESSO.

\n\n

If slurm_template is present,\nit checks it with aton.interface.slurm.check_template().

\n", "signature": "(\tdimension: str = '2 2 2',\trelax_in: str = 'relax.in',\trelax_out: str = 'relax.out',\tfolder: str = None,\tslurm_template: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe", "modulename": "aton.interface.qe", "kind": "module", "doc": "

Description

\n\n

Tools to work with the pw.x module from Quantum ESPRESSO.

\n\n

Index

\n\n

Input and output reading
\nread_in()
\nread_out()
\nread_dir()
\nread_dirs()

\n\n

Input file manipulation
\nset_value()
\nadd_atom()
\nscf_from_relax()

\n\n

Data extraction
\nget_atom()
\ncount_elements()
\nnormalize_card()
\nto_cartesian()
\nfrom_cartesian()

\n\n

Dicts with input file description
\npw_namelists
\npw_cards

\n\n
\n"}, {"fullname": "aton.interface.qe.read_in", "modulename": "aton.interface.qe", "qualname": "read_in", "kind": "function", "doc": "

Reads a Quantum ESPRESSO input filepath and returns the values as a dict.

\n\n

Dict keys are named after the corresponding variable.\nCARDS are returned as lists, and contain the\ntitle card + parameters in the first item.

\n", "signature": "(filepath) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.read_out", "modulename": "aton.interface.qe", "qualname": "read_out", "kind": "function", "doc": "

Reads a Quantum ESPRESSO output filepath, returns a dict with the output keys.

\n\n

The output keys are:\n'Energy' (Ry), 'Total force' (float), 'Total SCF correction' (float),\n'Runtime' (str), 'JOB DONE' (bool), 'BFGS converged' (bool), 'BFGS failed' (bool),\n'Maxiter reached' (bool), 'Error' (str), 'Success' (bool), 'CELL_PARAMETERS_out' (list of str), 'ATOMIC_POSITIONS_out' (list of str), 'Alat' (bohr), 'Volume' (a.u.^3), 'Density' (g/cm^3).

\n\n

Note that these output keys start with a Capital letter.

\n", "signature": "(filepath) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.read_dir", "modulename": "aton.interface.qe", "qualname": "read_dir", "kind": "function", "doc": "

Takes a folder from a QE calculation, returns a dict with input and output values.

\n\n

Input and output files are determined automatically,\nbut must be specified with in_str and out_str\nif more than one file ends with .in or .out.

\n", "signature": "(folder, in_str: str = '.in', out_str: str = '.out') -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.read_dirs", "modulename": "aton.interface.qe", "qualname": "read_dirs", "kind": "function", "doc": "

Reads recursively QE calculations from all the subfolders inside the given directory.

\n\n

Results are saved to CSV files inside the current directory.\nInput and output files are determined automatically, but must be specified with\nin_str and out_str if more than one file ends with .in or .out.

\n\n

To properly group the calculations per type, saving separated CSVs for each calculation type,\nyou can modify calc_splitter ('_' by default), calc_type_index (0) and calc_id_index (1).\nWith these default values, a subfolder named './CalculationType_CalculationID_AdditionalText/'\nwill be interpreted as follows:

\n\n
    \n
  • Calculation type: 'CalculationType' (The output CSV will be named after this)
  • \n
  • CalculationID: 'CalculationID' (Stored in the 'ID' column of the resulting dataframe)
  • \n
\n\n

If everything fails, the subfolder name will be used for the CSV file.

\n", "signature": "(\tdirectory,\tin_str: str = '.in',\tout_str: str = '.out',\tcalc_splitter='_',\tcalc_type_index=0,\tcalc_id_index=1) -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.set_value", "modulename": "aton.interface.qe", "qualname": "set_value", "kind": "function", "doc": "

Replace the value of a key parameter in an input filepath.

\n\n

Delete parameters with value=''.\nRemember to include the single quotes ' on values that use them.

\n\n

Updating 'ATOMIC_POSITIONS' updates 'nat' automatically,\nand updating 'ATOMIC_SPECIES' updates 'ntyp'.

\n\n

Optionally change indentation with indent, 2 spaces by default.

\n", "signature": "(filepath, key: str, value, indent: str = ' ') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.add_atom", "modulename": "aton.interface.qe", "qualname": "add_atom", "kind": "function", "doc": "

Adds an atom in a given filepath at a specified position.

\n\n

Position must be a string or a list, as follows:\n\"specie:str float float float\" or [specie:str, float, float, float].

\n\n

This method updates automatically other related values,\nsuch as 'ntyp' when updating ATOMIC_SPECIES, etc.

\n\n

Optionally change indentation with indent, 2 spaces by default.

\n", "signature": "(filepath, position, indent=' ') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.get_atom", "modulename": "aton.interface.qe", "qualname": "get_atom", "kind": "function", "doc": "

Takes the approximate position of an atom, and returns the full line from the filepath.

\n\n

It compares the atomic positions rounded up to the specified precision decimals.\nIf return_anyway = True, ignores errors and returns an empty string.

\n", "signature": "(\tfilepath: str,\tposition: list,\tprecision: int = 3,\treturn_anyway: bool = False) -> str:", "funcdef": "def"}, {"fullname": "aton.interface.qe.normalize_card", "modulename": "aton.interface.qe", "qualname": "normalize_card", "kind": "function", "doc": "

Take a matched card, and return it in a normalised format.

\n\n

Optionally change indentation with indent, 0 spaces by default.

\n", "signature": "(card: list, indent='') -> list:", "funcdef": "def"}, {"fullname": "aton.interface.qe.count_elements", "modulename": "aton.interface.qe", "qualname": "count_elements", "kind": "function", "doc": "

Takes ATOMIC_POSITIONS, returns a dict as {element : number of atoms}

\n", "signature": "(atomic_positions) -> dict:", "funcdef": "def"}, {"fullname": "aton.interface.qe.scf_from_relax", "modulename": "aton.interface.qe", "qualname": "scf_from_relax", "kind": "function", "doc": "

Create a Quantum ESPRESSO scf.in file from a previous relax calculation.

\n\n

If no folder is provided, the current working directory is used.\nThe relax_in and relax_out files by default are relax.in and relax.out,\nupdate the names if necessary.

\n", "signature": "(\tfolder: str = None,\trelax_in: str = 'relax.in',\trelax_out: str = 'relax.out') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.qe.to_cartesian", "modulename": "aton.interface.qe", "qualname": "to_cartesian", "kind": "function", "doc": "

Converts a given cordinates from crystal lattice vectors to cartesian.

\n\n

Only for ibrav=0. Uses the cell parameters.\nNote that the result is not multiplied by A nor celldm(1).

\n", "signature": "(filepath, coordinates) -> str:", "funcdef": "def"}, {"fullname": "aton.interface.qe.from_cartesian", "modulename": "aton.interface.qe", "qualname": "from_cartesian", "kind": "function", "doc": "

Converts a given cordinates from cartesian to the base of lattice vectors.

\n\n

Only for ibrav=0. Uses the cell parameters.\nNote that the result is not divided by A nor celldm(1).

\n", "signature": "(filepath, coordinates: list) -> str:", "funcdef": "def"}, {"fullname": "aton.interface.qe.pw_namelists", "modulename": "aton.interface.qe", "qualname": "pw_namelists", "kind": "variable", "doc": "

Dictionary with all possible NAMELISTs as keys, and the corresponding variables as values.

\n", "default_value": "{'&CONTROL': ['calculation', 'title', 'verbosity', 'restart_mode', 'wf_collect', 'nstep', 'iprint', 'tstress', 'tprnfor', 'dt', 'outdir', 'wfcdir', 'prefix', 'lkpoint_dir', 'max_seconds', 'etot_conv_thr', 'forc_conv_thr', 'disk_io', 'pseudo_dir', 'tefield', 'dipfield', 'lelfield', 'nberrycyc', 'lorbm', 'lberry', 'gdir', 'nppstr', 'gate', 'twochem', 'lfcp', 'trism'], '&SYSTEM': ['ibrav', 'celldm(1)', 'celldm(2)', 'celldm(3)', 'celldm(4)', 'celldm(5)', 'celldm(6)', 'A', 'B', 'C', 'cosAB', 'cosAC', 'cosBC', 'nat', 'ntyp', 'nbnd', 'nbnd_cond', 'tot_charge', 'starting_charge', 'tot_magnetization', 'starting_magnetization', 'ecutwfc', 'ecutrho', 'ecutfock', 'nr1', 'nr2', 'nr3', 'nr1s', 'nr2s', 'nr3s', 'nosym', 'nosym_evc', 'noinv', 'no_t_rev', 'force_symmorphic', 'use_all_frac', 'occupations', 'one_atom_occupations', 'starting_spin_angle', 'degauss_cond', 'nelec_cond', 'degauss', 'smearing', 'nspin', 'sic_gamma', 'pol_type', 'sic_energy', 'sci_vb', 'sci_cb', 'noncolin', 'ecfixed', 'qcutz', 'q2sigma', 'input_dft', 'ace', 'exx_fraction', 'screening_parameter', 'exxdiv_treatment', 'x_gamma_extrapolation', 'ecutvcutnqx1', 'nqx2', 'nqx3', 'localization_thr', 'Hubbard_occ', 'Hubbard_alpha', 'Hubbard_beta', 'starting_ns_eigenvalue', 'dmft', 'dmft_prefix', 'ensemble_energies', 'edir', 'emaxpos', 'eopreg', 'eamp', 'angle1', 'angle2', 'lforcet', 'constrained_magnetization', 'fixed_magnetization', 'lambda', 'report', 'lspinorb', 'assume_isolated', 'esm_bc', 'esm_w', 'esm_efield', 'esm_nfit', 'lgcscf', 'gcscf_mu', 'gcscf_conv_thr', 'gcscf_beta', 'vdw_corr', 'london', 'london_s6', 'london_c6', 'london_rvdw', 'london_rcut', 'dftd3_version', 'dftd3_threebody', 'ts_vdw_econv_thr', 'ts_vdw_isolated', 'xdm', 'xdm_a1', 'xdm_a2', 'space_group', 'uniqueb', 'origin_choice', 'rhombohedral', 'zgate', 'relaxz', 'block', 'block_1', 'block_2', 'block_height', 'nextffield'], '&ELECTRONS': ['electron_maxstep', 'exx_maxstep', 'scf_must_converge', 'conv_thr', 'adaptive_thr', 'conv_thr_init', 'conv_thr_multi', 'mixing_mode', 'mixing_beta', 'mixing_ndim', 'mixing_fixed_ns', 'diagonalization', 'diago_thr_init', 'diago_cg_maxiter', 'diago_ppcg_maxiter', 'diago_david_ndim', 'diago_rmm_ndim', 'diago_rmm_conv', 'diago_gs_nblock', 'diago_full_acc', 'efield', 'efield_cart', 'efield_phase', 'startingpot', 'startingwfc', 'tqr', 'real_space'], '&IONS': ['ion_positions', 'ion_velocities', 'ion_dynamics', 'pot_extrapolation', 'wfc_extrapolation', 'remove_rigid_rot', 'ion_temperature', 'tempw', 'tolp', 'delta_t', 'nraise', 'refold_pos', 'upscale', 'bfgs_ndim', 'trust_radius_max', 'trust_radius_min', 'trust_radius_ini', 'w_1', 'w_2', 'fire_alpha_init', 'fire_falpha', 'fire_nmin', 'fire_f_inc', 'fire_f_dec', 'fire_dtmax'], '&CELL': ['cell_dynamics', 'press', 'wmass', 'cell_factor', 'press_conv_thrcell_dofree'], '&FCP': ['fcp_mu', 'fcp_dynamics', 'fcp_conv_thr', 'fcp_ndiis', 'fcp_mass', 'fcp_velocity', 'fcp_temperature', 'fcp_tempw', 'fcp_tolp ', 'fcp_delta_t', 'fcp_nraise', 'freeze_all_atoms'], '&RISM': ['nsolv', 'closure', 'tempv', 'ecutsolv', 'solute_lj', 'solute_epsilon', 'solute_sigma', 'starting1d', 'starting3d', 'smear1d', 'smear3d', 'rism1d_maxstep', 'rism3d_maxstep', 'rism1d_conv_thr', 'rism3d_conv_thr', 'mdiis1d_size', 'mdiis3d_size', 'mdiis1d_step', 'mdiis3d_step', 'rism1d_bond_width', 'rism1d_dielectric', 'rism1d_molesize', 'rism1d_nproc', 'rism3d_conv_level', 'rism3d_planar_average', 'laue_nfit', 'laue_expand_right', 'laue_expand_left', 'laue_starting_right', 'laue_starting_left', 'laue_buffer_right', 'laue_buffer_left', 'laue_both_hands', 'laue_wall', 'laue_wall_z', 'laue_wall_rho', 'laue_wall_epsilon', 'laue_wall_sigma', 'laue_wall_lj6']}"}, {"fullname": "aton.interface.qe.pw_cards", "modulename": "aton.interface.qe", "qualname": "pw_cards", "kind": "variable", "doc": "

Dictionary with every possible CARDs as keys, and the corresponding variables as values.

\n", "default_value": "{'ATOMIC_SPECIES': ['X', 'Mass_X', 'PseudoPot_X'], 'ATOMIC_POSITIONS': ['X', 'x', 'y', 'z', 'if_pos(1)', 'if_pos(2)', 'if_pos(3)'], 'K_POINTS': ['nks', 'xk_x', 'xk_y', 'xk_z', 'wk', 'nk1', 'nk2', 'nk3', 'sk1', 'sk2', 'sk3'], 'ADDITIONAL_K_POINTS': ['nks_add', 'k_x', 'k_y', 'k_z', 'wk_'], 'CELL_PARAMETERS': ['v1', 'v2', 'v3'], 'CONSTRAINTS': ['nconstr', 'constr_tol', 'constr_type', 'constr(1)', 'constr(2)', 'constr(3)', 'constr(4)', 'constr_target'], 'OCCUPATIONS': ['f_inp1', 'f_inp2'], 'ATOMIC_VELOCITIES': ['V', 'vx', 'vy', 'vz'], 'ATOMIC_FORCES': ['X', 'fx', 'fy', 'fz'], 'SOLVENTS': ['X', 'Density', 'Molecule', 'X', 'Density_Left', 'Density_Right', 'Molecule'], 'HUBBARD': ['label(1)-manifold(1)', 'u_val(1)', 'label(1)-manifold(1)', 'j0_val(1)', 'paramType(1)', 'label(1)-manifold(1)', 'paramValue(1)', 'label(I)-manifold(I)', 'u_val(I)', 'label(I)-manifold(I)', 'j0_val(I)', 'label(I)-manifold(I)', 'label(J)-manifold(J)', 'I', 'J', 'v_val(I,J)'], 'CELL_PARAMETERS_out': ['v1', 'v2', 'v3'], 'ATOMIC_POSITIONS_out': ['X', 'x', 'y', 'z', 'if_pos(1)', 'if_pos(2)', 'if_pos(3)']}"}, {"fullname": "aton.interface.slurm", "modulename": "aton.interface.slurm", "kind": "module", "doc": "

Description

\n\n

Functions to handle Slurm calls, to run calculations in clusters.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
sbatch()Sbatch all calculations
scancel()Scancel all calculations, or applying some filters
scancel_here()Scancel all calculations running from a specific folder
squeue()Get a Pandas DataFrame with info about the submitted calculations
check_template()Checks that the slurm template is OK, and provides an example if not
\n\n
\n"}, {"fullname": "aton.interface.slurm.sbatch", "modulename": "aton.interface.slurm", "qualname": "sbatch", "kind": "function", "doc": "

Sbatch all the calculations at once.

\n\n

Calculation names should follow prefix_ID.ext,\nwith prefix as the common name across calculations,\nfollowed by the calculation ID, used as JOB_NAME.\nThe extensions from in_ext and out_ext ('.in' and '.out' by default)\nwill be used for the INPUT_FILE and OUTPUT_FILE of the slurm template.

\n\n

The slurm template, template.slurm by default,\nmust contain the keywords JOB_ID, INPUT_FILE and OUTPUT_FILE:

\n\n
#SBATCH --job-name=JOB_NAME\nmpirun pw.x -inp INPUT_FILE > OUTPUT_FILE\n
\n\n

Runs from the specified folder, current working directory if empty.

\n\n

If more control is required, a custom list of files can be specified for sbatching.

\n\n

If testing = True it skips the final sbatching,\njust printing the commands on the screen.

\n", "signature": "(\tprefix: str = '',\ttemplate: str = 'template.slurm',\tin_ext: str = '.in',\tout_ext: str = '.out',\tfolder=None,\tfiles: list = [],\ttesting: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.scancel", "modulename": "aton.interface.slurm", "qualname": "scancel", "kind": "function", "doc": "

Cancel all user jobs.

\n\n

If a particular status string is provided,\nonly the calculations with said status will be cancelled.

\n\n

If a particular text string is provided,\nonly the calculations containing said text in the name will be deleted.

\n\n

If testing = True, it shows the calculations that would be deleted.

\n\n

if the slurm squeue titles are different in your cluster,\nyou can specify them with key_jobid, key_status and key_name.

\n", "signature": "(\tuser: str,\tstatus: str = '',\ttext: str = '',\ttesting: bool = False,\tkey_jobid: str = 'JOBID',\tkey_name: str = 'NAME',\tkey_status: str = 'ST') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.scancel_here", "modulename": "aton.interface.slurm", "qualname": "scancel_here", "kind": "function", "doc": "

Cancel all running jobs in a given folder.

\n\n

If no job is provided, all jobs detected in the current folder will be cancelled.\nThe jobs will be detected from the <prefix>JOBID<sufix> files, slurm-JOBID.out by default.

\n", "signature": "(\tjobs=None,\tfolder=None,\tprefix: str = 'slurm-',\tsufix: str = '.out') -> None:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.squeue", "modulename": "aton.interface.slurm", "qualname": "squeue", "kind": "function", "doc": "

Returns a Pandas DataFrame with the jobs from a specific user

\n", "signature": "(user) -> pandas.core.frame.DataFrame:", "funcdef": "def"}, {"fullname": "aton.interface.slurm.check_template", "modulename": "aton.interface.slurm", "qualname": "check_template", "kind": "function", "doc": "

Check the slurm template inside folder.

\n\n

The current working directory is used if folder is not provided.\nIf the file does not exist or is invalid, creates a template_EXAMPLE.slurm file for reference.

\n", "signature": "(template: str = 'template.slurm', folder=None) -> str:", "funcdef": "def"}, {"fullname": "aton.phys", "modulename": "aton.phys", "kind": "module", "doc": "

Physico-chemical constants

\n\n

This subpackage contains universal physical constants,\nas well as chemical data from all known elements.\nIt also includes functions to manage this data.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.phys.unitsUniversal constants and conversion factors
aton.phys.atomsData from all chemical elements
aton.phys.functionsFunctions to sort and manage element data from the aton.phys.atoms dict
\n\n

Examples

\n\n

All values and functions from phys submodules can be\nloaded directly as phys.value or phys.function(),\nas in the example below.

\n\n
\n
from aton import phys\nphys.eV_to_J                     # 1.602176634e-19\nphys.atoms['H'].isotope[2].mass  # 2.0141017779\nphys.split_isotope('He4')        # ('He', 4)\n
\n
\n\n

See the API reference of the specific modules for more information.

\n\n

References

\n\n

aton.phys.units

\n\n

Constant values come from the 2022 CODATA Recommended Values of the Fundamental Physical Constants.

\n\n

Conversion factors for neutron scattering come from\nM. B\u00e9e, \"Quasielastic Neutron scattering\", Adam Hilger, Bristol and Philadelphia, 1988.

\n\n

aton.phys.atoms

\n\n

Atomic mass are in atomic mass units (amu), and come from:\nPure Appl. Chem., Vol. 78, No. 11, pp. 2051-2066, 2006.\nThe following masses are obtained from Wikipedia:\nAc: 227, Np: 237, Pm: 145, Tc: 98.

\n\n

Isotope mass, mass_number and abundance come from:\nJ. R. de Laeter, J. K. B\u00f6hlke, P. De Bi\u00e8vre, H. Hidaka, H. S. Peiser, K. J. R. Rosman\nand P. D. P. Taylor (2003). \"Atomic weights of the elements. Review 2000 (IUPAC Technical Report)\".

\n\n

Total bound scattering cross_section $\\sigma_s$ are in barns (1 b = 100 fm$^2$).\nFrom Felix Fernandez-Alonso, \"Neutron Scattering Fundamentals\", 2013.

\n"}, {"fullname": "aton.phys.atoms", "modulename": "aton.phys.atoms", "kind": "module", "doc": "

Description

\n\n

This module contains the atoms megadictionary,\nwhich contains the properties of all elements.\nIt is managed and updated automatically with aton.phys.functions.

\n\n

The atoms dictionary can be loaded directly as aton.phys.atoms.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
ElementUsed as values in the atoms dict, stores element properties
IsotopeUsed as values in Element.isotope, contains isotope properties
atomsThe dict with data from all elements
\n\n

Examples

\n\n
\n
from aton import phys\naluminium_cross_section = phys.atoms['Al'].cross_section  # 1.503\nHe4_mass = phys.atoms['H'].isotope[4].mass  # 4.0026032497\n
\n
\n\n
\n"}, {"fullname": "aton.phys.atoms.Element", "modulename": "aton.phys.atoms", "qualname": "Element", "kind": "class", "doc": "

Used in the aton.atoms megadictionary to store element data.

\n"}, {"fullname": "aton.phys.atoms.Element.__init__", "modulename": "aton.phys.atoms", "qualname": "Element.__init__", "kind": "function", "doc": "

\n", "signature": "(\tZ: int = None,\tsymbol: str = None,\tname: str = None,\tmass: float = None,\tcross_section: float = None,\tisotope: dict = None)"}, {"fullname": "aton.phys.atoms.Element.Z", "modulename": "aton.phys.atoms", "qualname": "Element.Z", "kind": "variable", "doc": "

Atomic number (Z). Corresponds to the number of protons / electrons.

\n", "annotation": ": int"}, {"fullname": "aton.phys.atoms.Element.symbol", "modulename": "aton.phys.atoms", "qualname": "Element.symbol", "kind": "variable", "doc": "

Standard symbol of the element.

\n", "annotation": ": str"}, {"fullname": "aton.phys.atoms.Element.name", "modulename": "aton.phys.atoms", "qualname": "Element.name", "kind": "variable", "doc": "

Full name.

\n", "annotation": ": str"}, {"fullname": "aton.phys.atoms.Element.mass", "modulename": "aton.phys.atoms", "qualname": "Element.mass", "kind": "variable", "doc": "

Atomic mass, in atomic mass units (amu).

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Element.cross_section", "modulename": "aton.phys.atoms", "qualname": "Element.cross_section", "kind": "variable", "doc": "

Total bound scattering cross section.

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Element.isotope", "modulename": "aton.phys.atoms", "qualname": "Element.isotope", "kind": "variable", "doc": "

Dictionary containing the different Isotope of the element.\nThe keys are the mass number (A).

\n", "annotation": ": dict"}, {"fullname": "aton.phys.atoms.Isotope", "modulename": "aton.phys.atoms", "qualname": "Isotope", "kind": "class", "doc": "

Used in the aton.atoms megadictionary to store isotope data.

\n"}, {"fullname": "aton.phys.atoms.Isotope.__init__", "modulename": "aton.phys.atoms", "qualname": "Isotope.__init__", "kind": "function", "doc": "

\n", "signature": "(\tA: int = None,\tmass: float = None,\tabundance: float = None,\tcross_section: float = None)"}, {"fullname": "aton.phys.atoms.Isotope.A", "modulename": "aton.phys.atoms", "qualname": "Isotope.A", "kind": "variable", "doc": "

Mass number (A) of the isotope.\nCorresponds to the total number of protons + neutrons in the core.

\n", "annotation": ": int"}, {"fullname": "aton.phys.atoms.Isotope.mass", "modulename": "aton.phys.atoms", "qualname": "Isotope.mass", "kind": "variable", "doc": "

Atomic mass of the isotope, in atomic mass units (amu).

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Isotope.abundance", "modulename": "aton.phys.atoms", "qualname": "Isotope.abundance", "kind": "variable", "doc": "

Relative abundance of the isotope.

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.Isotope.cross_section", "modulename": "aton.phys.atoms", "qualname": "Isotope.cross_section", "kind": "variable", "doc": "

Total bound scattering cross section of the isotope.

\n", "annotation": ": float"}, {"fullname": "aton.phys.atoms.atoms", "modulename": "aton.phys.atoms", "qualname": "atoms", "kind": "variable", "doc": "

\n", "default_value": "{'H': <aton.phys.atoms.Element object>, 'He': <aton.phys.atoms.Element object>, 'Li': <aton.phys.atoms.Element object>, 'Be': <aton.phys.atoms.Element object>, 'B': <aton.phys.atoms.Element object>, 'C': <aton.phys.atoms.Element object>, 'N': <aton.phys.atoms.Element object>, 'O': <aton.phys.atoms.Element object>, 'F': <aton.phys.atoms.Element object>, 'Ne': <aton.phys.atoms.Element object>, 'Na': <aton.phys.atoms.Element object>, 'Mg': <aton.phys.atoms.Element object>, 'Al': <aton.phys.atoms.Element object>, 'Si': <aton.phys.atoms.Element object>, 'P': <aton.phys.atoms.Element object>, 'S': <aton.phys.atoms.Element object>, 'Cl': <aton.phys.atoms.Element object>, 'Ar': <aton.phys.atoms.Element object>, 'K': <aton.phys.atoms.Element object>, 'Ca': <aton.phys.atoms.Element object>, 'Sc': <aton.phys.atoms.Element object>, 'Ti': <aton.phys.atoms.Element object>, 'V': <aton.phys.atoms.Element object>, 'Cr': <aton.phys.atoms.Element object>, 'Mn': <aton.phys.atoms.Element object>, 'Fe': <aton.phys.atoms.Element object>, 'Co': <aton.phys.atoms.Element object>, 'Ni': <aton.phys.atoms.Element object>, 'Cu': <aton.phys.atoms.Element object>, 'Zn': <aton.phys.atoms.Element object>, 'Ga': <aton.phys.atoms.Element object>, 'Ge': <aton.phys.atoms.Element object>, 'As': <aton.phys.atoms.Element object>, 'Se': <aton.phys.atoms.Element object>, 'Br': <aton.phys.atoms.Element object>, 'Kr': <aton.phys.atoms.Element object>, 'Rb': <aton.phys.atoms.Element object>, 'Sr': <aton.phys.atoms.Element object>, 'Y': <aton.phys.atoms.Element object>, 'Zr': <aton.phys.atoms.Element object>, 'Nb': <aton.phys.atoms.Element object>, 'Mo': <aton.phys.atoms.Element object>, 'Tc': <aton.phys.atoms.Element object>, 'Ru': <aton.phys.atoms.Element object>, 'Rh': <aton.phys.atoms.Element object>, 'Pd': <aton.phys.atoms.Element object>, 'Ag': <aton.phys.atoms.Element object>, 'Cd': <aton.phys.atoms.Element object>, 'In': <aton.phys.atoms.Element object>, 'Sn': <aton.phys.atoms.Element object>, 'Sb': <aton.phys.atoms.Element object>, 'Te': <aton.phys.atoms.Element object>, 'I': <aton.phys.atoms.Element object>, 'Xe': <aton.phys.atoms.Element object>, 'Cs': <aton.phys.atoms.Element object>, 'Ba': <aton.phys.atoms.Element object>, 'La': <aton.phys.atoms.Element object>, 'Ce': <aton.phys.atoms.Element object>, 'Pr': <aton.phys.atoms.Element object>, 'Nd': <aton.phys.atoms.Element object>, 'Pm': <aton.phys.atoms.Element object>, 'Sm': <aton.phys.atoms.Element object>, 'Eu': <aton.phys.atoms.Element object>, 'Gd': <aton.phys.atoms.Element object>, 'Tb': <aton.phys.atoms.Element object>, 'Dy': <aton.phys.atoms.Element object>, 'Ho': <aton.phys.atoms.Element object>, 'Er': <aton.phys.atoms.Element object>, 'Tm': <aton.phys.atoms.Element object>, 'Yb': <aton.phys.atoms.Element object>, 'Lu': <aton.phys.atoms.Element object>, 'Hf': <aton.phys.atoms.Element object>, 'Ta': <aton.phys.atoms.Element object>, 'W': <aton.phys.atoms.Element object>, 'Re': <aton.phys.atoms.Element object>, 'Os': <aton.phys.atoms.Element object>, 'Ir': <aton.phys.atoms.Element object>, 'Pt': <aton.phys.atoms.Element object>, 'Au': <aton.phys.atoms.Element object>, 'Hg': <aton.phys.atoms.Element object>, 'Tl': <aton.phys.atoms.Element object>, 'Pb': <aton.phys.atoms.Element object>, 'Bi': <aton.phys.atoms.Element object>, 'Po': <aton.phys.atoms.Element object>, 'At': <aton.phys.atoms.Element object>, 'Rn': <aton.phys.atoms.Element object>, 'Fr': <aton.phys.atoms.Element object>, 'Ra': <aton.phys.atoms.Element object>, 'Ac': <aton.phys.atoms.Element object>, 'Th': <aton.phys.atoms.Element object>, 'Pa': <aton.phys.atoms.Element object>, 'U': <aton.phys.atoms.Element object>, 'Np': <aton.phys.atoms.Element object>, 'Pu': <aton.phys.atoms.Element object>, 'Am': <aton.phys.atoms.Element object>, 'Cm': <aton.phys.atoms.Element object>, 'Bk': <aton.phys.atoms.Element object>, 'Cf': <aton.phys.atoms.Element object>, 'Es': <aton.phys.atoms.Element object>, 'Fm': <aton.phys.atoms.Element object>, 'Md': <aton.phys.atoms.Element object>, 'No': <aton.phys.atoms.Element object>, 'Lr': <aton.phys.atoms.Element object>, 'Rf': <aton.phys.atoms.Element object>, 'Db': <aton.phys.atoms.Element object>, 'Sg': <aton.phys.atoms.Element object>, 'Bh': <aton.phys.atoms.Element object>, 'Hs': <aton.phys.atoms.Element object>, 'Mt': <aton.phys.atoms.Element object>, 'Ds': <aton.phys.atoms.Element object>, 'Rg': <aton.phys.atoms.Element object>, 'Cn': <aton.phys.atoms.Element object>, 'Uut': <aton.phys.atoms.Element object>, 'Uuq': <aton.phys.atoms.Element object>, 'Uup': <aton.phys.atoms.Element object>, 'Uuh': <aton.phys.atoms.Element object>, 'Uus': <aton.phys.atoms.Element object>, 'Uuo': <aton.phys.atoms.Element object>}"}, {"fullname": "aton.phys.functions", "modulename": "aton.phys.functions", "kind": "module", "doc": "

Description

\n\n

This module contains functions to sort and analyse\nchemical data using the aton.phys.atoms megadictionary,\nwhich contains the properties of all elements.\nIt also contains the tools needed to\nautomatically update said megadictionary.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
export_atoms()Used to update and export the aton.phys.atoms dict
split_isotope()Splits element name and mass number
allowed_isotopes()Returns the available mass numbers for a given element
\n\n

Examples

\n\n

All functions can be called from the phys subpackage directly, as:

\n\n
\n
from aton import phys\nphys.split_isotope('He4')    # (He, 4)\nphys.allowed_isotopes('Li')  # (6, 7)\n
\n
\n\n
\n"}, {"fullname": "aton.phys.functions.export_atoms", "modulename": "aton.phys.functions", "qualname": "export_atoms", "kind": "function", "doc": "

Export a dictionary of chemical elements to a python file.

\n\n

This is used to build and update the aton.atoms megadictionary, that contains\nall the element data, such as masses, cross-sections, etc.\nThe atoms.py file must be modified here.

\n", "signature": "(\tatoms: dict = {'H': <aton.phys.atoms.Element object>, 'He': <aton.phys.atoms.Element object>, 'Li': <aton.phys.atoms.Element object>, 'Be': <aton.phys.atoms.Element object>, 'B': <aton.phys.atoms.Element object>, 'C': <aton.phys.atoms.Element object>, 'N': <aton.phys.atoms.Element object>, 'O': <aton.phys.atoms.Element object>, 'F': <aton.phys.atoms.Element object>, 'Ne': <aton.phys.atoms.Element object>, 'Na': <aton.phys.atoms.Element object>, 'Mg': <aton.phys.atoms.Element object>, 'Al': <aton.phys.atoms.Element object>, 'Si': <aton.phys.atoms.Element object>, 'P': <aton.phys.atoms.Element object>, 'S': <aton.phys.atoms.Element object>, 'Cl': <aton.phys.atoms.Element object>, 'Ar': <aton.phys.atoms.Element object>, 'K': <aton.phys.atoms.Element object>, 'Ca': <aton.phys.atoms.Element object>, 'Sc': <aton.phys.atoms.Element object>, 'Ti': <aton.phys.atoms.Element object>, 'V': <aton.phys.atoms.Element object>, 'Cr': <aton.phys.atoms.Element object>, 'Mn': <aton.phys.atoms.Element object>, 'Fe': <aton.phys.atoms.Element object>, 'Co': <aton.phys.atoms.Element object>, 'Ni': <aton.phys.atoms.Element object>, 'Cu': <aton.phys.atoms.Element object>, 'Zn': <aton.phys.atoms.Element object>, 'Ga': <aton.phys.atoms.Element object>, 'Ge': <aton.phys.atoms.Element object>, 'As': <aton.phys.atoms.Element object>, 'Se': <aton.phys.atoms.Element object>, 'Br': <aton.phys.atoms.Element object>, 'Kr': <aton.phys.atoms.Element object>, 'Rb': <aton.phys.atoms.Element object>, 'Sr': <aton.phys.atoms.Element object>, 'Y': <aton.phys.atoms.Element object>, 'Zr': <aton.phys.atoms.Element object>, 'Nb': <aton.phys.atoms.Element object>, 'Mo': <aton.phys.atoms.Element object>, 'Tc': <aton.phys.atoms.Element object>, 'Ru': <aton.phys.atoms.Element object>, 'Rh': <aton.phys.atoms.Element object>, 'Pd': <aton.phys.atoms.Element object>, 'Ag': <aton.phys.atoms.Element object>, 'Cd': <aton.phys.atoms.Element object>, 'In': <aton.phys.atoms.Element object>, 'Sn': <aton.phys.atoms.Element object>, 'Sb': <aton.phys.atoms.Element object>, 'Te': <aton.phys.atoms.Element object>, 'I': <aton.phys.atoms.Element object>, 'Xe': <aton.phys.atoms.Element object>, 'Cs': <aton.phys.atoms.Element object>, 'Ba': <aton.phys.atoms.Element object>, 'La': <aton.phys.atoms.Element object>, 'Ce': <aton.phys.atoms.Element object>, 'Pr': <aton.phys.atoms.Element object>, 'Nd': <aton.phys.atoms.Element object>, 'Pm': <aton.phys.atoms.Element object>, 'Sm': <aton.phys.atoms.Element object>, 'Eu': <aton.phys.atoms.Element object>, 'Gd': <aton.phys.atoms.Element object>, 'Tb': <aton.phys.atoms.Element object>, 'Dy': <aton.phys.atoms.Element object>, 'Ho': <aton.phys.atoms.Element object>, 'Er': <aton.phys.atoms.Element object>, 'Tm': <aton.phys.atoms.Element object>, 'Yb': <aton.phys.atoms.Element object>, 'Lu': <aton.phys.atoms.Element object>, 'Hf': <aton.phys.atoms.Element object>, 'Ta': <aton.phys.atoms.Element object>, 'W': <aton.phys.atoms.Element object>, 'Re': <aton.phys.atoms.Element object>, 'Os': <aton.phys.atoms.Element object>, 'Ir': <aton.phys.atoms.Element object>, 'Pt': <aton.phys.atoms.Element object>, 'Au': <aton.phys.atoms.Element object>, 'Hg': <aton.phys.atoms.Element object>, 'Tl': <aton.phys.atoms.Element object>, 'Pb': <aton.phys.atoms.Element object>, 'Bi': <aton.phys.atoms.Element object>, 'Po': <aton.phys.atoms.Element object>, 'At': <aton.phys.atoms.Element object>, 'Rn': <aton.phys.atoms.Element object>, 'Fr': <aton.phys.atoms.Element object>, 'Ra': <aton.phys.atoms.Element object>, 'Ac': <aton.phys.atoms.Element object>, 'Th': <aton.phys.atoms.Element object>, 'Pa': <aton.phys.atoms.Element object>, 'U': <aton.phys.atoms.Element object>, 'Np': <aton.phys.atoms.Element object>, 'Pu': <aton.phys.atoms.Element object>, 'Am': <aton.phys.atoms.Element object>, 'Cm': <aton.phys.atoms.Element object>, 'Bk': <aton.phys.atoms.Element object>, 'Cf': <aton.phys.atoms.Element object>, 'Es': <aton.phys.atoms.Element object>, 'Fm': <aton.phys.atoms.Element object>, 'Md': <aton.phys.atoms.Element object>, 'No': <aton.phys.atoms.Element object>, 'Lr': <aton.phys.atoms.Element object>, 'Rf': <aton.phys.atoms.Element object>, 'Db': <aton.phys.atoms.Element object>, 'Sg': <aton.phys.atoms.Element object>, 'Bh': <aton.phys.atoms.Element object>, 'Hs': <aton.phys.atoms.Element object>, 'Mt': <aton.phys.atoms.Element object>, 'Ds': <aton.phys.atoms.Element object>, 'Rg': <aton.phys.atoms.Element object>, 'Cn': <aton.phys.atoms.Element object>, 'Uut': <aton.phys.atoms.Element object>, 'Uuq': <aton.phys.atoms.Element object>, 'Uup': <aton.phys.atoms.Element object>, 'Uuh': <aton.phys.atoms.Element object>, 'Uus': <aton.phys.atoms.Element object>, 'Uuo': <aton.phys.atoms.Element object>},\tfilename='exported_atoms.py') -> None:", "funcdef": "def"}, {"fullname": "aton.phys.functions.split_isotope", "modulename": "aton.phys.functions", "qualname": "split_isotope", "kind": "function", "doc": "

Split the name of an isotope into the element and the mass number, eg. He4 -> He, 4.

\n\n

If the isotope is not found in the aton.atoms megadictionary it raises an error,\ninforming of the allowed mass numbers (A) values for the given element.

\n", "signature": "(name: str) -> tuple:", "funcdef": "def"}, {"fullname": "aton.phys.functions.allowed_isotopes", "modulename": "aton.phys.functions", "qualname": "allowed_isotopes", "kind": "function", "doc": "

Return a list with the allowed mass numbers (A) of a given element.

\n\n

These mass numbers are used as isotope keys in the aton.atoms megadictionary.

\n", "signature": "(element) -> list:", "funcdef": "def"}, {"fullname": "aton.phys.units", "modulename": "aton.phys.units", "kind": "module", "doc": "

Description

\n\n

This module contains the constants from the \n2022 CODATA\nRecommended Values of the Fundamental Physical Constants.

\n\n

It also contains useful conversion factors for neutron scattering,\nfrom M. B\u00e9e, \"Quasielastic Neutron scattering\", Adam Hilger, Bristol and Philadelphia, 1988.

\n\n

Index

\n\n\n\n

Examples

\n\n

Units and constants are named as their standard symbol, removing any / divider in between.\nInverse of a unit or constant X, as in 1/X or X$^{-1}$, is expressed as X1.

\n\n

Universal constant names contain\nromanized greek letters,\nexcept for $\\mu$ which is used as u.

\n\n

Some examples:

\n\n
\n
from aton.phys import *\n# Constants\nh     # Planck constant\nhbar  # reduced Planck constant\na     # fine-structure constant (alpha)\nue    # electron magnetic moment (mu e)\nmn    # neutron mass\nmnc2  # neutron mass energy equivalent\n# Conversions\n# meV to 1/cm\nenergy_in_cm1 = energy_in_meV * meV_to_cm1\n# Bohr to Angstroms\ndistance_in_angstroms = distance_in_bohr * bohr_to_A\n# m/s to rad/s  (used in neutron scattering)\nvelocity_in_rads = velocity_in_ms * ms_to_rads\n
\n
\n\n
\n\n

Fundamental Physical Constants

\n\n

Using SI units unless stated otherwise.

\n\n

Universal

\n"}, {"fullname": "aton.phys.units.c", "modulename": "aton.phys.units", "qualname": "c", "kind": "variable", "doc": "

$c$ | speed of light in vacuum / natural unit of velocity, in m/s

\n", "default_value": "299792458"}, {"fullname": "aton.phys.units.u0", "modulename": "aton.phys.units", "qualname": "u0", "kind": "variable", "doc": "

$\\mu_0$ | vacuum magnetic permeability, in N\u00b7A$^{-2}$ ($4\\pi\\alpha\\hbar/e^2 c$)

\n", "default_value": "1.25663706127e-06"}, {"fullname": "aton.phys.units.e0", "modulename": "aton.phys.units", "qualname": "e0", "kind": "variable", "doc": "

$\\epsilon_0$ | vacuum electric permittivity, in F\u00b7m$^{-1}$ ($1/\\mu_0 c^2$)

\n", "default_value": "1.25663706127e-06"}, {"fullname": "aton.phys.units.Z0", "modulename": "aton.phys.units", "qualname": "Z0", "kind": "variable", "doc": "

$Z_0$ | characteristic impedance of vacuum, in $\\Omega$ ($\\mu_0 c$)

\n", "default_value": "376.730313412"}, {"fullname": "aton.phys.units.G", "modulename": "aton.phys.units", "qualname": "G", "kind": "variable", "doc": "

$G$ | Newtonian constant of gravitation, in m$^3$\u00b7kg$^{-1}$\u00b7s$^{-1}$

\n", "default_value": "6.6743e-11"}, {"fullname": "aton.phys.units.h", "modulename": "aton.phys.units", "qualname": "h", "kind": "variable", "doc": "

$h$ | Planck constant, in J\u00b7s

\n", "default_value": "6.62607015e-34"}, {"fullname": "aton.phys.units.h_eV", "modulename": "aton.phys.units", "qualname": "h_eV", "kind": "variable", "doc": "

$h$ | Planck constant, in eV\u00b7s

\n", "default_value": "4.135667696923859e-15"}, {"fullname": "aton.phys.units.hbar", "modulename": "aton.phys.units", "qualname": "hbar", "kind": "variable", "doc": "

$\\hbar$ | reduced Planck constant / natural unit of action, in J\u00b7s

\n", "default_value": "1.0545718176461565e-34"}, {"fullname": "aton.phys.units.hbar_eV", "modulename": "aton.phys.units", "qualname": "hbar_eV", "kind": "variable", "doc": "

$\\hbar$ | reduced Planck constant, in eV\u00b7s

\n\n
\n\n

Electromagnetic

\n", "default_value": "6.582119569509066e-16"}, {"fullname": "aton.phys.units.e", "modulename": "aton.phys.units", "qualname": "e", "kind": "variable", "doc": "

$e$ | elementary charge, in C

\n", "default_value": "1.602176634e-19"}, {"fullname": "aton.phys.units.P0", "modulename": "aton.phys.units", "qualname": "P0", "kind": "variable", "doc": "

$\\Phi_0$ | magnetic flux quantum, in Wb ($2\\pi\\hbar/(2e)$)

\n", "default_value": "2.067833848e-15"}, {"fullname": "aton.phys.units.G0", "modulename": "aton.phys.units", "qualname": "G0", "kind": "variable", "doc": "

$G_0$ | conductance quantum, in S ($2e^2/2\\pi h$)

\n", "default_value": "7.748091729e-05"}, {"fullname": "aton.phys.units.KJ", "modulename": "aton.phys.units", "qualname": "KJ", "kind": "variable", "doc": "

$K_J$ | Josephson constant, in Hz\u00b7V$^{-1}$ (2e/h)

\n", "default_value": "483597848400000.0"}, {"fullname": "aton.phys.units.RK", "modulename": "aton.phys.units", "qualname": "RK", "kind": "variable", "doc": "

$R_K$ | von Klitzing constant, in $\\Omega$ ($\\mu_0 c/2\\alpha = 2\\pi\\hbar/e^2$)

\n", "default_value": "25812.80745"}, {"fullname": "aton.phys.units.uB", "modulename": "aton.phys.units", "qualname": "uB", "kind": "variable", "doc": "

$\\mu_B$ | Bohr magneton, in J\u00b7T$^{-1}$ ($e\\hbar / 2m_e$)

\n", "default_value": "9.2740100657e-24"}, {"fullname": "aton.phys.units.uN", "modulename": "aton.phys.units", "qualname": "uN", "kind": "variable", "doc": "

$\\mu_N$ | nuclear magneton, in J\u00b7T$^{-1}$ ($e\\hbar / 2m_p$)

\n\n
\n\n

Atomic and nuclear

\n\n

General

\n", "default_value": "5.0507837393e-27"}, {"fullname": "aton.phys.units.a", "modulename": "aton.phys.units", "qualname": "a", "kind": "variable", "doc": "

$\\alpha$ | fine-structure constant ($e^2 / 4 \\pi \\epsilon_0 \\hbar c$)

\n", "default_value": "0.0072973525643"}, {"fullname": "aton.phys.units.a1", "modulename": "aton.phys.units", "qualname": "a1", "kind": "variable", "doc": "

$\\alpha^{-1}$ | inverse fine-structure constant

\n", "default_value": "137.035999177"}, {"fullname": "aton.phys.units.cRinf", "modulename": "aton.phys.units", "qualname": "cRinf", "kind": "variable", "doc": "

$cR\\infty$ | Rydberg frequency, in Hz ($\\alpha^2m_e c^2/2h = E_h/2h$)

\n", "default_value": "3289841960250000.0"}, {"fullname": "aton.phys.units.Rinf", "modulename": "aton.phys.units", "qualname": "Rinf", "kind": "variable", "doc": "

$R\\infty$ | Rydberg constant, in $[m^{-1}]^a$

\n", "default_value": "10973731.568157"}, {"fullname": "aton.phys.units.a0", "modulename": "aton.phys.units", "qualname": "a0", "kind": "variable", "doc": "

$a_0$ | Bohr radius, in m

\n", "default_value": "5.29177210544e-11"}, {"fullname": "aton.phys.units.Eh", "modulename": "aton.phys.units", "qualname": "Eh", "kind": "variable", "doc": "

$E_h$ | Hartree energy, in J ($\\alpha^2m_ec^2=e^2/4\\pi\\epsilon_0a_0=2h c R_{\\infty}$)

\n\n
\n\n

Electron

\n", "default_value": "4.359744722206e-18"}, {"fullname": "aton.phys.units.me", "modulename": "aton.phys.units", "qualname": "me", "kind": "variable", "doc": "

$m_e$ | electron mass / natural unit of mass, in kg

\n", "default_value": "-21.8906162861"}, {"fullname": "aton.phys.units.me_uma", "modulename": "aton.phys.units", "qualname": "me_uma", "kind": "variable", "doc": "

$m_e$ | electron mass, in uma

\n", "default_value": "0.0005485799090441"}, {"fullname": "aton.phys.units.mec2", "modulename": "aton.phys.units", "qualname": "mec2", "kind": "variable", "doc": "

$m_e c^2$ | electron mass energy equivalent / natural unit of energy, in J

\n", "default_value": "8.187105788e-14"}, {"fullname": "aton.phys.units.mec2_eV", "modulename": "aton.phys.units", "qualname": "mec2_eV", "kind": "variable", "doc": "

$m_e c^2$ | electron mass energy equivalent, in eV

\n", "default_value": "510998.95069"}, {"fullname": "aton.phys.units.lC", "modulename": "aton.phys.units", "qualname": "lC", "kind": "variable", "doc": "

$\\lambda_C$ | Compton wavelength, in $[m]^a$

\n", "default_value": "2.42631023538e-12"}, {"fullname": "aton.phys.units.re", "modulename": "aton.phys.units", "qualname": "re", "kind": "variable", "doc": "

$r_e$ | classical electron radius, in m ($\\alpha^2 a_0$)

\n", "default_value": "2.8179403205e-15"}, {"fullname": "aton.phys.units.se", "modulename": "aton.phys.units", "qualname": "se", "kind": "variable", "doc": "

$\\sigma_e$ | Thomson cross section, in m$^2$ ($(8\\pi / 3)r_e^2$)

\n", "default_value": "6.6524587051e-29"}, {"fullname": "aton.phys.units.ue", "modulename": "aton.phys.units", "qualname": "ue", "kind": "variable", "doc": "

$\\mu_e$ | electron magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Proton

\n", "default_value": "-9.2847646917e-24"}, {"fullname": "aton.phys.units.mp", "modulename": "aton.phys.units", "qualname": "mp", "kind": "variable", "doc": "

$m_p$ | proton mass, in kg

\n", "default_value": "-25.32737807405"}, {"fullname": "aton.phys.units.mp_uma", "modulename": "aton.phys.units", "qualname": "mp_uma", "kind": "variable", "doc": "

$m_p$ | proton mass, in uma

\n", "default_value": "1.0072764665789"}, {"fullname": "aton.phys.units.mpc2", "modulename": "aton.phys.units", "qualname": "mpc2", "kind": "variable", "doc": "

$m_p c^2$ | proton mass energy equivalent, in J

\n", "default_value": "1.50327761802e-10"}, {"fullname": "aton.phys.units.mpc2_eV", "modulename": "aton.phys.units", "qualname": "mpc2_eV", "kind": "variable", "doc": "

$m_p c^2$ | proton mass energy equivalent, in eV

\n", "default_value": "938272089.43"}, {"fullname": "aton.phys.units.mpme", "modulename": "aton.phys.units", "qualname": "mpme", "kind": "variable", "doc": "

$m_p/m_e$ | proton-electron mass ratio

\n", "default_value": "1836.152673426"}, {"fullname": "aton.phys.units.lCp", "modulename": "aton.phys.units", "qualname": "lCp", "kind": "variable", "doc": "

$\\lambda_{C,p}$ | proton Compton wavelength, in $[m]^a$

\n", "default_value": "1.3214098536e-15"}, {"fullname": "aton.phys.units.rp", "modulename": "aton.phys.units", "qualname": "rp", "kind": "variable", "doc": "

$r_p$ | proton rms charge radius, in m

\n", "default_value": "8.4075e-16"}, {"fullname": "aton.phys.units.up", "modulename": "aton.phys.units", "qualname": "up", "kind": "variable", "doc": "

$\\mu_p$ | proton magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Neutron

\n", "default_value": "1.41060679545e-26"}, {"fullname": "aton.phys.units.mn", "modulename": "aton.phys.units", "qualname": "mn", "kind": "variable", "doc": "

$m_n$ | neutron mass, in kg

\n", "default_value": "1.67492750056e-27"}, {"fullname": "aton.phys.units.mn_uma", "modulename": "aton.phys.units", "qualname": "mn_uma", "kind": "variable", "doc": "

$m_n$ | neutron mass, in uma

\n", "default_value": "1.00866491606"}, {"fullname": "aton.phys.units.mnc2", "modulename": "aton.phys.units", "qualname": "mnc2", "kind": "variable", "doc": "

$m_n c^2$ | neutron mass energy equivalent, in J

\n", "default_value": "1.50534976514e-10"}, {"fullname": "aton.phys.units.mnc2_eV", "modulename": "aton.phys.units", "qualname": "mnc2_eV", "kind": "variable", "doc": "

$m_n c^2$ | neutron mass energy equivalent, in eV

\n", "default_value": "939565421.94"}, {"fullname": "aton.phys.units.lCn", "modulename": "aton.phys.units", "qualname": "lCn", "kind": "variable", "doc": "

$\\lambda_{C,n}$ | neutron compton wavelength, in $[m]^a$

\n", "default_value": "1.31959090382e-15"}, {"fullname": "aton.phys.units.un", "modulename": "aton.phys.units", "qualname": "un", "kind": "variable", "doc": "

$\\mu_n$ | neutron magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Deuteron

\n", "default_value": "-9.6623653e-27"}, {"fullname": "aton.phys.units.md", "modulename": "aton.phys.units", "qualname": "md", "kind": "variable", "doc": "

$m_d$ | deuteron mass, in kg

\n", "default_value": "3.3435837768e-27"}, {"fullname": "aton.phys.units.md_uma", "modulename": "aton.phys.units", "qualname": "md_uma", "kind": "variable", "doc": "

$m_d$ | deuteron mass, in uma

\n", "default_value": "2.013553212544"}, {"fullname": "aton.phys.units.mdc2", "modulename": "aton.phys.units", "qualname": "mdc2", "kind": "variable", "doc": "

$m_d c^2$ | deuteron mass energy equivalent, in J

\n", "default_value": "3.00506323491e-10"}, {"fullname": "aton.phys.units.mdc2_eV", "modulename": "aton.phys.units", "qualname": "mdc2_eV", "kind": "variable", "doc": "

$m_d c^2$ | deuteron mass energy equivalent, in eV

\n", "default_value": "1875612945"}, {"fullname": "aton.phys.units.rd", "modulename": "aton.phys.units", "qualname": "rd", "kind": "variable", "doc": "

$r_d$ | deuteron rms charge radius, in m

\n", "default_value": "2.12778e-15"}, {"fullname": "aton.phys.units.ud", "modulename": "aton.phys.units", "qualname": "ud", "kind": "variable", "doc": "

$\\mu_d$ | deuteron magnetic moment, in J\u00b7T$^{-1}$

\n\n
\n\n

Alpha particle

\n", "default_value": "4.330735087e-27"}, {"fullname": "aton.phys.units.ma", "modulename": "aton.phys.units", "qualname": "ma", "kind": "variable", "doc": "

$m_\\alpha$ | alpha particle mass, in kg

\n", "default_value": "6.644657345e-27"}, {"fullname": "aton.phys.units.mac2", "modulename": "aton.phys.units", "qualname": "mac2", "kind": "variable", "doc": "

$m_\\alpha$ | alpha particle mass energy equivalent, in J

\n", "default_value": "5.9719201997e-10"}, {"fullname": "aton.phys.units.mac2_eV", "modulename": "aton.phys.units", "qualname": "mac2_eV", "kind": "variable", "doc": "

$m_\\alpha$ | alpha particle mass energy equivalent, in eV

\n", "default_value": "3727379411.8"}, {"fullname": "aton.phys.units.ra", "modulename": "aton.phys.units", "qualname": "ra", "kind": "variable", "doc": "

$r_\\alpha$ | alpha particle rms charge radius, in m

\n\n
\n\n

Physicochemical

\n", "default_value": "1.6785e-15"}, {"fullname": "aton.phys.units.NA", "modulename": "aton.phys.units", "qualname": "NA", "kind": "variable", "doc": "

$N_A$ | Avogadro constant, in mol$^{-1}$

\n", "default_value": "6.02214076e+23"}, {"fullname": "aton.phys.units.k", "modulename": "aton.phys.units", "qualname": "k", "kind": "variable", "doc": "

$k$ | Boltzmann constant, in J\u00b7K$^{-1}$

\n", "default_value": "1.380649e-23"}, {"fullname": "aton.phys.units.k_eV", "modulename": "aton.phys.units", "qualname": "k_eV", "kind": "variable", "doc": "

$k$ | Boltzmann constant, in eV\u00b7K$^{-1}$

\n", "default_value": "8.617333262e-05"}, {"fullname": "aton.phys.units.mu", "modulename": "aton.phys.units", "qualname": "mu", "kind": "variable", "doc": "

$m_u$ | atomic mass constant / unified atomic mass unit, in kg ($\\frac{1}{12}m(^{12}C)$)

\n", "default_value": "1.66053906892e-27"}, {"fullname": "aton.phys.units.muc2", "modulename": "aton.phys.units", "qualname": "muc2", "kind": "variable", "doc": "

$m_u c^2$ | atomic mass constant energy equivalent, in J

\n", "default_value": "1.49241808768e-10"}, {"fullname": "aton.phys.units.muc2_eV", "modulename": "aton.phys.units", "qualname": "muc2_eV", "kind": "variable", "doc": "

$m_u c^2$ | atomic mass constant energy equivalent, in eV

\n", "default_value": "931494103.72"}, {"fullname": "aton.phys.units.R", "modulename": "aton.phys.units", "qualname": "R", "kind": "variable", "doc": "

$R$ | molar gas constant, in J\u00b7mol$^{-1}$K$^{-1}$ ($N_A k$)

\n", "default_value": "8.314462618"}, {"fullname": "aton.phys.units.F", "modulename": "aton.phys.units", "qualname": "F", "kind": "variable", "doc": "

$F$ | Faraday constant, in C\u00b7mol$^{-1}$ ($N_A e$)

\n", "default_value": "96485.33212"}, {"fullname": "aton.phys.units.s", "modulename": "aton.phys.units", "qualname": "s", "kind": "variable", "doc": "

$\\sigma$ | Stefan-Boltzmann constant, in W\u00b7m$^{-2}$\u00b7K$^{-4}$ ($(\\pi^2/60)k^4 /\\hbar^3 c^2$)

\n\n
\n\n

Conversion factors

\n\n

Energy

\n", "default_value": "5.670374419e-08"}, {"fullname": "aton.phys.units.Ry_to_eV", "modulename": "aton.phys.units", "qualname": "Ry_to_eV", "kind": "variable", "doc": "

\n", "default_value": "13.60569312299"}, {"fullname": "aton.phys.units.Ry_to_meV", "modulename": "aton.phys.units", "qualname": "Ry_to_meV", "kind": "variable", "doc": "

\n", "default_value": "13605.69312299"}, {"fullname": "aton.phys.units.Ry_to_J", "modulename": "aton.phys.units", "qualname": "Ry_to_J", "kind": "variable", "doc": "

\n", "default_value": "2.179872361103e-18"}, {"fullname": "aton.phys.units.eV_to_Ry", "modulename": "aton.phys.units", "qualname": "eV_to_Ry", "kind": "variable", "doc": "

\n", "default_value": "0.07349864435133158"}, {"fullname": "aton.phys.units.eV_to_J", "modulename": "aton.phys.units", "qualname": "eV_to_J", "kind": "variable", "doc": "

\n", "default_value": "1.602176634e-19"}, {"fullname": "aton.phys.units.eV_to_meV", "modulename": "aton.phys.units", "qualname": "eV_to_meV", "kind": "variable", "doc": "

\n", "default_value": "1000.0"}, {"fullname": "aton.phys.units.meV_to_eV", "modulename": "aton.phys.units", "qualname": "meV_to_eV", "kind": "variable", "doc": "

\n", "default_value": "0.001"}, {"fullname": "aton.phys.units.meV_to_Ry", "modulename": "aton.phys.units", "qualname": "meV_to_Ry", "kind": "variable", "doc": "

\n", "default_value": "7.349864435133159e-05"}, {"fullname": "aton.phys.units.meV_to_J", "modulename": "aton.phys.units", "qualname": "meV_to_J", "kind": "variable", "doc": "

\n", "default_value": "1.602176634e-22"}, {"fullname": "aton.phys.units.meV_to_A", "modulename": "aton.phys.units", "qualname": "meV_to_A", "kind": "variable", "doc": "

\n", "default_value": "9.045"}, {"fullname": "aton.phys.units.meV_to_A1", "modulename": "aton.phys.units", "qualname": "meV_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.6947"}, {"fullname": "aton.phys.units.meV_to_ms", "modulename": "aton.phys.units", "qualname": "meV_to_ms", "kind": "variable", "doc": "

\n", "default_value": "437.4"}, {"fullname": "aton.phys.units.meV_to_K", "modulename": "aton.phys.units", "qualname": "meV_to_K", "kind": "variable", "doc": "

\n", "default_value": "11.604"}, {"fullname": "aton.phys.units.meV_to_THz", "modulename": "aton.phys.units", "qualname": "meV_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.2418"}, {"fullname": "aton.phys.units.meV_to_rads", "modulename": "aton.phys.units", "qualname": "meV_to_rads", "kind": "variable", "doc": "

\n", "default_value": "1519000000000.0"}, {"fullname": "aton.phys.units.meV_to_cm1", "modulename": "aton.phys.units", "qualname": "meV_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "8.0655"}, {"fullname": "aton.phys.units.meV_to_kJmol", "modulename": "aton.phys.units", "qualname": "meV_to_kJmol", "kind": "variable", "doc": "

\n", "default_value": "0.0965"}, {"fullname": "aton.phys.units.cal_to_J", "modulename": "aton.phys.units", "qualname": "cal_to_J", "kind": "variable", "doc": "

\n", "default_value": "4.184"}, {"fullname": "aton.phys.units.kcal_to_J", "modulename": "aton.phys.units", "qualname": "kcal_to_J", "kind": "variable", "doc": "

\n", "default_value": "4184.0"}, {"fullname": "aton.phys.units.J_to_eV", "modulename": "aton.phys.units", "qualname": "J_to_eV", "kind": "variable", "doc": "

\n", "default_value": "6.241509074460763e+18"}, {"fullname": "aton.phys.units.J_to_meV", "modulename": "aton.phys.units", "qualname": "J_to_meV", "kind": "variable", "doc": "

\n", "default_value": "6.241509074460763e+21"}, {"fullname": "aton.phys.units.J_to_Ry", "modulename": "aton.phys.units", "qualname": "J_to_Ry", "kind": "variable", "doc": "

\n", "default_value": "4.5874245567938074e+17"}, {"fullname": "aton.phys.units.J_to_cal", "modulename": "aton.phys.units", "qualname": "J_to_cal", "kind": "variable", "doc": "

\n", "default_value": "0.2390057361376673"}, {"fullname": "aton.phys.units.J_to_kcal", "modulename": "aton.phys.units", "qualname": "J_to_kcal", "kind": "variable", "doc": "

\n", "default_value": "0.0002390057361376673"}, {"fullname": "aton.phys.units.kJmol_to_A", "modulename": "aton.phys.units", "qualname": "kJmol_to_A", "kind": "variable", "doc": "

\n", "default_value": "2.809"}, {"fullname": "aton.phys.units.kJmol_to_A1", "modulename": "aton.phys.units", "qualname": "kJmol_to_A1", "kind": "variable", "doc": "

\n", "default_value": "2.237"}, {"fullname": "aton.phys.units.kJmol_to_ms", "modulename": "aton.phys.units", "qualname": "kJmol_to_ms", "kind": "variable", "doc": "

\n", "default_value": "1408.0"}, {"fullname": "aton.phys.units.kJmol_to_K", "modulename": "aton.phys.units", "qualname": "kJmol_to_K", "kind": "variable", "doc": "

\n", "default_value": "120.3"}, {"fullname": "aton.phys.units.kJmol_to_THz", "modulename": "aton.phys.units", "qualname": "kJmol_to_THz", "kind": "variable", "doc": "

\n", "default_value": "2.506"}, {"fullname": "aton.phys.units.kJmol_to_rads", "modulename": "aton.phys.units", "qualname": "kJmol_to_rads", "kind": "variable", "doc": "

\n", "default_value": "15750000000000.0"}, {"fullname": "aton.phys.units.kJmol_to_cm1", "modulename": "aton.phys.units", "qualname": "kJmol_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "83.59"}, {"fullname": "aton.phys.units.kJmol_to_meV", "modulename": "aton.phys.units", "qualname": "kJmol_to_meV", "kind": "variable", "doc": "
\n\n

Distance

\n", "default_value": "10.36"}, {"fullname": "aton.phys.units.A_to_m", "modulename": "aton.phys.units", "qualname": "A_to_m", "kind": "variable", "doc": "

\n", "default_value": "1e-10"}, {"fullname": "aton.phys.units.m_to_A", "modulename": "aton.phys.units", "qualname": "m_to_A", "kind": "variable", "doc": "

\n", "default_value": "10000000000.0"}, {"fullname": "aton.phys.units.bohr_to_m", "modulename": "aton.phys.units", "qualname": "bohr_to_m", "kind": "variable", "doc": "

\n", "default_value": "5.29177210544e-11"}, {"fullname": "aton.phys.units.m_to_bohr", "modulename": "aton.phys.units", "qualname": "m_to_bohr", "kind": "variable", "doc": "

\n", "default_value": "18897261259.077824"}, {"fullname": "aton.phys.units.A_to_bohr", "modulename": "aton.phys.units", "qualname": "A_to_bohr", "kind": "variable", "doc": "

\n", "default_value": "1.8897261259077824"}, {"fullname": "aton.phys.units.bohr_to_A", "modulename": "aton.phys.units", "qualname": "bohr_to_A", "kind": "variable", "doc": "
\n\n

Mass

\n", "default_value": "0.529177210544"}, {"fullname": "aton.phys.units.kg_to_g", "modulename": "aton.phys.units", "qualname": "kg_to_g", "kind": "variable", "doc": "

\n", "default_value": "1000.0"}, {"fullname": "aton.phys.units.g_to_kg", "modulename": "aton.phys.units", "qualname": "g_to_kg", "kind": "variable", "doc": "

\n", "default_value": "0.001"}, {"fullname": "aton.phys.units.amu_to_kg", "modulename": "aton.phys.units", "qualname": "amu_to_kg", "kind": "variable", "doc": "

\n", "default_value": "1.6605390666e-27"}, {"fullname": "aton.phys.units.kg_to_amu", "modulename": "aton.phys.units", "qualname": "kg_to_amu", "kind": "variable", "doc": "
\n\n

Pressure

\n", "default_value": "6.022140762081123e+26"}, {"fullname": "aton.phys.units.Pa_to_bar", "modulename": "aton.phys.units", "qualname": "Pa_to_bar", "kind": "variable", "doc": "

\n", "default_value": "1e-05"}, {"fullname": "aton.phys.units.bar_to_Pa", "modulename": "aton.phys.units", "qualname": "bar_to_Pa", "kind": "variable", "doc": "

\n", "default_value": "99999.99999999999"}, {"fullname": "aton.phys.units.GPa_to_Pa", "modulename": "aton.phys.units", "qualname": "GPa_to_Pa", "kind": "variable", "doc": "

\n", "default_value": "1000000000.0"}, {"fullname": "aton.phys.units.Pa_to_GPa", "modulename": "aton.phys.units", "qualname": "Pa_to_GPa", "kind": "variable", "doc": "

\n", "default_value": "1e-09"}, {"fullname": "aton.phys.units.kbar_to_bar", "modulename": "aton.phys.units", "qualname": "kbar_to_bar", "kind": "variable", "doc": "

\n", "default_value": "1000.0"}, {"fullname": "aton.phys.units.bar_to_kbar", "modulename": "aton.phys.units", "qualname": "bar_to_kbar", "kind": "variable", "doc": "

\n", "default_value": "0.001"}, {"fullname": "aton.phys.units.GPa_to_kbar", "modulename": "aton.phys.units", "qualname": "GPa_to_kbar", "kind": "variable", "doc": "

\n", "default_value": "10.0"}, {"fullname": "aton.phys.units.kbar_to_GPa", "modulename": "aton.phys.units", "qualname": "kbar_to_GPa", "kind": "variable", "doc": "
\n\n

Time

\n", "default_value": "0.1"}, {"fullname": "aton.phys.units.H_to_s", "modulename": "aton.phys.units", "qualname": "H_to_s", "kind": "variable", "doc": "

\n", "default_value": "3600.0"}, {"fullname": "aton.phys.units.s_to_H", "modulename": "aton.phys.units", "qualname": "s_to_H", "kind": "variable", "doc": "
\n\n

Wavelength

\n", "default_value": "0.0002777777777777778"}, {"fullname": "aton.phys.units.A_to_A1", "modulename": "aton.phys.units", "qualname": "A_to_A1", "kind": "variable", "doc": "

\n", "default_value": "6.28318"}, {"fullname": "aton.phys.units.A_to_ms", "modulename": "aton.phys.units", "qualname": "A_to_ms", "kind": "variable", "doc": "

\n", "default_value": "3956"}, {"fullname": "aton.phys.units.A_to_K", "modulename": "aton.phys.units", "qualname": "A_to_K", "kind": "variable", "doc": "

\n", "default_value": "949.3"}, {"fullname": "aton.phys.units.A_to_THz", "modulename": "aton.phys.units", "qualname": "A_to_THz", "kind": "variable", "doc": "

\n", "default_value": "19.78"}, {"fullname": "aton.phys.units.A_to_rads", "modulename": "aton.phys.units", "qualname": "A_to_rads", "kind": "variable", "doc": "

\n", "default_value": "124300000000000.0"}, {"fullname": "aton.phys.units.A_to_cm1", "modulename": "aton.phys.units", "qualname": "A_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "659.8"}, {"fullname": "aton.phys.units.A_to_meV", "modulename": "aton.phys.units", "qualname": "A_to_meV", "kind": "variable", "doc": "

\n", "default_value": "81.805"}, {"fullname": "aton.phys.units.A_to_kJmol", "modulename": "aton.phys.units", "qualname": "A_to_kJmol", "kind": "variable", "doc": "
\n\n

Wavevector

\n", "default_value": "7.893"}, {"fullname": "aton.phys.units.A1_to_A", "modulename": "aton.phys.units", "qualname": "A1_to_A", "kind": "variable", "doc": "

\n", "default_value": "6.28318"}, {"fullname": "aton.phys.units.A1_to_ms", "modulename": "aton.phys.units", "qualname": "A1_to_ms", "kind": "variable", "doc": "

\n", "default_value": "629.6"}, {"fullname": "aton.phys.units.A1_to_K", "modulename": "aton.phys.units", "qualname": "A1_to_K", "kind": "variable", "doc": "

\n", "default_value": "24.046"}, {"fullname": "aton.phys.units.A1_to_THz", "modulename": "aton.phys.units", "qualname": "A1_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.501"}, {"fullname": "aton.phys.units.A1_to_rads", "modulename": "aton.phys.units", "qualname": "A1_to_rads", "kind": "variable", "doc": "

\n", "default_value": "3148000000000.0"}, {"fullname": "aton.phys.units.A1_to_cm1", "modulename": "aton.phys.units", "qualname": "A1_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "16.71"}, {"fullname": "aton.phys.units.A1_to_meV", "modulename": "aton.phys.units", "qualname": "A1_to_meV", "kind": "variable", "doc": "

\n", "default_value": "2.072"}, {"fullname": "aton.phys.units.A1_to_kJmol", "modulename": "aton.phys.units", "qualname": "A1_to_kJmol", "kind": "variable", "doc": "
\n\n

Velocity

\n", "default_value": "0.1999"}, {"fullname": "aton.phys.units.ms_to_A", "modulename": "aton.phys.units", "qualname": "ms_to_A", "kind": "variable", "doc": "

\n", "default_value": "3956"}, {"fullname": "aton.phys.units.ms_to_A1", "modulename": "aton.phys.units", "qualname": "ms_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.001589"}, {"fullname": "aton.phys.units.ms_to_K", "modulename": "aton.phys.units", "qualname": "ms_to_K", "kind": "variable", "doc": "

\n", "default_value": "606600.0"}, {"fullname": "aton.phys.units.ms_to_THz", "modulename": "aton.phys.units", "qualname": "ms_to_THz", "kind": "variable", "doc": "

\n", "default_value": "1.265e-06"}, {"fullname": "aton.phys.units.ms_to_rads", "modulename": "aton.phys.units", "qualname": "ms_to_rads", "kind": "variable", "doc": "

\n", "default_value": "7948000.0"}, {"fullname": "aton.phys.units.ms_to_cm1", "modulename": "aton.phys.units", "qualname": "ms_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "4.216e-05"}, {"fullname": "aton.phys.units.ms_to_meV", "modulename": "aton.phys.units", "qualname": "ms_to_meV", "kind": "variable", "doc": "

\n", "default_value": "5.227e-06"}, {"fullname": "aton.phys.units.ms_to_kJmol", "modulename": "aton.phys.units", "qualname": "ms_to_kJmol", "kind": "variable", "doc": "
\n\n

Temperature

\n", "default_value": "5.044e-07"}, {"fullname": "aton.phys.units.K_to_A", "modulename": "aton.phys.units", "qualname": "K_to_A", "kind": "variable", "doc": "

\n", "default_value": "30.81"}, {"fullname": "aton.phys.units.K_to_A1", "modulename": "aton.phys.units", "qualname": "K_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.2039"}, {"fullname": "aton.phys.units.K_to_ms", "modulename": "aton.phys.units", "qualname": "K_to_ms", "kind": "variable", "doc": "

\n", "default_value": "128.4"}, {"fullname": "aton.phys.units.K_to_THz", "modulename": "aton.phys.units", "qualname": "K_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.02084"}, {"fullname": "aton.phys.units.K_to_rads", "modulename": "aton.phys.units", "qualname": "K_to_rads", "kind": "variable", "doc": "

\n", "default_value": "130900000000.0"}, {"fullname": "aton.phys.units.K_to_cm1", "modulename": "aton.phys.units", "qualname": "K_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "0.695"}, {"fullname": "aton.phys.units.K_to_meV", "modulename": "aton.phys.units", "qualname": "K_to_meV", "kind": "variable", "doc": "

\n", "default_value": "0.08617"}, {"fullname": "aton.phys.units.K_to_kJmol", "modulename": "aton.phys.units", "qualname": "K_to_kJmol", "kind": "variable", "doc": "
\n\n

Temperature scales

\n\n

Note that to change between temperature scales,\nthese constants must be added instead of multiplied.

\n", "default_value": "0.008314"}, {"fullname": "aton.phys.units.C_to_K_scale", "modulename": "aton.phys.units", "qualname": "C_to_K_scale", "kind": "variable", "doc": "

\n", "default_value": "273.15"}, {"fullname": "aton.phys.units.K_to_C_scale", "modulename": "aton.phys.units", "qualname": "K_to_C_scale", "kind": "variable", "doc": "
\n\n

Frequency

\n", "default_value": "-273.15"}, {"fullname": "aton.phys.units.THz_to_A", "modulename": "aton.phys.units", "qualname": "THz_to_A", "kind": "variable", "doc": "

\n", "default_value": "4.4475"}, {"fullname": "aton.phys.units.THz_to_A1", "modulename": "aton.phys.units", "qualname": "THz_to_A1", "kind": "variable", "doc": "

\n", "default_value": "1.4127"}, {"fullname": "aton.phys.units.THz_to_ms", "modulename": "aton.phys.units", "qualname": "THz_to_ms", "kind": "variable", "doc": "

\n", "default_value": "889.5"}, {"fullname": "aton.phys.units.THz_to_K", "modulename": "aton.phys.units", "qualname": "THz_to_K", "kind": "variable", "doc": "

\n", "default_value": "48.0"}, {"fullname": "aton.phys.units.THz_to_rads", "modulename": "aton.phys.units", "qualname": "THz_to_rads", "kind": "variable", "doc": "

\n", "default_value": "6283000000000.0"}, {"fullname": "aton.phys.units.THz_to_cm1", "modulename": "aton.phys.units", "qualname": "THz_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "33.36"}, {"fullname": "aton.phys.units.THz_to_meV", "modulename": "aton.phys.units", "qualname": "THz_to_meV", "kind": "variable", "doc": "

\n", "default_value": "4.136"}, {"fullname": "aton.phys.units.THz_to_kJmol", "modulename": "aton.phys.units", "qualname": "THz_to_kJmol", "kind": "variable", "doc": "
\n\n

Angular frequency

\n", "default_value": "0.399"}, {"fullname": "aton.phys.units.rads_to_A", "modulename": "aton.phys.units", "qualname": "rads_to_A", "kind": "variable", "doc": "

\n", "default_value": "11150000.0"}, {"fullname": "aton.phys.units.rads_to_A1", "modulename": "aton.phys.units", "qualname": "rads_to_A1", "kind": "variable", "doc": "

\n", "default_value": "5.64e-07"}, {"fullname": "aton.phys.units.rads_to_ms", "modulename": "aton.phys.units", "qualname": "rads_to_ms", "kind": "variable", "doc": "

\n", "default_value": "0.0003549"}, {"fullname": "aton.phys.units.rads_to_K", "modulename": "aton.phys.units", "qualname": "rads_to_K", "kind": "variable", "doc": "

\n", "default_value": "7.64e-12"}, {"fullname": "aton.phys.units.rads_to_THz", "modulename": "aton.phys.units", "qualname": "rads_to_THz", "kind": "variable", "doc": "

\n", "default_value": "1.592e-13"}, {"fullname": "aton.phys.units.rads_to_cm1", "modulename": "aton.phys.units", "qualname": "rads_to_cm1", "kind": "variable", "doc": "

\n", "default_value": "5.309e-12"}, {"fullname": "aton.phys.units.rads_to_meV", "modulename": "aton.phys.units", "qualname": "rads_to_meV", "kind": "variable", "doc": "

\n", "default_value": "6.582e-13"}, {"fullname": "aton.phys.units.rads_to_kJmol", "modulename": "aton.phys.units", "qualname": "rads_to_kJmol", "kind": "variable", "doc": "
\n\n

Wavenumber

\n", "default_value": "6.351e-14"}, {"fullname": "aton.phys.units.cm1_to_A", "modulename": "aton.phys.units", "qualname": "cm1_to_A", "kind": "variable", "doc": "

\n", "default_value": "25.69"}, {"fullname": "aton.phys.units.cm1_to_A1", "modulename": "aton.phys.units", "qualname": "cm1_to_A1", "kind": "variable", "doc": "

\n", "default_value": "0.2446"}, {"fullname": "aton.phys.units.cm1_to_ms", "modulename": "aton.phys.units", "qualname": "cm1_to_ms", "kind": "variable", "doc": "

\n", "default_value": "154.01"}, {"fullname": "aton.phys.units.cm1_to_K", "modulename": "aton.phys.units", "qualname": "cm1_to_K", "kind": "variable", "doc": "

\n", "default_value": "1.439"}, {"fullname": "aton.phys.units.cm1_to_THz", "modulename": "aton.phys.units", "qualname": "cm1_to_THz", "kind": "variable", "doc": "

\n", "default_value": "0.02998"}, {"fullname": "aton.phys.units.cm1_to_rads", "modulename": "aton.phys.units", "qualname": "cm1_to_rads", "kind": "variable", "doc": "

\n", "default_value": "188400000000.0"}, {"fullname": "aton.phys.units.cm1_to_meV", "modulename": "aton.phys.units", "qualname": "cm1_to_meV", "kind": "variable", "doc": "

\n", "default_value": "0.12398487384539086"}, {"fullname": "aton.phys.units.cm1_to_kJmol", "modulename": "aton.phys.units", "qualname": "cm1_to_kJmol", "kind": "variable", "doc": "

\n", "default_value": "0.01196"}, {"fullname": "aton.qrotor", "modulename": "aton.qrotor", "kind": "module", "doc": "

QRotor

\n\n

The QRotor module is used to study the energy levels and wavefunctions of quantum rotations,\nsuch as those of methyl and amine groups.\nThese quantum systems are represented by the qrotor.System() object.

\n\n

QRotor can obtain custom potentials from DFT,\nwhich are used to solve the quantum system.

\n\n

This module uses meV as the default unit in the calculations.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.qrotor.systemDefinition of the quantum System object
aton.qrotor.systemsFunctions to manage several System objects, such as a list of systems
aton.qrotor.rotateRotate specific atoms from structural files
aton.qrotor.constantsBond lengths and inertias
aton.qrotor.potentialPotential definitions and loading functions
aton.qrotor.solveSolve rotation eigenvalues and eigenvectors
aton.qrotor.plotPlotting functions
\n\n

Examples

\n\n

Solving quantum rotational systems

\n\n

A basic calculation of the eigenvalues for a zero potential goes as follows:

\n\n
\n
import aton.qrotor as qr\nsystem = qr.System()\nsystem.gridsize = 200000  # Size of the potential grid\nsystem.B = 1  # Rotational inertia\nsystem.potential_name = 'zero'\nsystem.solve()\nsystem.eigenvalues\n# [0.0, 1.0, 1.0, 4.0, 4.0, 9.0, 9.0, ...]  # approx values\n
\n
\n\n

The accuracy of the calculation increases with bigger gridsizes,\nbut note that the runtime increases exponentially.

\n\n

The same calculation can be performed for a methyl group,\nin a cosine potential of amplitude 30 meV:

\n\n
\n
import aton.qrotor as qr\nsystem = qr.System()\nsystem.gridsize = 200000  # Size of the potential grid\nsystem.B = qr.B_CH3  # Rotational inertia of a methyl group\nsystem.potential_name = 'cosine'\nsystem.potential_constants = [0, 30, 3, 0]  # Offset, max, frequency, phase (for cosine potential)\nsystem.solve()\n# Plot potential and eigenvalues\nqr.plot.energies(system)\n# Plot the first wavefunctions\nqr.plot.wavefunction(system, levels=[0,1,2], square=True)\n
\n
\n\n

Custom potentials from DFT

\n\n

QRotor can be used to obtain custom rotational potentials from DFT calculations.\nUsing Quantum ESPRESSO, running an SCF calculation for a methyl rotation every 10 degrees:

\n\n
\n
import aton.qrotor as qr\nfrom aton import interface\n# Approx crystal positions of the atoms to rotate\natoms = [\n    '1.101   1.204   1.307'\n    '2.102   2.205   2.308'\n    '3.103   3.206   3.309'\n]\n# Create the input SCF files, saving the filenames to a list\nscf_files = qr.rotate.structure_qe('molecule.in', positions=atoms, angle=10, repeat=True)\n# Run the Quantum ESPRESSO calculations\ninterface.slurm.sbatch(files=scf_files)\n
\n
\n\n

To load the calculated potential to a QRotor System,

\n\n
\n
# Create a 'potential.dat' file with the potential as a function of the angle\nqr.potential.from_qe()\n# Load to the system\nsystem = qr.potential.load()\n# Solve the system, interpolating to a bigger gridsize\nsystem.B = qr.B_CH3\nsystem.solve(200000)\nqr.plot.energies(system)\n
\n
\n\n

Check the API documentation for more details.

\n"}, {"fullname": "aton.qrotor.constants", "modulename": "aton.qrotor.constants", "kind": "module", "doc": "

Description

\n\n

Common constants and default inertia values used in the QRotor subpackage.

\n\n

Bond lengths and angles were obtained from MAPbI3,\nsee Cryst. Growth Des. 2024, 24, 391\u2212404.

\n\n
\n"}, {"fullname": "aton.qrotor.constants.distance_CH", "modulename": "aton.qrotor.constants", "qualname": "distance_CH", "kind": "variable", "doc": "

Distance of the C-H bond, in Angstroms.

\n", "default_value": "1.09285"}, {"fullname": "aton.qrotor.constants.distance_NH", "modulename": "aton.qrotor.constants", "qualname": "distance_NH", "kind": "variable", "doc": "

Distance of the N-H bond, in Angstroms.

\n", "default_value": "1.040263"}, {"fullname": "aton.qrotor.constants.angle_CH_external", "modulename": "aton.qrotor.constants", "qualname": "angle_CH_external", "kind": "variable", "doc": "

External angle of the X-C-H bond, in degrees.

\n", "default_value": "108.7223"}, {"fullname": "aton.qrotor.constants.angle_NH_external", "modulename": "aton.qrotor.constants", "qualname": "angle_NH_external", "kind": "variable", "doc": "

External angle of the X-N-H bond, in degrees.

\n", "default_value": "111.29016"}, {"fullname": "aton.qrotor.constants.angle_CH", "modulename": "aton.qrotor.constants", "qualname": "angle_CH", "kind": "variable", "doc": "

Internal angle of the X-C-H bond, in degrees.

\n", "default_value": "71.2777"}, {"fullname": "aton.qrotor.constants.angle_NH", "modulename": "aton.qrotor.constants", "qualname": "angle_NH", "kind": "variable", "doc": "

Internal angle of the X-N-H bond, in degrees.

\n", "default_value": "68.70984"}, {"fullname": "aton.qrotor.constants.r_CH", "modulename": "aton.qrotor.constants", "qualname": "r_CH", "kind": "variable", "doc": "

Rotation radius of the methyl group, in meters.

\n", "default_value": "np.float64(1.0350223020441665e-10)"}, {"fullname": "aton.qrotor.constants.r_NH", "modulename": "aton.qrotor.constants", "qualname": "r_NH", "kind": "variable", "doc": "

Rotation radius of the amine group, in meters.

\n", "default_value": "np.float64(9.69268793902999e-11)"}, {"fullname": "aton.qrotor.constants.I_CH3", "modulename": "aton.qrotor.constants", "qualname": "I_CH3", "kind": "variable", "doc": "

Inertia of CH3, in kg\u00b7m^2.

\n", "default_value": "np.float64(5.37903596799128e-47)"}, {"fullname": "aton.qrotor.constants.I_CD3", "modulename": "aton.qrotor.constants", "qualname": "I_CD3", "kind": "variable", "doc": "

Inertia of CD3, in kg\u00b7m^2.

\n", "default_value": "np.float64(1.0748582164136045e-46)"}, {"fullname": "aton.qrotor.constants.I_NH3", "modulename": "aton.qrotor.constants", "qualname": "I_NH3", "kind": "variable", "doc": "

Inertia of NH3, in kg\u00b7m^2.

\n", "default_value": "np.float64(4.717299973303422e-47)"}, {"fullname": "aton.qrotor.constants.I_ND3", "modulename": "aton.qrotor.constants", "qualname": "I_ND3", "kind": "variable", "doc": "

Inertia of ND3, in kg\u00b7m^2.

\n", "default_value": "np.float64(9.426277618824576e-47)"}, {"fullname": "aton.qrotor.constants.B_CH3", "modulename": "aton.qrotor.constants", "qualname": "B_CH3", "kind": "variable", "doc": "

Rotational energy of CH3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.6452195002679675)"}, {"fullname": "aton.qrotor.constants.B_CD3", "modulename": "aton.qrotor.constants", "qualname": "B_CD3", "kind": "variable", "doc": "

Rotational energy of CD3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.32289457773984676)"}, {"fullname": "aton.qrotor.constants.B_NH3", "modulename": "aton.qrotor.constants", "qualname": "B_NH3", "kind": "variable", "doc": "

Rotational energy of NH3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.7357299554474442)"}, {"fullname": "aton.qrotor.constants.B_ND3", "modulename": "aton.qrotor.constants", "qualname": "B_ND3", "kind": "variable", "doc": "

Rotational energy of ND3, in meV\u00b7s/kg\u00b7m^2.

\n", "default_value": "np.float64(0.36818976053280467)"}, {"fullname": "aton.qrotor.constants.constants_titov2023", "modulename": "aton.qrotor.constants", "qualname": "constants_titov2023", "kind": "variable", "doc": "

Potential constants from\nK. Titov et al., Phys. Rev. Mater. 7, 073402 (2023)\nfor the aton.qrotor.potential.titov2023 potential.\nIn meV units.

\n", "default_value": "[[2.786, 0.013, -1.5284, -0.0037, -1.2791], [2.6507, 0.0158, -1.4111, -0.0007, -1.2547], [2.1852, 0.0164, -1.0017, 0.0003, -1.2061], [5.9109, 0.0258, -7.0152, -0.0168, 1.0213], [1.4526, 0.0134, -0.3196, 0.0005, -1.1461]]"}, {"fullname": "aton.qrotor.plot", "modulename": "aton.qrotor.plot", "kind": "module", "doc": "

Description

\n\n

This module provides straightforward functions to plot QRotor data.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
potential()Potential values as a function of the angle
energies()Calculated eigenvalues
reduced_energies()Reduced energies E/B as a function of the reduced potential V/B
wavefunction()Selected wavefunctions or squared wavefunctions of a system
convergence()Energy convergence
\n\n
\n"}, {"fullname": "aton.qrotor.plot.potential", "modulename": "aton.qrotor.plot", "qualname": "potential", "kind": "function", "doc": "

Plot the potential values of a system (System object, or list of systems).

\n", "signature": "(system, title: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.energies", "modulename": "aton.qrotor.plot", "qualname": "energies", "kind": "function", "doc": "

Plot the eigenvalues of data (System or a list of System objects).

\n", "signature": "(data, title: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.reduced_energies", "modulename": "aton.qrotor.plot", "qualname": "reduced_energies", "kind": "function", "doc": "

Plots the reduced energy of the system E/B vs the reduced potential energy V/B.

\n\n

Takes a data list of System objects as input.

\n", "signature": "(data: list, title: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.wavefunction", "modulename": "aton.qrotor.plot", "qualname": "wavefunction", "kind": "function", "doc": "

Plot the wavefunction of a system for the specified levels.

\n\n

Wavefunctions are squared by default, showing the probabilities;\nTo show the actual wavefunctions, set square = False.

\n\n

levels can be a list of indexes, or the number of levels to plot.

\n\n

Specific wavefunctions can be overlapped with overlap as a list with the target indexes.\nThe overlap value can also be the max number of wavefunctions to add.\nAll found wavefunctions can be added together with overlap = True;\nbut note that this overlap is limited by the number of System.E_levels,\nthat must be specified before solving the system.\nSetting overlap will ignore the levels argument.

\n", "signature": "(\tsystem: aton.qrotor.system.System,\tsquare: bool = True,\tlevels=[0, 1, 2],\toverlap=False,\ttitle: str = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.plot.convergence", "modulename": "aton.qrotor.plot", "qualname": "convergence", "kind": "function", "doc": "

Plot the energy convergence of a data list of Systems as a function of the gridsize.

\n", "signature": "(data: list) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential", "modulename": "aton.qrotor.potential", "kind": "module", "doc": "

Description

\n\n

This module contains functions to calculate the actual potential_values of the system.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
save()Save the potential from a System to a data file
load()Load a System with a custom potential from a potential data file
from_qe()Creates a potential data file from Quantum ESPRESSO outputs
interpolate()Interpolates the current System.potential_values to a new System.gridsize
solve()Solve the potential values based on the potential name
\n\n

A sinthetic potential can be created by specifying its name in System.potential_name,\nalong with the corresponding System.potential_constants if required.\nAvailable potentials are:

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
zero()Zero potential
sine()Sine potential
cosine()Cosine potential
titov2023()Potential of the hindered methyl rotor, as in titov2023.
\n\n
\n"}, {"fullname": "aton.qrotor.potential.save", "modulename": "aton.qrotor.potential", "qualname": "save", "kind": "function", "doc": "

Save the rotational potential from a system to a potential data file.

\n\n

The output filepath contains angle and energy columns,\nin degrees and meVs by default.\nThe units can be changed with angle and energy,\nbut only change these defaults if you know what you are doing.

\n", "signature": "(\tsystem: aton.qrotor.system.System,\tfilepath: str = 'potential.dat',\tangle: str = 'deg',\tenergy: str = 'meV') -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.load", "modulename": "aton.qrotor.potential", "qualname": "load", "kind": "function", "doc": "

Read a rotational potential energy dataset.

\n\n

The input file in filepath should contain two columns with angle and potential energy values.\nDegrees and meV are assumed as default units unless stated in angle and energy.\nUnits will be converted automatically to radians and meV.

\n\n

An optional comment can be included in the output System.

\n\n

A previous System object can be provided through system to update its potential values.

\n", "signature": "(\tfilepath: str = 'potential.dat',\tcomment: str = None,\tsystem: aton.qrotor.system.System = None,\tangle: str = 'deg',\tenergy: str = 'meV') -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.from_qe", "modulename": "aton.qrotor.potential", "qualname": "from_qe", "kind": "function", "doc": "

Creates a potential data file from Quantum ESPRESSO outputs.

\n\n

The angle in degrees is extracted from the output filenames,\nwhich must follow whatever_ANGLE.out.

\n\n

Outputs from SCF calculations must be located in the provided folder (CWD if None).\nFiles can be filtered by those containing the specified include filters,\nexcluding those containing any string from the exclude list. \nThe output filepath name is 'potential.dat' by default.

\n\n

Energy values are saved to meV by dafault, unless specified in energy.\nOnly change the energy units if you know what you are doing;\nremember that default energy units in QRotor are meV!

\n", "signature": "(\tfolder=None,\tfilepath: str = 'potential.dat',\tinclude: list = ['.out'],\texclude: list = ['slurm-'],\tenergy: str = 'meV',\tcomment: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.interpolate", "modulename": "aton.qrotor.potential", "qualname": "interpolate", "kind": "function", "doc": "

Interpolates the current System.potential_values\nto a new grid of size System.gridsize.

\n", "signature": "(system: aton.qrotor.system.System) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.solve", "modulename": "aton.qrotor.potential", "qualname": "solve", "kind": "function", "doc": "

Solves System.potential_values\naccording to the System.potential_name,\nreturning the new potential_values.\nAvaliable potential names are zero, sine and titov2023.

\n\n

If System.potential_name is not present or not recognised,\nthe current System.potential_values are used.

\n\n

This function provides basic solving of the potential energy function.\nTo interpolate to a new gridsize and correct the potential offset after solving,\ncheck aton.qrotor.solve.potential().

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.zero", "modulename": "aton.qrotor.potential", "qualname": "zero", "kind": "function", "doc": "

Zero potential.

\n\n

$V(x) = 0$

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.sine", "modulename": "aton.qrotor.potential", "qualname": "sine", "kind": "function", "doc": "

Sine potential.

\n\n

$V(x) = C_0 + \\frac{C_1}{2} sin(x C_2 + C_3)$
\nWith $C_0$ as the potential offset,\n$C_1$ as the max potential value (without considering the offset),\n$C_2$ as the frequency, and $C_3$ as the phase.\nIf no System.potential_constants are provided, defaults to $sin(3x)$

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.cosine", "modulename": "aton.qrotor.potential", "qualname": "cosine", "kind": "function", "doc": "

Cosine potential.

\n\n

$V(x) = C_0 + \\frac{C_1}{2} cos(x C_2 + C_3)$
\nWith $C_0$ as the potential offset,\n$C_1$ as the max potential value (without considering the offset),\n$C_2$ as the frequency, and $C_3$ as the phase.\nIf no System.potential_constants are provided, defaults to $cos(3x)$

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.potential.titov2023", "modulename": "aton.qrotor.potential", "qualname": "titov2023", "kind": "function", "doc": "

Potential energy function of the hindered methyl rotor, from\nK. Titov et al., Phys. Rev. Mater. 7, 073402 (2023).

\n\n

$V(x) = C_0 + C_1 sin(3x) + C_2 cos(3x) + C_3 sin(6x) + C_4 cos(6x)$
\nDefault constants are aton.qrotor.constants.constants_titov2023[0].

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.rotate", "modulename": "aton.qrotor.rotate", "kind": "module", "doc": "

Description

\n\n

This submodule contains tools to rotate molecular structures.\nWorks with Quantum ESPRESSO input files.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n
structure_qe()Rotate specific atoms from a Quantum ESPRESSO input file
rotate_coords()Rotate a specific list of coordinates
\n\n
\n"}, {"fullname": "aton.qrotor.rotate.structure_qe", "modulename": "aton.qrotor.rotate", "qualname": "structure_qe", "kind": "function", "doc": "

Rotates atoms from a Quantum ESPRESSO input file.

\n\n

Takes a filepath with a molecular structure, and three or more atomic positions (list).\nThese input positions can be approximate, and are used to identify the target atoms.\nThe decimal precision in the search for these positions is controlled by precision.

\n\n

It rotates the atoms by a specific angle in degrees.\nAdditionally, if repeat = True it repeats the same rotation over the whole circunference.\nFinally, it writes the rotated structure(s) to a new structural file(s).\nReturns a list with the output filename(s).

\n\n

By default, the rotation axis is defined by the perpendicular vector\npassing through the geometrical center of the first three points.\nTo override this and instead use the vector between the first two atoms\nas the rotation axis, set use_centroid = False.

\n\n

To debug, show_axis = True adds two additional helium atoms as the rotation vector.

\n", "signature": "(\tfilepath: str,\tpositions: list,\tangle: float,\trepeat: bool = False,\tprecision: int = 3,\tuse_centroid: bool = True,\tshow_axis: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.rotate.rotate_coords", "modulename": "aton.qrotor.rotate", "qualname": "rotate_coords", "kind": "function", "doc": "

Rotates geometrical coordinates.

\n\n

Takes a list of atomic positions in cartesian coordinates, as\n[[x1,y1,z1], [x2,y2,z2], [x3,y3,z3], [etc].\nThen rotates said coordinates by a given angle in degrees.\nReturns a list with the updated positions.

\n\n

By default, the rotation axis is defined by the perpendicular vector\npassing through the geometrical center of the first three points.\nTo override this and use the vector between the first two atoms\nas the rotation axis, set use_centroid = False.

\n\n

If show_axis = True it returns two additional coordinates at the end of the list,\nwith the centroid and the rotation vector. Only works with use_centroid = True.

\n", "signature": "(\tpositions: list,\tangle: float,\tuse_centroid: bool = True,\tshow_axis: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve", "modulename": "aton.qrotor.solve", "kind": "module", "doc": "

Description

\n\n

This module is used to solve the hamiltonian eigenvalues and eigenvectors for a given quantum system.\nSparse matrices are used to achieve optimal performance.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
energies()Solve the quantum system, including eigenvalues and eigenvectors
potential()Solve the potential values of the system
schrodinger()Solve the Schr\u00f6diger equation for the system
hamiltonian_matrix()Calculate the hamiltonian matrix of the system
laplacian_matrix()Calculate the second derivative matrix for a given grid
\n\n
\n"}, {"fullname": "aton.qrotor.solve.energies", "modulename": "aton.qrotor.solve", "qualname": "energies", "kind": "function", "doc": "

Solves the quantum system.

\n\n

This includes solving the potential, the eigenvalues and the eigenvectors.

\n\n

The resulting System object is saved with pickle to filename if specified.

\n", "signature": "(\tsystem: aton.qrotor.system.System,\tfilename: str = None) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.potential", "modulename": "aton.qrotor.solve", "qualname": "potential", "kind": "function", "doc": "

Solves the potential values of the system.

\n\n

It interpolates the potential if system.gridsize is larger than the current grid.\nIt solves the potential according to the potential name,\nby calling aton.qrotor.potential.solve().\nThen it applies extra operations, such as removing the potential offset\nif system.correct_potential_offset = True.

\n", "signature": "(system: aton.qrotor.system.System) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.schrodinger", "modulename": "aton.qrotor.solve", "qualname": "schrodinger", "kind": "function", "doc": "

Solves the Schr\u00f6dinger equation for a given system.

\n\n

Uses ARPACK in shift-inverse mode to solve the hamiltonian sparse matrix.

\n", "signature": "(system: aton.qrotor.system.System) -> aton.qrotor.system.System:", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.hamiltonian_matrix", "modulename": "aton.qrotor.solve", "qualname": "hamiltonian_matrix", "kind": "function", "doc": "

Calculates the Hamiltonian matrix for a given system.

\n", "signature": "(system: aton.qrotor.system.System):", "funcdef": "def"}, {"fullname": "aton.qrotor.solve.laplacian_matrix", "modulename": "aton.qrotor.solve", "qualname": "laplacian_matrix", "kind": "function", "doc": "

Calculates the Laplacian (second derivative) matrix for a given grid.

\n", "signature": "(grid):", "funcdef": "def"}, {"fullname": "aton.qrotor.system", "modulename": "aton.qrotor.system", "kind": "module", "doc": "

Description

\n\n

The System object contains all the information needed for a single QRotor calculation.\nThis class can be loaded directly as aton.qrotor.System().

\n\n
\n"}, {"fullname": "aton.qrotor.system.System", "modulename": "aton.qrotor.system", "qualname": "System", "kind": "class", "doc": "

Quantum system.

\n\n

Contains all the data for a single QRotor calculation, with both inputs and outputs.

\n"}, {"fullname": "aton.qrotor.system.System.__init__", "modulename": "aton.qrotor.system", "qualname": "System.__init__", "kind": "function", "doc": "

\n", "signature": "(\tcomment: str = None,\tgroup: str = 'CH3',\tE_levels: int = 15,\tcorrect_potential_offset: bool = True,\tsave_eigenvectors: bool = True,\tgridsize: int = None,\tgrid=[],\tB: float = None,\tpotential_name: str = '',\tpotential_constants: list = None,\tpotential_values=[])"}, {"fullname": "aton.qrotor.system.System.version", "modulename": "aton.qrotor.system", "qualname": "System.version", "kind": "variable", "doc": "

Version of the package used to generate the data.

\n"}, {"fullname": "aton.qrotor.system.System.comment", "modulename": "aton.qrotor.system", "qualname": "System.comment", "kind": "variable", "doc": "

Custom comment for the dataset.

\n", "annotation": ": str"}, {"fullname": "aton.qrotor.system.System.group", "modulename": "aton.qrotor.system", "qualname": "System.group", "kind": "variable", "doc": "

Chemical group, methyl or amine: 'CH3', 'CD3', 'NH3', 'ND3'.

\n", "annotation": ": str"}, {"fullname": "aton.qrotor.system.System.E_levels", "modulename": "aton.qrotor.system", "qualname": "System.E_levels", "kind": "variable", "doc": "

Number of energy levels to be studied.

\n", "annotation": ": int"}, {"fullname": "aton.qrotor.system.System.correct_potential_offset", "modulename": "aton.qrotor.system", "qualname": "System.correct_potential_offset", "kind": "variable", "doc": "

Correct the potential offset as V - min(V) or not.

\n", "annotation": ": bool"}, {"fullname": "aton.qrotor.system.System.save_eigenvectors", "modulename": "aton.qrotor.system", "qualname": "System.save_eigenvectors", "kind": "variable", "doc": "

Save or not the eigenvectors. Final file size will be bigger.

\n", "annotation": ": bool"}, {"fullname": "aton.qrotor.system.System.gridsize", "modulename": "aton.qrotor.system", "qualname": "System.gridsize", "kind": "variable", "doc": "

Number of points in the grid.

\n", "annotation": ": int"}, {"fullname": "aton.qrotor.system.System.grid", "modulename": "aton.qrotor.system", "qualname": "System.grid", "kind": "variable", "doc": "

The grid with the points to be used in the calculation.

\n\n

Can be set automatically over $2 \\pi$ with System.set_grid().\nUnits must be in radians.

\n"}, {"fullname": "aton.qrotor.system.System.B", "modulename": "aton.qrotor.system", "qualname": "System.B", "kind": "variable", "doc": "

Rotational inertia, as in $B=\\frac{\\hbar^2}{2I}$.

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_name", "modulename": "aton.qrotor.system", "qualname": "System.potential_name", "kind": "variable", "doc": "

Name of the desired potential: 'zero', 'titov2023', 'test'...\nIf empty or unrecognised, the custom potential values inside System.potential_values will be used.

\n", "annotation": ": str"}, {"fullname": "aton.qrotor.system.System.potential_constants", "modulename": "aton.qrotor.system", "qualname": "System.potential_constants", "kind": "variable", "doc": "

List of constants to be used in the calculation of the potential energy, in the aton.qrotor.potential module.

\n", "annotation": ": list"}, {"fullname": "aton.qrotor.system.System.potential_values", "modulename": "aton.qrotor.system", "qualname": "System.potential_values", "kind": "variable", "doc": "

Numpy ndarray with the potential values for each point in the grid.

\n\n

Can be calculated with a function available in the qrotor.potential module,\nor loaded externally with the qrotor.potential.load() function.\nPotential energy units must be in meV.

\n"}, {"fullname": "aton.qrotor.system.System.potential_offset", "modulename": "aton.qrotor.system", "qualname": "System.potential_offset", "kind": "variable", "doc": "

min(V) before offset correction when correct_potential_offset = True

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_min", "modulename": "aton.qrotor.system", "qualname": "System.potential_min", "kind": "variable", "doc": "

min(V)

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_max", "modulename": "aton.qrotor.system", "qualname": "System.potential_max", "kind": "variable", "doc": "

max(V)

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.potential_max_B", "modulename": "aton.qrotor.system", "qualname": "System.potential_max_B", "kind": "variable", "doc": "

Reduced potential_max, in units of B.

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.eigenvalues", "modulename": "aton.qrotor.system", "qualname": "System.eigenvalues", "kind": "variable", "doc": "

Calculated eigenvalues of the system. Should be in meV.

\n"}, {"fullname": "aton.qrotor.system.System.eigenvalues_B", "modulename": "aton.qrotor.system", "qualname": "System.eigenvalues_B", "kind": "variable", "doc": "

Reduced eigenvalues, in units of B.

\n"}, {"fullname": "aton.qrotor.system.System.eigenvectors", "modulename": "aton.qrotor.system", "qualname": "System.eigenvectors", "kind": "variable", "doc": "

Eigenvectors, if save_eigenvectors is True. Beware of the file size.

\n"}, {"fullname": "aton.qrotor.system.System.energy_barrier", "modulename": "aton.qrotor.system", "qualname": "System.energy_barrier", "kind": "variable", "doc": "

max(V) - min(eigenvalues)

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.first_transition", "modulename": "aton.qrotor.system", "qualname": "System.first_transition", "kind": "variable", "doc": "

eigenvalues[1] - eigenvalues[0]

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.runtime", "modulename": "aton.qrotor.system", "qualname": "System.runtime", "kind": "variable", "doc": "

Time taken to solve the eigenvalues.

\n", "annotation": ": float"}, {"fullname": "aton.qrotor.system.System.summary", "modulename": "aton.qrotor.system", "qualname": "System.summary", "kind": "function", "doc": "

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.set_grid", "modulename": "aton.qrotor.system", "qualname": "System.set_grid", "kind": "function", "doc": "

Sets the System.grid to the specified gridsize from 0 to $2\\pi$.

\n\n

If the system had a previous grid and potential values,\nit will interpolate those values to the new gridsize,\nusing aton.qrotor.potential.interpolate().

\n", "signature": "(self, gridsize: int = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.set_group", "modulename": "aton.qrotor.system", "qualname": "System.set_group", "kind": "function", "doc": "

Normalise System.group name, and set System.B based on it.

\n", "signature": "(self, group: str = None, B: float = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.solve", "modulename": "aton.qrotor.system", "qualname": "System.solve", "kind": "function", "doc": "

Solves the quantum system.

\n\n

The potential can be interpolated to a new_gridsize.

\n\n

Same as running aton.qrotor.solve.energies(System).

\n", "signature": "(self, new_gridsize: int = None):", "funcdef": "def"}, {"fullname": "aton.qrotor.system.System.reduce_size", "modulename": "aton.qrotor.system", "qualname": "System.reduce_size", "kind": "function", "doc": "

Discard data that takes too much space,\nlike eigenvectors, potential values and grids.

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.qrotor.systems", "modulename": "aton.qrotor.systems", "kind": "module", "doc": "

Description

\n\n

This module contains utility functions to handle multiple aton.qrotor.system calculations.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
as_list()Ensures that a list only contains System objects
get_energies()Get the eigenvalues from all systems
get_gridsizes()Get all gridsizes
get_runtimes()Get all runtimes
get_groups()Get the chemical groups in use
sort_by_gridsize()Sort systems by gridsize
reduce_size()Discard data that takes too much space
get_ideal_E()Calculate the ideal energy for a specified level
\n\n
\n"}, {"fullname": "aton.qrotor.systems.as_list", "modulename": "aton.qrotor.systems", "qualname": "as_list", "kind": "function", "doc": "

Ensures that systems is a list of System objects.

\n\n

If it is a System, returns a list with that System as the only element.\nIf it is neither a list nor a System,\nor if the list does not contain only System objects,\nit raises an error.

\n", "signature": "(systems) -> None:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_energies", "modulename": "aton.qrotor.systems", "qualname": "get_energies", "kind": "function", "doc": "

Get a list with all eigenvalues from all systems.

\n\n

If no eigenvalues are present for a particular system, appends None.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_gridsizes", "modulename": "aton.qrotor.systems", "qualname": "get_gridsizes", "kind": "function", "doc": "

Get a list with all gridsize values.

\n\n

If no gridsize value is present for a particular system, appends None.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_runtimes", "modulename": "aton.qrotor.systems", "qualname": "get_runtimes", "kind": "function", "doc": "

Returns a list with all runtime values.

\n\n

If no runtime value is present for a particular system, appends None.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_groups", "modulename": "aton.qrotor.systems", "qualname": "get_groups", "kind": "function", "doc": "

Returns a list with all System.group values.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.sort_by_gridsize", "modulename": "aton.qrotor.systems", "qualname": "sort_by_gridsize", "kind": "function", "doc": "

Sorts a list of System objects by System.gridsize.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.reduce_size", "modulename": "aton.qrotor.systems", "qualname": "reduce_size", "kind": "function", "doc": "

Discard data that takes too much space.

\n\n

Removes eigenvectors, potential values and grids,\nfor all System values inside the systems list.

\n", "signature": "(systems: list) -> list:", "funcdef": "def"}, {"fullname": "aton.qrotor.systems.get_ideal_E", "modulename": "aton.qrotor.systems", "qualname": "get_ideal_E", "kind": "function", "doc": "

Calculates the ideal energy for a specified E_level.

\n\n

To be used in convergence tests with potential_name = 'zero'.

\n", "signature": "(E_level: int) -> int:", "funcdef": "def"}, {"fullname": "aton.spx", "modulename": "aton.spx", "kind": "module", "doc": "

Spectra analysis

\n\n

This module contains spectral analysis tools.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.spx.classesDefinition of the Spectra, Plotting and Material classes, instantiated as aton.spx.Class()
aton.spx.fitSpectral fitting functions
aton.spx.normalizeSpectra normalisation
aton.spx.deuteriumDeuteration estimation functions
aton.spx.samplesMaterial definition examples
aton.spx.plotSpectra plotting, as aton.spx.plot(Spectra)
\n\n

Examples

\n\n

To load two INS spectra CSV files with cm$^{-1}$ as input units,\nand plot them in meV units, normalizing their heights over the range from 20 to 50 meV:

\n\n
\n
from aton import spx\n# Set plotting parameters\nplotting_options = spx.Plotting(\n    title     = 'Calculated INS',\n    )\n# Load the spectral data\nins = spx.Spectra(\n    type     = 'INS',\n    files    = ['example_1.csv', 'example_2.csv'],\n    units_in = 'cm-1',\n    units    = 'meV',\n    plotting = plotting_options,\n    )\n# Normalize the spectra\nspx.height(spectra=ins, range=[20, 50])\n# Plot the spectra\nspx.plot(ins)\n
\n
\n\n

More examples in the Aton/examples/ folder.

\n"}, {"fullname": "aton.spx.classes", "modulename": "aton.spx.classes", "kind": "module", "doc": "

Description

\n\n

This module contains common classes used to load and manipulate spectral data.\nAny class can be instantiated directly from the aton.spx module,\nas aton.spx.Class().

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
SpectraUsed to load and process spectral data
PlottingStores plotting options, used in Spectra.plotting
MaterialUsed to store and calculate material parameters, such as molar masses and neutron cross sections
\n\n

Examples

\n\n

To load two INS spectra CSV files with cm$^{-1}$ as input units,\nconverting them to meV units, and finally plotting them:

\n\n
\n
from aton import spx\nins = spx.Spectra(\n    type     = 'ins',\n    files    = ['example_1.csv', 'example_2.csv'],\n    units_in = 'cm-1',\n    units    = 'meV',\n    )\nspx.plot(ins)\n
\n
\n\n

Check more use examples in the ATON/examples/ folder.

\n\n
\n"}, {"fullname": "aton.spx.classes.Plotting", "modulename": "aton.spx.classes", "qualname": "Plotting", "kind": "class", "doc": "

Stores plotting options, read by aton.spx.plot

\n"}, {"fullname": "aton.spx.classes.Plotting.__init__", "modulename": "aton.spx.classes", "qualname": "Plotting.__init__", "kind": "function", "doc": "

Default values can be overwritten when initializing the Plotting object.

\n", "signature": "(\ttitle: str = None,\txlim=None,\tylim=None,\tmargins: list = [0, 0],\toffset=True,\tscaling: float = 1.0,\tvline: list = None,\tvline_error: list = None,\tfigsize: tuple = None,\tlog_xscale: bool = False,\tshow_yticks: bool = False,\txlabel: str = None,\tylabel: str = None,\tlegend=None,\tlegend_title: str = None,\tlegend_size='medium',\tlegend_loc='best',\tsave_as: str = None)"}, {"fullname": "aton.spx.classes.Plotting.title", "modulename": "aton.spx.classes", "qualname": "Plotting.title", "kind": "variable", "doc": "

Title of the plot. Set it to an empty string to remove the title.

\n"}, {"fullname": "aton.spx.classes.Plotting.xlim", "modulename": "aton.spx.classes", "qualname": "Plotting.xlim", "kind": "variable", "doc": "

List with the x-limits of the plot, as in [xlim_low, xlim_top].

\n"}, {"fullname": "aton.spx.classes.Plotting.ylim", "modulename": "aton.spx.classes", "qualname": "Plotting.ylim", "kind": "variable", "doc": "

List with the y-limits of the plot, as in [ylim_low, ylim_top].

\n"}, {"fullname": "aton.spx.classes.Plotting.margins", "modulename": "aton.spx.classes", "qualname": "Plotting.margins", "kind": "variable", "doc": "

List with additional margins at the bottom and top of the plot, as in [low_margin, top_margin].

\n"}, {"fullname": "aton.spx.classes.Plotting.offset", "modulename": "aton.spx.classes", "qualname": "Plotting.offset", "kind": "variable", "doc": "

If True, the plots will be separated automatically.

\n\n

It can be set to a float, to equally offset the plots by a given value.

\n"}, {"fullname": "aton.spx.classes.Plotting.scaling", "modulename": "aton.spx.classes", "qualname": "Plotting.scaling", "kind": "variable", "doc": "

Scaling factor

\n"}, {"fullname": "aton.spx.classes.Plotting.vline", "modulename": "aton.spx.classes", "qualname": "Plotting.vline", "kind": "variable", "doc": "

Vertical line/s to plot. Can be an int or float with the x-position, or a list with several ones.

\n"}, {"fullname": "aton.spx.classes.Plotting.vline_error", "modulename": "aton.spx.classes", "qualname": "Plotting.vline_error", "kind": "variable", "doc": "

Plot a shaded area of the specified width around the vertical lines specified at vline.

\n\n

It can be an array of the same length as vline, or a single value to be applied to all.

\n"}, {"fullname": "aton.spx.classes.Plotting.figsize", "modulename": "aton.spx.classes", "qualname": "Plotting.figsize", "kind": "variable", "doc": "

Tuple with the figure size, as in matplotlib.

\n"}, {"fullname": "aton.spx.classes.Plotting.log_xscale", "modulename": "aton.spx.classes", "qualname": "Plotting.log_xscale", "kind": "variable", "doc": "

If true, plot the x-axis in logarithmic scale.

\n"}, {"fullname": "aton.spx.classes.Plotting.show_yticks", "modulename": "aton.spx.classes", "qualname": "Plotting.show_yticks", "kind": "variable", "doc": "

Show or not the yticks on the plot.

\n"}, {"fullname": "aton.spx.classes.Plotting.xlabel", "modulename": "aton.spx.classes", "qualname": "Plotting.xlabel", "kind": "variable", "doc": "

Custom label of the x-axis.

\n\n

If None, the default label will be used.\nSet to '' to remove the label of the horizontal axis.

\n"}, {"fullname": "aton.spx.classes.Plotting.ylabel", "modulename": "aton.spx.classes", "qualname": "Plotting.ylabel", "kind": "variable", "doc": "

Custom label of the y-axis.

\n\n

If None, the default label will be used.\nSet to '' to remove the label of the vertical axis.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend", "modulename": "aton.spx.classes", "qualname": "Plotting.legend", "kind": "variable", "doc": "

Legend of the plot.

\n\n

If None, the filenames will be used as legend.\nCan be a bool to show or hide the plot legend.\nIt can also be an array containing the strings to display;\nin that case, elements set to False will not be displayed.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend_title", "modulename": "aton.spx.classes", "qualname": "Plotting.legend_title", "kind": "variable", "doc": "

Title of the legend, defaults to None.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend_size", "modulename": "aton.spx.classes", "qualname": "Plotting.legend_size", "kind": "variable", "doc": "

Size of the legend, as in matplotlib. Defaults to 'medium'.

\n"}, {"fullname": "aton.spx.classes.Plotting.legend_loc", "modulename": "aton.spx.classes", "qualname": "Plotting.legend_loc", "kind": "variable", "doc": "

Location of the legend, as in matplotlib. Defaults to 'best'.

\n"}, {"fullname": "aton.spx.classes.Plotting.save_as", "modulename": "aton.spx.classes", "qualname": "Plotting.save_as", "kind": "variable", "doc": "

Filename to save the plot. None by default.

\n"}, {"fullname": "aton.spx.classes.Spectra", "modulename": "aton.spx.classes", "qualname": "Spectra", "kind": "class", "doc": "

Spectra object. Used to load and process spectral data.

\n\n

Most functions in the aton.spx module receive this object as input.

\n"}, {"fullname": "aton.spx.classes.Spectra.__init__", "modulename": "aton.spx.classes", "qualname": "Spectra.__init__", "kind": "function", "doc": "

All values can be set when initializing the Spectra object.

\n", "signature": "(\ttype: str = None,\tcomment: str = None,\tfiles=None,\tdfs=None,\tunits=None,\tunits_in=None,\tplotting: aton.spx.classes.Plotting = <aton.spx.classes.Plotting object>)"}, {"fullname": "aton.spx.classes.Spectra.type", "modulename": "aton.spx.classes", "qualname": "Spectra.type", "kind": "variable", "doc": "

Type of the spectra: 'INS', 'ATR', or 'RAMAN'.

\n"}, {"fullname": "aton.spx.classes.Spectra.comment", "modulename": "aton.spx.classes", "qualname": "Spectra.comment", "kind": "variable", "doc": "

Custom comment. If Plotting.title is None, it will be the title of the plot.

\n"}, {"fullname": "aton.spx.classes.Spectra.files", "modulename": "aton.spx.classes", "qualname": "Spectra.files", "kind": "variable", "doc": "

List containing the files with the spectral data.

\n\n

Loaded automatically to dfs with Pandas at initialization.\nIn order for Pandas to read the files properly, note that the column lines must start by #.\nAny additional line that is not data must be removed or commented with #.\nCSV files must be formatted with the first column as the energy or energy transfer,\nand the second column with the intensity or absorbance, depending on the case.\nAn additional third 'Error' column can be used.

\n"}, {"fullname": "aton.spx.classes.Spectra.dfs", "modulename": "aton.spx.classes", "qualname": "Spectra.dfs", "kind": "variable", "doc": "

List containing the pandas dataframes with the spectral data.

\n\n

Loaded automatically from files at initialization.

\n"}, {"fullname": "aton.spx.classes.Spectra.units", "modulename": "aton.spx.classes", "qualname": "Spectra.units", "kind": "variable", "doc": "

Target units of the spectral data.

\n\n

Can be 'meV' or 'cm-1'.

\n"}, {"fullname": "aton.spx.classes.Spectra.units_in", "modulename": "aton.spx.classes", "qualname": "Spectra.units_in", "kind": "variable", "doc": "

Input units of the spectral data, used in the input CSV files.

\n\n

Can be 'meV' or 'cm-1'.\nIf the input CSV files have different units,\nit can also be set as a list of the same length of the number of input files,\neg. ['meV', 'cm-1', 'cm-1'].

\n"}, {"fullname": "aton.spx.classes.Spectra.plotting", "modulename": "aton.spx.classes", "qualname": "Spectra.plotting", "kind": "variable", "doc": "

Plotting object, used to set the plotting options.

\n"}, {"fullname": "aton.spx.classes.Spectra.set_units", "modulename": "aton.spx.classes", "qualname": "Spectra.set_units", "kind": "function", "doc": "

Method to change between spectral units. ALWAYS use this method to do that.

\n\n

For example, to change to meV from cm-1:

\n\n
\n
Spectra.set_units('meV', 'cm-1')\n
\n
\n", "signature": "(self, units, units_in=None, default_unit='cm-1'):", "funcdef": "def"}, {"fullname": "aton.spx.classes.Material", "modulename": "aton.spx.classes", "qualname": "Material", "kind": "class", "doc": "

Material class.

\n\n

Used to calculate molar masses and cross sections,\nand to pass data to different analysis functions\nsuch as aton.spectra.deuterium.impulse_approx().

\n"}, {"fullname": "aton.spx.classes.Material.__init__", "modulename": "aton.spx.classes", "qualname": "Material.__init__", "kind": "function", "doc": "

All values can be set when initializing the Material object.\nHowever, it is recommended to only set the elements and the grams,\nand optionally the name, and calculate the rest with Material.set().

\n", "signature": "(\telements: dict,\tname: str = None,\tgrams: float = None,\tgrams_error: float = None,\tmols: float = None,\tmols_error: float = None,\tmolar_mass: float = None,\tcross_section: float = None,\tpeaks: dict = None)"}, {"fullname": "aton.spx.classes.Material.elements", "modulename": "aton.spx.classes", "qualname": "Material.elements", "kind": "variable", "doc": "

Dict of atoms in the material, as in {'H': 6, 'C':1, 'N':1}.

\n\n

Isotopes can be expressed as 'H2', 'He4', etc. with the atom symbol + isotope mass number.

\n"}, {"fullname": "aton.spx.classes.Material.name", "modulename": "aton.spx.classes", "qualname": "Material.name", "kind": "variable", "doc": "

String with the name of the material.

\n"}, {"fullname": "aton.spx.classes.Material.grams", "modulename": "aton.spx.classes", "qualname": "Material.grams", "kind": "variable", "doc": "

Mass, in grams.

\n"}, {"fullname": "aton.spx.classes.Material.grams_error", "modulename": "aton.spx.classes", "qualname": "Material.grams_error", "kind": "variable", "doc": "

Error of the measured mass in grams.

\n\n

Set automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.mols", "modulename": "aton.spx.classes", "qualname": "Material.mols", "kind": "variable", "doc": "

Number of moles.

\n\n

Set automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.mols_error", "modulename": "aton.spx.classes", "qualname": "Material.mols_error", "kind": "variable", "doc": "

Error of the number of moles.

\n\n

Set automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.molar_mass", "modulename": "aton.spx.classes", "qualname": "Material.molar_mass", "kind": "variable", "doc": "

Molar mass of the material, in mol/g.

\n\n

Calculated automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.cross_section", "modulename": "aton.spx.classes", "qualname": "Material.cross_section", "kind": "variable", "doc": "

Neutron total bound scattering cross section, in barns.

\n\n

Calculated automatically with Material.set().

\n"}, {"fullname": "aton.spx.classes.Material.peaks", "modulename": "aton.spx.classes", "qualname": "Material.peaks", "kind": "variable", "doc": "

Dict with interesting peaks that you might want to store for later use.

\n"}, {"fullname": "aton.spx.classes.Material.set", "modulename": "aton.spx.classes", "qualname": "Material.set", "kind": "function", "doc": "

Set the molar mass, cross section and errors of the material.

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.spx.classes.Material.print", "modulename": "aton.spx.classes", "qualname": "Material.print", "kind": "function", "doc": "

Print a summary with the material information.

\n", "signature": "(self):", "funcdef": "def"}, {"fullname": "aton.spx.deuterium", "modulename": "aton.spx.deuterium", "kind": "module", "doc": "

Description

\n\n

This module contains methods to calculate deuteration levels from different spectra.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n
impulse_approx()Calculate the deuteration levels from INS spectra with the Impulse Approximation
peaks_mapbi3()Estimates CH$_3$NH$_3$PbI$_3$ deuteration by integrating the INS disrotatory peaks
\n\n
\n"}, {"fullname": "aton.spx.deuterium.impulse_approx", "modulename": "aton.spx.deuterium", "qualname": "impulse_approx", "kind": "function", "doc": "

Calculate the deuteration levels from INS spectra\nwith the Impulse Approximation, see\nhttps://www.tandfonline.com/doi/full/10.1080/00018732.2017.1317963.

\n\n

Protonated and deuterated materials must be specified\nas aton.spectra.classes.Material objects.\nNote that this approximation is very sensitive to the mass sample.\nThe threshold controls the start of the plateau (in meV)\nto start considering Deep Inelastic Neutron Scattering (DINS).\nThe protonated and deuterated dataframe indexes are specified\nby H_df_index and D_df_index, respectively.

\n\n

In this approximation, the ideal ratio between\nthe cross-sections and the experimental ratio between\nthe pleteaus at high energies should be the same:\n$$\n\\frac{\\text{plateau_D}}{\\text{plateau_H}} \\approx \\frac{\\text{cross_section_D}}{\\text{cross_section_H}}\n$$\nTaking this into account, the deuteration is estimated as:\n$$\n\\text{Deuteration} = \\frac{1-\\text{real_ratio}}{1-\\text{ideal_ratio}}\n$$

\n", "signature": "(\tins: aton.spx.classes.Spectra,\tmaterial_H: aton.spx.classes.Material,\tmaterial_D: aton.spx.classes.Material,\tthreshold: float = 600,\tH_df_index: int = 0,\tD_df_index: int = 1) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.deuterium.peaks_mapbi3", "modulename": "aton.spx.deuterium", "qualname": "peaks_mapbi3", "kind": "function", "doc": "

Estimates CH$_3$NH$_3$PbI$_3$ deuteration by integrating the INS disrotatory peaks.

\n\n

The INS disrotatory peaks of CH3NH3 appear at ~38 meV for the fully protonated sample.\nNote that peaks must be a dictionary with the peak limits\nand the baseline, as in the example below:

\n\n
\n
peaks = {\n    'baseline' : None,\n    'baseline_error' : None,\n    'h6d0' : [41, 43],\n    'h5d1' : [41, 43],\n    'h4d2' : [41, 43],\n    'h3d3' : [34.7, 37.3],\n    'h2d4' : [31.0, 33.0],\n    'h1d5' : [28.0, 30.5],\n    'h0d6' : [26.5, 28.0],\n    }\n
\n
\n\n

Peak keywords required for selective deuteration (only C or only N):\nh6d0, h5d1, h4d2, h3d3.

\n\n

Additional peak keywords required for total deuteration:\nh2d4, h1d5, h0d6.

\n\n

If some peak is not present in your sample,\njust set the limits to a small baseline plateau.

\n", "signature": "(ins: aton.spx.classes.Spectra, peaks: dict, df_index: int = 0) -> str:", "funcdef": "def"}, {"fullname": "aton.spx.fit", "modulename": "aton.spx.fit", "kind": "module", "doc": "

Description

\n\n

This module contains functions for fitting and analyzing spectral data.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
plateau()Fit the mean value and the error of a plateau
area_under_peak()Calculate the area under a given peak
ratio_areas()Check the ratio between two areas
mean()Get the mean and standard deviation of a list of values
\n\n
\n"}, {"fullname": "aton.spx.fit.plateau", "modulename": "aton.spx.fit", "qualname": "plateau", "kind": "function", "doc": "

Fit the mean value and the error of a plateau in a aton.spectra.Spectra object.

\n\n

Use as aton.spx.fit.plateau(spectra, cuts=[low_cut, high_cut], df_index=0).

\n\n

If aton.spx.classes.Spectra.dfs[df_index] has an 'Error' column, those errors are also taken into account\nalong with the standard deviation of the mean, else only the standard deviation is considered.\nThis is the case if your dataset had a third column with the errors\nwhen you imported the aton.spx.classes.Spectra object.

\n\n

Note that cuts, low_cut and/or top_cut can be set to None.

\n", "signature": "(spectra: aton.spx.classes.Spectra, cuts=None, df_index: int = 0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.fit.area_under_peak", "modulename": "aton.spx.fit", "qualname": "area_under_peak", "kind": "function", "doc": "

Calculate the area under a given peak.

\n\n

Peaks must be defined as peak:list=[xmin, xmax, baseline=0, baseline_error=0].\nIf the dataset has no Error column, the error for each point is assumed to be the same\nas the baseline error if errors_as_in_baseline=True, otherwise it is assumed to be zero.\nIf min_as_baseline=True and baseline=0, the baseline is assumed to be the minimum value.\nAlso, if min_as_baseline=True and there are negative areas even after applying the baseline,\nthe baseline will be corrected to the minimum value.

\n", "signature": "(\tspectra: aton.spx.classes.Spectra,\tpeak: list,\tdf_index: int = 0,\terrors_as_in_baseline: bool = True,\tmin_as_baseline: bool = False) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.fit.ratio_areas", "modulename": "aton.spx.fit", "qualname": "ratio_areas", "kind": "function", "doc": "

Check the ratio between two areas, e.g. to estimate deuteration levels from ATR data.

\n\n

The ratio is calculated as area / area_total. This behavior is modified if inverse_ratio = True,\nso that the ratio is calculated as (area_total - area) / area_total.\nNote that changing the ratio calculation also affects the error propagation.

\n", "signature": "(\tarea: float,\tarea_total: float,\tarea_error: float = 0.0,\tarea_total_error: float = 0.0,\tinverse_ratio: bool = False) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.fit.mean", "modulename": "aton.spx.fit", "qualname": "mean", "kind": "function", "doc": "

Takes an array of numerical values and returns the mean and standard deviation.

\n\n

It is calculated with numpy as:

\n\n

$\\sigma_{x}=\\sqrt{\\frac{\\sum{(x_{i}-{\\overline{x}})^2}}{N-\\text{ddof}}}$

\n\n

where ddof are the delta degrees_of_freedom, zero by default.\nSet it to 1 for a corrected sample standard deviation (low N cases),\nsee more details here.

\n\n

The mean is rounded up to the order of the error by default. To override this behaviour, set rounded=False.

\n", "signature": "(array: list, rounded: bool = True, degrees_of_freedom=0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.spx.normalize", "modulename": "aton.spx.normalize", "kind": "module", "doc": "

Description

\n\n

This module contains functions to normalize data and other variables.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
height()Normalize a spectra by height
area()Normalize a spectra by the area under the datasets
unit_str()Normalize a unit string from user input
\n\n
\n"}, {"fullname": "aton.spx.normalize.height", "modulename": "aton.spx.normalize", "qualname": "height", "kind": "function", "doc": "

Normalize a set of spectra by height.

\n\n

By default it normalises the spectra over the entire range.\nThis can be modified by setting a specific range,\nas in range = [x_min, x_max] with axis = 'x'.\nIt can also normalise over manual y-positions,\nfor example for peaks with different baselines.\nThis can be done by settingch axis='y', and\nrange = [[y_min_1, y_max_1], ..., [y_min_N, y_max_N]].

\n\n

Heights are normalised with respect to the\nreference dataframe df_index, the first one by default.

\n", "signature": "(\tspectra: aton.spx.classes.Spectra,\trange: list = None,\taxis: str = 'x',\tdf_index: int = 0) -> aton.spx.classes.Spectra:", "funcdef": "def"}, {"fullname": "aton.spx.normalize.area", "modulename": "aton.spx.normalize", "qualname": "area", "kind": "function", "doc": "

Normalize spectra by the area under the datasets.

\n", "signature": "(\tspectra: aton.spx.classes.Spectra,\trange: list = None,\tdf_index: int = 0) -> aton.spx.classes.Spectra:", "funcdef": "def"}, {"fullname": "aton.spx.normalize.unit_str", "modulename": "aton.spx.normalize", "qualname": "unit_str", "kind": "function", "doc": "

Normalize unit string from user input.

\n", "signature": "(unit: str):", "funcdef": "def"}, {"fullname": "aton.spx.plot", "modulename": "aton.spx.plot", "kind": "module", "doc": "

Description

\n\n

This module contains the plot() function,\nused to plot aton.spx.classes.Spectra data,\ncontaining optional aton.spx.classes.Plotting parameters.

\n\n

It is used as aton.spx.plot(Spectra)

\n\n
\n"}, {"fullname": "aton.spx.plot.plot", "modulename": "aton.spx.plot", "qualname": "plot", "kind": "function", "doc": "

Plots a spectra.

\n\n

Optional aton.spectra.classes.Plotting attributes can be used.

\n", "signature": "(spectra: aton.spx.classes.Spectra):", "funcdef": "def"}, {"fullname": "aton.spx.samples", "modulename": "aton.spx.samples", "kind": "module", "doc": "

Description

\n\n

This module contains premade examples of material compositions, for testing purposes.\nThe aton.spx.classes.Material.grams is yet to be provided,\nbefore setting the material as aton.spx.Material.set().

\n\n
\n"}, {"fullname": "aton.spx.samples.CH3NH3PbI3", "modulename": "aton.spx.samples", "qualname": "CH3NH3PbI3", "kind": "variable", "doc": "

CH$_3$NH$_3$PbI$_3$

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CD3ND3PbI3", "modulename": "aton.spx.samples", "qualname": "CD3ND3PbI3", "kind": "variable", "doc": "

CD$_3$ND$_3$PbI$_3$.

\n\n

With experimental values of the partially-deuterated amine peaks\nfor the disrotatory mode of MAPbI3's methylammonium.\nMeasured at TOSCA, ISIS RAL, UK, May 2024.

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CH3ND3PbI3", "modulename": "aton.spx.samples", "qualname": "CH3ND3PbI3", "kind": "variable", "doc": "

CH$_3$ND$_3$PbI$_3$.

\n\n

With experimental values of the partially-deuterated amine peaks\nfor the disrotatory mode of MAPbI3's methylammonium.\nMeasured at TOSCA, ISIS RAL, UK, May 2024.

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CD3NH3PbI3", "modulename": "aton.spx.samples", "qualname": "CD3NH3PbI3", "kind": "variable", "doc": "

CD$_3$NH$_3$PbI$_3$

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CH3NH3I", "modulename": "aton.spx.samples", "qualname": "CH3NH3I", "kind": "variable", "doc": "

CH$_3$NH$_3$I

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.spx.samples.CH3ND3I", "modulename": "aton.spx.samples", "qualname": "CH3ND3I", "kind": "variable", "doc": "

CH$_3$ND$_3$I

\n", "default_value": "<aton.spx.classes.Material object>"}, {"fullname": "aton.st", "modulename": "aton.st", "kind": "module", "doc": "

System Tools

\n\n

Common system tools across all ATON subpackages.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.st.fileFile manipulation
aton.st.callRun bash scripts and related
aton.st.aliasUseful dictionaries for user input correction
\n"}, {"fullname": "aton.st.alias", "modulename": "aton.st.alias", "kind": "module", "doc": "

Description

\n\n

This module contains common dictionaries to normalise and correct user inputs.\nAll values can be found in lowercase, to allow comparison with the string.lower() method.

\n\n

Index

\n\n

units
\nspatial
\nexperiments
\nfiles
\nboolean
\nmath

\n\n

Examples

\n\n
\n
unit = 'Electronvolts'\nif unit.lower() in aton.alias.units['eV']:\n    ... do stuff ...\n
\n
\n\n
\n"}, {"fullname": "aton.st.alias.units", "modulename": "aton.st.alias", "qualname": "units", "kind": "variable", "doc": "

Dict with unit names.

\n", "annotation": ": dict", "default_value": "{'mol': ['mol', 'mols', 'mole', 'moles'], 'g': ['g', 'gram', 'grams'], 'kg': ['kg', 'kilogram', 'kilograms'], 'amu': ['amu', 'atomicmassunit', 'atomicmassunits'], 'eV': ['eV', 'ev', 'electronvolt', 'electronvolts'], 'meV': ['meV', 'mev', 'millielectronvolt', 'millielectronvolts'], 'J': ['J', 'j', 'joule', 'joules'], 'cal': ['cal', 'calorie', 'calories'], 'kcal': ['kcal', 'kilocalorie', 'kilocalories'], 'Ry': ['Ry', 'ry', 'rydberg', 'rydbergs'], 'cm-1': ['cm^{-1}', 'cm1', 'cm-1', 'cm^-1'], 'cm': ['cm', 'centimeter', 'centimeters'], 'A': ['A', 'a', 'aa', 'angstrom', 'angstroms', 'armstrong', 'armstrongs'], 'bohr': ['bohr', 'bohrs', 'bohrradii'], 'm': ['m', 'meter', 'meters'], 'deg': ['deg', 'degree', 'degrees'], 'rad': ['rad', 'radian', 'radians'], 'bar': ['bar', 'bars'], 'kbar': ['kbar', 'kilobar', 'kilobars'], 'Pa': ['Pa', 'pa', 'pascal', 'pascals'], 'GPa': ['GPa', 'gpa', 'gigapascal', 'gigapascals'], 's': ['s', 'second', 'seconds'], 'H': ['H', 'h', 'hour', 'hours']}"}, {"fullname": "aton.st.alias.spatial", "modulename": "aton.st.alias", "qualname": "spatial", "kind": "variable", "doc": "

Dict with different spatial parameters. Values must be compared to string.lower().

\n", "annotation": ": dict", "default_value": "{'height': ['height', 'h'], 'area': ['area', 'a'], 'volume': ['volume', 'vol'], 'x': ['x', 'horizontal', 'h'], 'y': ['y', 'vertical', 'v'], 'z': ['z']}"}, {"fullname": "aton.st.alias.chemical", "modulename": "aton.st.alias", "qualname": "chemical", "kind": "variable", "doc": "

Dict with chemical groups.

\n", "annotation": ": dict", "default_value": "{'CH3': ['ch', 'CH', 'ch3', 'CH3', 'methyl'], 'NH3': ['nh', 'NH', 'nh3', 'NH3', 'amine'], 'CD3': ['cd', 'CD', 'cd3', 'CD3', 'deuterated methyl'], 'ND3': ['nd', 'ND', 'nd3', 'ND3', 'deuterated amine']}"}, {"fullname": "aton.st.alias.experiments", "modulename": "aton.st.alias", "qualname": "experiments", "kind": "variable", "doc": "

Dictionary with the available experiment types. Values must be compared to string.lower().

\n", "annotation": ": dict", "default_value": "{'ins': ['ins', 'inelasticneutronscattering', 'inelastic neutron scattering'], 'atr': ['atr', 'ftir', 'attenuatedtotalreflection', 'attenuated total reflection'], 'raman': ['raman'], 'qens': ['qens', 'quasielasticneutronscattering', 'quasielastic neutron scattering', 'quasi elastic neutron scattering']}"}, {"fullname": "aton.st.alias.files", "modulename": "aton.st.alias", "qualname": "files", "kind": "variable", "doc": "

Strings related to files. Values must be compared to string.lower().

\n", "annotation": ": dict", "default_value": "{'file': ['file', 'files', 'f', 'filepath', 'file path', 'filename', 'file name'], 'dir': ['dir', 'directory', 'd', 'folder'], 'error': ['error', 'errors', 'e', 'err']}"}, {"fullname": "aton.st.alias.boolean", "modulename": "aton.st.alias", "qualname": "boolean", "kind": "variable", "doc": "

Strings with booleans such as 'yes' / 'no'.

\n", "annotation": ": dict", "default_value": "{True: ['yes', 'YES', 'Yes', 'Y', 'y', 'T', 'True', 'TRUE', 't', 'true', 'Si', 'SI', 'si', 'S', 's'], False: ['no', 'NO', 'No', 'N', 'n', 'F', 'False', 'FALSE', 'f', 'false']}"}, {"fullname": "aton.st.alias.math", "modulename": "aton.st.alias", "qualname": "math", "kind": "variable", "doc": "

Math-related strings.

\n", "annotation": ": dict", "default_value": "{'sin': ['sin', 'sen', 'sine', 'seno'], 'cos': ['cos', 'cosine', 'coseno'], 'tg': ['tg', 'tangent', 'tangente'], '0': ['zero', 'cero', '0']}"}, {"fullname": "aton.st.call", "modulename": "aton.st.call", "kind": "module", "doc": "

Description

\n\n

Functions to handle bash calls and related operations on Linux systems.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
bash()Run a bash shell commands
git()Automatically update a Git repository
here()Runs the rest of the script inside a given folder
\n\n
\n"}, {"fullname": "aton.st.call.bash", "modulename": "aton.st.call", "qualname": "bash", "kind": "function", "doc": "

Run a bash shell commands.

\n\n

A given command will be executed inside an optional cwd directory.\nIf empty, the current working directory will be used.\nPrints the running command and outputs by default, override this with verbose=False.\nReturns the result of the command used, except for when\nerrors are raised automatically; set return_anyway=True to override this.

\n", "signature": "(\tcommand: str,\tcwd=None,\tverbose: bool = True,\treturn_anyway: bool = False):", "funcdef": "def"}, {"fullname": "aton.st.call.git", "modulename": "aton.st.call", "qualname": "git", "kind": "function", "doc": "

Automatically update a Git repository

\n", "signature": "(path=None, verbose=True, message=None, tag=None) -> None:", "funcdef": "def"}, {"fullname": "aton.st.call.here", "modulename": "aton.st.call", "qualname": "here", "kind": "function", "doc": "

Runs the rest of the script inside the specified folder.

\n\n

If none is provided, it runs from the same directory where the current script lies.\nThis is really useful to run scripts from the VSCode terminal, etc.\nReturns the path of the used folder, or the path of the script if folder is not provided.

\n\n

Note that this changes not only the working directory of your script,\nbut also of other scripts that import and run your script.

\n", "signature": "(folder=None) -> str:", "funcdef": "def"}, {"fullname": "aton.st.file", "modulename": "aton.st.file", "kind": "module", "doc": "

Description

\n\n

Functions to move files around.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
get()Check that a file exists, and return the full path
get_list()Get a list of the files inside a folder, applying optional filters
get_dir()Get the full path of a folder or the cwd
copy()Copy file
move()Move file
remove()Remove file or folder
rename_on_folder()Batch rename files from a folder
rename_on_folders()Barch rename files from subfolders
copy_to_folders()Copy files to individual subfolders
save()Save a Python object to a binary file, as .aton
load()Load a Python object from a binary file, as .aton
\n\n
\n"}, {"fullname": "aton.st.file.get", "modulename": "aton.st.file", "qualname": "get", "kind": "function", "doc": "

Check if filepath exists, and returns its full path.

\n\n

Raises an error if the file is not found,\nunless return_anyway = True, in which case it returns None.\nThis can be used to personalize errors.

\n\n

If the provided string is a directory, it checks the files inside it.\nif there is only one file inside, it returns said file;\nif there are more files, it tries to filter them with the include filters\n(string or list of strings) to return a single file.\nIf this fails, try using more strict filters to return a single file.

\n", "signature": "(filepath, include=None, return_anyway: bool = False) -> str:", "funcdef": "def"}, {"fullname": "aton.st.file.get_list", "modulename": "aton.st.file", "qualname": "get_list", "kind": "function", "doc": "

Return the files inside a folder, applying optional filters.

\n\n

Only filenames containing all strings in the include list will be returned.\nFilenames containing any string from the exclude list will be ignored.

\n\n

The full paths are returned by default; to get only the base names, set abspath = False.\nThe CWD folder is used by default if no folder is provided.\nIt also returns folders if also_folders = True.

\n", "signature": "(\tfolder: str = None,\tinclude=None,\texclude=None,\tabspath: bool = True,\talso_folders: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.st.file.get_dir", "modulename": "aton.st.file", "qualname": "get_dir", "kind": "function", "doc": "

Returns the full path of folder or the parent folder if it's a file. If none is provided, the current working directory is returned.

\n", "signature": "(folder=None) -> str:", "funcdef": "def"}, {"fullname": "aton.st.file.copy", "modulename": "aton.st.file", "qualname": "copy", "kind": "function", "doc": "

Copies old file to new file

\n", "signature": "(old: str, new: str) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.move", "modulename": "aton.st.file", "qualname": "move", "kind": "function", "doc": "

Moves old file to new file.

\n", "signature": "(old: str, new: str) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.remove", "modulename": "aton.st.file", "qualname": "remove", "kind": "function", "doc": "

Removes the given file or folder at filepath.

\n\n
\n

WARNING: Removing stuff is always dangerous, be careful!

\n
\n", "signature": "(filepath: str) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.rename_on_folder", "modulename": "aton.st.file", "qualname": "rename_on_folder", "kind": "function", "doc": "

Batch renames files in the given folder.

\n\n

Replaces the old string by new string.\nIf no folder is provided, the current working directory is used.

\n", "signature": "(old: str, new: str, folder=None) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.rename_on_folders", "modulename": "aton.st.file", "qualname": "rename_on_folders", "kind": "function", "doc": "

Renames the files inside the subfolders in the parent folder.

\n\n

Renames from an old string to the new string.\nIf no folder is provided, the current working directory is used.

\n", "signature": "(old: str, new: str, folder=None) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.copy_to_folders", "modulename": "aton.st.file", "qualname": "copy_to_folders", "kind": "function", "doc": "

Copies the files from the parent folder with the given extension to individual subfolders.

\n\n

The subfolders are named as the original files,\nremoving the strings from the strings_to_delete list.\nIf no folder is provided, it runs in the current working directory.

\n", "signature": "(folder=None, extension: str = None, strings_to_delete: list = []) -> None:", "funcdef": "def"}, {"fullname": "aton.st.file.save", "modulename": "aton.st.file", "qualname": "save", "kind": "function", "doc": "

Save a Python object in the current working directory as a binary *.aton file.

\n", "signature": "(object, filename: str = None):", "funcdef": "def"}, {"fullname": "aton.st.file.load", "modulename": "aton.st.file", "qualname": "load", "kind": "function", "doc": "

Load a Python object from a binary *.aton file.

\n\n

Use only if you trust the person who sent you the file!

\n", "signature": "(filepath: str = 'data.aton'):", "funcdef": "def"}, {"fullname": "aton.txt", "modulename": "aton.txt", "kind": "module", "doc": "

General text operations

\n\n

This subpackage contains tools for general text operations.\nIt provides the basic functionality that powers more complex subpackages,\nsuch as aton.interface.

\n\n

Index

\n\n\n\n\n \n \n\n\n\n\n \n \n\n\n \n \n\n\n \n \n\n\n
aton.txt.findSearch for specific content from a text file
aton.txt.editEdit specific content from a text file
aton.txt.extractExtract data from raw text strings
\n\n

Examples

\n\n

The following example shows how to find a value in a text file, extract it and paste it into another file using the txt subpackage:

\n\n
\n
from aton import txt\n# Get an array with all matches\nalat_lines = txt.find.lines('relax.out', 'Lattice parameter =')\n# Extract the numerical value of the last match\nalat = txt.extract.number(alat_lines[-1], 'Lattice parameter')\n# Paste it into another file\ntxt.edit.replace_line('scf.in', 'Lattice parameter =', f'Lattice parameter ='{alat})\n
\n
\n\n

Advanced usage such as regular expression matching or\nadditional line extraction is detailed in the API documentation.

\n"}, {"fullname": "aton.txt.edit", "modulename": "aton.txt.edit", "kind": "module", "doc": "

Description

\n\n

Functions to manipulate the content of text files.

\n\n

Index

\n\n

insert_at()
\ninsert_under()
\nreplace()
\nreplace_line()
\nreplace_between()
\ndelete_under()
\ncorrect_with_dict()
\nfrom_template()

\n\n
\n"}, {"fullname": "aton.txt.edit.insert_at", "modulename": "aton.txt.edit", "qualname": "insert_at", "kind": "function", "doc": "

Inserts a text in the line with position index of a given filepath.

\n\n

If position is negative, starts from the end of the file.

\n", "signature": "(filepath, text: str, position: int) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.insert_under", "modulename": "aton.txt.edit", "qualname": "insert_under", "kind": "function", "doc": "

Inserts a text under the line(s) containing the key in filepath.

\n\n

The keyword can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

By default all matches are inserted with insertions=0,\nbut it can insert only a specific number of matches\nwith positive numbers (1, 2...), or starting from the bottom with negative numbers.

\n\n

The text can be introduced after a specific number of lines after the match,\nchanging the value skips. Negative integers introduce the text in the previous lines.

\n", "signature": "(\tfilepath,\tkey: str,\ttext: str,\tinsertions: int = 0,\tskips: int = 0,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.replace", "modulename": "aton.txt.edit", "qualname": "replace", "kind": "function", "doc": "

Replaces the key with text in filepath.

\n\n

It can also be used to delete the keyword with text=''.\nTo search with regular expressions, set regex=True.

\n\n

The value replacements specifies the number of replacements to perform:\n1 to replace only the first keyword found, 2, 3...\nUse negative values to replace from the end of the file,\neg. to replace the last found key, use replacements=-1.\nTo replace all values, set replacements = 0, which is the value by default.

\n\n
line... key ...line -> line... text ...line\n
\n", "signature": "(\tfilepath: str,\tkey: str,\ttext: str,\treplacements: int = 0,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.replace_line", "modulename": "aton.txt.edit", "qualname": "replace_line", "kind": "function", "doc": "

Replaces the entire line(s) containing the key with the text in filepath.

\n\n

It can be used to delete line(s) by setting text=''.\nRegular expressions can be used with regex=True.

\n\n

The value replacements specifies the number of lines to replace:\n1 to replace only the first line with the keyword, 2, 3...\nUse negative values to replace from the end of the file,\ne.g., to replace only the last line containing the keyword, use replacements = -1.\nTo replace all lines, set replacements = 0, which is the value by default.

\n\n

The default line to replace is the matching line,\nbut it can be any other specific line after or before the matching line;\nthis is indicated with skips as a positive or negative integer.

\n\n

More lines can be replaced with additional lines (int).\nNote that the matched line plus the additional lines\nwill be replaced, this is, additional lines +1.

\n", "signature": "(\tfilepath: str,\tkey: str,\ttext: str,\treplacements: int = 0,\tskips: int = 0,\tadditional: int = 0,\tregex: bool = False,\traise_errors: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.replace_between", "modulename": "aton.txt.edit", "qualname": "replace_between", "kind": "function", "doc": "

Replace with text between keywords key1 and key2 in filepath.

\n\n

It can be used to delete the text between the keys by setting text=''.\nRegular expressions can be used by setting regex=True.

\n\n

Key lines are also deleted if delete_keys=True.

\n\n

Only the first matches of the keywords are used by default;\nyou can use the last ones with from_end = True.

\n\n
lines...\nkey1\ntext\nkey2\nlines...\n
\n", "signature": "(\tfilepath: str,\tkey1: str,\tkey2: str,\ttext: str,\tdelete_keys: bool = False,\tfrom_end: bool = False,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.delete_under", "modulename": "aton.txt.edit", "qualname": "delete_under", "kind": "function", "doc": "

Deletes all the content under the line containing the key in filepath.

\n\n

The keyword can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

By default the first match is used; it can be any positive integer (0 is treated as 1!),\nincluding negative integers to select a match starting from the end of the file.

\n\n

The content can be deleted after a specific number of lines after the match,\nchanging the value skips, that skips the specified number of lines.\nNegative integers start deleting the content from the previous lines.

\n", "signature": "(\tfilepath,\tkey: str,\tmatch: int = 1,\tskips: int = 0,\tregex: bool = False) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.correct_with_dict", "modulename": "aton.txt.edit", "qualname": "correct_with_dict", "kind": "function", "doc": "

Corrects the given text file filepath using a correct dictionary.

\n", "signature": "(filepath: str, correct: dict) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.edit.from_template", "modulename": "aton.txt.edit", "qualname": "from_template", "kind": "function", "doc": "

Creates new file from old, replacing values from a correct dict, inserting a comment on top.

\n", "signature": "(old: str, new: str, correct: dict = None, comment: str = None) -> None:", "funcdef": "def"}, {"fullname": "aton.txt.extract", "modulename": "aton.txt.extract", "kind": "module", "doc": "

Description

\n\n

Functions to extract data from raw text strings.

\n\n

Index

\n\n

number()
\nstring()
\ncolumn()
\ncoords()
\nelement()

\n\n

Examples

\n\n

To extract a float value from a string,

\n\n
\n
from aton import txt\nline = 'energy =   500.0 Ry'\ntxt.extract.number(line, 'energy')\n# 500.0  (float output)\n
\n
\n\n

To extract a text value, after and before specific strings,

\n\n
\n
line = 'energy =   500.0 Ry were calculated'\ntxt.extract.string(line, 'energy', 'were')\n# '500.0 Ry'  (String output)\n
\n
\n\n

To extract a value from a specific column,

\n\n
\n
# Name, Energy, Force, Error\nline = 'Testing    1.1    1.2    0.3'\nenergy = txt.extract.column(line, 1)\n# '1.1'  (String output)\n
\n
\n\n

To extract coordinates,

\n\n
\n
line = ' He  0.10  0.20  0.30 '\ntxt.extract.coords(line)\n# [0.1, 0.2, 0.3]  (List of floats)\n
\n
\n\n

To extract chemical elements,

\n\n
\n
line = ' He4  0.10  Ag  0.20  Pb  0.30 '\nfirst_element = txt.extract.element(line, 0)\n# 'He4'\nthird_element = txt.extract.element(line, 2)\n# 'Pb'\n
\n
\n\n
\n"}, {"fullname": "aton.txt.extract.number", "modulename": "aton.txt.extract", "qualname": "number", "kind": "function", "doc": "

Extracts the float value of a given name variable from a raw text.

\n", "signature": "(text: str, name: str = '') -> float:", "funcdef": "def"}, {"fullname": "aton.txt.extract.string", "modulename": "aton.txt.extract", "qualname": "string", "kind": "function", "doc": "

Extracts the text value of a given name variable from a raw string. Stops before an optional stop string.

\n\n

Removes leading and trailing commas by default, change this with strip = False.

\n", "signature": "(text: str, name: str = '', stop: str = '', strip: bool = True) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.extract.column", "modulename": "aton.txt.extract", "qualname": "column", "kind": "function", "doc": "

Extracts the desired column index of a given string (0 by default).

\n", "signature": "(text: str, column: int = 0) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.extract.coords", "modulename": "aton.txt.extract", "qualname": "coords", "kind": "function", "doc": "

Returns a list with the float coordinates expressed in a given text string.

\n", "signature": "(text: str) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.extract.element", "modulename": "aton.txt.extract", "qualname": "element", "kind": "function", "doc": "

Extract a chemical element from a raw text string.

\n\n

If there are several elements, you can return a specific index match (positive, 0 by default).\nAllows for standard elements (H, He, Na...) and isotopes (H2, He4...).

\n", "signature": "(text: str, index: int = 0) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.find", "modulename": "aton.txt.find", "kind": "module", "doc": "

Description

\n\n

Functions to search for specific content inside text files.

\n\n

Index

\n\n

Find and return specific text strings from a file
\nlines()
\nbetween()

\n\n

Find the (start, end) position of specific strings in a file
\npos()
\npos_regex()
\nnext_pos()
\nnext_pos_regex()
\nline_pos()
\nbetween_pos()

\n\n

Examples

\n\n

To find the lines containing the word 'key', plus an additional line below,

\n\n
\n
from aton import txt\n# with split = False\ntxt.find.lines(filepath=file, key='key', additional=1)\n    # ['line with key 1\\nline below first match',\n    #  'line with key 2\\nline below second match]\n# with split = True\ntxt.find.lines(filepath=file, key='key', additional=1, split=True)\n    # ['line with key 1',\n    # 'line below first match',\n    # 'line with key 2',\n    # 'line below second match]\n
\n
\n\n

To find the text between the lines containing the words 'first' and 'second',

\n\n
\n
from aton import txt\ntxt.find.between(filepath=file, key1='first', key2='second')\n    # 'first line\\nadditional\\nlines\\nin\\nbetween\\nsecond line'\n
\n
\n\n
\n"}, {"fullname": "aton.txt.find.lines", "modulename": "aton.txt.find", "qualname": "lines", "kind": "function", "doc": "

Returns a list with the matches containing the key string in filepath.

\n\n

If no match is found, returns an empty list.

\n\n

To use regular expressions in the search, set regex=True\n(deactivated by default).

\n\n

The value matches specifies the max number of matches to be returned.\nDefaults to 0 to return all possible matches. Set it to 1 to return only one match,\nor to negative integers to start the search from the end of the file upwards.

\n\n

The value additional specifies the number of additional lines\nbelow the target line that are also returned;\n2 to return the found line plus two additional lines below, etc.\nNegative values return the specified number of lines before the target line.\nThe original ordering from the file is preserved.\nDefaults to additional=0, only returning the target line.\nBy default, the additional lines are returned\nin the same list item as the match separated by a \\n,\nunless split=True, in which case these additional lines\nare splitted and added as additional items in the list.

\n", "signature": "(\tfilepath: str,\tkey: str,\tmatches: int = 0,\tadditional: int = 0,\tsplit: bool = False,\tregex: bool = False) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.find.between", "modulename": "aton.txt.find", "qualname": "between", "kind": "function", "doc": "

Returns the content between the lines with key1 and key2 in filepath.

\n\n

Keywords can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

Key lines are omited by default, but can be returned with include_keys=True.

\n\n

If there is more than one match, only the first one is considered by default;\nset match (int) to specify a particular match (1, 2... 0 is considered as 1!).\nUse negative numbers to start from the end of the file.

\n\n

If no match is found, returns an empty string.

\n\n

If key2 is not found, it returns all the text from key1 to the end of the file.

\n", "signature": "(\tfilepath: str,\tkey1: str,\tkey2: str,\tinclude_keys: bool = True,\tmatch: int = 1,\tregex: bool = False) -> str:", "funcdef": "def"}, {"fullname": "aton.txt.find.pos", "modulename": "aton.txt.find", "qualname": "pos", "kind": "function", "doc": "

Returns a list with the positions of the key in filepath.

\n\n

If no match is found, returns an empty list.

\n\n

The filepath can be a file or a memory mapped file.

\n\n

The value matches specifies the max number of matches to return.\nDefaults to 0 to return all possible matches.\nSet it to 1 to return only one match,\n2 to get the first two matches, etc.\nYou can also set it to negative integers to start\nsearching from the end of the file upwards.

\n\n

This method is faster than pos_regex(),\nbut does not search for regular expressions.

\n", "signature": "(filepath, key: str, matches: int = 0) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.find.pos_regex", "modulename": "aton.txt.find", "qualname": "pos_regex", "kind": "function", "doc": "

Returns a list of the positions of a key in a given filepath (actual file, not mmapped!).

\n\n

The value matches specifies the max number of matches to return.\nDefaults to 0 to return all possible matches. Set it to 1 to return only one match,\nor to negative integers to start searching from the end of the file upwards.

\n\n

For big files, this method is slower than pos(), but it can search for regular expressions.

\n", "signature": "(filepath, key: str, matches: int = 0) -> list:", "funcdef": "def"}, {"fullname": "aton.txt.find.next_pos", "modulename": "aton.txt.find", "qualname": "next_pos", "kind": "function", "doc": "

Get the next position of the key in the filepath (file or mmapped file), starting from an initial position tuple.

\n\n

The match number specifies the nonzero index of the next match to return (1, 2... 0 is considered as 1!).\nIt can be negative to search backwards from the initial position.\nThe last known positions will be returned if no more matches are found.

\n\n

This method is specific for normal strings.\nTo use regular expressions, check next_pos_regex().

\n", "signature": "(filepath, position: tuple, key: str, match: int = 1) -> tuple:", "funcdef": "def"}, {"fullname": "aton.txt.find.next_pos_regex", "modulename": "aton.txt.find", "qualname": "next_pos_regex", "kind": "function", "doc": "

Get the next position of the key in the filepath (actual file, not mmapped!), starting from an initial position tuple.

\n\n

The match number specifies the next match to return (1, 2... 0 is considered as 1!).\nIt can be negative to search backwards from the initial position.\nThis method is specific for regular expressions.

\n\n

For normal strings, check the faster next_pos() method.

\n", "signature": "(filepath, position: tuple, key: str, match: int = 0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.txt.find.line_pos", "modulename": "aton.txt.find", "qualname": "line_pos", "kind": "function", "doc": "

Get the position of the full line containing the position tuple in filepath (whether file or memory mapped file).

\n\n

A specific line below can be returned with skips being a natural int,\nor previous lines with negative values.

\n", "signature": "(filepath, position: tuple, skips: int = 0) -> tuple:", "funcdef": "def"}, {"fullname": "aton.txt.find.between_pos", "modulename": "aton.txt.find", "qualname": "between_pos", "kind": "function", "doc": "

Returns the positions of the content between the lines containing key1 and key2 in the filepath.

\n\n

Keywords can be at any position within the line.\nRegular expressions can be used by setting regex=True.

\n\n

Key lines are omited by default, but can be returned with include_keys=True.

\n\n

If there is more than one match, only the first one is considered by default;\nset match number to specify a particular match (1, 2... 0 is considered as 1!).\nUse negative numbers to start from the end of the file.

\n\n

If key2 is not found, it returns the text position from key1 to the end of the file.

\n", "signature": "(\tfilepath,\tkey1: str,\tkey2: str,\tinclude_keys: bool = True,\tmatch: int = 1,\tregex: bool = False) -> tuple:", "funcdef": "def"}]; // mirrored in build-search-index.js (part 1) // Also split on html tags. this is a cheap heuristic, but good enough.