After I create a quantum circuit in qiskit, I want to output its matrix form. Any idea how to do it?
After I create a quantum circuit in qiskit, I want to output its matrix form. Any idea how to do it?
Qiskit now support the matrix representation of a circuit:
from qiskit.quantum_info import Operator
U = Operator(circ)
# Show the matrix form results
U.data
see also