2
$\begingroup$

I have been trying to understand the Grover-Rudolph scheme for loading a probability distribution into a quantum circuit. This article gives a demonstration of this scheme by creating a probability distribution of 8 states in a quantum circuit.

My question is about the use of $X$ gates in the circuit. I don't quite understand the reasoning behind their placements. I want to be able to go deeper into the algorithm, creating maybe 128 states in a 7-qubit circuit, but to do so, I need to understand when to use an $X$ gate.

$\endgroup$
2

1 Answer 1

1
$\begingroup$

The $X$ gates are a transformation of the conditional RY rotation gates. You could compute $(X \otimes I) \text{CR}_Y (X \otimes I)$ (where $\text{CR}_Y$ is the conditional $R_Y$ gate) to find a reduced version of the circuit if you like. I find it's

$$ \begin{align} (X \otimes I) \text{CR}_Y (X \otimes I) &= \begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ \end{pmatrix} \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \cos(\frac{\theta}{2}) & -\sin(\frac{\theta}{2}) \\ 0 & 0 & \sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \\ \end{pmatrix} \begin{pmatrix} 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ \end{pmatrix} \\ &= \begin{pmatrix} \cos(\frac{\theta}{2}) & -\sin(\frac{\theta}{2}) & 0 & 0 \\ \sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{pmatrix} \end{align} $$

A similar computation can be done for the double conditional $R_Y$ gate and so on.

The $R_Y$ gate is nice to use in the tutorial you mentioned because it will only produce quantum states with real amplitudes (if the initial state amplitudes are all real). You can avoid complex amplitudes all together. You only need real amplitudes to produce the desired probabilities. However, complex amplitudes would also do it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.