  Fast N-body PM simulations with a small number of time steps such as FastPM
or COLA have been remarkably successful in modeling the galaxy statistics, but
their lack of small scale force resolution and long time steps cannot give
accurate halo matter profiles or matter power spectrum. High resolution N-body
simulations can improve on this, but lack baryonic effects, which can only be
properly included in hydro simulations. Here we present a scheme to calibrate
the fast simulations to mimic the precision of the hydrodynamic simulations or
high resolution N-body simulations. The scheme is based on a gradient descent
of either effective gravitational potential, which mimics the short range
force, or of effective enthalpy, which mimics gas hydrodynamics and feedback.
The scheme is fast and differentiable, and can be incorporated as a
post-processing step into any simulation. It gives very good results for the
matter power spectrum for several of the baryonic feedback and dark matter
simulations, and also gives improved dark matter halo profiles. The scheme is
even able to find the large subhalos, and increase the correlation coefficient
between the fast simulations and the high resolution N-body or hydro
simulations. It can also be used to add baryonic effects to the high resolution
N-body simulations. While the method has free parameters that can be calibrated
on various simulations, they can also be viewed as astrophysical nuisance
parameters describing baryonic effects that can be marginalized over during the
data analysis. In this view these parameters can be viewed as an efficient
parametrization of baryonic effects.
