where E is an arbitrary energy, Tr is the trace operation, Ĥ is an arbitrary Hamiltonian, E i is the i th eigenvalue of the Hamiltonian Ĥ, and δ is the standard Dirac-δ -function. In practice, if one cannot directly diagonalize the Hamiltonian, it is hard to know the set of E i to generate the exact DOS. However, in the following, we will both approximate the δ -function and obtain the DOS without diagonalizing the Hamiltonian or knowing its eigenvalues . The code and data that support the findings of this article are openly available .