I have implemented a simple CNOT gate using
I was expecting a the result the matrix as in the following image (extracted from wikipedia):
from qiskit import * circuit = QuantumCircuit(2, 2) circuit.cx(0, 1) simulator = Aer.get_backend("unitary_simulator") result = execute(circuit, backend=simulator).result() unitary = result.get_unitary() print(circuit.draw()) print(unitary)
The results in the print are:
If you pay attention, it seems the order of the qbits is reversed. I would like to know why this happens and if it's normal because it seems confusing at first glance.
To be really clear: The matrix in the first image and the second (the result) should be the same.