  Quantum metrology comprises a set of techniques and protocols that utilize
quantum features for parameter estimation which can in principle outperform any
procedure based on classical physics. We formulate the quantum metrology in
terms of an optimal control problem and apply Pontryagin's Maximum Principle to
determine the optimal protocol that maximizes the quantum Fisher information
for a given evolution time. As the quantum Fisher information involves a
derivative with respect to the parameter which one wants to estimate, we devise
an augmented dynamical system that explicitly includes gradients of the quantum
Fisher information. The necessary conditions derived from Pontryagin's Maximum
Principle are used to quantify the quality of the numerical solution. The
proposed formalism is generalized to problems with control constraints, and can
also be used to maximize the classical Fisher information for a chosen
measurement.
