Polynomial deformations of Lie algebras in quantum optics