nitrogen.coordsys

This module implements the CoordSys base class, which is extended for all NITROGEN coordinate systems. See Coordinate systems and the CoordSys class for a tutorial.

Coordinate systems

CoordSys

The coordinate system base class.

ZMAT

Z-matrix coordinates.

Valence3

Triatomic valence coordinates.

CartesianN

Simple \(n\)-dimensional Cartesian.

Polar

Polar coordinates.

Cylindrical

Cylindrical coordinates.

Spherical

Spherical coordinates.

QTransCoordSys

Input-transformed coordinate system.

JacobiChain3N

An \(n\)-particle Jacobi chain.

Coordinate transformations

CoordTrans

The coordinate transformation base class.

CompositeCoordTrans

Composite coordinate transformations.

LinearTrans

Linear transformations.

PathTrans

Generic reaction path transformation.

class nitrogen.coordsys.CartesianN(N)

Bases: nitrogen.coordsys.coordsys.CoordSys

Cartesian coordinates in N-D space.

\(X_i = Q_i\)

Create a new CartesianN coordinate system object.

Parameters

N (int) – The number of Cartesian coordinates.

class nitrogen.coordsys.CompositeCoordTrans(A, B)

Bases: nitrogen.coordsys.coordsys.CoordTrans

Composite coordinate transformation

Q = A(B(Q’))

diagram()

CoordTrans diagram string

class nitrogen.coordsys.CoordSys(Q2Xfun, nQ=1, nX=1, name='(unnamed coordinate system)', Qstr=None, Xstr=None, maxderiv=None, isatomic=False, zlevel=None)

Bases: nitrogen.dfun.DFun

A generic coordinate system base class, which extends the dfun.DFun generic differentiable function class.

nQ

The number of input (curvlinear) coordinates.

Type

int

nX

The number of output (Cartesian-like) coordinates.

Type

int

name

The coordinate system label.

Type

str

Qstr

The labels of the input coordinates.

Type

list of str

Xstr

The labels of the output coordinates.

Type

list of st

maxderiv

The maximum supported derivative order. maxderiv = None if arbitrarily high-order derivatives are supported.

Type

int

isatomic

If isatomic == True, the coordinate system is atomic.

Type

bool

natoms

For atomic coordinate systems, the number of atoms. nX is equal to 3*natoms

Type

int

Create a new CoordSys object.

Parameters
  • Q2Xfun (function) – An instance method for calculating X as a function of Q, the coordinates. This function should have a signature QX2fun(self, Q, deriv = 0, out = None, var = None). See CoordSys.Q2X() for details.

  • nQ (int, optional) – Number of input (curvilinear) coordinates. The default is 1.

  • nX (int, optional) – Number of output (Cartesian-like) coordinates. The default is 1.

  • name (str, optional) – Coordinate system label. The default is ‘(unnamed coordinate system)’.

  • Qstr (list of str, optional) – Labels for each of the nQ input coordinates. If None, these will be automatically numbered.

  • Xstr (list of str, optional) – Labels for each of the nX output coordinates. If None, these will be automatically numbered.

  • maxderiv (int, optional) – The maximum supported derviative order. The default is None, indicating arbitrarily high derivatives are supported.

  • isatomic (bool, optional) – If isatomic == True, then nX must be a multiple of 3, and the Cartesian-like output coordinates X should be ordered as \((x_0, y_0, z_0, x_1, y_1, z_1,...)\). The default is False.

  • zlevel (int, optional) – The zero-level of the differentiable Q2Xfun function. The default is None.

Q2GUV(q, masses, deriv, var=None, hbar=None)

Compute the kinetic energy operator coefficients in the pseudo-potential representation.

Parameters
  • q ((nq,...) ndarray) – The evaluation grid.

  • masses (array_like) – The masses.

  • deriv (integer) – The derivative order of G. The derivative order of U and V will be one less.

  • var (array_like, optional) – The active coordinates. If None (default), all are used.

  • hbar (float, optional) – The value of \(\hbar\). If None (default), standard NITROGEN units will be used.

Returns

  • Gvib ((nd1, nvar, nvar, …)) – The vibrational block of \(G\) multplied by \(\hbar^2 / 2\).

  • Grv ((nd1, 3, nvar, …)) – The rotational-vibrational block of \(G\) multplied by \(\hbar^2 / 2\).

  • Grot ((nd1, 3, 3, …)) – The rotational block of \(G\) multplied by \(\hbar^2 / 2\).

  • U ((nd2, nvar, …)) – The \(U_i\) functions multplied by \(\hbar^2 / 2\).

  • VT ((nd2, …)) – The \(V_T\) pseudo-potential.

Q2X(Q, deriv=0, out=None, var=None)

Evaluate the coordinate function X(Q).

Parameters
  • Q (ndarray) – An array of input coordinates with shape (nQ, …).

  • deriv (int, optional) – All derivatives up through order deriv are requested. The default is 0.

  • out (ndarray, optional) – Output location. If None, a new ndarray will be created. The default is None. See nitrogen.dfun.DFun.f.out for details.

  • var (list of int, optional) – Variables with respect to which derivatives are taken. If None, all nQ variables will be used in the input order. The default is None. See nitrogen.dfun.DFun.f.var for details.

Returns

out – The result, X(Q), in DFun format.

Return type

ndarray

Q2g(Q, masses=None, deriv=0, out=None, vvar=None, rvar=None, mode='bodyframe')

Calculate the curvilinear metric tensor g

Parameters
  • Q (ndarray) – An array of input coordinates. Q has shape (nQ, …).

  • masses (array_like) – A list of masses of length natoms (if mode == ‘bodyframe’) or length nX (if mode == ‘simple’). A value of None is interpreted as unit masses (for applicable modes).

  • deriv (int) – The requested derivative order. Derivatives are calculated for all vibrational coordinates indicated by vvar. The default is 0.

  • out (ndarray, optional) – Output location, an ndarray with shape (nd, ng, ...) and the same data-type as Q. If None, this will be created. The default is None.

  • vvar (list of int, optional) – The coordinates included in the vibrational block of g. If None, then all coordinates will be used in order. The default is None.

  • rvar (str, optional) – The body-fixed axes included in the rotational block of g. If None, then all axes will be used in order (rvar = ‘xyz’). The default is None. This only applied to mode = ‘bodyframe’.

  • mode ({'bodyframe','simple'}) – Calculation mode. ‘bodyframe’ (default) calculates the standard g tensor for a rotating molecule (CoordSys must be atomic). ‘simple’ assumes a rectangular (Cartesian) space-fixed embedding.

Returns

out – The g tensor derivative array with shape (nd, ng, ...) stored in packed upper triangle column-major order.

Return type

ndarray

Q2t(Q, deriv=0, out=None, vvar=None, rvar=None)

Calculate t-vectors and their derivatives (for atomic CoordSys objects).

Parameters
  • Q (ndarray) – An array of m input coordinate vectors. Q has shape (nQ, …).

  • deriv (int) – Derivative level. The default is 0.

  • out (ndarray, optional) – Output location, an ndarray with shape (nd, nt, natoms, 3, ...) and the same data-type as Q. If None, this will be created. The default is None.

  • vvar (list of int, optional) – The coordinates for which vibrational t-vectors, and derivatives thereof, will be calculated. If None, then all coordinates will be used in order. The default is None.

  • rvar (str, optional) – The body-fixed axes for which rotational t-vectors will be calculated. This is specified by a string containing ‘x’, ‘y’, and ‘z’, e.g. ‘xyz’ or ‘zy’. ‘’ will calculate no rotational t-vectors, and None is equivalent to ‘xyz’. The default is None.

Returns

out – The t-vector array with shape (nd, nt, natoms, 3, ...). The second index runs over the requested vibrational and rotational coordinates in the order given by vvar and rvar. The first dimension runs over the nd requested derivatives in normal DFun order for the number of independent variables indicated by vvar.

Return type

ndarray

static s2g(s, masses, deriv, out=None)

Calculate g metric tensor for a simple embedding.

Parameters
  • s (ndarray) – An (nd, nv, nX, …) array containing the coordinate system Jacobian derivative array.

  • masses (array_like) – A list of masses of length nv

  • deriv (int) – The derivative order of the s array.

  • out (ndarray, optional) – an (nd, ng, …) output array, where ng = (nv * (nv + 1))

Returns

out – Result.

Return type

ndarray

static t2g(t, masses, deriv, nv, fixCOM=True, out=None)

Calculate g metric tensor given atomic t-vectors and masses.

Parameters
  • t (ndarray) – Atomic t-vector array, with shape (nd, nt, natoms, 3, ...), as returned by Q2t().

  • masses (array_like) – A list of masses of length natoms.

  • deriv (int) – The derivative order of the t-vector derivative arrays

  • nv (int) – The number of variables w.r.t which the derivative arrays were calculated.

  • fixCOM (bool) – If fixCOM, then the t vectors are shifted to the center-of-mass frame before calculating the g metric tensor. This modifies `t`. The default is True.

  • out (ndarray, optional) – The output location with shape (nd, ng, ...), where ng = (nt * (nt+1)) // 2. If None, this will be created. The default is None.

Returns

out – The curvlinear metric tensor in derivative array format. The second-index is in packed upper triangle column-major order.

Return type

ndarray

class nitrogen.coordsys.CoordTrans(dfunction, nQp=1, nQ=1, name='(unnamed coordinate transformation)', Qpstr=None, Qstr=None, maxderiv=None, zlevel=None)

Bases: nitrogen.dfun.DFun

A base class for coordinate transformations.

Parameters
  • dfunction (DFun or function) – A differentiable function defining the coordinate transformation Q(Q’)

  • nQp (int, optional) – The number of new (input) coordinates. Ignored if dfunction is a DFun. The default is 1.

  • nQ (int, optional) – The number of old (output) coordinates. Ignored if dfunction is a DFun. The default is 1.

  • name (str, optional) – Transformation name.

  • Qpstr (list of str, optional) – Coordinate labels

  • Qstr (list of str, optional) – Coordinate labels

  • maxderiv (int, optional) – The maximum supported derivative order. Ignored if dfunction is a DFun. The default is None (no maximum).

  • zlevel (int, optional) – The zero-level of the Q(Q’) DFun. Ignored if dfunction is a DFun. The default is None.

Qp2Q(Qp, deriv=0, out=None, var=None)

Evaluate the transformation function Q(Q’)

Parameters
  • Qp (ndarray) – An array of input coordinates with shape (nQp, …).

  • deriv (int, optional) – All derivatives up through order deriv are requested. The default is 0.

  • out (ndarray, optional) – Output location. If None, a new ndarray will be created. The default is None.

  • var (list of int, optional) – Variables with respect to which derivatives are taken. If None, all nQp variables will be used in the input order. The default is None.

Returns

out – The (nd, nQ, …) derivate array for Q(Q’), in DFun format.

Return type

ndarray

diagram()

CoordTrans diagram string

class nitrogen.coordsys.Cylindrical(angle='deg')

Bases: nitrogen.coordsys.coordsys.CoordSys

Cylindirical coordinates \((r,\phi, z)\) in three dimensions.

\[ \begin{align}\begin{aligned}x &= r \cos\phi\\y &= r \sin\phi\end{aligned}\end{align} \]
angle

The angular unit.

Type

{‘deg’,’rad’}

Create a new Cylindrical coordinate system object.

Parameters

angle ({'deg', 'rad'}, optional) – The angular unit, degrees or radians. The default is ‘deg’.

class nitrogen.coordsys.EckartCoordSys(cs, X0, mass)

Bases: nitrogen.coordsys.coordsys.CoordSys

An Eckart frame coordinate system. This method uses the quaternion-based algorithm of [Kras2014soew].

cs

The original coordinate system

Type

CoordSys

X0

The reference Cartesian configuration

Type

(3*N,) ndarray

mass

The atomic masses used to calculate the Eckart frame

Type

(N,) ndarray

References

References

Kras2014soew

S. Krasnoshchekov, E. Isayeva, and N. Stepanov, “Determination of the Eckart molecule-fixed frame by use of the apparatus of quaternion algebra,” J. Chem. Phys., 140, 154104 (2014). https://doi.org/10.1063/1.4870936

Create an EckartCoordSys object.

Parameters
  • cs (CoordSys) – The original coordinate system

  • X0 ((3*N,) array_like) – The reference Cartesian configuration. The center-of- mass will be shifted to the origin.

  • mass ((N,) array_like) – The mass of each atom. (This does not have to equal the masses used for KEOs, but it should in practice for a useful Eckart frame.)

class nitrogen.coordsys.JacobiChain3N(jacobi_masses)

Bases: nitrogen.coordsys.coordsys.CoordSys

Simple chained Cartesian Jacobi coordinates for N particles in a space-fixed 3D frame.

The Jacobi binary tree diagram is

  +
 / \
0   +
   / \
  1   +
     / \
    2   +
       ...

The first three coordinates are the Cartesian position of the total center-of-mass. The second three coordinates are the Jacobi vector from atom 0 to its sibling node, and so on.

jacobi_masses

The masses defining the Jacobi coordinates

Type

ndarray

mu

The effective mass of each Jacobi vector

Type

ndarray

J

The linear transformation matrix between the Jacobi coordinates and space-frame Cartesian coordinates (X = J*Q)

Type

ndarray

Parameters

jacobi_masses (array_like) – An array of N particles masses defining the Jacobi coordinates. (These are not the masses used for calculating metric tensors.)

class nitrogen.coordsys.LinearTrans(T, t=None, Qpstr=None, name=None)

Bases: nitrogen.coordsys.coordsys.CoordTrans

Linear coordinate transformation plus constant offset.

The output coordinates Qi are defined as

\(Q_i = T_{ij} Q'_j + t_i\)

T

The transformation matrix.

Type

ndarray

t

The offset vector.

Type

ndarray

Create a LinearTrans object.

Parameters
  • T (ndarray) – The linear transformation matrix.

  • t (ndarray, optional) – An offset vector. If None, it is ignored.

  • Qpstr (list of str, optional) – Labels for the new coordinates.

  • name (str, optional) – Coordinate transformation name.

diagram()

CoordTrans diagram string

class nitrogen.coordsys.MovingEckartCoordSys(cs, X0, mass)

Bases: nitrogen.coordsys.coordsys.CoordSys

A mpving-frame Eckart coordinate system. This method uses the quaternion-based algorithm of [Kras2014itdp].

cs

The original coordinate system

Type

CoordSys

X0

The reference Cartesian configuration as a function of the coordinates.

Type

CoordSys

mass

The atomic masses used to calculate the Eckart frame

Type

(N,) ndarray

References

Kras2014itdp

S. Krasnoshchekov, E. Isayeva, and N. Stepanov, “Determination of the Eckart molecule-fixed frame by use of the apparatus of quaternion algebra,” J. Chem. Phys., 140, 154104 (2014). https://doi.org/10.1063/1.4870936

Create a MovingEckartCoordSys object.

Parameters
  • cs (CoordSys) – The original coordinate system

  • X0 (CoordSys) – The reference Cartesian configuration as a function of the coordinates. These will be shifted to the local center-of-mass frame.

  • mass ((N,) array_like) – The mass of each atom. (This does not have to equal the masses used for KEOs, but it should in practice for a useful Eckart frame.)

class nitrogen.coordsys.MovingFrameCoordSys(cs, R)

Bases: nitrogen.coordsys.coordsys.CoordSys

A coordinate system rotated to a moving frame. The new coordinates \(x'\) are related to the original coordinates \(x\) by

\[\vec{x}'_i(q) = \mathbf{R}(q) \vec{x}_i(q)\]

for each atom \(i\). \(\mathbf{R}(q)\) is a coordinate dependent rotation matrix.

R

The rotation matrix function.

Type

DFun

cs

The original coordinate system

Type

CoordSys

Create a MovingFrameCoordSys

Parameters
  • cs (CoordSys) – The original coordinate system.

  • R (DFun) – The rotation matrix. Each element is provided by the DFun in row major order.

class nitrogen.coordsys.PathTrans(path_fun, disp_fun)

Bases: nitrogen.coordsys.coordsys.CoordTrans

A generic reaction path coordinate transformation

path_fun

The coordinate path function.

Type

DFun

disp_fun

The path displacement vectors.

Type

DFun

Create a PathTrans coordinate transformation.

Parameters
  • path_fun ((1,) -> (nQ,) DFun) – The reaction path function, \(P_i(s)\).

  • disp_fun ((1,) -> (nQ * n) DFun) – The path displacement vectors, \(T_{ij}(s)\).

Notes

The nQ output coordinates \(Q_i\) are the same as those given by the path function object, path_fun. Its single argument, \(s\), is the path parameter.

An additional n coordinates \(d_j\) are defined by the displacements vectors \(T_{ij}(s)\) returned by disp_fun. (disp_fun returns the elements of T in row major order.)

The input variable order is \((s,d_0,d_1,\ldots,d_{n-1})\).

The output coordinates are calculated as

\[Q_i = P_i(s) + \sum_{j = 0}^{n-1} T_{ij}(s) d_j \quad (i = 0\ldots nQ-1)\]
diagram()

CoordTrans diagram string

class nitrogen.coordsys.PermutedAxisCoordSys(cs, new_axis_order)

Bases: nitrogen.coordsys.coordsys.CoordSys

Permute the axis ordering of a coordinate system.

new_axis_order

The new axis order. The index values are the axes of the original coordinate system.

Type

tuple

cs

The original coordinate system

Type

CoordSys

Create a PermutedAxisCoordSys.

Parameters
  • cs (CoordSys) – The original coordinate system.

  • new_axis_order (array_like) – The new axis order in terms of the original axis indices. This is a 3-tuple. The coordinate value along the new axis i equals the coordinate value of the old axis new_axis_order[i]. Examples: (0,1,2) leaves the axis order unchanged. (1,0,2) permutes the first two axes. (1,2,0) makes the original y coordinates the new x coordinates, the original z coordinates the new y coordinates, and the original x coordinates the new z coordinates.

class nitrogen.coordsys.Polar(angle='deg')

Bases: nitrogen.coordsys.coordsys.CoordSys

Polar coordinates \((r,\phi)\) in two dimensions.

\[ \begin{align}\begin{aligned}x &= r \cos\phi\\y &= r \sin\phi\end{aligned}\end{align} \]
angle

The angular unit.

Type

{‘deg’,’rad’}

Create a new Polar coordinate system object.

Parameters

angle ({'deg', 'rad'}, optional) – The angular unit, degrees or radians. The default is ‘deg’.

class nitrogen.coordsys.QTransCoordSys(T, C)

Bases: nitrogen.coordsys.coordsys.CoordSys

Input-transformed coordinate system

X = C(T(Q’))

class nitrogen.coordsys.RotatedCoordSys(cs, R)

Bases: nitrogen.coordsys.coordsys.CoordSys

A rotated axis coordinate system. The new coordinates \(x'\) are related to the original coordinates \(x\) by

\[\vec{x}'_i = \mathbf{R} \vec{x}_i\]

for each atom \(i\).

R

The rotation matrix.

Type

(3,3) ndarray

cs

The original coordinate system

Type

CoordSys

Create a RotatedCoordSys

Parameters
  • cs (CoordSys) – The original coordinate system.

  • R ((3,3) array_like) – The rotation matrix

class nitrogen.coordsys.SingleAxisR3DFun(theta_pow, Q0, axis, ni, i)

Bases: nitrogen.dfun.DFun

A diffentiable 3 x 3 rotation matrix for rotation about a single axis with a rotation angle power series w.r.t a single variable.

Create a DFun object for the 3 x 3 rotation matrix about a given axis.

Parameters
  • theta_pow (array_like) – The power series coefficients of the rotation angle \(\theta\) with respect to displacements of \(Q\) from \(Q_0\).

  • Q0 (scalar) – The reference value of \(Q\).

  • axis (integer) – The axis index (0, 1, 2).

  • ni (integer) – The total number of DFun variables.

  • i (integer) – The variable index of \(Q\) in the DFun.

class nitrogen.coordsys.Spherical(angle='deg')

Bases: nitrogen.coordsys.coordsys.CoordSys

Spherical coordinates \((r,\theta,\phi)\) in three dimensions.

\[ \begin{align}\begin{aligned}x &= r \sin\theta\cos\phi\\y &= r \sin\theta\sin\phi\\z &= r \cos\theta\end{aligned}\end{align} \]
angle

The angular unit.

Type

{‘deg’,’rad’}

Create a new Spherical coordinate system object.

Parameters

angle ({'deg', 'rad'}, optional) – The angular unit, degrees or radians. The default is ‘deg’.

class nitrogen.coordsys.TriatomicRadialPolar(name='Triatomic radial-polar', angle='rad')

Bases: nitrogen.coordsys.coordsys.CoordSys

Triatomic radial-polar coordinate system, \((R,\rho,\phi)\).

The three atoms lie in the \(xy\) plane. Their coordinates are

\[ \begin{align}\begin{aligned}x_1 &= \frac{R}{\sqrt{3} }\left( 1 - \rho \cos \phi \right)\\y_1 &= \frac{R}{\sqrt{3} } \rho \sin \phi\\ x_2 &= \frac{R}{2 \sqrt{3} } \left ( -1 + \rho\cos\phi + \sqrt{3} \rho \sin \phi \right )\\y_2 &= \frac{R}{2 \sqrt{3} } \left( \sqrt{3} + \sqrt{3} \rho\cos\phi - \rho\sin\phi \right )\\ x_3 &= \frac{R}{2 \sqrt{3} } \left(-1 + \rho\cos\phi - \sqrt{3} \rho\sin\phi \right )\\y_3 &= \frac{R}{2 \sqrt{3} } \left(-\sqrt{3} - \sqrt{3} \rho\cos\phi - \rho\sin\phi \right )\\z_1 &= z_2 = z_3 = 0\end{aligned}\end{align} \]

\(R > 0\) controls the total size scale, :math:` 0 leq rho leq 1` is the deformation magnitude, and \(0 \leq \phi < 2 \pi\) determines the direction of deformation. For \(\rho = 0\), the three particles form a triangle with side length \(R\). For \(\rho = 1\), the three particles are co-linear.

Some useful identities include

\[ \begin{align}\begin{aligned}\frac{r_1^2 + r_2^2 + r_3^2}{3} &= R^2 ( 1 + \rho^2 )\\\frac{2r_1^2 - r_2^2 - r_3^2}{6} &= R^2 \rho \cos \phi\\\frac{r_2^2 - r_3^2}{\sqrt{12}} &= R^2 \rho \sin \phi\end{aligned}\end{align} \]

where \(r_1 = | \vec{x}_2 - \vec{x}_3 |\), etc.

Parameters
  • name (str, optional) – The coordinate system name. The default is ‘Triatomic radial-polar’.

  • angle ({'rad', 'deg'}, optional) – The angular units. The default is radians.

static Distance2RRhoPhi(r1, r2, r3)

Calculate triatomic radial-polar coordinates from the three internuclear distances

Parameters
  • r1 (array_like) – The internuclear distance

  • r2 (array_like) – The internuclear distance

  • r3 (array_like) – The internuclear distance

Returns

R, rho, phi – The coordinates. \(\phi\) is returned in radians in the range \([0,2\pi)\).

Return type

ndarray

static DistanceSquared2RRhoPhi(rr1, rr2, rr3)

Calculate triatomic radial-polar coordinates from the squares of the three internuclear distances

Parameters
  • rr1 (array_like) – The squared internuclear distance

  • rr2 (array_like) – The squared internuclear distance

  • rr3 (array_like) – The squared internuclear distance

Returns

R, rho, phi – The coordinates. \(\phi\) is returned in radians in the range \([0,2\pi)\).

Return type

ndarray

static X2RRhoPhi(X)

Calculate triatomic radial-polar coordinates from Cartesian coordinates.

Parameters

X ((9,...) array_like) – The Cartesian coordinates

Returns

R, rho, phi – The coordinates. \(\phi\) is returned in radians in the range \([0,2\pi)\).

Return type

ndarray

class nitrogen.coordsys.Valence3(name='Triatomic valence', angle='rad', supplementary=False, embedding_mode=0)

Bases: nitrogen.coordsys.coordsys.CoordSys

A triatomic valence coordinate system.

The coordinates are \(r_1\), \(r_2\), and \(\theta\). See Notes for embedding conventions.

If supplementary then \(\theta \leftarrow \pi - \theta\) is used.

Create a new Valence3 object.

Parameters
  • name (str, optional) – The coordinate system name. The default is ‘Triatomic valence’.

  • angle ({'rad', 'deg'}, optional) – The degree units. The default is radians (‘rad’).

  • supplementary (bool, optional) – If True, then the angle supplement is used. The default is False.

  • embedding_mode (int, optional) – Select the frame embedding convention. The default is 0. See Notes for details.

Notes

For embedding_mode = 0, the Cartesian coordinates are

\[\begin{split}X_0 &= (0, 0, -r_1) \\ X_1 &= (0, 0, 0) \\ X_2 &= (0, r_2 \sin \theta, -r_2 \cos\theta)\end{split}\]

For embedding_mode = 1, the Cartesian coordinates are

\[\begin{split}X_0 &= (r_1 \cos \theta/2, 0, r_1 \sin \theta/2) \\ X_1 &= (0, 0, 0) \\ X_2 &= (r_2 \cos \theta/2, 0, -r_2 \sin \theta/2)\end{split}\]
class nitrogen.coordsys.Valence4(name='Tetratomic valence', angle='rad', embedding_mode='C2')

Bases: nitrogen.coordsys.coordsys.CoordSys

A tetratomic valence coordinate system.

The coordinates are \(r_1\), \(r_2\), \(r_3\), \(\theta_1\), \(\theta_2\), and \(\phi\). See Notes for embedding conventions.

Create a new Valence3 object.

Parameters
  • name (str, optional) – The coordinate system name. The default is ‘Tetratomic valence’.

  • angle ({'rad', 'deg'}, optional) – The degree units. The default is radians (‘rad’).

  • embedding_mode ({'C2'}, optional) – The embedding mode, see Notes.

Notes

For \(r_1 = r_2\) and \(\theta_1 = \theta_2\), the \(C_2\) axis is parallel to \(z\) for embedding mode 'C2'.

class nitrogen.coordsys.ZMAT(zmatrix, angles='deg', supplementary=False, four_center_type=None)

Bases: nitrogen.coordsys.coordsys.CoordSys

Z-matrix coordinate system.

Angles are in degrees by default, not radians.

zmat

A Z-matrix string that reproduces this ZMAT.

Type

str

angles

The units (degrees or radians) used for angular coordinates.

Type

{‘deg’,’rad’}

supplementary

Use supplementary ABC angles.

Type

bool

Notes

The embedding convention places the first atom at the origin, the second atom on the \(+z\) axis, and the third atom in the \((z,+x)\) plane (for a bond angle between \(0\) and \(\pi\)).

Create a new ZMAT CoordSys.

Parameters
  • zmatrix (str) – Z-matrix definition string.

  • angles ({'deg','rad'}) – Angles are interpreted as degrees (‘deg’) or radians (‘rad’). The default is ‘deg’.

  • supplementary (bool, optional) – Use supplementary angles. The default is False.

  • four_center_type (array_like, optional) – The type of embedding for atom. If the entry is 0, then standard ZMAT angle and dihedral are used. If the entry is 1, then the out-of-plane embedding is used. The entryies are ignored for the first three atoms. If None, all entries are assumed to be 0.

nitrogen.coordsys.calcRASangle(cs, mass, Qref, Qstar_idx, Qstar_final_value, axis, int_points=100, Rref=None)

Calculate the reduced axis system (RAS) for an aperiodic coordinate \(Q^*\) with a fixed rotation axis via numerical integration.

Parameters
  • cs (CoordSys) – The coordinate system

  • mass (array_like) – The atomic masses

  • Qref (array_like) – The reference geometry.

  • Qstar_idx (integer) – The coordinate index of \(Q^*\)

  • Qstar_final_value (scalar) – The integration end-point of \(Q^*\).

  • axis (integer) – The RAS rotation axis after rotation to the intermediate reference frame via Rref. This must be 0, 1, or 2 (for the first, second, or third axis).

  • int_points (integer, optional) – The number of integration steps. The default is 100.

  • Rref ((3,3) array_like, optional) – The fixed rotation matrix from the original coordinate system frame to an intermediate frame. If None (default), then the inertial principal axis system will be used. In this case, axis = 0, 1, or 2 specifies the \(a\), \(b\), or \(c\) principal axis, respectively.

Returns

  • Rref ((3,3) ndarray) – The rotation axis to the intermediate reference system. If Rref is None, then this is the PAS of the reference geometry.

  • Qstar_grid (ndarray) – The \(Q^*\) integration grid.

  • theta (ndarray) – The integrated value of the rotation angle \(\theta\) (in radians) on the \(Q^*\) grid.

Notes

The RAS is defined in [Picket1972]. This function assumes the special case of a fixed direction of rotation along the large amplitude motion (LAM) coordinate \(Q^*\), e.g. an axis of common symmetry or the direction normal to a plane of symmetry.

The reference coordinate system is evaluated at the supplied coordinates \(Q_\mathrm{ref}\) and, by default, moved to its inertial principal axis system (PAS). A different choice of reference can be passed via Rref. The rotation matrix which rotates the coordinates from the original frame to the intermediate frame is returned as \(\mathbf{R}_\mathrm{ref}\).

The RAS usually coincides with the reference PAS at the reference geometry. As \(Q^*\) is displaced from its reference value, the RAS frame is rotated relative to the reference frame by an angle \(\theta(Q^*)\) about the axis specified by axis. The coordinates in the final RAS are thus

\[\vec{x}_\mathrm{RAS} = \mathbf{R}(\theta(Q^*)) \mathbf{R}_\mathrm{ref} \vec{x},\]

where \(\vec{x}\) refers to the original coordinate system cs. \(\mathbf{R}_\mathrm{ref}\) orders the principal axes as \((a,b,c)\) by default. If axis is 0, then

\[\begin{split}\mathbf{R}(\theta) = \left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & \cos\theta & -\sin\theta \\ 0 & \sin\theta & \cos\theta \end{array} \right)\end{split}\]

and cyclic permutations for 1 and 2. Special care should be taken for degenerate inertial axes.

See also

calcRASseries

Calculate the RAS angle power series.

References

Picket1972

H. M. Pickett, “Vibration-Rotation Interactions and the Choice of Rotating Axes for Polyatomic Molecules,” J. Chem. Phys., 56, 1715 (1972). https://doi.org/10.1063/1.1677430

nitrogen.coordsys.calcRASseries(cs, mass, Qref, Qstar_idx, degree, axis, Rref=None)

Calculate the reduced axis system (RAS) for an aperiodic coordinate \(Q^*\) with a fixed rotation axis via a partial power series.

Parameters
  • cs (CoordSys) – The coordinate system

  • mass (array_like) – The atomic masses

  • Qref (array_like) – The reference geometry.

  • Qstar_idx (integer) – The coordinate index of \(Q^*\)

  • degree (integer) – The maximum degree of the \(\theta(Q^*)\) power series

  • axis (integer) – The rotation axis of the reference geometry. This must be 0,1,2

  • Rref ((3,3) array_like, optional) – The fixed rotation matrix from the original coordinate system frame to an intermediate frame. If None (default), then the inertial principal axis system will be used. In this case, axis = 0, 1, or 2 specifies the \(a\), \(b\), or \(c\) principal axis, respectively.

Returns

  • Rref ((3,3) ndarray) – The rotation axis to the intermediate reference system

  • pow ((degree+1,) ndarray) – The power series approximation of the rotation angle \(\theta\) (in radians) as a function of the displacement of \(Q^*\) from the reference value.

Notes

See the Notes to calcRASangle() for more details.

See also

calcRASangle

Calculate the RAS angle via numerical integration.