# How to tranfer given superposition to quantum circuit?

Let's say I have a superposition of qubit defined as

$$\frac{1}{2} (| 000 \rangle + | 001 \rangle + | 111 \rangle + | 110 \rangle)$$

(as given in the answer here: Explanation of output produced by the following quantum circuit)

I want to know how to perform reverse operation compared to that task, where the circuit was given. How can one looking at superposition create a circuit consisting of 3 qubits, the superposition of which is defined above?

• This is pretty broad right now; could you consider editing the question to focus on, for example, only three qubits and asking how to construct a circuit to map $\vert 000\rangle$ to an explicitly given vector in a Hilbert space of three qubits? Nov 14 at 20:50

\begin{align} \frac{1}{2} (|000\rangle + |001\rangle + |110\rangle + |111\rangle) = CNOT_{2,3}(\frac{1}{2} (|000\rangle + |001\rangle + |010\rangle + |011\rangle)) \end{align}
The gate $$CNOT_{2,3}$$ means flip the state of qubit 3 conditioned on the state of qubit 2. I'm using the convention where the rightmost index is the least significant. Now we can see that the leftmost qubit is always $$|0\rangle$$, and the remaining two qubits span all possible states with equal weight, which is suggestive of a Hadamard gate on each. So the final circuit becomes