2

In the qiskit textbook chapter 1.3.1 "The CNOT-Gate" it says that the matrix representation on the right is the own corresponding to the circuit shown above, with q_0 being the control and q_1 the target, but shouldn't this matrix representation be for the case of q_1 being the control and q_0 the target? This seems to be presented the other way round...or there seems to be something I am not quite getting yet.

Thanks so much :)

Quick edit: By "right" I am referring to this: enter image description here

epelaez
  • 2,985
  • 1
  • 9
  • 31
Alvo
  • 23
  • 1
  • 4

2 Answers2

12

Qiskit uses "little endian" bit ordering. That means, if A and B are $2 \times 2$ unitary matrices then $B \otimes A$ (note the order) is equivalent to applying $A$ to first qubit and $B$ to second qubit.

Hence, $$CNOT = I \otimes P_0 + X \otimes P_1$$ where $$ P_0 = \left( {\begin{array}{*{20}{c}} 1&0 \\ 0&0 \end{array}} \right) , P_1 = \left( {\begin{array}{*{20}{c}} 0&0 \\ 0&1 \end{array}} \right) $$

If you do the matrix multiplication, you should get $$CNOT = \left( {\begin{array}{*{20}{c}} 1&0&0&0 \\ 0&0&0&1 \\ 0&0&1&0 \\ 0&1&0&0 \end{array}} \right)$$

Egretta.Thula
  • 11,986
  • 1
  • 13
  • 34
-4

enter image description here

Hi there. the Matrix for 0,1 is to represent Q[0] = 1 to be effective, right, so that I wrote & got the answer for the Coefficient to be |01> is 1 in the last column of the Density Matrix.

Consequently do note that the for CNOT for 1,0 to be effecive Q[1] must be one so i get the representation of the the co-efficient of |10> to be 1 as the the last column of the matrix.

Also my Dears, Please do kindly note that the Density Matrix column has direct Relationship with the State Specially the 1st & last column.

p._phidot_
  • 107
  • 4