pymolsym
Molecular point groups and their irreducible representations as Python objects that you can
calculate with: multiply and add irreps, reduce representations, and follow irreps when the
symmetry is lowered.
pymolsym knows the character table of every point group it supports without storing any: each
group is defined by its generators, and its classes, characters and Mulliken symbols are
derived from them in exact arithmetic.
Home page: https://ohueter.github.io/pymolsym/, with character tables, examples and a
Python console that run in the browser.
Contents: Features · Installation ·
Quick start · Examples · Conventions ·
How it works · Literature · Reference ·
Limitations · Outlook · Development ·
Release · License
Features
- Point groups: C1, Cs, Ci, and Cn, Cnv, Cnh, Dn, Dnh, Dnd and Sn for any n, by name
(
PointGroup('D5h')) or by family (PointGroup('Dnh', n=5)); the cubic and icosahedral
groups 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
characters (2cos72° in D5h) and the complex pairs of Cn, Cnh, Sn, T and Th.
- Algebra of irreps: direct products
x * y, direct sums x + y, powers x ** n, also
with lists of irreps, so that expressions like b2u * e2g * dipole can be written as such.
- Reduction of a representation, given by its characters, into irreps.
- Lowering of symmetry: the irreps of a subgroup that an irrep correlates with,
correlation tables, and all the ways a subgroup can be oriented in a group.
- Symmetry operations as objects: every operation of a group, sorted into classes, as
a 3×3 matrix that can be applied to coordinates, composed and printed (
C6^5(z), σ(xz)).
- No dependencies, Python 3.9 or newer.
Installation
pip install pymolsym
Quick start
A point group is made from its name. Its irreps are its attributes, named by their Mulliken
symbols in lowercase:
>>> from pymolsym import PointGroup
>>> d6h = PointGroup('D6h')
>>> # direct product of two irreps
>>> print(d6h.b2g * d6h.b1u)
a2u
>>> # a product of degenerate irreps is a list of irreps
>>> print(*(d6h.e1g * d6h.e2u))
b1u b2u e1u
>>> # the six p_z orbitals of benzene
>>> print(*d6h.reduce((6, 0, 0, 0, -2, 0, 0, 0, 0, -6, 2, 0)))
b2g e1g a2u e2u
The characters passed to reduce are in the order of the classes of the group (here with the
carbon atoms on the C2′ axes):
>>> print(*d6h.classes)
E 2C6 2C3 C2 3C2′ 3C2″ i 2S6 2S3 σh 3σv 3σd
This order, the orientation of the axes and the Mulliken symbols follow fixed rules, see
Conventions. They differ between textbooks, so check them before you copy
characters from a table. For the theory of point groups and their representations, see for
example Hollas [1].
Examples
Character table
>>> c3v = PointGroup('C3v')
>>> print(*c3v.classes)
E 2C3 3σv
>>> for symbol, irrep in c3v.elements.items():
... print(symbol, *irrep.irrep)
a1 1 1 1
a2 1 1 -1
e 2 -1 0
Products and selection rules
An electric dipole transition between two states can only have a non-zero transition moment
if the direct product of the irreps of the two states and of a component of the dipole moment
contains the totally symmetric irrep, PointGroup.ts.
The electronic ground state of benzene is ¹A1g, its lowest excited singlet state ¹B2u. The
electronic transition between them (the band near 260 nm) is forbidden by symmetry for all
three components of the dipole moment. It becomes allowed vibronically: with one quantum of a
vibration of symmetry e2g excited in the upper state, the vibronic state is B2u × e2g = E1u,
which the (x, y) component of the dipole moment connects to the vibrationless ground state.
>>> # electronic states
>>> ground, excited = d6h.a1g, d6h.b2u
>>> # the components of the dipole moment: z and (x, y)
>>> dipole = [d6h.a2u, d6h.e1u]
>>> d6h.ts in ground * excited * dipole
False
>>> # vibronic state with one quantum of an e2g vibration
>>> print(excited * d6h.e2g)
e1u
>>> d6h.ts in ground * (excited * d6h.e2g) * dipole
True
>>> # for z and for (x, y) separately
>>> [d6h.ts in ground * (excited * d6h.e2g) * component for component in dipole]
[False, True]
Sums, powers and longer expressions:
>>> print(*(d6h.e1g ** 2))
a1g a2g e2g
>>> print(*(d6h.e2u + d6h.e1g * d6h.e2u * d6h.e2u + d6h.a1g))
a1g b1g b2g e1g e1g e1g e2u
Reducing a representation
The three B–F σ bonds of BF3 (D3h) are unchanged by E, by one C2′, by σh and by one σv:
>>> d3h = PointGroup('D3h')
>>> print(*d3h.classes)
E 2C3 3C2′ 2S3 σh 3σv
>>> print(*d3h.reduce((3, 0, 1, 0, 3, 1)))
a1p ep
a1p is A1′ and ep is E′, see Mulliken symbols.
The nine Cartesian displacements of water (C2v, molecule in the yz plane):
>>> c2v = PointGroup('C2v')
>>> print(*c2v.classes)
E C2 σv σd
>>> print(*c2v.reduce((9, -1, 1, 3)))
a1 a1 a1 a2 b1 b1 b2 b2 b2
Lowering the symmetry
x.lower(H) gives the irreps of the subgroup H that the irrep x splits into, and
G.correlation(H) does so for all irreps of G:
>>> oh = PointGroup('Oh')
>>> print(*oh.t2g.lower(PointGroup('D4h')))
b2g eg
>>> for irrep, lowered in oh.correlation(PointGroup('Td')).items():
... print(irrep, '->', *lowered)
a1g -> a1
a2g -> a2
eg -> e
t1g -> t1
t2g -> t2
a1u -> a2
a2u -> a1
eu -> e
t1u -> t2
t2u -> t1
By default both groups are in their standard orientation (see Axes). Other
orientations are given by the directions in G that the z and x axes of H point to,
orientation=(z_to, x_to). This is needed where the standard orientation is no subgroup, or
a different one: for D3d in Oh, whose C3 axis is a body diagonal, or for the C2v whose σv
planes are σd planes of D6h:
>>> d3d = PointGroup('D3d')
>>> d3d.is_subgroup_of(oh)
False
>>> print(*oh.t2g.lower(d3d, orientation=((1, 1, 1), (1, 0, -1))))
a1g eg
>>> print(*d6h.b1u.lower(c2v))
b1
>>> print(*d6h.b1u.lower(c2v, orientation=((0, 0, 1), (0, 1, 0))))
b2
G.orientations(H) finds the orientations: one for each different correlation table, the
standard orientation first if H fits in it. C2v, for example, fits in Oh with its C2 along a
C4 axis and σ(xz) in a σh or a σd plane, or with its C2 along a C2′ axis and σ(xz) in a σh
or a σd plane:
>>> oh.orientations(d3d)
[((1, 1, 1), (1, 0, -1))]
>>> for orientation in oh.orientations(c2v):
... print(*orientation, ':', *oh.eg.lower(c2v, orientation))
(0, 0, 1) (1, 0, 0) : a1 a1
(0, 0, 1) (1, 1, 0) : a1 a2
(1, 0, 1) (0, 1, 0) : a1 b2
(1, 0, 1) (1, 0, -1) : a1 b1
Irreps of different point groups can be combined directly if one group is a subgroup of the
other in standard orientation. They are lowered to the subgroup first:
>>> print(*(d6h.e1u * c2v.a2))
b1 b2
Linear molecules
C∞v and D∞h have an irrep for every k = 1, 2, 3, …: Π, Δ, Φ and so on. They are named e1,
e2, e3, …, and Σ+ and Σ− are a1 and a2, see Linear groups. The
Greek symbols are understood as well:
>>> # the same as PointGroup('Dinfh')
>>> dinfh = PointGroup('D∞h')
>>> # the same irrep as dinfh.pi_u and dinfh.e1u
>>> pi_u = dinfh('Πu')
>>> print(pi_u, pi_u.greek, pi_u.irrep)
e1u Πu (2, '2cos(φ)', 0, -2, '2cos(φ)', 0)
>>> print(*(dinfh('Πg') * pi_u))
a1u a2u e2u
Two electrons in a πg orbital, as in the ground state configuration of O2, give states
with these spatial symmetries:
>>> print(*(irrep.greek for irrep in dinfh.pi_g ** 2))
Σg+ Σg− Δg
When a linear AB2 molecule is bent, its symmetry is lowered to C2v, whose C2 axis is
perpendicular to the axis of the linear molecule. With the bent molecule in the yz plane of
C2v, that axis becomes y:
>>> # z and x of C2v in the frame of D∞h, whose axis is z
>>> bent = ((1, 0, 0), (0, 1, 0))
>>> for symbol in ('Σg+', 'Σu+', 'Πg', 'Πu'):
... print(symbol, '->', *dinfh(symbol).lower(c2v, bent))
Σg+ -> a1
Σu+ -> b2
Πg -> a2 b2
Πu -> a1 b1
Symmetry operations
>>> print(*d6h.generators)
C6(z) C2(x) σ(xy)
>>> # the operations of the class 2S6
>>> print(*d6h.classes[7])
S6(z) S6^5(z)
>>> from pymolsym import SymmetryOperation
>>> c4 = SymmetryOperation.rotation((0, 0, 1), 4)
>>> # applied to a point
>>> c4((1, 0, 0))
(0.0, 1.0, 0.0)
>>> print(SymmetryOperation.reflection((0, 0, 1)) * c4)
S4(z)
Named classes
The most common point groups have a class of their own as a shorthand, like D2h or Td
(see the list). Called with a Mulliken symbol, it gives the irrep directly:
>>> from pymolsym import D2h
>>> D2h() == PointGroup('D2h')
True
>>> print(D2h('b2g') * D2h('b1u'))
b3u
>>> print(repr(D2h('b1g')))
IrreducibleRepresentation(pg=D2h(), irrep=(1, 1, -1, -1, 1, 1, -1, -1))
>>> from pymolsym import Td
>>> print(*Td().elements)
a1 a2 e t1 t2
Conventions
Axes
z is the principal axis. C2′ axes and σv planes contain the x axis; the other C2 axes
perpendicular to z are C2″, the other planes containing z are σd. Cubic groups have their
C2, C4 or S4 axes along x, y and z and a C3 axis along (1, 1, 1); icosahedral groups have C2
axes along x, y and z, C3 along (1, 1, 1) and C5 along (0, 1, φ), φ = (1 + √5)/2.
The groups are generated by C_n(z), plus σ(xz) for Cnv, σh for Cnh, C2(x) for Dn, C2(x) and
σh for Dnh; S_2n(z) and C2(x) for Dnd; C2(z) and C3(1, 1, 1) for T, S4(z) and C3 for Td,
C4(z) and C3 for O, C2(z), C3 and C5(0, 1, φ) for I, and i in addition for Th, Oh and Ih.
Columns
There is one column per class of symmetry operations, as given by
[str(c) for c in pg.classes]. They follow one rule: proper before improper operations;
within each, E (or i) first, then the operations about z by their rotation angle (C6, C3,
C2, C3², C6⁵; S6, S3, S3⁵ = σh C3², S6⁵, and σh = S1, a full turn, last), then those
perpendicular to z, along x first. Examples:
| Group |
Classes |
| C1 |
E |
| C2v |
E, C2, σv, σd |
| D3 |
E, 2C3, 3C2′ |
| D2h |
E, C2, C2′, C2″, i, σh, σv, σd |
| D6h |
E, 2C6, 2C3, C2, 3C2′, 3C2″, i, 2S6, 2S3, σh, 3σv, 3σd |
| D3h |
E, 2C3, 3C2′, 2S3, σh, 3σv |
| D5h |
E, 2C5, 2C5², 5C2′, 2S5, 2S5³, σh, 5σv |
| D4d |
E, 2C4, C2, 4C2′, 2S8, 2S8³, 4σd |
| C6h |
E, C6, C3, C2, C3², C6⁵, i, S6, S3, S3⁵, S6⁵, σh |
| C5h |
E, C5, C5², C5³, C5⁴, S5, S5⁷, S5³, S5⁹, σh |
In C2v and D2h, where every class is a single operation, C2 is C2(z), C2′ is C2(x), C2″ is
C2(y), σh is σ(xy), σv is σ(xz) and σd is σ(yz).
Cubic and icosahedral groups have no principal axis and follow their own rule: proper
before improper operations; within each, E (or i) first, then by decreasing n and increasing
power k of C_n^k and S_n^k (σ = S1), operations about x, y, z first. C2 and σh are about or
perpendicular to x, y and z, C2′ and σd the others:
| Group |
Classes |
| Td |
E, 8C3, 3C2, 6S4, 6σd |
| Oh |
E, 6C4, 8C3, 3C2, 6C2′, i, 8S6, 6S4, 3σh, 6σd |
| Ih |
E, 12C5, 12C5², 20C3, 15C2, i, 12S10, 12S10³, 20S6, 15σh |
Other references order the columns differently: Katzer [2] for example has D3h
as E, 2C3, 3C2′, σh, 2S3, 3σv and D4d as E, 2S8, 2C4, 2S8³, C2, 4C2′, 4σd, others D6h as … i,
2S3, 2S6, σh, 3σd, 3σv. Characters taken from such a table must be reordered before they are
passed to PointGroup.reduce() or IrreducibleRepresentation().
The representative of a class is its operation of lowest power (C5² rather than C5³, S5³
rather than S5⁷), preferring axes and planes along x and y (C2(x) for 3C2′, C2(y) for 3C2″).
It is the first operation of its class.
Characters
Characters are tuples, one number per column: ints where they are integers, else floats or
complex numbers rounded to 12 digits (e.g. 2cos72° = 0.61803398875 in C5v, exp(2πi/3) =
(-0.5+0.866025403784j) in C3). reduce handles such numbers up to a rounding error, using
the complex conjugate of the irreps' characters. Products of irreps and lower do not use
the rounded numbers, see How it works.
Mulliken symbols
Irreps are named by lowercase Mulliken symbols (a1g, e2u, …). The symbols follow
Mulliken's rules [3], decided by the characters under these operations:
- A, B: symmetric or antisymmetric under the principal rotation C_n(z); in groups with
S_2n(z) but not i (S4, D2d, D4d, …) under S_2n. E is two-dimensional.
- D2, D2h: B1, B2, B3 are symmetric under C2(z), C2(y), C2(x).
- Subscripts 1, 2 of A and B: symmetric or antisymmetric under C2(x) (C2′), or if there is
none, under σ(xz) (σv). E_k, if there are several E: the principal rotation (C_n or
S_2n) of order m acts on it as a rotation by 2πk/m.
- Separably degenerate E (in Cn, Cnh, Sn): a pair of complex conjugate one-dimensional
irreps, named by the E symbol with
a or b appended. The principal rotation multiplies
the a irrep by exp(+2πik/m), the b irrep by exp(−2πik/m): ea, eb in C3, e1a,
e1b, e2a, e2b in C5, ega, egb in S6, eppa, eppb in C3h. They are
one-dimensional (dimension == 1), and ea * ea is eb in C3.
- g, u: symmetric or antisymmetric under i; without i, ′ and ″ under σh. Primes are
spelled
p and pp (a1p for A1′, a1pp for A1″), so that every symbol works as an
attribute name (d3h.a1pp). Lookup by call also accepts primes: d3h("a1''"),
d3h('A1″') and d3h('a1pp') are the same irrep.
In the cubic and icosahedral groups, the letters are A, E, T, G and H for dimensions 1
to 5 (E also for the complex pair ea, eb of T and Th). If there are two irreps of the
same letter and g/u, subscript 1 goes to the one with the larger character under the
principal operation P, the proper rotation of highest order (C3, C4 or C5), or S4 in Td:
T1 and T2 in O have χ(C4) = 1 and −1. This gives eg. t1u for x, y, z in Oh and t2 in Td;
in Ih the four- and five-dimensional irreps are gg, gu, hg and hu.
The canonical order of the irreps is the row order of the character table: g before u
(′ before ″), then A, B, E, T, G, H, then by subscript, then a before b. It starts with
the totally symmetric irrep. Every list returned by pymolsym is sorted in this order.
Linear groups
The axis of C∞v and D∞h is z. Their classes are E, 2C(φ), ∞σv, and E, 2C(φ), ∞C2′, i, 2S(φ),
∞σv, where C(φ) and S(φ) stand for the rotations and improper rotations by any angle φ
about z, and C2′ for the C2 axes perpendicular to z.
The irreps are named like those of the finite groups, so that the symbols are attribute
names: a1 is Σ+, a2 is Σ−, symmetric and antisymmetric under σv, and e1, e2, e3, …
are Π, Δ, Φ, …; a rotation by φ about z has the character 2cos(kφ) in ek. In D∞h, g or u follows: a1g is Σg+, e1u
is Πu. Lookup also accepts the Greek letters Σ, Π, Δ, Φ and Γ or their names: 'Σg+',
'Σ+g', 'sigma_g_plus', 'Πu', 'pi_u'. x.greek gives the Greek symbol of an irrep.
Their canonical order is g before u, then Σ+, Σ−, Π, Δ, ….
Symmetry operations
- C_n^k is a rotation by 2πk/n following the right-hand rule (counterclockwise when looking
down the axis towards the origin).
- S_n^k = σ^k C_n^k, with σ the reflection in the plane perpendicular to the axis; S1 = σ
and S2 = i. Improper rotations are written with odd powers:
S3^5, not S3^2, which is
C3^2.
- A product
a * b applies b first: (a * b)(v) == a(b(v)).
- Axes point in the direction whose first non-zero component is positive, so a rotation
by 60° about −z is
C6^5(z).
How it works