add atoms randomly around an atom in vasp poscar using pymatgen

331 Views Asked by At

I am trying to find all atoms of type A in a VASP POSCAR and then randomly add "n" atoms of type B in a sphere of radius ("r") centered at each site of type A atom using pymatgen and return each time a new POSCAR.

1

There are 1 best solutions below

0
On

This isn't currently a pre-built transformation in pymatgen. You could script it yourself, by creating a new PeriodicSite, changing its position to a random vector using numpy, and appending it to the Structure.