TransWikia.com

Qiskit CNOT-gate matrix mixup?

Quantum Computing Asked by Alvo on August 11, 2021

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

2 Answers

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)$$

Correct answer by Egretta.Thula on August 11, 2021

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.

Answered by Mujtaba Sattar Anonto on August 11, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP