Compute Matrix for Simple Quantum Gates

  • Context: Graduate 
  • Thread starter Thread starter brydustin
  • Start date Start date
  • Tags Tags
    Quantum Quantum gates
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
brydustin
Messages
201
Reaction score
0
The example from my textbook shows one example of how to compute the matrix for a gate.
The example is the U_CNOT operator: |00> -> |00>, |01> -> |01>; |10>->|11>; |11>->|10>

Then they show that the operator is merely the sum of the outer products of these.

|00><00| + |10><10| + |01><11| + |11><01| = [ I 0 ; 0 X] : where X is the "NOT" operator.

When I perform the same sort of computation with the "top" part of the circuit as the "target bit" and the bottom part as the "control bit" I get the identity; however, my first intuition was that it should be [X 0; 0 I] (which is also wrong). The correct answer is that it should be:
[1 0 0 0; 0 0 0 1; 0 0 1 0 ; 0 1 0 0 ] (that's row by row). I understand how to read the circuit, but not how to compute the associated matrix.

I've noticed that if I put the basis set into a "vector" then I can get the computation to work out, but this seems kinda "hand-wavy":
[tex]\begin{pmatrix} 1 &\0 &\0 &\0 \\ 0 &\0 &\0 &\1 \\ 0 &\0 &\1 &\0 \\ 0 &\1 &\0 &\0 \end{pmatrix} \begin{pmatrix}|00) \\ |01)\\ |10)\\ |11)\\ \end{pmatrix}= \begin{pmatrix}|00) \\ |11)\\ |10)\\ |01)\\ \end{pmatrix}[/tex]

For example I suppose this will also work:

[tex]\begin{pmatrix} \alpha &\0 &\0 &\0 \\ \beta &\1 &\1 &\0 \\ \gamma &\--1 &\0 &\+1 \\ \delta &\1 &\0 &\0 \end{pmatrix} \begin{pmatrix}|00) \\ |01)\\ |10)\\ |11)\\ \end{pmatrix}= \begin{pmatrix}|00) \\ |11)\\ |10)\\ |01)\\ \end{pmatrix} : {\alpha, \beta,\gamma,\delta \in Reals}[/tex]
 
Last edited:
Physics news on Phys.org
This seems to be the same as the first answer I got, and it's correct. Is this the best way to compute the matrix for a gate? Is there a more straightforward way to do this?