  We have carried out first-principles simulations, based on density functional
theory, to obtain the atomic and electronic structure of (001)
BaTiO$_{3}$/KNbO$_{3}$ interfaces in an isolated slab geometry. We tried
different types of structures including symmetric and asymmetric
configurations, and variations in the thickness of the constituent materials.
The spontaneous polarization of the layer-by-layer non neutral material
(KNbO$_{3}$) in these interfaces cancels out almost exactly the "built-in"
polarization responsible for the electronic reconstruction. As a consequence,
the so-called polar catastrophe is quenched and all the simulated interfaces
are insulating. A model, based on the modern theory of polarization and basic
electrostatics, allows an estimation of the critical thickness for the
formation of the two-dimensional electron gas between 42 and 44 KNbO$_{3}$ unit
cells. We also demonstrate the presence of an unexpected in-plane polarization
in BaTiO$_{3}$ localized at the $p$-type TiO$_2$/KO interface, even under
in-plane compressive strains. We expect this in-plane polarization to remain
hidden due to angular averaging during quantum fluctuations unless the symmetry
is broken with small electric fields.
