  One of the consequences of entering the era of precision cosmology is the
widespread adoption of photometric redshift probability density functions
(PDFs). Both current and future photometric surveys are expected to obtain
images of billions of distinct galaxies. As a result, storing and analyzing all
of these PDFs will be non-trivial and even more severe if a survey plans to
compute and store multiple different PDFs. In this paper we propose the use of
a sparse basis representation to fully represent individual photo-$z$ PDFs. By
using an Orthogonal Matching Pursuit algorithm and a combination of Gaussian
and Voigt basis functions, we demonstrate how our approach is superior to a
multi-Gaussian fitting, as we require approximately half of the parameters for
the same fitting accuracy with the additional advantage that an entire PDF can
be stored by using a 4-byte integer per basis function, and we can achieve
better accuracy by increasing the number of bases. By using data from the
CFHTLenS, we demonstrate that only ten to twenty points per galaxy are
sufficient to reconstruct both the individual PDFs and the ensemble redshift
distribution, $N(z)$, to an accuracy of 99.9% when compared to the one built
using the original PDFs computed with a resolution of $\delta z = 0.01$,
reducing the required storage of two hundred original values by a factor of ten
to twenty. Finally, we demonstrate how this basis representation can be
directly extended to a cosmological analysis, thereby increasing computational
performance without losing resolution nor accuracy.
