I am trying to sort a set of Cu atoms in a fcc (non primitive) crystal structure according to their Z cordinate. I am using
ase.build.sort to do this with the help of doccumentation. The doccumentation says that for
ase.build.sort(atoms, tags=None), it will return a new
Atoms object with sorted atomic order. The default is to order according to chemical symbols, but if tags is not
None, it will be used instead.
But there is no clue given how to sort in some different manner (not according to chemical symbols).
Here is my code:
import os import numpy import ase import ase.io import ase.build import ase.visualize from ase.build import bulk from ase.build.tools import sort Cu=ase.build.bulk('Cu','fcc',a=3.6, cubic=True) surface=ase.build.surface(Cu,(1,1,1),4,vacuum=15) from ase.build import bulk from ase.build.tools import sort surface_sorted = sort(surface,tag=)
What should I put in the tag so that I can get it sorted according to z coordinates?