Sampling photons to simulate molecules