# Implementing a circuit that returns $|01\rangle$ and $|10\rangle$ with equal probability

Using Python how can I implement a quantum circuit that returns $$|01\rangle$$ or $$|10\rangle$$ using only $$CX$$, $$RX$$ and $$RY$$ gates, starting with random parametric gates as parameters and optimizing it using gradient descent or other optimization algorithm?

• Can you show what you have tried so far to answer this question? Sep 14 '20 at 18:28
• I have used IBM Quantum Experience and have used an Rx gate (using pi/2 as theta) on qubit 1 Sep 24 '20 at 5:35

One potential combo is $$RY(\theta)$$ on qubit 1, $$CX$$ from qubit 1 to qubit 2, then $$RX(\pi)$$ on qubit 2. This would be the following transformation:
$$|0\rangle |0\rangle \mapsto (\cos \frac{\theta}{2} |0\rangle + \sin \frac{\theta}{2}|1\rangle)|0\rangle \mapsto \cos \frac{\theta}{2} |00 \rangle + \sin \frac{\theta}{2} |11\rangle \mapsto \cos \frac{\theta}{2} |01 \rangle + \sin \frac{\theta}{2} |10\rangle$$
(Matrices for $$RX$$, $$RY$$: https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.intrinsic.rx / https://docs.microsoft.com/en-us/qsharp/api/qsharp/microsoft.quantum.intrinsic.ry)