Operator description of the dynamics of optical modes