Measurement of quantum states of neutrons in the earth's gravitational field