Measuring the distance between quantum many-body wave functions