Decomposition of (non)linear optical properties