  Recently, variational quantum metrology was proposed for Hamiltonians with
multiplicative parameters, wherein the estimation precision can be optimized
via variational circuits. However, systems with generic Hamiltonians still lack
these variational schemes. This work introduces a quantum-circuit-based
approach for studying quantum metrology with generic Hamiltonians. We present a
time-dependent stochastic parameter-shift rule for the derivatives of evolved
quantum states, whereby the quantum Fisher information can be obtained. The
scheme can be executed in universal quantum computers under the family of
parameterized gates. In magnetic field estimations, we demonstrate the
consistency between the results obtained from the stochastic parameter-shift
rule and the exact results, while the results obtained from a standard
parameter-shift rule slightly deviate from the exact ones. Our work sheds light
on studying quantum metrology with generic Hamiltonians using quantum circuit
algorithms.
