  Two-qubit gates in trapped ion quantum computers are generated by applying
spin-dependent forces that temporarily entangle the internal state of the ion
with its motion. Laser pulses are carefully designed to generate a maximally
entangling gate between the ions while minimizing any residual entanglement
between the motion and the ion. The quality of the gates suffers when actual
experimental parameters differ from the ideal case. Here we improve the
robustness of frequency-modulated M{\o}lmer-S{\o}rensen gates to motional mode
frequency offsets by optimizing average performance over a range of systematic
errors using batch optimization. We then compare this method to frequency
modulated gates optimized for ideal parameters that include an analytic
robustness condition. Numerical simulations show good performance up to 12 ions
and the method is experimentally demonstrated on a two-ion chain.
