A graphene nanoribbon is a strip of the honeycomb lattice cut with a zigzag (teeth-shaped) or armchair (scalloped) edge. This simulator builds the real N×N nearest-neighbor tight-binding Hamiltonian for a finite ribbon,
H = -t Σ<i,j> c†ⅻ cⅻ (sum over bonded pairs, t = hopping energy)
and diagonalizes it numerically (cyclic Jacobi rotation) to get every exact energy En and wavefunction amplitude ψn(i).
Instead of rendering the wavefunction as a 3D height field over the atomic lattice, this version bins every atom into its transverse row (position across the ribbon width) and builds a local density of states map: for every row and every energy, it sums Σ|ψn(i)|² over atoms i in that row across all states n whose energy is within a small Gaussian window of that point. The result is a 2D field ρ(row, E) — a canonical solid-state "spectral fingerprint" plot, the same kind of row-vs-energy map used to visualize edge states with scanning tunneling spectroscopy.
- Zigzag edges produce a bright horizontal stripe pinned at E = 0 that is concentrated in the outermost rows — the edge-localized flat band predicted by Fujita et al. (1996) and Nakada et al. (1996).
- Armchair edges of the same size show no such row-confined stripe: whatever density exists near E = 0 is spread across the full row range.
- The right-hand bar strip shows the row-density profile |ψ(row)|² of the state currently selected by the slider, aligned with the map's rows.
- Edge weight = fraction of Σ|ψ(i)|² sitting in the outer 18% of the ribbon width on each side. Participation ratio = 1 / Σ|ψ(i)|⁴ (small = tightly localized).