[ase-users] spacegroup, primitive cell

Georg Madsen georg.madsen at rub.de
Thu Jan 20 21:32:52 CET 2011


Hi Jesper

Thanks a lot. I tested it on hematite and it works fine. Usually if it
works for rhombohedral structures it'll work for everything :)

fe2o3 = crystal('FeO',[(0., 0., 0.14783),(0.30618, 0.,
0.25)],spacegroup=167,cellpar=(5.035,5.035,13.73,90.,90.,120.))
fe2o3_prim=primitive_from_conventional_cell(fe2o3, 167)

I think the primitive_cell option would be very useful.

  Best wishes
    Georg

On 01/20/2011 08:52 PM, Jesper Friis wrote:
> Hi Georg,
> below is an example of a function that returns what you are looking for:
>
> def primitive_from_conventional_cell(atoms, spacegroup=1, setting=1):
>     """Returns primitive cell given an Atoms object for a conventional
>     cell and it's spacegroup."""
>     from ase.lattice.spacegroup import Spacegroup
>     from ase.utils.geometry  import cut
>     sg = Spacegroup(spacegroup, setting)
>     prim_cell = sg.scaled_primitive_cell  # Check if we need to transpose
>     return cut(atoms, a=prim_cell[0], b=prim_cell[1], c=prim_cell[2])
>
> # Simple test
> import ase
> from ase.lattice.spacegroup import crystal
>
> # fcc
> al = crystal('Al', [(0, 0, 0)], spacegroup=225, cellpar=4.05)
> al_prim = primitive_from_conventional_cell(al, 225)
>
> # bcc
> fe = crystal('Fe', [(0,0,0)], spacegroup=229, cellpar=2.87)
> fe_prim = primitive_from_conventional_cell(fe, 229)
>
>
> This seems to work fine for cubic structures. If you could verify that the above also works for arbitrary non-cubic systems it would be great. Maybe we could consider to add an option "primitive_cell=false" to ase.lattice.spacegroup.crystal() function? I think that could be useful.
>
>
> Best regards
> /Jesper
>
>
>
>
> ________________________________________
> From: ase-users-bounces at listserv.fysik.dtu.dk [ase-users-bounces at listserv.fysik.dtu.dk] On Behalf Of Georg Madsen [georg.madsen at rub.de]
> Sent: Thursday, January 20, 2011 2:06 PM
> To: ase-users at listserv.fysik.dtu.dk
> Subject: [ase-users] spacegroup, primitive cell
>
> In all examples using the spacegroup package, the conventional cell is
> returned. Usually you would want to do calculations on the primitive
> cell. Is there a way to get spacegroup to return this ?
>
>  Best wishes
>    Georg
>
> --
> http://www.icams.de/content/members/index.html?view=details&member=190
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>   


-- 
http://www.icams.de/content/members/index.html?view=details&member=190




More information about the ase-users mailing list