The Bayesian optimization was implemented using bayes_opt library. The black box function was surrogated by gaussian process regression. We used the upper confidence bound (UCB) 𝑈𝐶𝐵(𝑥) = 𝜇(𝑥) + 𝜅𝜎(𝑥) as the acquisition function. Here, 𝜇 and 𝜎 are the expectation value and the deviation at 𝑥, and 𝜅 is a hyperparameter. The value of hyperparameter was chosen based on a pre-simulation (Supplementary Figure ).