The recently derived input-output relations for radiation at a dispersive a
nd absorbing four-port device [T. Gruner and D.-G. Welsch, Phys. Rev. A 53,
1661 (1996)] are used to derive the unitary transformation that relates th
e output quantum state to the input quantum state, including radiation and
matter and without placing frequency restrictions. It is shown that for eac
h frequency component the transformation can be regarded as a U(4) group tr
ansformation, which can directly be calculated from the underlying complex
refractive-index profile of the device without additional postulates. If fo
r narrow-bandwidth radiation far from the medium resonances the absorption
matrix of the four-port device can be disregarded, the well-known U(2) grou
p transformation for a lossless device is recognized. Explicit formulas for
the transformation of Fock states, coherent states, and phase-space functi
ons are given. [S1050-2947(99)03406-X].