  We report on a systematic replica approach to calculate the subsystem trace
distance for a quantum field theory. This method has been recently introduced
in [J. Zhang, P. Ruggiero, P. Calabrese, Phys. Rev. Lett. 122, 141602 (2019)],
of which this work is a completion. The trace distance between two reduced
density matrices $\rho_A$ and $\sigma_A$ is obtained from the moments
$\textrm{tr} (\rho_A-\sigma_A)^n$ and taking the limit $n\to1$ of the traces of
the even powers. We focus here on the case of a subsystem consisting of a
single interval of length $\ell$ embedded in the low lying eigenstates of a
one-dimensional critical system of length $L$, a situation that can be studied
exploiting the path integral form of the reduced density matrices of
two-dimensional conformal field theories. The trace distance turns out to be a
scale invariant universal function of $\ell/L$. Here we complete our previous
work by providing detailed derivations of all results and further new formulas
for the distances between several low-lying states in two-dimensional free
massless compact boson and fermion theories. Remarkably, for one special case
in the bosonic theory and for another in the fermionic one, we obtain the exact
trace distance, as well as the Schatten $n$-distance, for an interval of
arbitrary length, while in generic case we have a general form for the first
term in the expansion in powers of $\ell/L$. The analytical predictions in
conformal field theories are tested against exact numerical calculations in XX
and Ising spin chains, finding perfect agreement. As a byproduct, new results
in two-dimensional CFT are also obtained for other entanglement-related
quantities, such as the relative entropy and the fidelity.
