query in when we apply multiple H gates in multiple qubits. suppose, one circuit, qreg_q = QuantumRegister(2, 'q') creg_c = ClassicalRegister(2, 'c') circuit = QuantumCircuit(qreg_q, creg_c)

circuit.h(qreg_q1) circuit.h(qreg_q[0]) circuit.h(qreg_q1) gives output for '00' and '01' states. and qreg_q = QuantumRegister(2, 'q') creg_c = ClassicalRegister(2, 'c') circuit = QuantumCircuit(qreg_q, creg_c)

circuit.h(qreg_q1) circuit.h(qreg_q[0]) circuit.h(qreg_q[0]) gives output for '00' and '10' states.

How to do this internal calculation? anyone help plz... how to derive.. for more H gates..

• Can you draw a circuit for what you're trying to implement? Then use a circuit identity where you can replace two H gates on the same wire with a blank wire. Apr 18 at 13:44
• how to post a picture in comment? Apr 18 at 13:46
• yes i know that but i am just looking for the detailed calculations in these two different cases? Apr 18 at 13:54
• You can't post a picture in a comment, but you can post it in the question (and improve the question in doing so). Apr 18 at 14:34
• I did. if possible kindly explain. Apr 19 at 6:08

You start by using the identity $$H^2=I$$. So, take your first circuit. You do Hadamard on the top qubit, and nothing on the second qubit or the classical bit. Thus, your output would be $$(H|0\rangle)\otimes |0\rangle=(|0\rangle+|1\rangle)\otimes|0\rangle/\sqrt{2}=(|00\rangle+|10\rangle)/\sqrt{2}$$ So, you can see how the outputs should be 00 and 10 with 50:50 probability.