Preparation of W, GHZ, and two-qutrit states using bimodal cavities