Quantum mechanics is the foundation for understanding the behavior of electrons and photons in nanoscale systems.