question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Matrix representation of circuit

See original GitHub issue

What is the expected enhancement?

It would be great to be able to inspect the unitary matrix of a circuit that can be represented as such. Currently one can go through Operator to get a representation but it’s not obvious to a user how to do this. A circuit.to_matrix method or similar would make this much clearer and easily accessible. However, not all circuits have a matrix representation and thus this would not be universal.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
chriseclecticcommented, Sep 20, 2019

I don’t think this should be a circuit method:

  • It hides the fact you are doing an expensive simulation to determine the matrix
  • Many circuits won’t have a matrix representation
  • For many circuits the the matrix will typically be too large for available memory (around >14 or so qubits)

It would be better to better document to the user how to use the Operator class or unitary simulator to do this

0reactions
1ucian0commented, Sep 19, 2021

closing this issues as wont fix. Please, reopen if there are new arguments for a QuantumCircuit.to_matrix method.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Matrix representation of quantum circuits - notations and gotchas
A case study by building a tensor network to match qiskit conventions.
Read more >
How to interpret a quantum circuit as a matrix?
To find the overall matrix for the circuit, then, we multiply them all together: ... If you don't know the base representation of...
Read more >
1 Matrix representation in Quantum Computing - bingweb
Suppose that all the matrices describing quantum gates are of the same size. (a). A. ˆ. We introduce a notation of quantum circuit....
Read more >
Matrix Representation of Quantum Gates
cused on representing quantum reversible gates in matrix form. In turn these matrices can be used to develop quantum circuits with help of...
Read more >
A Matrix Representation of Quantum Circuits over Non ...
A synthetic matrix representation of an arbitrary quantum circuit is easy to achieve by involving compositions of multiple SWAP gates and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found