tqchem.internal_coordinates =========================== .. py:module:: tqchem.internal_coordinates Classes ------- .. autoapisummary:: tqchem.internal_coordinates.InternalCoordinates tqchem.internal_coordinates.MolecularGrid Functions --------- .. autoapisummary:: tqchem.internal_coordinates.linearize tqchem.internal_coordinates.indices_to_components tqchem.internal_coordinates.internal_to_xyz tqchem.internal_coordinates.xyz_to_internal Module Contents --------------- .. py:class:: InternalCoordinates Bases: :py:obj:`dict` Collection of internal coordinates for components of a system. Dictionary mapping tuples of atom indices to a representation of internal coordinates, i.e. BATFrames or PuckeringFrames. For conformer search we do not want to alter all coordinates, so Internal coordinates can be filtered for relevant ones (filter_subset) and there are coordinates that we don't want to alter, but we need to make sure that they are correctly set (constant_coordinates) .. py:method:: update(coords: dict) -> None Update internal coordinates with (subset of) internal coordinates .. py:method:: combine(coords: dict) -> None Combine internal coordinates with (subset of) internal coordinates .. py:method:: variable_coordinates(molecule: tqchem.molgraph.MolecularSystem, atom_order: list[int]) -> InternalCoordinates Get subset of coordinates which are relevant/varied during conformer search atom_order is a list of atom ids in the graph and determines the order in which the variables will be listed in the subset .. py:method:: constant_coordinates(molecule: tqchem.molgraph.MolecularSystem) -> InternalCoordinates Get subset of coordinates which need to stay constant during conformer search This entails for example improper dihedrals for bonds going into and out of a ring, as well as bond lengths and bond angles .. py:method:: make_grid(**kwargs) -> None Make a discrete grid for each coordinate of each component. .. py:method:: evaluate_grid(indices: dict[tuple[int, Ellipsis], list[int]]) -> InternalCoordinates Evaluate indices on the grids and update the internal coordinates with the new values indices: dict[tuple[int, ...], list[int] Maps atom indices of the components to a list of indices for each coordinate in the component .. py:method:: grid_range() -> dict[tuple[int, Ellipsis], list[range]] Return grid ranges for each component .. py:class:: MolecularGrid(molecule: tqchem.molgraph.MolecularSystem, shift_by_reference: bool = False, **bond_grids) Grid representation of the conformers of a system .. attribute:: molecule Graph representation of the molcule and interface to ase to modify the atom positions :type: Molecular System .. attribute:: variables Subset of the InternalCoordinates of the system (mainly Dihedrals and puckering coordinates) which are represented on the grid, to perform Conformer Search. :type: InternalCoordinates .. attribute:: constant_coordinates Subset of InternalCoordinates (Bonds, Angles, improper Dihedrals used for the connection of Rings) which should not change during the Conformer Search, but need to be set to make sure they remain the same. :type: InternalCoordinates .. method:: __call__: Return new molecule based on the gridpoints received on input .. method:: shape: Return range of indices for each element of the Molecular Grid .. method:: n_variables: Return number of variable elements in the Molecular Grid .. method:: variable_atom_indices: Return list of the variable elements in the Molecular Grid .. method:: closest_gridpoint: Get grid point closest to the geometry/molecule system provided on input .. py:attribute:: molecule :type: _typeshed.Incomplete .. py:attribute:: variables :type: _typeshed.Incomplete .. py:attribute:: constant_coordinates :type: _typeshed.Incomplete .. py:method:: __call__(superidx: list[int]) -> tqchem.molgraph.MolecularSystem Construct new molecular system based on the incoming indices Indices are delinearized to match the structure of the internal coordinates. The variables are updated (e.g. with new dihedral values), combined with the constants, and converted to a new MolecularSystem with xyz coordinates. :param superidx: List of indices, one for each variable coordinate :type superidx: list[int] .. py:method:: shape() -> list[int] .. py:method:: n_variables() .. py:method:: variable_atom_indices() -> list[str] Convenient way to get string representation of the variables of the grid .. py:method:: closest_gridpoint(molecule: tqchem.molgraph.MolecularSystem) -> list[int] Return the gridpoint most similar to the provided molecule .. py:function:: linearize(dictionary: dict[Any, Iterable]) -> list[Any] Converts dictionary values (Iterables) into a one-dimensional list Used to convert a dictionary relating components to a list of ranges for the component's variables to a list which only contains the ranges Example: Three components with 2, 1 and 0 dihedrals >>> dictionary = { (0, 1, 2, 3, 4, 5): [range(0, 12), range(0, 10)], (6, 7, 8, 9): [range(0, 8)], (10): [], } >>> linearize(dictionary) [range(0, 12), range(0, 10), range(0, 8)] .. py:function:: indices_to_components(indices: list[int], component_ranges: dict[tuple[int], list[range]]) Assign list of indices to the variables of the components component_ranges is a dict mapping each component to a list containing as many ranges as there are variables in the component. This function returns an equivalent dict, but the ranges are replaced with the indices. .. py:function:: internal_to_xyz(molecule: tqchem.molgraph.MolecularSystem, coordinates: InternalCoordinates) -> tqchem.molgraph.MolecularSystem Transform internal coordinates to xyz coordinates. Internal Coordinates can consist of multiple components (BAT, puckering, BAT, ...) .. py:function:: xyz_to_internal(molecule: tqchem.molgraph.MolecularSystem) -> InternalCoordinates Transform xyz coordinates to internal coordinates. Internal Coordinates can consist of multiple components (BAT, puckering, BAT, ...)