/posym-normal-modes

Derivative of the PoSym project. The goal is to optimise and keep the core functionality.

Primary LanguagePythonMIT LicenseMIT

PoSym Normal Modes

A point symmetry analysis tool written in python designed for theoretical chemistry. This tool makes use of continuous symmetry ideas to provide a robust implementation to compute the symmetry of different objects. This library is designed to be easily extendable to other objects by subclassing the SymmetryBase class.

Features

  • Use as simple calculator for irreducible representations supporting direct sum and product
  • Continuous symmetry measures (CSM) expressed in the basis or irreducible representation
  • Determine symmetry of:
    • normal modes
  • Autogenerated high precision symmetry tables
  • Compatibility with PyQchem (http://www.github.com/abelcarreras/pyqchem)

Requisites

  • numpy
  • scipy
  • pandas

Use as a simple symmetry calculation

Posym allows to create basic continuous symmetry python objects that can be operated using direct sum (+) and direct product (*).

from posym_normal_modes import PointGroup, SymmetryBase

pg = PointGroup(group='Td')
print(pg)

a1 = SymmetryBase(group='Td', rep='A1')
a2 = SymmetryBase(group='Td', rep='A2')
e = SymmetryBase(group='Td', rep='E')
t1 = SymmetryBase(group='Td', rep='T1')

print('t1 * t1:', t1 * t1)
print('t1 * e:', t1 * e)
print('e * (e + a1):', e * (e + a1))

Determine the symmetry of normal modes

Symmetry objects can be obtained from normal modes using SymmetryModes.

from posym_normal_modes import SymmetryModes

coordinates = [[0.00000, 0.0000000, -0.0808819],
               [-1.43262, 0.0000000, -1.2823700],
               [1.43262, 0.0000000, -1.2823700]]

symbols = ['O', 'H', 'H']

normal_modes = [[[0., 0., -0.075],
                 [-0.381, -0., 0.593],
                 [0.381, -0., 0.593]],  # mode 1

                [[-0., -0., 0.044],
                 [-0.613, -0., -0.35],
                 [0.613, 0., -0.35]],  # mode 2

                [[-0.073, -0., -0.],
                 [0.583, 0., 0.397],
                 [0.583, 0., -0.397]]]  # mode 3

frequencies = [1737.01, 3988.5, 4145.43]

sym_modes_gs = SymmetryModes(group='c2v', coordinates=coordinates, modes=normal_modes, symbols=symbols)
for i in range(len(normal_modes)):
  print('Mode {:2}: {:8.3f} :'.format(i + 1, frequencies[i]), sym_modes_gs.get_state_mode(i))

print('Total symmetry: ', sym_modes_gs)

Determine the symmetry of a molecular geometry

Continuous symmetry measure (CSM) is obtained using measure method.

from posym_normal_modes import SymmetryMoleculeBase

coordinates = [[0.0000000000, 0.0000000000, 0.0000000000],
               [0.5541000000, 0.7996000000, 0.4965000000],
               [0.6833000000, -0.8134000000, -0.2536000000],
               [-0.7782000000, -0.3735000000, 0.6692000000],
               [-0.4593000000, 0.3874000000, -0.9121000000]]

symbols = ['C', 'H', 'H', 'H', 'H']

sym_geom = SymmetryMoleculeBase(group='Td', coordinates=coordinates, symbols=symbols)
print('Symmetry measure Td : ', sym_geom.measure)

sym_geom = SymmetryMoleculeBase(group='C3v', coordinates=coordinates, symbols=symbols)
print('Symmetry measure C3v : ', sym_geom.measure)

sym_geom = SymmetryMoleculeBase(group='C4v', coordinates=coordinates, symbols=symbols)
print('Symmetry measure C4v : ', sym_geom.measure)

Try an interactive example in Google Colab

Contact info

Abel Carreras
abelcarreras83@gmail.com

Donostia International Physics Center (DIPC)
Donostia-San Sebastian (Spain)