vibrav.util.gen_displaced module¶
- class vibrav.util.gen_displaced.DispMeta(name, bases, clsdict)[source]¶
Bases:
TypedMeta
- atom¶
alias of
Atom
- delta¶
alias of
DataFrame
- disp¶
alias of
Atom
- class vibrav.util.gen_displaced.Displace(*args, **kwargs)[source]¶
Bases:
object
Supporting class for Vibrational Averaging that will displace the input atomic coordinates along its normal modes (
gen_displaced()
).Computes displaced coordinates for all available normal modes from the equilibrium position by using the displacement vector components contained in the
Frequency
dataframe. It will scale these displacements to a desired type defined by the user with the delta_type keyword. For more information on this keyword see the documentation on theWe can also define a specific normal mode or a list of normal modes that are of interest and generate displaced coordinates along those specific modes rather than all of the normal modes. This is highly recommended if applicable as it may reduce number of computations and memory usage significantly.
- Parameters:
cls (
Universe
) – Universe object containg pertinent datadelta_type (int) – Integer value to define the type of delta parameter to use
fdx (int or list) – Integer or list parameter to only displace along the selected normal modes
disp (float) – Floating point value to set a specific displacement delta parameter. Must be used with delta_type=3
mwc (bool) – Divide the normal modes by the reduced mass prior to calculating the delta parameter
- property atom¶
- create_data_files(freq, atom, norm, cart_disp, disp, path=None, config=None)[source]¶
Method to create the .dat files that are needed to perform the calculations for vibrational averaging.
This script will auto-generate the configuration file (
'va.conf'
by default) given in the config parameter. It will create it with the following input options,DELTA_FILE: delta.dat
SMATRIX_FILE: smatrix.dat
ATOM_ORDER_FILE: atom_order.dat
REDUCED_MASS_FILE: redmass.dat
FREQUENCY_FILE: freq.dat
EQCOORD_FILE: eqcoord.dat
- Parameters:
cls (
exatomic.Universe
) – Universe object that has the frequency and atom dataframes.path (
str
, optional) – Path to save the files to. Defaults to None.config (
str
, optional) – Path to base config file. Defaults to None.
- property delta¶
- property disp¶
- gen_displaced(freq, atom_df, fdx)[source]¶
Function to generate displaced coordinates for each selected normal mode. We scale the displacements by the selected delta value in the positive and negative directions. We generate an array of coordinates that are put into a dataframe to write them to a file input for later evaluation.
Note
The index 0 is reserved for the optimized coordinates, the equilibrium geometry. The displaced coordinates in the positive direction are given an index from 1 to tnmodes (total number of normal modes). The displaced coordinates in the negative direction are given an index from tnmodes to 2*tnmodes. In an example with 39 normal modes 0 is the equilibrium geometry, 1-39 are the positive displacements and 40-78 are the negative displacements. nmodes are the number of normal modes that are selected. tnmodes are the total number of normal modes for the system.
- Parameters:
freq (
exatomic.atom.Frequency
) – Frequency dataframeatom (
exatomic.atom.Atom
) – Atom dataframefdx (int or list) – Integer or list parameter to only displace along the selected normal modes
- gen_displaced_cartesian(atom_df, delta=0.01, include_zeroth=True, exclude=None)[source]¶
Function to generate displaced coordinates in cartesian space. Will generate a total of 3N displacements with N being the number of atoms. If you desire the functionality to displace along the calculated normal modes please see
vibrav.util.gen_displaced.Displace.gen_displaced()
. We use the convention where nat*3 + j + nat*3*sign
- vibrav.util.gen_displaced.gen_delta(freq, delta_type, disp=None, norm=None)[source]¶
Function to compute the delta parameter to be used for the maximum distortion of the molecule along the normal mode.
When
delta_type = 0
we normalize all atomic displacements along all normal modes to have a global average displacement given by thenorm
parameter.When
delta_type = 1
we normalize the displacments to have a maximum given by thenorm
parameter on each normal mode.When
delta_type = 2
we normalize each displacement so the maximum displacement vector of any atom in the normal mode is set to thenorm
parameter.When
delta_type = 3
the user can select a constant delta parameter to use with the disp keyword this will displace all normal modes by that delta parameter.- Parameters:
freq (
exatomic.atom.Frequency
) – Frequency dataframe.delta_type (
int
) – Integer value to define the type of delta parameter to use.disp (
float
, optional) – Constant displacement parameter to use with delta_type=3. Defaults toNone
norm (
float
, optional) – Normalization parameter to use. Defaults to 0.04 au.
- Returns:
delta (
pandas.DataFrame
) – Delta parameters to multiply into each normal mode.- Raises:
ValueError – When
delta_type=3
anddisp=None
.
Examples: