  We report on a systematic approach for the calculation of the negativity in
the ground state of a one-dimensional quantum field theory. The partial
transpose rho_A^{T_2} of the reduced density matrix of a subsystem A=A_1 U A_2
is explicitly constructed as an imaginary-time path integral and from this the
replicated traces Tr (rho_A^{T_2})^n are obtained. The logarithmic negativity
E= log||rho_A^{T_2}|| is then the continuation to n->1 of the traces of the
even powers. For pure states, this procedure reproduces the known results. We
then apply this method to conformally invariant field theories in several
different physical situations for infinite and finite systems and without or
with boundaries. In particular, in the case of two adjacent intervals of
lengths L1, L2 in an infinite system, we derive the result E\sim(c/4) ln(L1
L2/(L1+L2)), where c is the central charge. For the more complicated case of
two disjoint intervals, we show that the negativity depends only on the
harmonic ratio of the four end-points and so is manifestly scale invariant. We
explicitly calculate the scale-invariant functions for the replicated traces in
the case of the CFT for the free compactified boson, but we have not so far
been able to obtain the n->1 continuation for the negativity even in the limit
of large compactification radius. We have checked all our findings against
exact numerical results for the harmonic chain which is described by a
non-compactified free boson.
