  The electronic structure of interfaces between LaAlO$_3$ and SrTiO$_3$ is
studied using local spin density approximation (LSDA) with intra-atomic Coulomb
repulsion (LSDA+U). We find that the nature of the interface metallic states is
strongly affected by the type of the structure (sandwich or bilayer) and by the
termination surface of LaAlO$_3$. In all structures the atomic relaxation plays
a crucial role in the electronic properties of the system. While in sandwiches
the structural relaxation produces a significant polarization in SrTiO$_3$ and
Jahn-Teller like splitting of Ti $3d_{xy}$ orbitals, in AlO$_2$-terminated
bilayers the relaxation occurs primarily in LaAlO$_3$ and results in an
insulator-metal transition which has been observed experimentally with
increasing thickness of the LaAlO$_3$ layer.
