$p$-type interface between the SrTiO$_3$ substrate and the 2 u.c. [LaAlO$_3$ ]{}buffer layer, and two $n$-type interfaces on both sides of the inserted thin [SrTiO$_3$ ]{}film. Both of the LaAlO$_3$ thin films are stoichiometric in this sytem, while the embedded SrTiO$_3$ thin film is not. As we have two $n$-type interfaces, the quantum well systems have one extra TiO$_2$ layer in the inserted SrTiO$_3$ film. Like the $n$-type and $np$-type interfaces, the two SrTiO$_3$ unit cells of the substrate facing the vacuum are fixed to simulate a bulk-like substrate and all the other atoms are fully relaxed.

The reason that this configuration forms a quantum well can also be explained in terms of an energy diagram. Fig. \[fig:interface\]d shows that the polar fields in the two LaAlO$_3$ thin films point in opposite directions. Therefore, the energy of the Ti-$d$ states in the embedded SrTiO$_3$ thin film is lowered relative to the conduction band edge of the SrTiO$_3$ substrate. (We choose two unit cells of LaAlO$_3$ as the buffer layer in order to bring down the Ti-$d$ states of the embedded SrTiO$_3$ film into the band gap of the SrTiO$_3$ substrate). As the capping LaAlO$_3$ layer thickens, the energy of the 