  We consider the mathematical background of the wavefront sensor type that is
widely used in Adaptive Optics systems for astronomy, microscopy, and
ophthalmology. The theoretical analysis of the pyramid sensor forward operators
presented in this paper is aimed at a subsequent development of fast and stable
algorithms for wavefront reconstruction from data of this sensor type. In our
analysis we allow the sensor to be utilized in both the modulated and
non-modulated fashion. We derive detailed mathematical models for the pyramid
sensor and the physically simpler roof wavefront sensor as well as their
various approximations. Additionally, we calculate adjoint operators which
build preliminaries for the application of several iterative mathematical
approaches for solving inverse problems such as gradient based algorithms,
Landweber iteration or Kaczmarz methods.
