Quantum mechanical determination of the potential and carrier distributions in the inversion layer of metal—oxide—semiconductor devices