The generic programming facilities of C++ allow the creation of efficient yet flexible computational systems. The Diagon framework describes the computation of energies and states for general quantum nanoscopic systems. Specifically, it uses the configuration interaction method to obtain all the many-body correlations of the system.