  Detection of weak forces and precise measurement of time are two of the many
applications of quantum metrology to science and technology. We consider a
quantum system initialized in a pure state and whose evolution is goverened by
a Hamiltonian $H$; a measurement can later estimate the time $t$ for which the
system has evolved. In this work, we introduce and study a fundamental
trade-off which relates the amount by which noise reduces the accuracy of a
quantum clock to the amount of information about the energy of the clock that
leaks to the environment. Specifically, we consider an idealized scenario in
which Alice prepares an initial pure state of the clock, allows the clock to
evolve for a time $t$ that is not precisely known, and then transmits the clock
through a noisy channel to Bob. The environment (Eve) receives any information
that is lost. We prove that Bob's loss of quantum Fisher information (QFI)
about $t$ is equal to Eve's gain of QFI about a complementary energy parameter.
We also prove a more general trade-off that applies when Bob and Eve wish to
estimate the values of parameters associated with two non-commuting
observables. We derive the necessary and sufficient conditions for the accuracy
of the clock to be unaffected by the noise. These are a subset of the
Knill-Laflamme error-correction conditions; states satisfying these conditions
are said to form a metrological code. We provide a scheme to construct
metrological codes in the stabilizer formalism. We show that there are
metrological codes that cannot be written as a quantum error-correcting code
with similar distance in which the Hamiltonian acts as a logical operator,
potentially offering new schemes for constructing states that do not lose any
sensitivity upon application of a noisy channel. We discuss applications of our
results to sensing using a many-body state subject to erasure or
amplitude-damping noise.
