I am not sure exactly what you are trying to do by doing this but this does what you are looking for:
from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit
from numpy import pi
from numpy.random import randint
from numpy.random import shuffle
num_qubits = 10
qreg_q = QuantumRegister(num_qubits, 'q')
creg_c = ClassicalRegister(num_qubits, 'c')
circuit = QuantumCircuit(qreg_q, creg_c)
for i in range(num_qubits):
circuit.h(qreg_q[i])
sequence = [i for i in range(num_qubits)]
shuffle(sequence)
num_measurements = 6
for i in range(num_measurements):
circuit.measure(qreg_q[sequence[i] ], creg_c[sequence[i] ])
circuit.draw( )
This will create a layer of Hadamard gate on n-qubits then you can select the number of measurements you want to execute. It will then place those measurement randomly on different qubits. Thus, if you run the above code, you might generate a circuit something like:
┌───┐
q_0: ┤ H ├──────────────────
├───┤ ┌─┐
q_1: ┤ H ├────────────┤M├───
├───┤ └╥┘
q_2: ┤ H ├─────────────╫────
├───┤ ║
q_3: ┤ H ├─────────────╫────
├───┤ ┌─┐ ║
q_4: ┤ H ├─────────┤M├─╫────
├───┤ └╥┘ ║
q_5: ┤ H ├──────────╫──╫────
├───┤ ┌─┐ ║ ║
q_6: ┤ H ├───┤M├────╫──╫────
├───┤ └╥┘ ║ ║ ┌─┐
q_7: ┤ H ├────╫─────╫──╫─┤M├
├───┤┌─┐ ║ ║ ║ └╥┘
q_8: ┤ H ├┤M├─╫─────╫──╫──╫─
├───┤└╥┘ ║ ┌─┐ ║ ║ ║
q_9: ┤ H ├─╫──╫─┤M├─╫──╫──╫─
└───┘ ║ ║ └╥┘ ║ ║ ║
c: 10/══════╩══╩══╩══╩══╩══╩═
8 6 9 4 1 7
Updated: So now, if we want to read-out the random bitstring, we can do:
backend = BasicAer.get_backend('qasm_simulator')
counts = execute(circuit, backend, shots=1).result().get_counts()
bit_strings = list(counts.keys())[0]
print('random bit_strings:', bit_strings)
which would output:
random bit_strings: 0011010010