Theory of heavy ion charge exchange scattering at low and intermediate energies