Add elements around edges

Hi

I want to make small graphene crystal with hydrogen-terminated edges. I was wondering if there’s a quick way of doing that if I have the carbon basal plane with pymatgen?

from pymatgen import Structure, Lattice

struct = Structure.from_spacegroup('P6/mmm',
                                  Lattice.hexagonal(2.46,15),
                                  ['C'],
                                  [[1/3,2/3,1/2]])
sup = struct*[5,4,1]
idx = []
for i,coords in enumerate(sup.cart_coords):
    if coords[0] < -0.1 : idx.append(i)
    elif coords[0] > 7.5: idx.append(i)
sup.remove_sites(idx)