where N atoms is the number of atoms in the molecule, q n is an atom-centered charge, and r n is its position. The second term in eq (3), χ q restraint , is a function that restraints the fitted charges towards a set of reference charges. The restraint cost function is given by