pymolsym

Loading demonstrations…

Molecular point groups and their irreducible representations for Python.

Overview

pymolsym is a Python package for molecular symmetry. It represents point groups and their irreducible representations as objects that support direct products and direct sums, the reduction of representations, and the correlation of irreducible representations when the symmetry is lowered.

Character tables are not stored. Each point group is defined by its generators; its classes, characters and Mulliken symbols are derived from them in exact arithmetic.

Features

  • Point groups: C1, Cs, Ci; Cn, Cnv, Cnh, Dn, Dnh, Dnd and Sn for any n; T, Td, Th, O, Oh, I and Ih; the linear groups C∞v and D∞h.
  • Character tables with classes, characters and Mulliken symbols, including irrational and complex characters.
  • Algebra of irreps: direct products, direct sums and powers, written as e1g * e2u.
  • Reduction of a representation into irreps.
  • Lowering of symmetry: correlation tables for all orientations of a subgroup in a group.
  • Symmetry operations as objects that can be applied to coordinates, composed and printed.

Example

>>> from pymolsym import PointGroup
>>> d6h = PointGroup('D6h')

>>> # direct product of two irreps
>>> print(*(d6h.e1g * d6h.e2u))
b1u b2u e1u

>>> # the six p_z orbitals of benzene
>>> p_z = (6, 0, 0, 0, -2, 0, 0, 0, 0, -6, 2, 0)
>>> print(*d6h.reduce(p_z))
b2g e1g a2u e2u

>>> # an octahedral complex distorted to D4h
>>> oh = PointGroup('Oh')
>>> print(*oh.t2g.lower(PointGroup('D4h')))
b2g eg

Installation

pymolsym requires Python 3.9 or newer and has no dependencies. It is installed from PyPI:

pip install pymolsym

The README contains examples, the conventions for axes, classes and symbols, and a reference of all classes. pymolsym is distributed under the MIT license. Questions and bug reports can be filed as issues.

Interactive demonstrations

The other tabs of this page run pymolsym itself. Python is loaded into the browser with Pyodide, so all results are computed locally; nothing is installed and no data is sent to a server.