# Can a Qubit belong to 2 different registers?

I'm starting with Qiskit in Python.

My question is regarding to have registers and sub-register. Something like this

axreg=QuantumRegister(4,name='ax')
ahreg=QuantumRegister(axreg[:2],name='ah')
alreg=QuantumRegister(axreg[2:],name='al')


The constructor of QuantumRegister has only the number of qubits to create, and I find no way to add previously existing qubit to other register

If you want to add previously existing qubits to other register you can obviously compose or append to add previously existing qubits to other register, let's say we have have two qubits who are in state |++> and we want to add them to our register which has for example 4 qubits, we can do

sub_circuit = QuantumCircuit(2)
circuit = QuantumCircuit(4)
qr = circuit.qregs[0]
circuit.x(range(4))
sub_circuit.h(range(2))
circuit = circuit.append(sub_circ.to_instruction(), [qr[0], qr[1]])


You'll get something like this

• Thank! I'll try the "subcircuit" approach. This is not exacty what I was looking for, but it's useful – Sourcerer Aug 18 at 9:23