# Quantum circuit for a $3$-qubit $|W \rangle$ state

Can someone specify a quantum circuit that will deterministically output the $$3$$-qubit $$|W \rangle$$ state, if the input to the circuit is $$|0,0,0 \rangle$$? Or, is there a quantum circuit with a different $$3$$-qubit input state that will output the $$3$$-qubit $$|W \rangle$$ state deterministically? I am looking for an abstract description, devoid of any physical system. If this is contained in a reference, one can just list the reference.

For those not familiar with the representation of the $$3$$-qubit $$|W \rangle$$ state in the computational basis, it is:

$$|W \rangle = \frac{1}{\sqrt{3}} \bigg( |0,0,1\rangle + |0,1,0\rangle + |1,0,0\rangle \bigg) .$$

Generalizations to the $$n$$-qubit case would also be greatly appreciated. For clarity on the allowable gates in the circuit, please use either $$1$$-qubit or $$2$$-qubit gates. Also, it'd be fine if the answer used a $$3$$-qubit gate such as Toffoli or Fredkin (and these $$3$$-qubit gates would not need to be further decomposed).

• You should specify what gates you're prepared to accept in your quantum circuit for your question to be well-posed. Otherwise, I could just say "let $U$ be the three-qubit gate that takes ..." and it would be a valid answer. Presumably you want to rule that out, but unless you provide actual hard lines, you're just making people guess at what you'll find acceptable or not. – Emilio Pisanty Feb 13 '17 at 1:44
• OP probably wants it using single and double qubit gates. – biryani Feb 13 '17 at 4:23
• Emilio this seems pedantic, but I see your point. @biryani thanks, you got what I was after. – sunspots Feb 13 '17 at 23:39
• What does W stand for in W-state? – W. Voltera Oct 21 '18 at 16:07
• @W.Voltera perhaps "Wolfgang," since the state emanates from arxiv.org/pdf/quant-ph/0005115.pdf – sunspots Jul 9 at 1:37

## 1 Answer

Given a gate schema $G(p) = \begin{bmatrix} \sqrt{1-p} & -\sqrt{p} \\ \sqrt{p} & \sqrt{1-p} \end{bmatrix}$, you can use $G(1/3)$ to make a circuit that does the trick.

First you make a balanced superposition of three states. Any three states. That's where the $G(1/3)$ comes in. We'd also need a $G(1/2)$ but $H$ will do the trick. Second, you permute the states so the non-zero amplitudes are on the states you want.

For example, I created a W-state circuit in my quantum simulator Quirk. The inline state displays make it a bit easier to see what's going on: $G(1/3)$ is not really a "standard" gate. Since I didn't want to use some crazy mix of allowed gates to approximate it, I just defined it as a custom gate: But as the comments on the question point out, you can also just directly define a gate that maps straight from $|000\rangle$ to the W-state. The core of whether this problem is easy or hard, whether it requires approximations or can be done exactly, is the question what gates do you allow yourself? 