Bayesian optimization for state engineering of quantum gases