Closed jywu20 closed 11 months ago
Thanks for reporting. At the moment I'm also not sure whether this is an issue and where it arises. Since the Chemfiles interface is very little code, my suspicion would be to look in Chemfiles.jl.
Could you go a little more into details what you tried to ensure the two structures are different ? E.g. could they not be just a different representation of the unit cell ? On that note can you post / compare some geometry details, such as interatomic distances or similar? Also with the QE input if possible ?
Thanks!
Thanks for your reply. I double checked and it seems the two structures are indeed different: it's possible to find a viewpoint from which the atoms in TaSe2-chemfile.cif
look as if they are on the same line:
while this is wrong for a 1T-TMD (transition metal dichalcogenide) and is never possible for TaSe2-ase.cif
.
Below is a further piece of evidence: this is the expected structure from TaSe2-ase.cif
:
And this is the wrong structure in TaSe2-chemfile.cif
, from the same perspective: you can see that the two Se atoms (green balls) are all below the Ta atoms, which is wrong.
The lattice constants of the two structures as well as the angles between the edges are the same in the two structures.
The QE input file is already in my first post.
I see, but if I do the following, after running your code:
position(load_system(AseParser(), "TaSe2-chemfile.cif")) .- position(load_system(ChemfilesParser(), "TaSe2-chemfile.cif"))
bounding_box(load_system(AseParser(), "TaSe2-chemfile.cif")) .- bounding_box(load_system(ChemfilesParser(), "TaSe2-chemfile.cif"))
position(load_system(AseParser(), "TaSe2-ase.cif")) .- position(load_system(ChemfilesParser(), "TaSe2-ase.cif"))
bounding_box(load_system(AseParser(), "TaSe2-ase.cif")) .- bounding_box(load_system(ChemfilesParser(), "TaSe2-ase.cif"))
The differences are tiny, suggesting to me that they both represent the same structures. Also viewing both cif files in ASE's builtin viewer they look exactly the same to me. Maybe this is actually a bug in the viewer you are using?
I tried your test and on my machine it also seems that the two files represent the same structures. I haven't checked whether VESTA (the viewer I'm using) works as expected here ... this then seems to be a problem of incorrect CIF parsing in VESTA. Thanks for looking into the issue!
When the default
Chemfiles
parser is used to save a system to an CIF file, the CIF file generated doesn't agree with the input file that defines the system.We use the following Julia script as a demonstration
Below is the content of a Quantum ESPRESSO input file
TaSe2.pwi
:After running the Julia script, we find that the file
TaSe2-ase.cif
produces the expected crystal structure (illustrated by VESTA):The file
TaSe2-chemfile.cif
however is completely nonsense:Currently I don't have any idea about whether it's an upstream bug caused by something wrong in
Chemfiles.jl
, or it's due to an incorrect function call inAtomsIO.jl
.