  Using quantum systems as sensors or probes has been shown to greatly improve
the precision of parameter estimation by exploiting unique quantum features
such as entanglement. A major task in quantum sensing is to design the optimal
protocol, i.e., the most precise one. It has been solved for some specific
instances of the problem, but in general even numerical methods are not known.
Here, we focus on the single-shot Bayesian setting, where the goal is to find
the optimal initial state of the probe (which can be entangled with an
auxiliary system), the optimal measurement, and the optimal estimator function.
We leverage the formalism of higher-order operations to develop a method based
on semidefinite programming that finds a protocol that is close to the optimal
one with arbitrary precision. Crucially, our method is not restricted to any
specific quantum evolution, cost function or prior distribution, and thus can
be applied to any estimation problem. Moreover, it can be applied to both
single or multiparameter estimation tasks. We demonstrate our method with three
examples, consisting of unitary phase estimation, thermometry in a bosonic
bath, and multiparameter estimation of an SU(2) transformation. Exploiting our
methods, we extend several results from the literature. For example, in the
thermometry case, we find the optimal protocol at any finite time and quantify
the usefulness of entanglement.
