materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.52k stars 868 forks source link

Wrong structure from spacegroup I4/mmm #482

Closed vladimirovpv closed 8 years ago

vladimirovpv commented 8 years ago

System

import pymatgen as mg                                                                                                                                                              
from pymatgen.analysis.defects.point_defects import Interstitial                                                                                                                   

lat = mg.Lattice.tetragonal(7.35,4.19)                                                                                                                                             
structure = mg.Structure.from_spacegroup("139",lat,["Be","Ti"],
    [[0.25, 0.25, 0.25],
    [0.35, 0.0,  0.0 ],
    [0.28, 0.50, 0.0 ],
    [0.0,  0.0,  0.0 ]])
structure.to(filename="POSCAR")

Error message

no error message, but wrong output to POSCAR

Suggested solution (if any)

Ti8 Be8
1.0
7.350000 0.000000 0.000000
0.000000 7.350000 0.000000
0.000000 0.000000 4.190000
Be Ti
8 8
direct
0.250000 0.250000 0.250000 Be
0.750000 0.750000 0.750000 Be
0.750000 0.750000 0.250000 Be
0.750000 0.250000 0.250000 Be
0.750000 0.250000 0.750000 Be
0.250000 0.250000 0.750000 Be
0.250000 0.750000 0.750000 Be
0.250000 0.750000 0.250000 Be
0.350000 0.000000 0.000000 Ti
0.650000 0.000000 0.000000 Ti
0.850000 0.500000 0.500000 Ti
0.000000 0.350000 0.000000 Ti
0.150000 0.500000 0.500000 Ti
0.000000 0.650000 0.000000 Ti
0.500000 0.850000 0.500000 Ti
0.500000 0.150000 0.500000 Ti
shyuep commented 8 years ago

Your input is wrong. The ["Be", "Ti"] should be ["Be", "Ti", "Ti", "Ti"] I think.

vladimirovpv commented 8 years ago

Thank you! Now it works. The correct input should be other way round: ["Be","Be","Be","Ti"].