On the occasion of Heisenberg's death, Wigner wrote an obituary in April 1976 issue of Physics Today (pp. 86-87):
Sommerfeld, an excellent teacher with a wonderful overall knowledge of his discipline, maintained close contact with the students of the institute. Although Heisenberg was apparently not one of Sommerfeld's favorite students, he received his doctorate in 1923 at the age of 22. He then went to Max Born's institute in Gottingen for one year and to Copenhagen for three years where Niels Bohr taught.
Whom did Sommerfeld prefer as student and why Heisenberg was not among those?