[ase-users] atoms sorting

Ask Hjorth Larsen asklarsen at gmail.com
Tue Nov 26 16:46:54 CET 2019


Dear Ondřej,

Am Di., 26. Nov. 2019 um 10:11 Uhr schrieb Ondřej Krejčí via ase-users
<ase-users at listserv.fysik.dtu.dk>:
>
> Dear ase users and developers,
>
> I'm really happy that ASE can work with so many DFT codes and their inputs and outputs.
> The only thing, that I'm missing is some simple build-in function for sorting atoms (I know they are possibilities outside of atoms, however that is not convenient and especially for new users hard to work with as well as it is not written in the ASE help). Sorting by x,y,z and elements ascending and descending (not because of DFT codes, but some other codes, that are working on top of DFT) would make life easier for some of the ASE users. Maybe in some future release?

I suppose one can always add shortcut methods, butin this case I think
it would be just two lines:

args = np.argsort(atoms.numbers)
sorted_atoms = atoms[args]

Best regards
Ask

>
> Thank you!
> Kind regards,
> Ondrej Krejci
> _______________________________________________
> 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