Jonathan Swift Bersson, Mikael Kovtun, Xiaosong Li
We present a new implementation of four-component relativistic density functional theory within the Dirac-Kohn-Sham framework using a Pauli quaternion representation of the density matrix. The method enables the evaluation of charge and magnetization densities from both large- and small-component wavefunctions and combines their contributions into a single exchange-correlation potential, allowing existing non-collinear and hybrid density functionals to be used in a fully relativistic framework. We also examine the numerical grid requirements for all-electron relativistic calculations and recommend superfine quadrature for reliable treatment of the small-component density. Benchmark calculations on Cu2, Ag2, and Au2 reproduce experimental spectroscopic trends and demonstrate that explicit small-component exchange-correlation contributions become increasingly important with atomic number. Comparisons between one-electron exact two-component and four-component calculations show that neglecting these contributions leads to growing errors for heavy and superheavy elements, with the error scaling linearly on a logarithmic scale with the magnitude of the small-component density. This work provides an efficient and robust foundation for fully relativistic density functional calculations in chemistry.