  We apply a worm algorithm to simulate the quantum transverse-field Ising
model in a path-integral representation of which the expansion basis is taken
as the spin component along the external-field direction. In such a
representation, a configuration can be regarded as a set of non-intersecting
loops constructed by "kinks" for pairwise interactions and spin-down (or -up)
imaginary-time segments. The wrapping probability for spin-down loops, a
dimensionless quantity characterizing the loop topology on a torus, is observed
to exhibit small finite-size corrections and yields a high-precision critical
point in two dimensions (2D) as $h_c \! =\! 3.044\, 330(6)$, significantly
improving over the existing results and nearly excluding the best one $h_c \!
=\! 3.044\, 38 (2)$. At criticality, the fractal dimensions of the loops are
estimated as $d_{\ell \downarrow} (1{\rm D}) \! = \! 1.37(1) \! \approx \! 11/8
$ and $d_{\ell \downarrow} (2{\rm D}) \! = \! 1.75 (3)$, consistent with those
for the classical 2D and 3D O(1) loop model, respectively. An interesting
feature is that in one dimension (1D), both the spin-down and -up loops display
the critical behavior in the whole disordered phase ($ 0 \! \leq \! h \! < \!
h_c$), having a fractal dimension $d_{\ell} \! = \! 1.750 (7)$ that is
consistent with the hull dimension $d_{\rm H} \! = \! 7/4$ for critical 2D
percolation clusters. The current worm algorithm can be applied to simulate
other quantum systems like hard-core boson models with pairing interactions.
