2

enter image description here

Suppose we have a quantum circuit like this. All the gates are known except for one. For any input of q[0] and q[1], we know the corresponding output. I have provided the output state for four different input state which forms a basis . How can we know that which gate is the unknown gate? enter image description here How to solve these types of problems?

wizzywizzy
  • 115
  • 7
  • Please refrain from posting one question several times (https://quantumcomputing.stackexchange.com/questions/30027/quantum-circuit-with-one-unknown-gate). Rather edit the former question. – Martin Vesely Feb 04 '23 at 21:50
  • 1
    That question was more general one. I couldn't work out the input state in this question. The answer on this question gives me the way of how to solve the question effectively. – wizzywizzy Feb 05 '23 at 12:49

1 Answers1

2

The effect of a circuit can be explained by matrix-vector multiplications.

If you start with a state $\vec{q}$ and if the gates in your figure are represented by the matrices $A$, $B$, and $U$ (where $U$ is the unknown), then the output will be given by $\vec{q_f} = ABU\vec{q}$.

The $AB$ factor can be replaced by a single matrix called $C$, and with symbolic computation (a.k.a computer algebra) you can combine $U$ and $C$ too.

Let's try this, assuming that your "controlled note" get is just what others usually call "controlled not" or CNOT. Then we have:

$$ A = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix},\tag{1} $$

$$ B = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix},\tag{2} $$

$$ U = \begin{bmatrix} a & b & c & d \\ e & f & g & h \\ i & j & k & l \\ m & n & o & p \end{bmatrix},\tag{3} $$

$$ \vec{q} = \begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix},\tag{4} $$

and

$$ \vec{q}_f = \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix}.\tag{5} $$

This would mean that we have:

$$\tag{6} \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix} \begin{bmatrix} 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix} \begin{bmatrix} a & b & c & d \\ e & f & g & h \\ i & j & k & l \\ m & n & o & p \end{bmatrix}\begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}, $$ $$\tag{7} \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} a & b & c & d \\ e & f & g & h \\ i & j & k & l \\ m & n & o & p \end{bmatrix}\begin{bmatrix} 0 \\ 1 \\ 0 \\ 0 \end{bmatrix}, $$

$$ \begin{bmatrix} 1 \\ 0 \\ 0 \\ 0 \end{bmatrix} = \begin{bmatrix} f \\ b \\ j \\ n \end{bmatrix}.\tag{8} $$

You now have found 4 out of 16 unknown variables. You can do the same for the other 3 scenarios to get the other 4x3 = 12 unkown variables. You can use this matrix-vector multplier to make the computations easier.