Applying a gate to all line qubits without explicitly listing them in Cirq

Say we have a custom gate CG, defined by a unitary matrix U, and line qubits qubits in Cirq. Something like this:

import numpy
import cirq

U = np.eye(8)    # The custom unitary matrix goes here
CG = cirq.MatrixGate(U)
qubits = cirq.LineQubit.range(3)


We build the circuit as follows:

circuit = cirq.Circuit()
circuit.append(CG(qubits[0], qubits[1], qubits[2]))


Is it possible to build the circuit without explicitly specifying all the qubits? Something like circuit.append(CG(qubits)), which would apply the CG gate to all the qubits?

In Python you can say callable(*args) instead of callable(args[0], args[1], args[2]).
• i.e. in your example you could write CG(*qubits) Jul 30 '20 at 21:35