User:Jackyko38/sandbox

This is a test of my sandbox.

Sketch
$$U_{\omega_2} =\begin{bmatrix}I&0\\0&-Z\end{bmatrix} =I-2|10\rangle\langle10| $$

$$ (X\otimes X)cZ(X\otimes X) =\begin{bmatrix}XZX&0\\0&XIX\end{bmatrix} =\begin{bmatrix}-Z&0\\0&I\end{bmatrix} = U_{\omega_0} $$

$$ (X\otimes I)cZ(X\otimes I) =\begin{bmatrix}Z&0\\0&I\end{bmatrix} = U_{\omega_1} $$

$$ (I\otimes X)cZ(I\otimes X) =\begin{bmatrix}XIX&0\\0&XZX\end{bmatrix} =\begin{bmatrix}I&0\\0&-Z\end{bmatrix} = U_{\omega_2} $$

$$ (I\otimes I)cZ(I\otimes I) =\begin{bmatrix}I&0\\0&Z\end{bmatrix} = U_{\omega_3} $$

Encoding in Grover's Algorithm
Let us encode the unstructured list of $$N$$ items as a series of $$n$$ qubits. i.e. $$N\le 2^n$$. To simplify the illustration, we only consider $$N=2^n$$. (The case of $$N<2^n$$ is a subset of the problem set.) For example, if we have $$N=8$$ items, we encode them in $$n=3$$ qubits ($$8=2^3$$).

The "winning" state $$|w\rangle$$ is among the basis states $$|x\rangle\in\{0,1\}^n$$.

The oracle, $$U_f|x\rangle=(-1)^{f(x)}|x\rangle,~$$ is a unitary operation that will negate the winning state $$\left(U_f|w\rangle=-|w\rangle\right)$$ or otherwise will do nothing $$\left(U_f|x\rangle=|x\rangle\right)$$.