Relationship between the wave function of a magnet and its static structure factor