Ti-$d$ states of the SrTiO$_3$ substrate and the O-$p$ states on the surface. For the $p$-type interface, since the polarity of LaAlO$_3$ is reversed, the electric field through the LaAlO$_3$ film decreases the valence band edge of the LaAlO$_3$. However, the energy gap of the $p$-type interface is not the most relevant quantity to monitor for the insulating-to-metallic transition. Rather, the LaAlO$_3$ film reduces the energy difference between the La states on the surface [^4] and the O $p$-states of the SrTiO$_3$ substrate, which from now on we call the ‘La-O energy difference’. In all three cases, the energy gap ($np$-type and $n$-type) or La-O energy difference ($p$-type) diminishes with the LaAlO$_3$ film thickness, finally disappearing when the insulating-to-metallic transition occurs. The minimum number of LaAlO$_3$ unit cells necessary to induce this phase transition is referred to as the ‘critical separation’.

Our DFT calculations, as well as previous studies [@Demkov-PRB-2008; @Chen-PRB-2009; @Pickett-PRL-2009; @Son-PRB-2009], support the above schematics. The values of the calculated energy gap versus the LaAlO$_3$ thickness are listed in Table \[tab:gap\] for the $np$-type, $n$-type and $p$-type interfaces. The corresponding ‘critical separation’ is the smallest thickness of LaAlO$_3$ that makes the interface conducting. The increasing thickness of the 