LaAlO$_3$ film reduces the energy gap until it disappears and the interface becomes metallic. However, the critical separation depends on the band gap of SrTiO$_3$, which is underestimated in DFT calculations (the calculated band gap is 1.85 eV and the experimental band gap is 3.2 eV). Taking into account the difference between the calculated and experimental band gaps, the realistic critical separation is two more unit cells of LaAlO$_3$ in addition to the calculated one, resulting in 5, 6 and 8 u.c. for the $np$-type, $n$-type and $p$-type interfaces, respectively.

![\[fig:potdos\]The average potential (left) and density of states (right) of the $np$-type interface with different thicknesses. The upper two panels correspond to the $np$-type interface with 1 unit cell of LaAlO$_3$, and the lower two panels correspond to the $np$-type interface with 3 unit cells of LaAlO$_3$. In the right panels, the red, blue, and orange lines are the total density of states (DOS), the atomic projected DOS of Ti-$d$ states, and the atomic projected DOS of O $p$-states, respectively. The vertical green line in the right panels is the Fermi level.](pot-dos.ps){width="10cm"}

In order to give a clearer illustration of how the polar field reduces the energy gap, we show 