  We develop a continuous-time quantum Monte Carlo (CTQMC) method for quantum
impurities coupled to interacting quantum wires described by a
Tomonaga-Luttinger liquid. The method is negative-sign free for any values of
the Tomonaga-Luttinger parameter, which is rigorously proved, and thus,
efficient low-temperature calculations are possible. Duality between electrons
and bosons in one dimensional systems allows us to construct a simple formula
for the CTQMC algorithm in these systems. We show that the CTQMC for
Tomonaga-Luttinger liquids can be implemented with only minor modifications of
previous CTQMC codes developed for impurities coupled to non-interacting
fermions. We apply this method to the Kane-Fisher model of a potential
scatterer in a spin-less quantum wire and to a single spin coupled with the
edge state of a two-dimensional topological insulator assuming an anisotropic
XXZ coupling. Various dynamical response functions such as the electron Green's
function and spin-spin correlation functions are calculated numerically and
their scaling properties are discussed.
