3
$\begingroup$

I'm searching for a circuit to generate, starting from the $|00\, ...\,0\rangle$ state, an arbitrary superposition of all states with either even or odd parity. The gate choice is irrelevant for now, but sticking with single qubit gates and controlled rotations would be preferrable.

For example, for 3 qubits, I want to be able to generate the states $$ |\mathrm{odd}\rangle = a|001\rangle + b|010\rangle + c |100\rangle + d|111\rangle $$ and $$ |\mathrm{even}\rangle = a|000\rangle + b|011\rangle + c |101\rangle + d|110\rangle $$ where $a,b,c,d$ are freely chosen complex values satisfying the condition of normalization.

$\endgroup$
3
  • $\begingroup$ Are $a,b,c,d$ complex parameters that you will specify, or can they be freely chosen? For example, there's a very nice circuit if you have $a=b=c=d$. $\endgroup$
    – DaftWullie
    Dec 3 '21 at 7:28
  • $\begingroup$ @DaftWullie The parameters should be able to be completely freely chosen. I found a solution to my problem (see post below), but it doesn't allow for every single possible state. $\endgroup$
    – NaturalLog
    Dec 3 '21 at 10:05
  • $\begingroup$ This was part of my confusion as I could see that. Perhaps you should add that qualifying remark to your solution. $\endgroup$
    – DaftWullie
    Dec 3 '21 at 10:07
2
$\begingroup$

I actually found the solution to my problem - with one caveat: the amplitudes $a,b,c,d$ can not be completely arbitrary. An $n$-qubit superposition state with even parity will have $2^{n-1}-1$ free parameters, while the approach presented below only allows for $2(n-1)$ parameters. This still solves my problem though, so I will share the approach anyways:

Given $n$ qubits initialized as $|0\rangle$, one can act with $R_y(\alpha_i)$ and $R_z(\beta_i)$ on all qubits $i$, excluding one of them (for me this will be the last one). This will put every qubit in an arbitrary superposition state $a|0\rangle + b|1\rangle$.

Then one just needs to apply $n-1$ CNOT gates with control qubits being the first $n-1$ qubits and the qubit acted upon being the last qubit (rotation angles are random):

enter image description here

This yields a superposition of all states with even parity. For odd parity, one can start with the last qubit in the $|1\rangle$ state.

If you want all amplitudes to be the same, replace the rotation gates with Hadamard gates.

$\endgroup$
1
$\begingroup$

To do this in general is equivalent to creating an arbitrary $n-1$-qubit state, and then using the pattern of controlled-nots to determine the bit value of the final qubit, as you did in your solution.

Creating an arbitrary $n$ qubit state is a standard, well-studied, but complex task which I'm not going to elaborate on here. You might look, for example, at this question and answer.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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