the Q-switch is an externally controlled variable attenuator. This may be a mechanical device such as a shutter, chopper wheel, or spinning mirror/prism placed inside the cavity, or (more commonly) it may be some form of modulator such as an acousto-optic device, a magneto-optic effect device or an electro-optic device — a Pockels cell or Kerr cell.