Quantum theory of electron-optical phonon interaction in ionic crystal films