  The study of persistent homology has contributed new insights and
perspectives into a variety of interesting problems in science and engineering.
Work in this domain relies on the result that any finitely-indexed persistence
module of finite-dimensional vector spaces admits an interval decomposition --
that is, a decomposition as a direct sum of simpler components called interval
modules. This result fails if we replace vector spaces with modules over more
general coefficient rings.
  We introduce an algorithm to determine whether a persistence module of
pointwise free and finitely-generated modules over a principal ideal domain
(PID) splits as a direct sum of interval submodules. If one exists, our
algorithm outputs an interval decomposition. Our algorithm is finite
(respectively, polynomial) time if the problem of computing Smith normal form
over the chosen PID is finite (respectively, polynomial) time. This is the
first algorithm with these properties of which we are aware.
  We also show that a persistence module of pointwise free and
finitely-generated modules over a PID splits as a direct sum of interval
submodules if and only if the cokernel of every structure map is free. This
result underpins the formulation our algorithm. It also complements prior
findings by Obayashi and Yoshiwaki regarding persistent homology, including a
criterion for field independence and an algorithm to decompose persistence
homology modules of simplex-wise filtrations.
