-3
$\begingroup$

enter image description herequery 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 enter image description here 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..

$\endgroup$
5
  • $\begingroup$ 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. $\endgroup$
    – DaftWullie
    Apr 18 at 13:44
  • $\begingroup$ how to post a picture in comment? $\endgroup$
    – Arpita
    Apr 18 at 13:46
  • $\begingroup$ yes i know that but i am just looking for the detailed calculations in these two different cases? $\endgroup$
    – Arpita
    Apr 18 at 13:54
  • $\begingroup$ You can't post a picture in a comment, but you can post it in the question (and improve the question in doing so). $\endgroup$
    – DaftWullie
    Apr 18 at 14:34
  • $\begingroup$ I did. if possible kindly explain. $\endgroup$
    – Arpita
    Apr 19 at 6:08

1 Answer 1

1
$\begingroup$

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.

This, however, was using the convention that assume the top qubit in the circuit is the first qubit in the tensor product. This is the convention that you'll find in pretty much any quantum computation textbook. However, it's not the convention that qiskit uses, which is where I assume you're performing these calculations. They take the tensor product in the opposite order, so the top qubit is the last one in the tensor product. Thus, the outputs are 00 and 01 with 50:50 probability.

$\endgroup$
2
  • $\begingroup$ But for teh first circuit it is '00' and '01' and fr the second '00' and '10'.. $\endgroup$
    – Arpita
    Apr 19 at 6:42
  • $\begingroup$ ok.. got it now.. $\endgroup$
    – Arpita
    Apr 19 at 6:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.