I wanted to look at the matrix representation of CNOT gate as defined in Qiskit.
from qiskit import Aer
from qiskit.circuit import Gate
from math import pi
qc = QuantumCircuit(2)
c = 0
t = 1
qc.cx(c,t)
qc.draw()
____________________
Out[4]:
q_0: ──■──
┌─┴─┐
q_1: ┤ X ├
└───┘
____________________
import qiskit.quantum_info as qi
op = qi.Operator(qc)
print(op)
____________________
Operator([[1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
[0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j],
[0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
[0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j]],
input_dims=(2, 2), output_dims=(2, 2))
I am a bit confused, as I expected to see \begin{matrix} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{matrix}
What Qiskit output as the matrix representation of CNOT looks to me like CNOT with the first qubit as target and second qubit as control.