abinit / abipy

Open-source library for analyzing the results produced by ABINIT

Home Page:http://abinit.github.io/abipy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why abistruct.py generate cell with acell 1.0 1.0 1.0?

namelessenko opened this issue · comments

Hello all!
When I use abiopen.py with script for convert .cif to Abinit format, than in output I have acell with 1.0 1.0 1.0 for Aluminium 225 spacegroupe:

natom 1
 ntypat 1
 typat 1
 znucl 13
 xred    0.0000000000    0.0000000000    0.0000000000
 acell    1.0    1.0    1.0
 rprim
    4.6739151824    0.0000000000    2.6984861887
    1.5579717275    4.4066094935    2.6984861887
    0.0000000000    0.0000000000    5.3969723774

but I think that primitive cell must be:

acell 3*7.632471437073 
natom    1  
ntypat   1  
typat    1  
znucl    13  

xred     0.000000000000000   0.000000000000000   0.000000000000000 

rprim  0.0  0.5  0.5  
           0.5  0.0  0.5
           0.5  0.5  0.0

Why is this happening?

The cif file specifies the lattice in terms of six numbers: the length of the three vectors (a, b, c) and the angles between the vectors (alpha, beta, gamma).

These six numbers alone are not enough to determine the value of rprim (9 numbers) as you can always perform a rigid rotation of the lattice without changing a,b,c and alpha, beta, gamma.

The conventions used by pymatgen to build the lattice matrix from the 6 lattice parameters can be found here

Your first structure is equivalent to the second one. It's simply not given in the standard settings used in textbooks.
You can use the python script below to check that all the structures have the same spacegroup, angles, and lengths in Ang

#!/usr/bin/env python

from abipy.abilab import Structure

# This is structure generated by pymatgen from CIF

al1 =  Structure.from_abistring("""
natom 1
 ntypat 1
 typat 1
 znucl 13
 xred    0.0000000000    0.0000000000    0.0000000000
 acell    1.0    1.0    1.0
 rprim
    4.6739151824    0.0000000000    2.6984861887
    1.5579717275    4.4066094935    2.6984861887
    0.0000000000    0.0000000000    5.3969723774
""")


print(">>> Al1 structure from cif\n\n", al1.spget_summary())
print("Lattice.matrix:\n", al1.lattice.matrix, end=2*"\n")


# This is the standard primitive fcc specified via Abinit input variables.

al2 =  Structure.from_abistring("""
acell 3*7.632471437073
natom    1
ntypat   1
typat    1
znucl    13

xred     0.000000000000000   0.000000000000000   0.000000000000000

rprim  0.0  0.5  0.5
           0.5  0.0  0.5
           0.5  0.5  0.0
""")

print(">>> Al2 structure from Abinit input\n", al2.spget_summary())
print("Lattice.matrix:\n", al2.lattice.matrix, end=2*"\n")


# This is a primitive fcc generated with the standard lattice vectors.

al3 = Structure.fcc(a=7.632471437073, species=["Al"], units="bohr")
print(">>> Al3 structure from Abipy fcc\n", al3.spget_summary())
print("Lattice.matrix:\n", al3.lattice.matrix, end=2*"\n")

The cif file specifies the lattice in terms of six numbers: the length of the three vectors (a, b, c) and the angles between the vectors (alpha, beta, gamma).

These six numbers alone are not enough to determine the value of rprim (9 numbers) as you can always perform a rigid rotation of the lattice without changing a,b,c and alpha, beta, gamma.

The conventions used by pymatgen to build the lattice matrix from the 6 lattice parameters can be found here

Your first structure is equivalent to the second one. It's simply not given in the standard settings used in textbooks.
You can use the python script below to check that all the structures have the same spacegroup, angles, and lengths in Ang

#!/usr/bin/env python

from abipy.abilab import Structure

# This is structure generated by pymatgen from CIF

al1 =  Structure.from_abistring("""
natom 1
 ntypat 1
 typat 1
 znucl 13
 xred    0.0000000000    0.0000000000    0.0000000000
 acell    1.0    1.0    1.0
 rprim
    4.6739151824    0.0000000000    2.6984861887
    1.5579717275    4.4066094935    2.6984861887
    0.0000000000    0.0000000000    5.3969723774
""")


print(">>> Al1 structure from cif\n\n", al1.spget_summary())
print("Lattice.matrix:\n", al1.lattice.matrix, end=2*"\n")


# This is the standard primitive fcc specified via Abinit input variables.

al2 =  Structure.from_abistring("""
acell 3*7.632471437073
natom    1
ntypat   1
typat    1
znucl    13

xred     0.000000000000000   0.000000000000000   0.000000000000000

rprim  0.0  0.5  0.5
           0.5  0.0  0.5
           0.5  0.5  0.0
""")

print(">>> Al2 structure from Abinit input\n", al2.spget_summary())
print("Lattice.matrix:\n", al2.lattice.matrix, end=2*"\n")


# This is a primitive fcc generated with the standard lattice vectors.

al3 = Structure.fcc(a=7.632471437073, species=["Al"], units="bohr")
print(">>> Al3 structure from Abipy fcc\n", al3.spget_summary())
print("Lattice.matrix:\n", al3.lattice.matrix, end=2*"\n")

Thanks!