(Left) Neutron mirror apparatus. An ultracold neutron (UCN) enters a space between two mirrors that act as potential wells, giving rise to a discrete energy spectrum. A detector measures neutrons exiting the cavity formed by the mirrors. The bottom mirror sits upon a nanopositioning table that induces a vertical oscillation that produces dips in the neutron transmission at the resonances. (Right) Energy-level diagram for the neutrons in a gravitational field caught between the walls, which oscillate owing to the mirror motion (horizontal direction here is vertical in the apparatus). This, in turn, causes the neutrons to move up and down energy levels. A measurement of the energy-level spacing yields constraints on parameters of scenarios describing dark energy and dark matter, which would slightly shift the levels as indicated by the dashed lines.