Theovib
A package for molecular vibrations analysis. This initial version contains functions to solve the vibrational problem starting from the Hessian matrix or from a 3D-Hessian construct from Interacting Quantum Atoms energy decomposition scheme. Infrared intensities are obtained from atomic charges and dipoles obtained by AIMAll.
Contents
Installation
To install, just use pip:
$ pip install theovib
Usage
You can perform a vibrational analysis for water using the files in the "example" folder.
Vibrational analysis of the Water molecule
In ./example/h2o you will find all single point calculations needed to generate the 3D-Hessian matrix.
The Cartesian coordinates of the water molecule are:
Atom(Label) | X | Y | Z |
---|---|---|---|
O(1) | 0.000000 | 0.000000 | 0.004316 |
H(2) | 0.000000 | -0.763369 | -0.580667 |
H(3) | 0.000000 | 0.763369 | -0.580667 |
The internal coordinates are defined as:
- bond between atoms 1 and 2;
- bond between atoms 1 and 3;
- angle defined by atoms 1, 2 and 3.
We start writing the input file:
MOLECULE:
h2o
FOLDER:
h2o
DELTA:
0.05
BOND:
1 2
1 3
---
ANGLE:
2 1 3
---
DELTA is the displacement that generated the non-equilibrium geometries.
1. Reading the input file:
Import modules:
from theovib.molecule import *
from theovib.internal import *
from theovib.matrices import *
from theovib.ir import *
from theovib.input import *
Use the Input class:
input_data = Input.read_text('input.txt')
Use the Molecule class and its methods to get and store data:
molecule = Molecule.read_gaussian(input_data.folder + '/EQ.com')
molecule.energy = get_energy_from_wfn(input_data.folder +'/EQ.wfn')
molecule.iqa_energy = get_IQA(input_data.folder +'/EQ_atomicfiles', molecule.atoms)
2. Construct the B matrix:
Initialize and construct the B matrix:
b_matrix = []
for coord in input_data.bond:
b_matrix.append(bond(molecule.positions, coord[0], coord[1]))
for coord in input_data.angle:
b_matrix.append(angle(molecule.positions, coord[0], coord[1], coord[2]))
molecule.b_matrix = np.array(b_matrix)
3. Obtain the Hessian and 3D Hessian matrix:
molecule.hessian, molecule.iqa_hessian, errors = hessian_from_iqa(molecule.atoms, input_data.delta, input_data.folder)
The Hessian and 3D Hessian are numerrically generated using IQA contributions from AIMAll outputs
3. Calculate the normal coordinates and infrared intensities:
molecule.normal_coordinates, molecule.freq, molecule.iqa_freq, molecule.iqa_terms = normal_modes(molecule.atoms, molecule.iqa_hessian)
molecule.int, molecule.c_tensors, molecule.ct_tensors, molecule.dp_tensors = intensities(molecule.atoms, molecule.positions, molecule.normal_coordinates, input_data.folder, input_data.delta)
4. Convert to internal coordinates to obtain the force constants:
molecule.internal_hessian, molecule.iqa_forces = convert_to_internal(molecule.atoms, molecule.b_matrix, molecule.iqa_hessian)
Theory
1. Force constant in internal coordinates:
In order to calculate, and decompose the force constants into its IQA components, one needs first to convert the Cartesian Hessian into the the Wilson's
The process of setting-up the
where
The decomposition of the force constants into the IQA contributions is done using:
Each
2. Infrared intensities:
The infrared intensity,
where
Let
Contributing
Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.
Documentation
https://ljduarte.github.io/theovib/
License
theovib
was created by L. J. Duarte. It is licensed under the terms of the MIT license.
Credits
theovib
was created with cookiecutter
and the py-pkgs-cookiecutter
template.