Wie interpretiere ich eine Quantenschaltung als Matrix?


15

Wenn eine Schaltung mehr als ein Qubit als Eingang benötigt und Quantengatter hat, die eine unterschiedliche Anzahl von Qubits als Eingang verwenden, wie würden wir diese Schaltung als Matrix interpretieren?

Hier ist ein Spielzeugbeispiel:

Bildbeschreibung hier eingeben

Antworten:


16

Spezifische Schaltung

Das erste Tor ist ein Hadamard-Tor, das normalerweise durch

12[1111]

HII

12[1010010110100101]

Als nächstes haben wir ein CNOT-Tor. Dies wird normalerweise durch dargestellt

[1000010000010010]

This is the right size for two qubits, so we don't need to scale using kronecker products. We then have another hadamard gate, which scales the same was as the first. To find the overall matrix for the circuit, then, we multiply them all together:

12[1010010110100101][1000010000010010]12[1010010110100101]

and get

12[1111111111111111]

(if python multiplied correctly =) We would then multiply this by our original qubit state, and get our result.

Generalization

So basically, you go through each gate one by one, take the base representation, and scale them appropriately using kronecker products with identity matrices. Then you multiply all the matrices together in the order they are applied. Be sure to do this such that if you wrote out the multiplication, the very first gate is on the far right; as arriopolis points out, this is a common mistake. Matrices are not commutative! If you don't know the base representation of a matrix, check first wikipedia's article on quantum gates which has a lot.


3
Maybe it's instructive to add that one should always reverse the order of matrix multiplication. In this particular toy example, it's not necessary as the circuit is symmetric, but in general, one should always put the matrix of the left-most gate in the right-most position of the matrix multiplication.
arriopolis

@arriopolis, good point; I will add that!
heather

1
Anstatt darüber nachzudenken, das Tor nach meinem Verständnis zu "skalieren", beruht das kronecker-Produkt durch die Identitätsmatrix auf der Tatsache, dass auf das zweite Qubit nichts angewendet wird, aber wenn Sie die Schaltung als Ganzes betrachten, auf dem ersten Schritt es wird eine H-Transformation auf dem ersten Qubit und eine "I" -Transformation auf dem zweiten Qubit durchlaufen, die sofort mit H⊗I dargestellt werden.
FSic

@ F.Siciliano das ist auch eine gute Möglichkeit, darüber nachzudenken; Für mich ist es eine gute Möglichkeit, mich daran zu erinnern, warum ich es tue.
Heather
Durch die Nutzung unserer Website bestätigen Sie, dass Sie unsere Cookie-Richtlinie und Datenschutzrichtlinie gelesen und verstanden haben.
Licensed under cc by-sa 3.0 with attribution required.