# How can I define two distinct sets of qubits? (Cirq)

I am trying to familiarise myself with Cirq, and I came across something I don't know how to code.

I would like to define two sets of qubits as follows: say the number of qubits in set 1 and 2 are both 3, then I would like my qubits in set 1 to be [cirq.GridQubit(0,0), cirq.GridQubit(0,1), cirq.GridQubit(0,2)] and my qubits in set 2 to be [cirq.GridQubit(1,0), cirq.GridQubit(1,1), cirq.GridQubit(1,2)]. I would like to be able to generalise this for an arbitrary number of qubits. In other words, I would like to be able to refer to a qubit in set 1 as cirq.GridQubit(0,i), and to a qubit in set 2 as cirq.GridQubit(1,j), for 0≤i<number of qubits in set 1 and 0≤j<number of qubits in set 2.

I can create my first set of qubits using qubits_set1 = cirq.GridQubit.rect(1, number_qubits_set1), but I am not sure how to create the second set?

Many thanks!

You can do this using the top keyword argument for cirq.GridQubit.rect which controls the starting index value for the first (topmost) row of the rectangle is indexed from:
qubits_set1 = cirq.GridQubit.rect(1, num_qubits_set1, top=0)

The left keyword provides analogous behavior for the column indexing by controlling the starting index value for the first column