  Functions preserving Loewner positivity when applied entrywise to positive
semidefinite matrices have been widely studied in the literature. Following the
work of Schoenberg [Duke Math. J. 9], Rudin [Duke Math. J. 26], and others, it
is well-known that functions preserving positivity for matrices of all
dimensions are absolutely monotonic (i.e., analytic with nonnegative Taylor
coefficients). In this paper, we study functions preserving positivity when
applied entrywise to sparse matrices, with zeros encoded by a graph $G$ or a
family of graphs $G_n$. Our results generalize Schoenberg and Rudin's results
to a modern setting, where functions are often applied entrywise to sparse
matrices in order to improve their properties (e.g. better conditioning). The
only such result known in the literature is for the complete graph $K_2$. We
provide the first such characterization result for a large family of
non-complete graphs. Specifically, we characterize functions preserving Loewner
positivity on matrices with zeros according to a tree. These functions are
multiplicatively midpoint-convex and super-additive. Leveraging the underlying
sparsity in matrices thus admits the use of functions which are not necessarily
analytic nor absolutely monotonic. We further show that analytic functions
preserving positivity on matrices with zeros according to trees can contain
arbitrarily long sequences of negative coefficients, thus obviating the need
for absolute monotonicity in a very strong sense. This result leads to the
question of exactly when absolute monotonicity is necessary when preserving
positivity for an arbitrary class of graphs. We then provide a stronger
condition in terms of the numerical range of all symmetric matrices, such that
functions satisfying this condition on matrices with zeros according to any
family of graphs with unbounded degrees are necessarily absolutely monotonic.
