  We propose an approach to realize an $n$-qubit controlled-$U$ gate with
superconducting quantum interference devices (SQUIDs) in cavity QED. In this
approach, the two lowest levels of a SQUID represent the two logical states of
a qubit while a higher-energy intermediate level serves the gate manipulation.
Our method operates essentially by creating a single photon through one of the
control SQUIDs and then performing an arbitrary unitrary transformation on the
target SQUID with the assistance of the cavity photon. In addition, we show
that the method can be applied to implement an $n $% -qubit controlled-$U$ gate
with atomic qubits in cavity QED.
