[ase-users] Sorting the atoms by type is ASE Atoms object

Spencer Hills spencer.hills at my.wheaton.edu
Mon Jan 8 17:48:06 CET 2018


Hello,

I am taking two atoms objects and combining them together in ASE. When I
combine the atoms objects together, the atoms in it become ordered based on
the atoms object that they came from, not the atom type. Is there a method
in the atoms object that will sort the atoms based in type?

For example, say I have a little IrO2 cluster:

Ir  22.6334501337769005 19.6996362359443431 21.0784105283482646

Ir  20.2595762079976787 22.4702461104581452 20.7038624595503258

O  19.3965392350654007 23.4514891890007426 22.1970325117515728

O  24.0620720990382466 21.0803337056451703 21.1448758079263861

O  15.7084192410784240 19.4294461605727591 20.5780672191905865

O  19.7168563866926618 21.1123958649343066 24.2764522228896453

Ir  21.3230402254681302 16.6020447883440561 17.0235124864985607

O  23.2085293491334674 22.2830325778158311 19.4895699171266834

O  18.7714791811689601 19.4119976460262293 16.9011321089083033


But I want it to look like this:

Ir  22.6334501337769005 19.6996362359443431 21.0784105283482646

Ir  20.2595762079976787 22.4702461104581452 20.7038624595503258

Ir  21.3230402254681302 16.6020447883440561 17.0235124864985607

O  19.3965392350654007 23.4514891890007426 22.1970325117515728

O  24.0620720990382466 21.0803337056451703 21.1448758079263861

O  15.7084192410784240 19.4294461605727591 20.5780672191905865

O  19.7168563866926618 21.1123958649343066 24.2764522228896453

O  23.2085293491334674 22.2830325778158311 19.4895699171266834

O  18.7714791811689601 19.4119976460262293 16.9011321089083033


Is there a way to do that?


Thanks,

Spencer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20180108/8c49093a/attachment.html>


More information about the ase-users mailing list