  We provide a detailed description of the path-integral Monte Carlo worm
algorithm used to exactly calculate the thermodynamics of Bose systems in the
canonical ensemble. The algorithm is fully consistent with periodic boundary
conditions, that are applied to simulate homogeneous phases of bulk systems,
and it does not require any limitation in the length of the Monte Carlo moves
realizing the sampling of the probability distribution function in the space of
path configurations. The result is achieved adopting a representation of the
path coordinates where only the initial point of each path is inside the
simulation box, the remaining ones being free to span the entire space.
Detailed balance can thereby be ensured for any update of the path
configurations without the ambiguity of the selection of the periodic image of
the particles involved. We benchmark the algorithm using the non-interacting
Bose gas model for which exact results for the partition function at finite
number of particles can be derived. Convergence issues and the approach to the
thermodynamic limit are also addressed for interacting systems of hard spheres
in the regime of high density.
