enforce_required_zmatrix_coordinates

enforce_required_zmatrix_coordinates(zm, required_coordinates=None, root_coordinates=None, isolated_coordinates=None, reparent_isolated_coordinates=True, reparent_root_coordinates=True, validate=False): 

LLM Docstring

Reparent a Z-matrix tree so requested bonds, angles, and dihedrals occur as row parent prefixes.

Already satisfied constraints are retained. Isolated coordinates can first be prevented from serving as references for unrelated rows, and root coordinates can be promoted into the initial embedding chain. Missing required coordinates are then tried in both orientations by replacing candidate parent prefixes through _adjust_zm_parents; all previously accepted constraints must remain valid. The result is returned in the same row representation as the input.

  • zm: Sequence[Sequence[int]] | dict

    Z-matrix rows or tree mapping.

  • required_coordinates: Sequence[Sequence[int]] | None

    Coordinates that must appear in either orientation.

  • root_coordinates: Sequence[Sequence[int]] | None

    Coordinates preferentially incorporated into the initial chain.

  • isolated_coordinates: Sequence[Sequence[int]] | None

    Coordinates whose endpoint atoms should not become unrelated parents.

  • reparent_isolated_coordinates: bool

    Remove isolated-coordinate endpoints as references where alternatives exist.

  • reparent_root_coordinates: bool

    Attempt to move root coordinates into the root chain.

  • validate: bool

    Enable duplicate-parent and intermediate-tree checks.

  • :returns: list[list[int]] | dict

    Reparented Z-matrix in the original input representation.


Feedback

Examples

Templates

Documentation