To simulate monolayer and trilayer of doped h-BN, we consider 2 × 2 × 1 supercells with 25 Å vacuum layer between the periodic images along the c-direction to avoid their interaction. van der Waals interactions are include for the trilayers. As the slabs are polar, we also include dipole moment correction (IDIPOL =3 tag in VASP). Allowing relaxation of supercell shape as well as atomic positions for each image, we employ solid-state nudged elastic band (SS-NEB) method with five images (three images for doped trilayer) to calculate the energy barrier for Al/Ga passing through the h-BN layers. The images are relaxed until the maximum force per atom was no more than 0.01 eV/Å.