A general method for approximating the electronic correlation energy in molecules and solids | Synapse