Deal all,

How do I do to put a molecule in the center of the unit cell slab using pymatgen? Is there any special function to find this site, like ontop, hollow, and bridge?

Hi, Celso_Rego,

I’m not quite sure I understand your question.

If you want to transfer an atom to the center of your unit cell, then you only need to calculate the center of the unit cell, and move the molecule to that point.

If I understand correctly about what you said, an example is in below:

from import bulk, molecule
from import AseAtomsAdaptor

# create a Pt bulk
Pt_bulk = bulk('Pt', a=3.98, cubic=True)
structure = AseAtomsAdaptor.get_structure(atoms=Pt_bulk)
cells = structure.lattice.matrix
a = cells[0]
b = cell[1]
c = cell[2]

# create a molecule (H2O)
mol = molecule('H2O')
mol_pmg = AseAtomsAdaptor.get_molecule(atoms=mol)

# calculate the center
center = (a+b+c)/2

# move the molecule to the center
mv_vector = center - molecule[0].coords

for site in mol_pmg:
    site.coords += mv_vector

If this is not what you want, please comment below.