  Evaluating the accuracy and calibration of the redshift posteriors produced
by photometric redshift (photo-z) estimators is vital for enabling precision
cosmology and extragalactic astrophysics with modern wide-field photometric
surveys. Evaluating photo-z posteriors on a per-galaxy basis is difficult,
however, as real galaxies have a true redshift but not a true redshift
posterior. We introduce PZFlow, a Python package for the probabilistic forward
modeling of galaxy catalogs with normalizing flows. For catalogs simulated with
PZFlow, there is a natural notion of "true" redshift posteriors that can be
used for photo-z validation. We use PZFlow to simulate a photometric galaxy
catalog where each galaxy has a redshift, noisy photometry, shape information,
and a true redshift posterior. We also demonstrate the use of an ensemble of
normalizing flows for photo-z estimation. We discuss how PZFlow will be used to
validate the photo-z estimation pipeline of the Dark Energy Science
Collaboration (DESC), and the wider applicability of PZFlow for statistical
modeling of any tabular data.
