Skip to content

Commit

Permalink
Added original_mol to converter molecules_from_xyz()
Browse files Browse the repository at this point in the history
To use if perception of b_mol is problematic
  • Loading branch information
alongd committed Oct 26, 2024
1 parent ab219d8 commit ebb86ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions arc/species/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,7 @@ def elementize(atom):
def molecules_from_xyz(xyz: Optional[Union[dict, str]],
multiplicity: Optional[int] = None,
charge: int = 0,
original_molecule: Optional[Molecule] = None,
) -> Tuple[Optional[Molecule], Optional[Molecule]]:
"""
Creating RMG:Molecule objects from xyz with correct atom labeling.
Expand All @@ -1371,6 +1372,7 @@ def molecules_from_xyz(xyz: Optional[Union[dict, str]],
xyz (dict): The ARC dict format xyz coordinates of the species.
multiplicity (int, optional): The species spin multiplicity.
charge (int, optional): The species net charge.
original_molecule (Molecule, optional): An RMG Molecule object to use as a reference for atom order.
Returns: Tuple[Optional[Molecule], Optional[Molecule]]
- The respective Molecule object with only single bonds.
Expand Down Expand Up @@ -1441,6 +1443,10 @@ def molecules_from_xyz(xyz: Optional[Union[dict, str]],
for atom in mol.atoms:
atom.radical_electrons = 0

if mol_bo is None and mol_s1_updated is not None and original_molecule is not None:
mol_bo = original_molecule.copy(deep=True)
order_atoms(ref_mol=mol_s1_updated, mol=mol_bo)

return mol_s1_updated, mol_bo


Expand Down

0 comments on commit ebb86ed

Please sign in to comment.