Skip to content

Commit

Permalink
cycle through reactants,products properly for TSs for cov_dep
Browse files Browse the repository at this point in the history
  • Loading branch information
mjohnson541 committed Jan 9, 2025
1 parent 06a5643 commit 29592b8
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions pynta/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,22 +699,22 @@ def setup_active_learning_loop(self):

for ts in self.transition_states.keys():
info_path = os.path.join(self.pynta_run_directory,ts,"info.json")
with open(info_path) as f:
info = json.load(f)
mol = Molecule().from_adjacency_list(info["adjlist"])
reactants = Molecule().from_adjacency_list(info["reactants"])
products = Molecule().from_adjacency_list(info["products"])
keep_binding_vdW_bonds=False
keep_vdW_surface_bonds=False
for bd in mol.get_all_edges():
if bd.order == 0:
if bd.atom1.is_surface_site() or bd.atom2.is_surface_site():
keep_binding_vdW_bonds = True
m = mol.copy(deep=True)
b = m.get_bond(m.atoms(mol.atoms.index(bd.atom1)),m.atoms[mol.atoms.index(bd.atom2)])
m.remove_bond(b)
out = m.split()
if len(out) == 1: #vdW bond is not only thing connecting adsorbate to surface
keep_vdW_surface_bonds = True

for mol in [reactants,products]:
for bd in mol.get_all_edges():
if bd.order == 0:
if bd.atom1.is_surface_site() or bd.atom2.is_surface_site():
keep_binding_vdW_bonds = True
m = mol.copy(deep=True)
b = m.get_bond(m.atoms(mol.atoms.index(bd.atom1)),m.atoms[mol.atoms.index(bd.atom2)])
m.remove_bond(b)
out = m.split()
if len(out) == 1: #vdW bond is not only thing connecting adsorbate to surface
keep_vdW_surface_bonds = True

atoms = read(admol_name_path_dict[ts])
st,_,_ = generate_TS_2D(atoms, info_path, self.metal, self.surface_type, self.sites, self.site_adjacency, self.nslab,
max_dist=np.inf, allowed_structure_site_structures=allowed_structure_site_structures,
Expand Down

0 comments on commit 29592b8

Please sign in to comment.