EntangledQuery
  • Threads
  • Categories
  • Users
  • Seminar
  • forum
  • group
  • theaters
  • search
  1. Threads
  2. Qiskit
chevron_left Qiskit

How to get the matrix form of a quantum circuit in qiskit?

  • forum 1 reply
  • last reply by Meng Sept. 4, 2021
  • Last
  • link
    CattyM
    Members 17 posts
    Sept. 4, 2021, 2 a.m. Sept. 4, 2021, 2 a.m.
    link

    After I create a quantum circuit in qiskit, I want to output its matrix form. Any idea how to do it?

  • link
    Meng
    Members 22 posts
    Sept. 4, 2021, 2:52 a.m. Sept. 4, 2021, 2:52 a.m.
    link

    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

    qiskit.org/documentation/tutorials/circuits/01_circuit_basics.html#Unitary-representation-of-a-circuit

There are no more posts in this thread.

  • EntangledQuery