  The metaplectic transform (MT), a generalization of the Fourier transform
sometimes called the linear canonical transform, is a tool used ubiquitously in
modern optics, for example, when calculating the transformations of light beams
in paraxial optical systems. The MT is also an essential ingredient of the
geometrical-optics modeling of caustics that was recently proposed by the
authors. In particular, this application relies on the near-identity MT (NIMT);
however, the NIMT approximation used so far is not exactly unitary and leads to
numerical instability. Here, we develop a discrete MT that is exactly unitary,
and approximate it to obtain a discrete NIMT that is also unitary and can be
computed in linear time. We prove that the discrete NIMT converges to the
discrete MT when iterated, thereby allowing the NIMT to compute MTs that are
not necessarily near-identity. We then demonstrate the new algorithms with a
series of examples.
