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).
 A: 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? 

