def controlled_by(self, *control_qubits: Qid) -> 'Gate':
        """Returns a controlled version of this gate.

        Args:
            control_qubits: Optional qubits to control the gate by.
        """
        # Avoids circular import.
        from cirq.ops import ControlledGate
        return ControlledGate(self, control_qubits,
                              len(control_qubits) if control_qubits is not None
                                                  else 1)