A method includes causing a common-resonator mode resonating with a transition between |2>i and |3>i that are coupled to each other by a transition having a homogenous broadening ΔEhomo greater than an energy difference between |0>i and |1>i, an energy difference between |2>i and |3>i being greater than ΔEhomo, transferring states of m quantum bits represented by |0>k and |1>k to |4>k and |5>k, respectively, when a quantum-bit-gate operation using the common-resonator mode is executed between the quantum bits represented by m physical systems k, |E(|u>k)−E(|v>k)|>ΔEhomo, u, vε{2, 3, 4, 5}, u≠v, executing adiabatic passage between the physical systems k, using light that resonates with a transition between |3>k and |4>k and a transition between |3>k and |5>k, executing the quantum-bit-gate operation between the quantum bits, and transferring, to |0>k and |1>k, the states represented by |4>k and |5>k, respectively.