Ab initio molecular (x-ray) diffraction