3

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.

NaturalLog
  • 159
  • 7

2 Answers2

2

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.

NaturalLog
  • 159
  • 7
1

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.

DaftWullie
  • 62,671
  • 4
  • 55
  • 140