Skip to content

Commit

Permalink
Implement heuristic site radius for 3D lattices
Browse files Browse the repository at this point in the history
  • Loading branch information
dean0x7d committed Jul 12, 2017
1 parent 2ba0276 commit 634e9fd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pybinding/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ def heuristic_radius(lattice):

return magic * sqrt(site_area / pi)
else:
raise RuntimeError("Not implemented for 3D lattices")
magic = 0.18
average_vec_length = sum(np.linalg.norm(v) for v in lattice.vectors) / 3
return magic * average_vec_length

def shortest_site_spacing(lattice):
from scipy.spatial.distance import pdist
Expand Down

0 comments on commit 634e9fd

Please sign in to comment.