The density functional definition of exchange and correlation differs from the traditional one. In order to calculate the density functional theory ͑DFT͒, quantities accurately, molecular Kohn-Sham ͑KS͒ solutions have been obtained from ab initio wave functions for the homonuclear diatomic molecules Li 2 , N 2 , F 2 . These afford the construction of the KS determinant ⌿ s and the calculation of its total electronic energy E KS and the kinetic, nuclear-attraction and Coulomb repulsion components T s , V, W H as well as the ͑DFT͒ exchange energy E x and correlation energy E c . Comparison of these DFT quantities has been made on one hand with the corresponding HartreeFock ͑HF͒ quantities and on the other hand with local density approximation ͑LDA͒ and generalized gradient approximation ͑GGA͒. Comparison with HF shows that the correlation errors in the components T, V, and W H of the total energy are much larger for HF than KS determinantal wave functions. However, the total energies E KS and E HF appear to be close to each other, as well as the exchange energies E x and E x HF and correlation energies E c and E c HF . The KS determinantal wave function and the KS orbitals therefore correspond to much improved kinetic and Coulombic energies, while having only a slightly larger total correlation energy. It is stressed that these properties of the Kohn-Sham orbitals make them very suitable for use in the molecular orbital theories of chemistry. Comparison of the accurate Kohn-Sham exchange and correlation energies with LDA and GGA shows that the GGA exchange energies are consistently too negative, while the GGA correlation energies are not negative enough. It is argued that the GGA exchange functionals represent effectively not only exchange, but also the molecular non-dynamical correlation, while the GGA correlation functionals represent dynamical correlation only. © 1997 American Institute of Physics. ͓S0021-9606͑97͒00337-1͔