Skip to content

libmolsymm

Point-group detection, character tables, subgroups, symmetrization, asymmetric-unit reconstruction, constructive Wyckoff assembly from a group label and site plan, and symmetry-reduced finite-difference displacements. C++20 core with C, Python, and Fortran bindings.

API reference: Python, C++, C, Fortran. Quickstarts live in the README.

Install

pip install libmolsymm

From source (CMake):

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
  -DMOLSYMM_BUILD_PYTHON=ON -DMOLSYMM_BUILD_FORTRAN=ON
cmake --build build -j && ctest --test-dir build --output-on-failure

The PyPI package is libmolsymm; the Python import name is molsymm. The CMake / pkg-config package name is molsymm.

Conventions

Topic Rule
Coordinates Ångströms
Z-matrix angles Radians
Z-matrix indices 1-based; 0 means unused
Fortran atom indices 1-based (representatives, copies, pieces)
Python positions Prefer (n, 3); (3, n) is also accepted
C xyz Flat length 3*n (x0,y0,z0,…)
Fortran xyz Shape (3, n)
Primary tolerance Default 1e-3 Å (geometry / equivalence)
Character tables Real Mulliken form; cyclic/Sn/Cnh (folded base) and T/Th fold complex-conjugate E pairs into one 2D row, so Σ dim² ≠ group order there

Analysis places the molecule in a Cotton / principal-axis frame with the center of mass at the origin. Displacement and reconstruct outputs are returned in the original input frame.

Errors

Binding Behavior
C++ / Python Throws molsymm::Error / a Python exception
C Status 0 is success; message via molsymm_last_error()
Fortran Check status; message via ms_last_error()