  The radio interferometer measurement equation (RIME), especially in its 2x2
form, has provided a comprehensive matrix-based formalism for describing
classical radio interferometry and polarimetry, as shown in the previous three
papers of this series. However, recent practical and theoretical developments,
such as phased array feeds (PAFs), aperture arrays (AAs) and wide-field
polarimetry, are exposing limitations of the formalism. This paper aims to
develop a more general formalism that can be used to both clearly define the
limitations of the matrix RIME, and to describe observational scenarios that
lie outside these limitations. Some assumptions underlying the matrix RIME are
explicated and analysed in detail. To this purpose, an array correlation matrix
(ACM) formalism is explored. This proves of limited use; it is shown that
matrix algebra is simply not a sufficiently flexible tool for the job. To
overcome these limitations, a more general formalism based on tensors and the
Einstein notation is proposed and explored both theoretically, and with a view
to practical implementations. The tensor formalism elegantly yields generalized
RIMEs describing beamforming, mutual coupling, and wide-field polarimetry in
one equation. It is shown that under the explicated assumptions, tensor
equations reduce to the 2x2 RIME. From a practical point of view, some methods
for implementing tensor equations in an optimal way are proposed and analysed.
The tensor RIME is a powerful means of describing observational scenarios not
amenable to the matrix RIME. Even in cases where the latter remains applicable,
the tensor formalism can be a valuable tool for understanding the limits of
such applicability.
