scm_molsg.Input.read_3D_with_bonds¶
-
scm_molsg.Input.
read_3D_with_bonds
(symbols: List[str], xyz: List[List[float[3]]], indices: List[int], bonds: List[Tuple[int, int]]) → scm_molsg_internal.Mol¶ Initializes a Mol from a list of atomic symbols and a nested list of atomic coordinates
- Parameters
symbols (
list
) – A list of atomic symbols as stringsxyz (
list(list)
) – A list of lists of length 3 (see example) to represent the atomic coordinates of each atomindices (
list
) – A list of integers representing the indices of each atom. This can be helpful to provide bond information relative to some existing index.bonds (
list
) – A list of index pairs corresponding to every bond in the structure
- Returns
An instance of a molecule
- Return type
Important
The atomic coordinates should be in units of Angstroms
Note
molsg will perform no sanity checks on the bonds provided and they will be used as is, so it’s advised to ensure the supplied connectivity is reasonable.
Example
We’ll input methane using its atomic symbols and 3D coordinates
mol = scm_molsg.Input.read_3D_with_bonds( ["C","H","H","H","H"], [[-0.677, 0.491, -0.147], [ 0.274, 0.980, -0.298], [-1.389, 0.859, -0.871], [-0.557, -0.575, -0.270], [-1.036, 0.701, 0.849]], [0,1,2,3,4], [(0,1),(0,2),(0,3),(0,4)] )