usnistgov / jarvis

JARVIS-Tools: an open-source software package for data-driven atomistic materials design. Publications: https://scholar.google.com/citations?user=3w6ej94AAAAJ https://www.youtube.com/watch?v=2-XHeC8gbeY
https://pages.nist.gov/jarvis/
Other
315 stars 124 forks source link

The bottom/top props appear to be incorrect for `Atoms.make_interface` #311

Open timurbazhirov opened 8 months ago

timurbazhirov commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior: run the following code

from jarvis.core.atoms import Atoms
from jarvis.analysis.interface.zur import make_interface

## Note: JVASP-670 is an entry for MoTe2
jid1 = "JVASP-670"
jid2 ="JVASP-664"

for i in dft_2d:
 if i["jid"] == jid1:
  atoms1 = Atoms.from_dict(i["atoms"])
for i in dft_2d:
 if i["jid"] == jid2:
  atoms2 = Atoms.from_dict(i["atoms"])

interface_atoms_dict = make_interface(film=atoms1, subs=atoms2)
heterostructure_atoms = interface_atoms_dict["interface"].center_around_origin()

print (jid1,jid2,atoms1.composition.reduced_formula,atoms2.composition.reduced_formula, heterostructure_atoms)

This returns:

JVASP-670 JVASP-664 Te2Mo MoS2 System
1.0
6.37593 -0.0 -0.0
3.18796 -5.52171 -0.0
-0.0 -0.0 -25.75734579378708
Mo S Te 
7 8 6 
direct
0.36111136029246144 0.02777693088071573 0.6061329711247329 bottom
0.5555559999999957 0.11111066666667094 0.3584887699946901 bottom
0.22222266666666238 -0.2222226666666623 0.3584887699946901 bottom
-0.11111066666667099 -0.5555559999999956 0.3584887699946901 bottom
0.36111136029246127 -0.4722230691192842 0.6061329711247329 bottom
-0.13888863970753865 -0.4722230691192842 0.6061329711247329 bottom
-0.1388886397075386 0.02777693088071573 0.6061329711247329 bottom
0.19444431985376934 0.36111153455964207 0.5453107527903425 bottom
-0.30555568014623086 -0.13888846544035782 0.6669565435968711 bottom
-0.30555568014623075 0.36111153455964207 0.6669565435968711 bottom
0.19444431985376934 0.36111153455964207 0.6669565435968711 bottom
-0.30555568014623086 -0.13888846544035782 0.5453107527903425 bottom
-0.30555568014623075 0.36111153455964207 0.5453107527903425 top
0.1944443198537693 -0.13888846544035782 0.5453107527903425 top
0.1944443198537693 -0.13888846544035782 0.6669565435968711 top
-0.11111133333333112 0.11111133333333116 0.28813862196335355 top
-0.4444446666666646 -0.2222220000000021 0.28813862196335355 top
0.22222200000000225 0.44444466666666443 0.42883891802602647 top
-0.11111133333333112 0.11111133333333116 0.42883891802602647 top
-0.4444446666666646 -0.2222220000000021 0.42883891802602647 top
0.22222200000000225 0.44444466666666443 0.28813862196335355 top

Expected behavior The atoms that are marked with the "bottom" prop should have their fractional z-coordinates below 0.5, and the ones marked with "top" - above it.

Screenshots Here's the visualization of the resulting interface/top/bottom materials:

Interface)

film - top

substrate - bottom

Desktop (please complete the following information):

Additional context As available in: