# How to construct thin film structure of desired thickness in quantum espresso?

I want to study the properties of thin films using DFT calculation. I have done the bulk crystal calculations in Quantum ESPRESSO but have no idea how can I construct the thin film of desired thickness. What changes do I have to make in PWscf input file. Please help me with how can I do this.

Thank you!

• I'm not if this is what are looking for but you can use software like Avogadro to construct slab with given thickness and surface from their crystal structure. Jun 23, 2022 at 20:07
• And if you don't want to use Avogadro, pymatgen has a tutorial Jun 24, 2022 at 15:48

You can't construct the thin film itself with Quantum Espresso, but only calculate it's properties. You first have to create the unit cell of the thin film with some other software. As an example here is a tutorial for creating a slab with a specific facet of Au, using VESTA.

Then you put the resulting unit cell in QE's input file, and you can run the calculation. For thin layers it is important to note that you have to add a large-enough vacuum along the out-of-plane direction in order to avoid fictitious interactions of the layer with it's reciprocal images. For a layer located on the XY plane this is really easy - you just manually enlarge the value of the Z direction of the unit cell. You should check for convergence of the total energy if you want accurate results, or just try some 1-2 nm as a rule of thumb.

• thank you for kindly answering the question. It is really helpful. But can you please briefly say, why do we need to have vacuum in between the layers? As I understand in real epitaxial thin film these layers must be interacting with each other right? Then why to insert vacuum in between? Please clarify this.
– UJM
Jul 4, 2022 at 6:13
• It depends on the system you are trying to calculate, and since you give almost no information about that in the question I had to take a guess. So what I understood is that you are trying to calculate a 2D slab of a material. In that case in order to make it 2D you have to add a vacuum in the out-of-plane direction, and if this vacuum is not large enough you will have fictitious interactions between slabs. If your system is different than this then please provide some more information and I'll be able to give a more suitable answer Jul 4, 2022 at 6:24
• I have prepared an epitaxial thin film of thickness 50nm using sputtering technique. The substrate is MgO(100). Though I am measuring it's various magnetic and electronic properties experimentally. I am also trying to model it and investigate its property using DFT simulation in QE. I have done the bulk calculation for this sample but struggling to model the thin film. Should I model it as a 2D slab with several layers seperated by each other via vacuum? While each layer is of (100) direction. How do I consider the thickness of thin film while creating the structure in VESTA.
– UJM
Jul 5, 2022 at 0:45
• I can share more details via email if you have time. I have just started learning DFT calculation on thin film all at my own and need guidance. Please help me with it. Thanks !
– UJM
Jul 5, 2022 at 0:47
• Seems to me that calculating a slab would be the best. You will need a few layers (you should NOT need to calculate all 50nm!!!) in the desired direction, and separate them with a large enough vacuum, otherwise you will just calculate the solid (if you put no vacuum) or some kind of pseduo-lattice of interacting slabs (if you put too small of a vacuum) Jul 5, 2022 at 8:52