Dear pymatgen maintainers,
I recently started working on interface and grain boundary modeling using pymatgen. After learning the basic slab and interface algorithms, I found that the legacy module pymatgen.analysis.gb is no longer available in the current versions.
My goal is to build a series of periodic models, such as LaAlO₃/SrTiO₃ heterojunctions and low-Σ Li–La–Zr–O grain boundaries. In these cases, I want to generate both types of z-direction periodicity:
- Vacuum–slabA–slabB–vacuum–slabA… (surface-terminated heterointerface, figure(a))
- slabA–slabB–slabA–slabB… (fully periodic double-interface supercell, figure(b))

I have a couple of questions:
- Was the old
pymatgen.analysis.gbmodule removed because grain boundaries are essentially a special case of heterogeneous interfaces (i.e., A/A interfaces), meaning that their structures can be generated using the same ZSLGenerator algorithm as for general A/B interfaces? - When using
ZSLGenerator, what type of periodicity does it actually construct along the z direction? Does it correspond to a slab model with vacuum (vacuum–A–B–vacuum), a fully periodic bicrystal (A–B–A–B), or is it up to the user to define afterward?
I might have misunderstood some of these concepts — any clarification or pointers to examples would be greatly appreciated.
Thank you very much for your time and for maintaining such a powerful toolkit!
Best regards,
Fengyu Xie