How to cut surfaces with different atoms termination?

Dear pymatgen community,

Recently I used the following code to cut Mg2Si into (111) surface.

However, upon examining the POSCAR I realized that Mg2Si (111) can have two types of surface atom termination. My code only generated Mg-terminated surface, not Si-terminated surface.

Any suggestions on how to make Si-terminated surface?

Appreciate your input in advance!

Try using get_slabs not get_slab. The latter generates a list of slabs with unique terminations.

Thanks for the advice @shyuep ! I can now produce both Mg and Si terminated (111) surface of Mg2Si.

Just a follow up post on a topic related to this. @shyuep

I used the same code to generate Al (111) surface

The output structure indicates that V3 (vacuum) vector being non-orthogonal to V1 and V2. However, when using the same code to generate (111) surface for Mg2Si, the V3 vector is indeed orthogonal to V1 and V2.

I have two questions regarding this: 1. Does the non-orthogonality in Al(111) introduce artificial numerical error when doing integration in the surface Brillouin zone :question: Assuming question one is correct, can I remove this artifact by manually change the z-values of V1 and V2 to 0 in order to make V3 orthogonal to V2 and V1 :question:

There is no requirement for the c vector to be orthogonal to do calculations. The non-orthongonality should not have any effect since the kpoint in the c direction for slab calculations is 1.

But if you would like an orthogonal slab, there is a method called get_orthogonal_c_slab that generates the slab for each slab.