pyramids#

Functions#

pyramidalization_angle(…)

Method to calculate the pyramidalization angle of a quadruple of atoms.

get_pyramidalization(…)

Identify atoms with three bonds (using RDKit) and calculate the corresponding pyramidalization angles

Module Contents#

pyramidalization_angle(atXYZ: shnitsel.core.typedefs.AtXYZ, x_index: int, a_index: int, b_index: int, c_index: int, deg: Literal['trig']) tuple[xarray.DataArray, xarray.DataArray]#
pyramidalization_angle(atXYZ: shnitsel.core.typedefs.AtXYZ, x_index: int, a_index: int, b_index: int, c_index: int, deg: bool = True) xarray.DataArray

Method to calculate the pyramidalization angle of a quadruple of atoms.

The result will be $pi/2$ minus the angle between the normal of ABC and the vector BX. (I.e.: the pyramidalization at atom b) We choose the universal (independent of the choice of b within the tuple) way of calculating a unique pyramidalization angle accordingt to https://doi.org/10.1063/5.0008368, where the existence and derivation of such an angle is shown.

Parameters:
  • atXYZ (AtXYZ) – Array with atom positions

  • x_index (int) – Index of the center atom in the pyramidalization

  • a_index (int) – Index of the first atom bonded to the x-atom

  • b_index (int) – Index of the second atom bonded to the x-atom

  • c_index (int) – Index of the third atom bonded to the x-atom

Returns:

  • xr.DataArray – The array of pyramidalization angles

  • tuple[xr.DataArray, xr.DataArray] – If deg=’trig’, return the pair of xr.DataArray sets of cosine and then sines of the pyramidalization angle.

Notes

According to https://doi.org/10.1063/5.0008368 this should yield a unique angle independent of the permutation of a,b,c if the distances are normalized first. This should give the p-orbital-aligned perpendicular normal.

get_pyramidalization(atXYZ_source: shnitsel.data.tree.node.TreeNode[Any, shnitsel.data.dataset_containers.trajectory.Trajectory | shnitsel.data.dataset_containers.frames.Frames | xarray.Dataset | xarray.DataArray], structure_selection: shnitsel.filtering.structure_selection.StructureSelection | shnitsel.filtering.structure_selection.StructureSelectionDescriptor | None = None, deg: bool | Literal['trig'] = True, signed=True) shnitsel.data.tree.node.TreeNode[Any, xarray.DataArray]#
get_pyramidalization(atXYZ_source: shnitsel.data.dataset_containers.trajectory.Trajectory | shnitsel.data.dataset_containers.frames.Frames | xarray.Dataset | xarray.DataArray, structure_selection: shnitsel.filtering.structure_selection.StructureSelection | shnitsel.filtering.structure_selection.StructureSelectionDescriptor | None = None, deg: bool | Literal['trig'] = True, signed=True) xarray.DataArray

Identify atoms with three bonds (using RDKit) and calculate the corresponding pyramidalization angles for each frame.

Each ‘pyramid’ consists of four atoms. Three of these (the “plane” atoms) are consecutive, and the fourth (the “bending” atom) is bonded to the middle atom of the plane atoms. The pyramidalization is the the angle between the plane of the plane atoms and the bond from the middle plane atom to the bending atom.

Two sorts of pyramids are currently handled: terminal and chain-internal.

  • Terminal pyramids are those where the central atom is bonded to two hydrogens and a single non-hydrogen; for these, the central atom and the hydrogens constitute the plane and the non-hydrogen becomes the bending atom.

  • Chain-internal pyramids are those where the central atom is bonded to non-hydrogens and a single hydrogen; for these, the central atom and the non-hydrogens constitute the plane and the hydrogen becomes the bending atom.

Parameters:
  • atXYZ_source (TreeNode[Any, Trajectory | Frames | xr.Dataset | xr.DataArray] | Trajectory | Frames | xr.Dataset | xr.DataArray) – An xarray.DataArray of molecular coordinates, with dimensions atom and direction or another source of positional data like a trajectory, a frameset, a dataset representing either of those or a tree structure holding such data.

  • structure_selection (StructureSelection | StructureSelectionDescriptor, optional) – An optional argument to specify the substructures for which pyramidalization angles should be calculated. If not provided, will be generated using _get_default_structure_selection() using the atXYZ data for the pyramids level.

  • deg (bool | Literal['trig'] = True, optional) – Whether to return angles in degrees (as opposed to radians), by default False. Alternatively with the option trig, this will yield the sin and cos of each pyramidalization angle instead.

  • signed (bool, optional) – Whether the result should be returned with a sign or just as an absolute value. Defaults to True, yielding the signed pyramidalization.

Returns:

An xarray.DataArray of pyramidalizations with dimensions all dimensions but atom still intact and a new descriptor dimension introduced to index all the chosen quadruples for pyramidalization instead of the atom dimension.

Return type:

TreeNode[Any, xr.DataArray] | xr.DataArray