  Developing an algorithm for computing the Betti numbers of semi-algebraic
sets with singly exponential complexity has been a holy grail in algorithmic
semi-algebraic geometry and only partial results are known. In this paper we
consider the more general problem of computing the image under the homology
functor of a semi-algebraic map $f:X \rightarrow Y$ between closed and bounded
semi-algebraic sets. For every fixed $\ell \geq 0$ we give an algorithm with
singly exponential complexity that computes bases of the homology groups
$\mathrm{H}_i(X), \mathrm{H}_i(Y)$ (with rational coefficients) and a matrix
with respect to these bases of the induced linear maps
$\mathrm{H}_i(f):\mathrm{H}_i(X) \rightarrow \mathrm{H}_i(Y), 0 \leq i \leq
\ell$. We generalize this algorithm to more general (zigzag) diagrams of maps
between closed and bounded semi-algebraic sets and give a singly exponential
algorithm for computing the homology functors on such diagrams. This allows us
to give an algorithm with singly exponential complexity for computing barcodes
of semi-algebraic zigzag persistent homology in small dimensions.
