[ase-users] ase-users Digest, Vol 114, Issue 11

Ask Hjorth Larsen asklarsen at gmail.com
Thu Jan 18 14:26:48 CET 2018


Hi,

2018-01-18 11:13 GMT+01:00 fabian <Fabian.T89 at web.de>:
> Dear Ask
>
>
> Here are two example files in POSCAR format to illustrate my problem:
>
> The initial file looks like this and i want to move the Atom with the number
> 138 ( Co ) and Nr 28 (Ag) to the
> top position. I want to do this for core level calculations in VASP. Line 1
> , 6 and 7 need to
> be changed accordingly. The constraints should be kept.
>
> This is the original file:
(snip)

Okay, so I try to do an arbitrary permutation, e.g.:

from ase.io import read
import numpy as np

atoms = read('POSCAR')  # The first one in the previous mail
indices = np.arange(len(atoms))
indices[6] = 0
indices[0] = 6
atoms[indices]
print(atoms)

The above works for me and keeps the constraints.  Which exact
permutation causes the problem?

Best regards
Ask


More information about the ase-users mailing list