vibrav.numerical.redmass module¶
- vibrav.numerical.redmass.rmass_cart(data, symbol)[source]¶
Calculate the reduced masses from the normalized non-mass-weighted cartesian normal modes. With the equation,
\[\mu_i = \left(\sum_k^{3N} l_{CARTk,i}^2\right)^{-1}\]Note
This assumes that the normal modes have already been placed in the
['dx', 'dy', 'dz']
columns.- Parameters:
data (
pandas.DataFrame
) – Data frame the has the non-mass-weighted cartesian normal modes.symbol (
list
) – List-like object that has the atomic symbols.
- Returns:
r_mass (
numpy.ndarray
) –- Array containing the calculated reduced
masses in Dalton or atomic mass units not atomic units of mass.
Examples
Usage of this method is as follows,
>>> import pandas as pd >>> from vibrav.base import resource >>> res_file = 'adf-ubr-1minus-b3lyp-numeric-norm-modes-cart.csv.xz' >>> freqs = pd.read_csv(resource(res_file), compression='xz') >>> symbols = ['U'] + ['Br']*6 >>> freqs.groupby('freqdx').apply(rmass_cart, symbols) freqdx 0 78.918337 1 78.918337 2 78.918337 3 78.918337 4 78.918337 5 78.918337 6 93.006642 7 93.006642 8 93.006642 9 78.918337 10 78.918337 11 78.918337 12 111.682085 13 111.682085 14 111.682085 dtype: float64
It is also possible to use the method without the groupby/apply methods from a pandas data frame. However, the pandas data frame that is passed into the function must have the
['dx', 'dy', 'dz']
columns present. In addition thesymbols
parameter must have all of the atomic symbols that exists, including ones that are repeated.
- vibrav.numerical.redmass.rmass_mwc(data, symbol)[source]¶
Calculate the reduced masses from the mass-weighted normal modes. With the equation,
\[\mu_i = \left(\sum_k^{3N} \left(\frac{l_{MWCk,i}} {\sqrt{m_k}}\right)^2\right)^{-1}\]Note
This assumes that the normal modes have already been placed in the
['dx', 'dy', 'dz']
columns.- Parameters:
data (
pandas.DataFrame
) – Data frame the has the mass-weighted normal modes.symbol (
list
) – List-like object that has the atomic symbols.
- Returns:
r_mass (
numpy.ndarray
) –- Array containing the calculated reduced
masses in Dalton or atomic mass units not atomic units of mass.
Examples
Usage of this method is as follows,
>>> import pandas as pd >>> from vibrav.base import resource >>> res_file = 'adf-ubr-1minus-b3lyp-numeric-norm-modes-mwc.csv.xz' >>> freqs = pd.read_csv(resource(res_file), compression='xz') >>> symbols = ['U'] + ['Br']*6 >>> freqs.groupby('freqdx').apply(rmass_mwc, symbols) freqdx 0 78.918337 1 78.918337 2 78.918337 3 78.918337 4 78.918337 5 78.918337 6 93.006642 7 93.006642 8 93.006642 9 78.918337 10 78.918337 11 78.918337 12 111.682084 13 111.682084 14 111.682084 dtype: float64
It is also possible to use the method without the groupby/apply methods from a pandas data frame. However, the pandas data frame that is passed into the function must have the
['dx', 'dy', 'dz']
columns present. In addition thesymbols
parameter must have all of the atomic symbols that exists, including ones that are repeated.