Skip to content

Commit

Permalink
include distances from all adsorbate/TS atoms in fingerprint to ident…
Browse files Browse the repository at this point in the history
…ify site uniqueness
  • Loading branch information
mjohnson541 committed Jan 11, 2025
1 parent f006381 commit 125118d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions pynta/coveragedependence.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def generate_pair_geometries(adpath1,adpath2,slabpath,metal,facet,adinfo1=None,a
ad2_geoms.append(ad2s[i])


inds = get_unique_site_inds(ad2_sites,slab,fixed_point=ad1_sites[0]["position"])
inds = get_unique_site_inds(ad2_sites,slab,fixed_points=[x["position"] for x in ad1_sites])

for i in inds:
# if any(sites_match(ad2_sites[i],s,slab) for s in ad1_to_ad1_sites[j]):
Expand Down Expand Up @@ -546,16 +546,19 @@ def generate_pair_geometries(adpath1,adpath2,slabpath,metal,facet,adinfo1=None,a

return adpairs,pairmols

def get_unique_site_inds(sites,slab,fixed_point=None,tol=0.15):
def get_unique_site_inds(sites,slab,fixed_points=None,tol=0.15):
fingerprints = []
for k,site in enumerate(sites):
if fixed_point is None:
if fixed_points is None:
fingerprints.append((site["morphology"],site["site"]))
else:
bd,d = get_distances([site["position"]], [fixed_point], cell=slab.cell, pbc=(True,True,False))
xydist = np.linalg.norm(bd[0][0][:2])
zdist = bd[0][0][2]
fingerprints.append((site["morphology"],site["site"],xydist,zdist,))
dists = [site["morphology"],site["site"]]
for fixed_point in fixed_points:
bd,d = get_distances([site["position"]], [fixed_point], cell=slab.cell, pbc=(True,True,False))
xydist = np.linalg.norm(bd[0][0][:2])
zdist = bd[0][0][2]
dists.extend([xydist,zdist])
fingerprints.append(tuple(dists))

unique_sites = []
unique_inds = []
Expand Down

0 comments on commit 125118d

Please sign in to comment.