[ase-users] Sort Atoms in specific Order

fabian Fabian.T89 at web.de
Fri Apr 7 14:11:12 CEST 2017


Hi Mikkel ,

Thanks for your answer! This seems to work if the number of atoms is not 
to large as the permutation seems to address individual atoms by their 
position within the slab?

For a slab with a large amount of atoms this doesn´t seem to work as 
well ( if i am not missing the point). This is why i want to change the 
order of atoms

(from  C Cu  H  O  to C H Cu O in my case) by addressing the atoms with 
their name tag.

Do you have an idea how to achieve this?


All the best


fabian


Am 07.04.2017 um 13:12 schrieb Mikkel Strange:
> Hi Fabian,
>
> perhaps you could use a list of indices to reorder the atoms the way you like them.
> Here is a simple example:
>
> from ase import Atoms
> slab = Atoms(symbols='HHeLi')
> perm = [2, 0, 1]
> slab = slab[perm]
>
> which produces
> Atoms(symbols='LiHHe')
>
> best regards,
> Mikkel
>
>
> ________________________________________
> From: ase-users-bounces at listserv.fysik.dtu.dk [ase-users-bounces at listserv.fysik.dtu.dk] on behalf of fabian via ase-users [ase-users at listserv.fysik.dtu.dk]
> Sent: Friday, April 07, 2017 12:05 PM
> To: ase-users
> Subject: [ase-users] Sort Atoms in specific Order
>
> Dear all ,
>
> I want to sort the order of the atoms in my  Output files
>
> in a specific order.
>
> currently i use:
>
> slab=sort(slab, tags=None)
>
> Which sets them in alphabetical order. I want to determine the order myself
>
> All the best
>
>
> fabian
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list