I'm studying an introduction course to quantum computation at my uni and we got homework to draw a certain circuit using qiskit. I managed to understand how to do what is asked from me, and this is the final answer:
Now I know that once the qubit is no longer used in a manipulation you can measure it without effecting the results, however I find this circuit rather confusing and messy. Since we can always postponed our measurement to the end, I'd prefer a more organised drawing where all CNOT gates are performed, and only then the measurements - preferably from the top one to the bottom one. Is it possible to force such a thing?
To try and force the code doing that I tried to first use a for loop to apply CNOTs on every qubit, then using a seperate loop I performed the measurements on every qubit
circuit_three = QuantumCircuit(5, 5) circuit_three.h(0) for i in range(1, 5): circuit_three.cx(0, i) for i in range(0, 5): circuit_three.measure(i, i) circuit_three.draw(output='mpl', filename='3')