a, b, The local density of states (DOS; colour scale) in different cross-sections of a clean system with random impurities W = 0 (a) and a system with random impurities W = 0.1 (both in the bulk and on the surface; b), showing the location and extent of the modes. The system size is Lx = 120, Ly = 100 and Lz ∈ [21, 35], with sharp side walls at both ends. The upper panels show trapezoidal x–z cross-sections, with the local DOS averaged across y ∈ [0.1Ly, 0.9Ly] to exclude contributions from the modes on the side walls at both ends in the y direction. The lower panels show the x–y cross-sections, with the local DOS averaged across the thickness Lz. We set the Fermi energy to μ = 0.4. c, d, Real-space thickness profile in the x–y plane (Lz, colour scale; c) and the local DOS (d). The settings are the same as in a, except that we consider a system with an uneven top surface (see c). e, Local DOS across the x–z cross-section, averaged over y ∈ [0.1Ly, 0.9Ly]; μ = 0.41. f, Local DOS in the x–y cross-section, averaged over the thickness Lz, for Fermi energies of μ = 0.41, μ = 0.40 and μ = 0.39. As the Fermi energy shifts, the x position of the bulk modes moves accordingly. g, Schematic of the Landau levels. A chiral mode appears where the Landau level crosses the Fermi energy μ (red dotted lines). The energy profile also illustrates the origin of the counter-propagating chiral modes on the right side wall. The system size is Lx = 90, Ly = 100 and Lz ∈ [21, 49]; W = 0.