.. include:: /_substitutions.rst

.. _internal-coordinates-page:

Internal coordinates
====================

Internal coordinates provide a chemically intuitive description of
atomic motion in terms of bond stretches, angle bends, and related
geometric deformations. In |LModeAk|, internal coordinates form the
foundation for the construction and analysis of local vibrational
modes.

Internal coordinates supported in |LModeAk|
-------------------------------------------

|LModeAk| computes analytical derivatives for the following types of internal coordinates. Each internal coordinate type is described in detail below. In addition, |LModeAk| enables LMA and CNM to be performed using arbitrary custom internal coordinate types via the API, provided that their derivatives are supplied by the user.

.. list-table:: Conventional internal coordinates supported by |LModeAk|
   :widths: 20 60 5 15
   :header-rows: 1

   * - Type of internal coordinate
     - Description
     - CLI symbol
     - Input keyword
   * - :ref:`Bond <bond_ics>`
     - Distance between two bonded atoms.
     - ``b``
     - ``bond``
   * - :ref:`Hydrogen bond <hbond_ics>`
     - Distance between a H atom and an O, N or F atom.
     - ``h``
     - ``hbond``
   * - :ref:`Angle <angle_ics>`
     - Angle formed by three bonded atoms.
     - ``a``
     - ``angle``
   * - :ref:`Dihedral <dihedral_ics>`
     - Dihedral angle formed by four consecutively bonded atoms.
     - ``d``
     - ``dihedral``
   * - :ref:`Ring pucker <ring_ics>`
     - Ring puckering coordinates as defined by Cremer and Pople. [1]_
     - ``p``
     - ``pucker``
   * - :ref:`Intermolecular interaction <inter_ics>`
     - Rigid-body displacements of groups/molecules along a defined axis.
     - N/A
     - ``inter``

.. list-table:: Rigid-body coordinates for periodic systems in |LModeAk|
   :widths: 20 60 5 15
   :header-rows: 1

   * - Type of internal coordinate
     - Description
     - CLI symbol
     - Input keyword
   * - :ref:`Rigid-body group translation <rbtrans_ics>`
     - Translation of all atoms in a group/molecule along x, y or z.
     - ``m``
     - ``translate``
   * - :ref:`Rigid-body group rotation <rbrot_ics>`
     - Rotation of all atoms in a group/molecule around x, y or z.
     - ``q``
     - ``rotate``
   * - :ref:`System translation <systrans_ics>`
     - Translation of all atoms along x, y or z.
     - ``t``
     - ``translate``
   * - :ref:`System rotation <sysrot_ics>` (for 1D systems)
     - Rotation of all atoms around the periodic axis (user-specified as x, y or z).
     - ``r``
     - ``rotate``

.. list-table:: Special basis-completing coordinates in |LModeAk|
   :widths: 20 60 5 15
   :header-rows: 1

   * - Type of special coordinate
     - Description
     - CLI symbol
     - Input keyword
   * - :ref:`Orthogonal complement <complement_ics>`
     - Automatically-generated set of vectors spanning the orthogonal complement of the row space of a rank-deficient B matrix.
     - ``o``
     - ``complement``


.. _conventional_coordinates:

Conventional internal coordinates
---------------------------------


.. _bond_ics:

Bond internal coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^

Bond internal coordinates correspond to distances between two atoms :math:`i` and :math:`j`,

.. math::

  d = |\mathbf{r}_{ij}|

The associated local vibrational modes describe localised bond stretching motions along the interatomic axis. Bond internal coordinate derivatives with respect to the Cartesian positions of the two atoms are:

.. math::

  \frac{\partial d}{\partial \mathbf{r}_i} = \frac{\mathbf{r}_{ij}}{|\mathbf{r}_{ij}|} \quad,\quad \frac{\partial d}{\partial \mathbf{r}_j} = -\frac{\partial d}{\partial \mathbf{r}_i}
        
In the automatic internal coordinate search, bonds are identified using element-specific cutoff distances when the ``b`` type is specified. In the coordinate specification file, arbitrary bond internal coordinates can be requested as::

  bond 1 4         # bond between atoms 1 and 4
  bond 3[0 0 1] 8  # bond between atoms 3 and 8; atom 3 crosses
                   # the unit cell boundary in the z-direction

.. _hbond_ics:

Hydrogen bond internal coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Hydrogen bond internal coordinates are treated equivalently to typical :ref:`bond <bond_ics>` internal coordinates. In the automatic internal coordinate search, hydrogen bonds are identified as distances between a H atom and an O, N or F atom within the range 1.20--2.10 |ang| when the ``h`` type is specified. In the coordinate specification file, hydrogen bond internal coordinates can be requested as::

  hbond 9 2           # hydrogen bond between atoms 2 and 9
  hbond 4 11[0 -1 0]  # hydrogen bond between atoms 4 and 11; atom 11 crosses
                      # the unit cell boundary in the -y-direction


.. _angle_ics:

Angle internal coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^

Angle internal coordinates correspond to angles formed between three atoms :math:`i`, :math:`j` and :math:`k`,

.. math::

  \alpha=\arccos \frac{\mathbf{r}_{i j} \cdot \mathbf{r}_{k j}}{\left|\mathbf{r}_{i j} \| \mathbf{r}_{k j}\right|}

The associated local vibrational modes describe localised angle bending motions in the :math:`(i,j,k)` plane. Angle internal coordinate derivatives with respect to the Cartesian positions of the atoms are:

.. math::

  \begin{aligned}
  \frac{\partial \alpha}{\partial \mathbf{r}_i} & =\frac{\partial \alpha}{\partial \cos \alpha} \frac{\partial \cos \alpha}{\partial \mathbf{r}_i}=\frac{1}{\sqrt{1-\cos ^2 \alpha}} \frac{1}{r_{i j}}\left(\frac{\mathbf{r}_{i j}}{r_{i j}} \cos \alpha-\frac{\mathbf{r}_{k j}}{r_{k j}}\right) \\
  \frac{\partial \alpha}{\partial \mathbf{r}_k} & =\frac{\partial \alpha}{\partial \cos \alpha} \frac{\partial \cos \alpha}{\partial \mathbf{r}_k}=\frac{1}{\sqrt{1-\cos ^2 \alpha}} \frac{1}{r_{k j}}\left(\frac{\mathbf{r}_{k j}}{r_{k j}} \cos \alpha-\frac{\mathbf{r}_{i j}}{r_{i j}}\right) \\
  \frac{\partial \alpha}{\partial \mathbf{r}_j} & =-\frac{\partial \alpha}{\partial \mathbf{r}_i}-\frac{\partial \alpha}{\partial \mathbf{r}_k}
  \end{aligned}

The B matrix rows corresponding to angle internal coordinates have units of length\ :sup:`--1`, and hence the raw force constants, :math:`k^a_n`, have units of energy. Normalising by the product of the lengths of the two bonds forming the angle, produces an effective force constant, :math:`k^{\mathrm{eff}}`, in units of energy length\ :sup:`--2`, making it comparable to conventional internal coordinate force constants.

.. math::
  k^{\mathrm{eff}} = \frac{k^a}{|\mathbf{r}_{i j}||\mathbf{r}_{k j}|}

In the automatic internal coordinate search, angles are identified as pairs of bonded atoms sharing a
common central atom when the ``a`` type is specified. Zero-valued angles are discarded due to undefined derivatives. In the coordinate specification file, arbitrary angle internal coordinates can be requested as::

  angle 4 6 9            # angle between atoms 4-6-9
  angle 12[1 0 0] 14 17  # angle between atoms 12-14-17; atom 12 crosses
                         # the unit cell boundary in the x-direction


.. _dihedral_ics:

Dihedral internal coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Dihedral internal coordinates correspond to torsional angles defined by four consecutively bonded atoms :math:`i`, :math:`j`, :math:`k` and :math:`l`. The dihedral angle describes the relative orientation of the planes formed by the atoms :math:`(i,j,k)` and :math:`(j,k,l)`,

.. math::

  \chi=\operatorname{sign}(\chi) \arccos \frac{\left(\mathbf{r}_{i j} \times \mathbf{r}_{k j}\right) \cdot\left(\mathbf{r}_{k j} \times \mathbf{r}_{k l}\right)}{\left|\mathbf{r}_{i j} \times \mathbf{r}_{k j} \| \mathbf{r}_{k j} \times \mathbf{r}_{k l}\right|}

where

.. math::

  \operatorname{sign}(\chi)=\operatorname{sign}\left[\mathbf{r}_{k j} \cdot\left(\mathbf{r}_{i j} \times \mathbf{r}_{k j}\right) \times\left(\mathbf{r}_{k j} \times \mathbf{r}_{k l}\right)\right]

The associated local vibrational modes describe localised torsional motions about the central bond between atoms :math:`j` and :math:`k`. Dihedral internal coordinate derivatives with respect to the Cartesian positions of the atoms are: [2]_

.. math::

  \begin{aligned}
  \mathbf{r}_{m j} &= \mathbf{r}_{i j} \times \mathbf{r}_{k j} \quad,\quad \mathbf{r}_{n k} = \mathbf{r}_{k j} \times \mathbf{r}_{k l} \\
  \frac{\partial \chi}{\partial \mathbf{r}_i} &=\frac{r_{k j}}{r_{m j}^2} \mathbf{r}_{m j} \\
  \frac{\partial \chi}{\partial \mathbf{r}_l} &=-\frac{r_{k j}}{r_{n k}^2} \mathbf{r}_{n k} \\
  \frac{\partial \chi}{\partial \mathbf{r}_j} &=\left(\frac{\mathbf{r}_{i j} \cdot \mathbf{r}_{k j}}{r_{k j}^2}-1\right) \frac{\partial \chi}{\partial \mathbf{r}_i}-\frac{\mathbf{r}_{k l} \cdot \mathbf{r}_{k j}}{r_{k j}^2} \frac{\partial \chi}{\partial \mathbf{r}_l} \\
  \frac{\partial \chi}{\partial \mathbf{r}_k} &=\left(\frac{\mathbf{r}_{k l} \cdot \mathbf{r}_{k j}}{r_{k j}^2}-1\right) \frac{\partial \chi}{\partial \mathbf{r}_l}-\frac{\mathbf{r}_{i j} \cdot \mathbf{r}_{k j}}{r_{k j}^2} \frac{\partial \chi}{\partial \mathbf{r}_i}
  \end{aligned}

The B matrix rows corresponding to dihedral internal coordinates have units of length\ :sup:`--1`, and hence the raw force constants, :math:`k^a_n`, have units of energy. Normalising by the by the product of the perpendicular distances of atoms :math:`i` and :math:`l` from the central bond axis :math:`j\!-\!k`, denoted :math:`h_1` and :math:`h_2`, produces an effective force constant, :math:`k^{\mathrm{eff}}`, in units of energy length\ :sup:`--2`, making it comparable to conventional internal coordinate force constants.

.. math::

  h_1 = \frac{|\mathbf{r}_{ij} \times \mathbf{r}_{kj}|}{|\mathbf{r}_{kj}|}
  \quad,\quad
  h_2 = \frac{|\mathbf{r}_{kj} \times \mathbf{r}_{kl}|}{|\mathbf{r}_{kj}|}
  \quad,\quad
  k^{\mathrm{eff}} = \frac{k^a}{h_1 h_2}

In the automatic internal coordinate search, dihedrals are identified as sequences of four bonded atoms forming a connected chain when the ``d`` type is specified. Colinear chains of atoms and zero-valued dihedrals are discarded due to undefined derivatives. In the coordinate specification file, arbitrary dihedral internal coordinates can be requested as::

  dihedral 3 5 7 9  # dihedral angle between the 3,5,7 and 5,7,9 planes



.. _ring_ics:

Ring puckering coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^

Ring puckering internal coordinates describe the out-of-plane deformation of cyclic structures. In |LModeAk|, these coordinates follow the formalism of Cremer and Pople. Only a brief summary is
given here; the full theoretical background can be found in Ref. [1]_.

For a ring consisting of :math:`N` atoms, the number of puckering coordinates is :math:`N-3`. The atomic positions are first expressed relative to the ring centroid and projected onto the mean ring plane. The displacements of each atom perpendicular to this plane are used to construct the puckering amplitudes,

.. math::

  z_j = \mathbf{r}_j \cdot \mathbf{n}

where :math:`\mathbf{r}_j` is the position of atom :math:`j` relative to the ring centroid and :math:`\mathbf{n}` is the vector normal to the ring.

The puckering coordinates are constructed from linear combinations of these out-of-plane displacements. For a given mode index :math:`m = 2, 3, ... (N-1)/2`, the coordinates are

.. math::

  q_m^{(\cos)} = \sqrt{\frac{2}{N}} \sum_{j=0}^{N-1} z_j \cos\left(\frac{2\pi m j}{N}\right) \quad,\quad q_m^{(\sin)} = -\sqrt{\frac{2}{N}} \sum_{j=0}^{N-1} z_j \sin\left(\frac{2\pi m j}{N}\right)

For rings with an even number of atoms, the highest index :math:`m = N/2` has only a single coordinate

.. math::

  q_{N/2} = \frac{1}{\sqrt{N}} \sum_{j=0}^{N-1} z_j (-1)^j

The derivatives with respect to the Cartesian coordinates of the atoms follow directly from the definition of :math:`z_j`. For atom :math:`j`, the derivative of the perpendicular displacement is

.. math::

  \frac{\partial z_j}{\partial \mathbf{r}_j} = \mathbf{n}

Thus the derivatives of the puckering coordinates used to construct the
:math:`B` matrix are

.. math::

  \frac{\partial q_m^{(\cos)}}{\partial \mathbf{r}_j} = \sqrt{\frac{2}{N}} \cos\left(\frac{2\pi m j}{N}\right) \mathbf{n} \quad,\quad \frac{\partial q_m^{(\sin)}}{\partial \mathbf{r}_j} = -\sqrt{\frac{2}{N}} \sin\left(\frac{2\pi m j}{N}\right) \mathbf{n}

and for the special even-ring coordinate

.. math::

  \frac{\partial q_{N/2}}{\partial \mathbf{r}_j}
  = \frac{(-1)^j}{\sqrt{N}} \mathbf{n}

The associated local vibrational modes describe collective out-of-plane motions of atoms in a cyclic structure. 

In the automatic internal coordinate search, rings are identified using a graph-based ring detection algorithm applied to the molecular connectivity when the ``p`` type is specified. The maximum ring size in the automatic search is :math:`N=12`. In the coordinate specification file, ring puckering coordinates can be requested for arbitrary rings as::
  
  group ring1 3 4 5 6 7[1 0 0] 8  # definition of a ring 3-4-5-6-7-8-3, named 'ring1';   
                                  # atom 7 crosses the unit cell boundary in the x-direction
  pucker ring1  # command to include Cremer-Pople coordinates for ring1
  
When puckering coordinates are requested, |LModeAk| generates the full Cremer-Pople orthogonal basis for each ring. These coordinates form a complete basis describing the independent out-of-plane deformations of the ring.

.. _inter_ics:

Intermolecular interaction coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Intermolecular interaction coordinates correspond to the relative displacement of two groups of atoms projected along a specified axis. By default, the axis is defined by the line connecting the centroids of the two groups, but an alternative axis can be defined by specifying an arbitrary interatomic axis. For groups :math:`A` and :math:`B`, containing :math:`N_A` and :math:`N_B` atoms respectively, the centroids are defined as the arithmetic mean of the atomic positions,

.. math::

  \mathbf{R}_A = \frac{1}{N_A}\sum_{i \in A} \mathbf{r}_i
  \quad,\quad
  \mathbf{R}_B = \frac{1}{N_B}\sum_{j \in B} \mathbf{r}_j

The coordinate value is the projection of the centroid-centroid vector onto the defined axis:

.. math::

  q = \hat{\mathbf{e}} \cdot (\mathbf{R}_A - \mathbf{R}_B)

where :math:`\hat{\mathbf{e}}` is the unit vector along the selected axis.

The associated local vibrational modes describe collective motions in which the two groups move relative to one another along the specified axis.

The derivatives of the coordinate with respect to the Cartesian positions of the atoms are distributed uniformly among the atoms of each group:

.. math::

  \frac{\partial q}{\partial \mathbf{r}_i} = \frac{1}{N_A}\hat{\mathbf{e}} \qquad (i \in A)

.. math::

  \frac{\partial q}{\partial \mathbf{r}_j} = -\frac{1}{N_B}\hat{\mathbf{e}} \qquad (j \in B)

In the coordinate specification file, intermolecular interaction coordinates are defined by specifying the two atom groups whose centroids should be used, and requesting a centroid-centroid coordinate::
  
  group frag1 3 4 5 6 7      # definition of a fragment including atoms 3-7, named 'frag1'
  group frag2 12 13 14 15    # definition of a fragment including atoms 12-15, named 'frag2'

  inter frag1 frag2          # default: projection along centroid-centroid axis
  inter frag1 frag2 4 12     # projection along axis connecting atom 4 (frag1) to atom 12 (frag2)

.. _rigid_body_coordinates:

Rigid-body coordinates
----------------------

Rigid-body coordinates describe collective translations and rotations of groups of atoms, or all atoms in the primitive cell. Unlike conventional internal coordinates (distances, angles, or dihedrals), these motions cannot be expressed as analytic scalar functions of the Cartesian coordinates. Instead, they correspond to rigid-body kinematic operations acting on a set of atoms.

For rigid-body motions, where no analytic function :math:`q = f(\mathbf{r})` exists, the most natural description is the Cartesian displacement field generated by an infinitesimal rigid transformation. For a coordinate :math:`q`, this field is

.. math::
  \frac{\partial \mathbf{r}_i}{\partial q}

which directly specifies the Cartesian displacement pattern associated with an infinitesimal change in the coordinate.

In |LModeAk|, the rows of the B matrix for rigid-body coordinates are constructed from these displacement fields. Although the Wilson B matrix is formally defined as :math:`\partial q / \partial \mathbf{r}_i`, the overall scale of an internal coordinate is arbitrary, and local mode properties depend only on the Cartesian displacement direction associated with each coordinate. Using :math:`\partial \mathbf{r}_i / \partial q` therefore provides the physically meaningful displacement pattern for analysing rigid-body motion within the LMA and CNM frameworks.

In the automatic internal coordinate search, atom groups corresponding to discrete molecular fragments satisfying a specific chemical formula can be searched for using the ``--mol`` command-line option.

.. _rbtrans_ics:

Rigid-body translation coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Rigid-body translation coordinates describe collective displacements of a group of atoms along a fixed Cartesian axis. For a translational coordinate :math:`q`, the displacement field is

.. math::
  \frac{\partial \mathbf{r}_i}{\partial q} = \hat{\mathbf{e}}

where :math:`\hat{\mathbf{e}}` is a unit vector pointing along the translation axis. The associated local vibrational modes describe the rigid-body translations of the atom groups along the specified Cartesian axes (:math:`x`, :math:`y` or :math:`z`).

Since the B matrix rows are dimensionless, :math:`k^a_n` have the correct units of energy length\ :sup:`--2`, and they are directly comparable to conventional internal coordinate force constants.

In the automatic internal coordinate search, rigid-body translation coordinates along all Cartesian axes for all identified molecular fragments are included when the ``m`` type is specified. In the coordinate specification file, rigid-body translations for arbitrary groups of atoms along specified Cartesian axes can be requested as::

  group mol1 2 5[1 1 0] 8 4 6  # definition of a group incl. atoms 2,4,5,6,8, named 'mol1';
                               # atom 5 crosses the unit cell boundary in the xy-direction
  group mol2 12 9 3 10 7       # definition of a group incl. atoms 3,7,9,10,12, named 'mol1'

  translate mol1      # command to include rigid-body translation coordinates for mol1
                      # along all Cartesian axes (defaults to separate x, y, z coordinates)
  translate mol2 x    # one explicit axis per line
  translate mol2 y
                      # together these include rigid-body translation coordinates for mol2
                      # along the x- and y-axes only


.. _rbrot_ics:

Rigid-body rotation coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Rigid-body rotation coordinates describe collective rotations of a group of atoms about a fixed Cartesian axis. For a rotation about a unit axis vector :math:`\hat{\mathbf{a}}`, an infinitesimal angular displacement :math:`\partial q` produces the Cartesian displacement

.. math::
  \partial \mathbf{r}_i = \partial q \; (\hat{\mathbf{a}} \times \mathbf{R}_i)

The atomic displacement field associated with a rigid-body rotational coordinate :math:`q` is described by 

.. math::
  \frac{\partial \mathbf{r}_i}{\partial q} = \hat{\mathbf{a}} \times \mathbf{R}_i

where :math:`\mathbf{R}_i` is the position of atom :math:`i` relative to the centre of mass of the group. The associated local vibrational modes describe the rigid-body rotations of the atom groups around the specified Cartesian axes (:math:`x`, :math:`y` or :math:`z`).

The B matrix rows corresponding to rigid-body rotational coordinates have units of length, and hence the raw force constants, :math:`k^a_n`, have units of energy length\ :sup:`--4`. Normalising by the squared norm of the B matrix row produces an effective force constant, :math:`k^{\mathrm{eff}}`, in units of energy length\ :sup:`--2`, making it comparable to conventional internal coordinate force constants.

.. math::
  k^{\mathrm{eff}} = \frac{k^a}{\sum_i |\frac{\partial \mathbf{r}_i}{\partial q}|^2}

In the automatic internal coordinate search, rigid-body rotation coordinates along all Cartesian axes for all identified molecular fragments are included when the ``q`` type is specified. In the coordinate specification file, rigid-body rotations of arbitrary groups of atoms along specified Cartesian axes can be requested as::

  group mol1 2 5[1 1 0] 8 4 6  # definition of a group incl. atoms 2,4,5,6,8, named 'mol1';
                               # atom 5 crosses the unit cell boundary in the xy-direction
  group mol2 12 9 3 10 7       # definition of a group incl. atoms 3,7,9,10,12, named 'mol1'

  rotate mol1      # command to include rigid-body translation coordinates for mol1
                   # about all Cartesian axes (defaults to separate x, y, z coordinates)
  rotate mol2 x    # one explicit axis per line
  rotate mol2 z
                   # about the x- and z-axes only

.. _systrans_ics:

System translation coordinates
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

System translation coordinates describe collective displacements of all atoms in the primitive cell along a fixed Cartesian axis. For a translational coordinate :math:`q`, the displacement field is

.. math::
  \frac{\partial \mathbf{r}_i}{\partial q} = \hat{\mathbf{e}}

where :math:`\hat{\mathbf{e}}` is a unit vector pointing along the translation axis. The associated local vibrational modes describe the rigid-body translations of the system along the specified Cartesian axes (:math:`x`, :math:`y` or :math:`z`).

Since the displacement field is dimensionless, :math:`k^a_n` have the correct units of energy length\ :sup:`--2`, and they are directly comparable to conventional internal coordinate force constants.

In the automatic internal coordinate search, system translation coordinates along all Cartesian axes are included when the ``t`` type is specified. In the coordinate specification file, system translations along specified Cartesian axes can be requested as::

  translate system x        # one explicit axis per line
  translate system y
                            # specify x and y on separate lines; no axes specification defaults to separate x, y, z coordinates

.. _sysrot_ics:

System rotation coordinate (1D systems only)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In one-dimensional systems, one rigid-body rotation coordinate can be defined to describe the rotation of the system about its periodic axis (:math:`x`, :math:`y` or :math:`z`). To avoid spurious translations, the centre of mass of the system along the non-periodic directions is subtracted before computing the rotation. The atomic displacement fields associated with the rotation coordinate :math:`q` about the periodic axis are then

.. math::
  \frac{\partial \mathbf{r}_i}{\partial q_x} = (0, -z'_i,  y'_i) \quad,\quad
  \frac{\partial \mathbf{r}_i}{\partial q_y} = (z'_i,  0, -x'_i) \quad,\quad
  \frac{\partial \mathbf{r}_i}{\partial q_z} = (-y'_i, x'_i,  0)

where :math:`x'_i, y'_i, z'_i` are the Cartesian coordinates relative to the centre of mass along the non-periodic directions. The associated local vibrational modes describe the rigid-body rotation of the system around the specified Cartesian axis.

The B matrix rows corresponding to rigid-body rotational coordinates have units of length, and hence the raw force constants, :math:`k^a_n`, have units of energy length\ :sup:`--4`. Normalising by the squared norm of the B matrix row produces an effective force constant, :math:`k^{\mathrm{eff}}`, in units of energy length\ :sup:`--2`, making it comparable to conventional internal coordinate force constants.

.. math::
  k^{\mathrm{eff}} = \frac{k^a}{\sum_i |\frac{\partial \mathbf{r}_i}{\partial q}|^2}

In the automatic internal coordinate search, system rotation along one Cartesian axis specified using the ``rot-axis`` command-line option is included when the ``r`` type is specified. In the coordinate specification file, one system rotation along specified Cartesian axis can be requested as::

  rotate system z      # command to include system rotation coordinate about the z-axis


Special basis-completing coordinates
------------------------------------

.. _complement_ics:

Orthogonal complement of the internal coordinate space
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If the reduced set of internal coordinates does not span the $3N$ degrees of freedom of the vibrational space (the resulting B matrix has rank < 3N\ :sub:`atoms`), the set can be complemented by including vectors spanning the orthogonal complement of the row space of :math:`\mathbf{B}`. These can be obtained by computing a full QR decomposition of :math:`\mathbf{B}^T`, such that :math:`\mathbf{Q} = [\mathbf{Q}_\parallel \;|\; \mathbf{Q}_\perp]`, where :math:`\mathbf{Q}_\perp \in \mathbb{R}^{3N \times (3N - \mathrm{rank})}` spans the desired complement, giving :math:`\mathbf{B}^\mathrm{full}_\mathrm{rank} = [\mathbf{B} \;|\; \mathbf{Q}_\perp]`. The complementing vectors in :math:`\mathbf{Q}_\perp` may not correspond to localized or chemically interpretable internal coordinates, but they ensure that no vibrational degrees of freedom are unaccounted for in the CNM procedure, while having no effect on the local mode properties of the original set of linearly-independent internal coordinates.

In the automatic internal coordinate search, rank-deficient B matrices are augmented with the orthogonal complement coordinates when the ``o`` type is specified. In the coordinate specification file, this behaviour can be requested as::

  complement  # request orthogonal complement augmentation if B is rank-deficient


Dimensions
==========

.. list-table:: Dimensions of B matrix rows and local mode force constants
   :widths: 40 15 15 15 15
   :header-rows: 1

   * - Type of internal coordinate
     - Dimension of B matrix row
     - Dimension of :math:`k^a`
     - Dimension of normalisation factor
     - Dimension of :math:`k^{\mathrm{eff}}`
   * - :ref:`Bond <bond_ics>` / :ref:`Hydrogen bond <hbond_ics>` / :ref:`Ring puckering <ring_ics>` / :ref:`Intermolecular interaction <inter_ics>` / :ref:`Rigid-body group translation <rbtrans_ics>` / :ref:`System translation <systrans_ics>` / :ref:`Orthogonal complement <complement_ics>`
     - dimensionless
     - energy length\ :sup:`--2`
     - N/A
     - energy length\ :sup:`--2`
   * - :ref:`Angle <angle_ics>` / :ref:`Dihedral <dihedral_ics>`
     - length\ :sup:`--1`
     - energy
     - length\ :sup:`--2`
     - energy length\ :sup:`--2`
   * - :ref:`Rigid-body group rotation <rbrot_ics>` / :ref:`System rotation <sysrot_ics>`
     - length
     - energy\ :sup:`--4`
     - length\ :sup:`2`
     - energy length\ :sup:`--2`



Notes on symmetry and redundancy
--------------------------------

In periodic systems, multiple internal coordinates may be related by crystal symmetry. |LModeAk| provides tools to identify and group symmetry-equivalent internal coordinates (see ``sym_key`` in the :ref:`output file <symkey>`), while retaining the ability to analyse symmetry breaking at finite wavevectors.

For internal coordinates corresponding to rigid-body displacements of groups (e.g., intermolecular centroid-centroid vectors), the local-mode frequency computed using the supercell B-matrix method may differ slightly from the primitive method near the :math:`\Gamma`-point.
This is because such coordinates overlap strongly with acoustic modes, and any small numerical mismatch in the ``supercell`` B-matrix projections is amplified by the inversion of near-zero normal-mode eigenvalues. For these coordinates, we recommend using the ``primitive`` method, which correctly enforces translational symmetry and yields a local-mode frequency that approaches zero as :math:`\mathbf{k}\to\mathbf{0}`.


References
^^^^^^^^^^

.. [1] D.\  Cremer and J. A. Pople, *J. Am. Chem. Soc.*, 1975 **97**, 1354-1358.
.. [2] R.\  C. van Schaik and H. J. C. Berendsen, *J. Mol. Biol.*, 1993 **234**, 751-762.
