Generation of optical harmonics