If yes, I have tried to follow it yesterday and when I was trying with 4 indices I got the below error (which I am not getting when using 3 indices). It is quite possible that I am doing something wrong (as I am using pymatgen for the first time) but I followed the tutorial to my best!
In : from pymatgen.core.surface import SlabGenerator, generate_all_slabs, Structure, Lattice; import os
In : lattice = Lattice.hexagonal(3.31700,5.31400); zno = Structure(lattice, [“Zn”, “O”],[[0.66667,0.33333,0.0],[0.66667,0.33333,0.345]])
In : slabgen = SlabGenerator(zno,(1,0,-1,0), 10, 10)
However, I don’t think there is an explanation which will help you to code.
As far as I know, this paper can help you with coding (pyMatGen cited this paper and it seems to me that the authors of the paper have coded the procedure in pyMatGen). They claim that their procedure will always work.