$n$-type and $p$-type interfaces in the same system. Below, we refer to this type of geometry as the $np$-type interface. Experimentally, the $n$-type, $p$-type and $np$-type interfaces have all been fabricated. In this study, we simulate all three types of interfaces, the configurations of which are illustrated in Fig. \[fig:interface\]. For the $np$-type interface, we use 5 unit cells of SrTiO$_3$ to simulate the substrate and another 5 unit cells of SrTiO$_3$ as a capping layer. For both the $n$-type and $p$-type interfaces, we use 11 unit cells of SrTiO$_3$ to simulate the substrate. In all cases, the thickness of LaAlO$_3$ is varied from 1 to 7 unit cells. In addition, the first two SrTiO$_3$ unit cells in the substrate are fixed at the ideal perovskite positions to simulate the bulk-like interior of the substrate [@Chen-PRB-2009]. The termination of the SrTiO$_3$ substrate and capping layers is always SrO. As illustrated in our previous work [^3], the TiO$_2$ termination has a surface O-$p$ state which is $\simeq$ 0.5 eV higher than the valence band edge of bulk SrTiO$_3$, while the SrO termination does not have this surface state. Since we are interested in the evolution of polar fields of LaAlO$_3$ on 