You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# for determining whether to include pairs of atom in calculation for the `free` adjective
5754
+
5755
+
atom_rel_pos=einx.subtract('j c, i c -> i j c', atom_pos, atom_pos)
5756
+
atom_rel_dist_sq=atom_rel_pos.pow(2).sum(dim=-1)
5757
+
5758
+
max_distance_include=einx.add('i, j -> i j', atom_radii, atom_radii).pow(2)
5759
+
5760
+
include_in_free_calc= (
5761
+
(atom_rel_dist_sq<max_distance_include) &
5762
+
(atom_rel_dist_sq>atom_distance_min_thres)
5763
+
)
5764
+
5765
+
# overall logic
5766
+
5767
+
surface_dots=einx.multiply('m, sd c -> m sd c', atom_radii, unit_surface_dots)
5768
+
5769
+
dist_from_surface_dots_sq=einx.subtract('i j c, i sd c -> i sd j c', atom_rel_pos, surface_dots).pow(2).sum(dim=-1)
5770
+
5771
+
target_atom_close_to_surface_dots=einx.less('j, i sd j -> i sd j', atom_radii_sq, dist_from_surface_dots_sq)
5772
+
5773
+
target_atom_close_or_not_included=einx.logical_or('i sd j, i j -> i sd j', target_atom_close_to_surface_dots, ~include_in_free_calc)
5774
+
5775
+
is_free=reduce(target_atom_close_or_not_included, 'i sd j -> i sd', 'all') # basically the most important line, calculating whether an atom is free by some distance measure
surface_dots=einx.multiply('m, sd c -> m sd c', atom_radii, unit_surface_dots)
5830
-
5831
-
dist_from_surface_dots_sq=einx.subtract('i j c, i sd c -> i sd j c', atom_rel_pos, surface_dots).pow(2).sum(dim=-1)
5832
-
5833
-
target_atom_close_to_surface_dots=einx.less('j, i sd j -> i sd j', atom_radii_sq, dist_from_surface_dots_sq)
5834
-
5835
-
target_atom_close_or_not_included=einx.logical_or('i sd j, i j -> i sd j', target_atom_close_to_surface_dots, ~include_in_free_calc)
5836
-
5837
-
is_free=reduce(target_atom_close_or_not_included, 'i sd j -> i sd', 'all') # basically the most important line, calculating whether an atom is free by some distance measure
0 commit comments