According to an embodiment, a quantum computer includes physical systems Xi, a physical system Yj and a light source unit. The physical systems Xi and the physical system Yj are provided in a cavity. Each physical system Xi includes states |0>i, |1>i, |2>i and |e>i, the states |0>i and |1>i being used for a qubit, a |2>i-|e>i transition being resonant with a cavity mode of the cavity. The physical system Yj includes states |2>′j and |e>′j, a |2>′j-|e>′j transition being resonant with the cavity mode. The light source unit applies laser beams to the cavity to manipulate states of two of physical systems Xi, the laser beams including a laser beam for collecting population in the state |2>′j in the |2>′j-|e>′j transition.