The virial theorem originates in classical mechanics and expresses a balance between kinetic energy and the radial component of the force acting on a system. Remarkably, this principle persists in quantum mechanics. For the Schrödinger equation, virial identities arise from simple dynamical considerations and have become fundamental tools in the analysis of partial differential equations, with applications ranging from dispersive estimates to nonlinear dynamics. In this talk I will discuss how the virial principle extends to relativistic quantum mechanics, governed by the Dirac operator. In this setting the classical dynamical derivation breaks down due to the peculiar structure of relativistic dynamics. Instead, virial-type identities emerge from algebraic relations involving commutators and anticommutators of the Dirac Hamiltonian. This viewpoint reveals an unexpected connection between classical mechanics, quantum dynamics, and operator theory. As an application, we obtain constraints on the spectral properties of relativistic quantum Hamiltonians, leading in particular to conditions that exclude the existence of bound states.