量子回路を行列として解釈する方法は?


15

回路が入力として複数のキュービットを受け取り、入力として異なる数のキュービットを受け取る量子ゲートを持っている場合、この回路を行列としてどのように解釈しますか?

おもちゃの例を次に示します。

ここに画像の説明を入力してください

回答:


16

特定の回路

最初のゲートは、通常1で表されるアダマールゲートです。

12[1111]

HI

12[1010010110100101]

次に、CNOTゲートがあります。通常、これは

[1000010000010010]

これは2つのキュービットに適したサイズであるため、クロネッカー製品を使用してスケーリングする必要はありません。その後、もう1つのハダマールゲートがあります。回路の全体的なマトリックスを見つけるには、それらをすべて乗算します。

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
Rather than thinking about 'scaling' the gate, from what I understood, the kronecker product by the identity matrix is due to the fact that on the second qubit nothing is applied, but if you consider the circuit as a whole, at the first step it will undergo and H transform on the first qubit and an "I" transform on the second, that are represented at once with H⊗I.
FSic

@F.Siciliano that is a good way to think about it as well; for me it's a good way to remind myself of why I'm doing it.
heather
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.