Beam preparation for studying the gravitational behavior of antimatter at rest (GBAR)