# Does entangling 100 qubits require a 2^100 X 2^100 Hadamard gate?

Suppose I have 100 qubits that I want to entangle and put into superposition. To do so I construct a Hadamard gate to do this. By definition, the Hadamard is going to be a 2^100 X 2^100 matrix - which is huge.

How does one go about actually performing this operation? The size of the Hadamard matrix is exponential relative to the number of qubits (ie 2^100 X 2^100). Is there a way to perform this operation without actually making this huge matrix? Or can we only work with a 'small' number of qubits at once?

Follow up question: does using 100 4x4 Hadamard gates (one for each qubit) do the same thing as using a single 2^100 x 2^100 Hadamard gate? If so, how do these qubits become entangled?

• just reminding that "Nature" doesn't build Hadamard matrices, and that one small piece of semi-reflecting glass can operate on a LARGE number of photons, all at once. Nevertheless, it is a valid question, asking how to construct complex gates from more simple ones. Oct 27 '15 at 21:35
• D.W. - just a heads up. Math.SE told me to post on CSTheory.SE. CSTheory.SE told me to post here. Sorry for the reposts. Would love to get some feedback on this. Oct 28 '15 at 3:02
• Isn't the fast Walsh–Hadamard transform what you're looking for? It recursively breaks down the Hadamard matrix into 4 copies of a smaller Hadamard matrix (one negated).
– TLW
Oct 28 '15 at 4:53
• @D.W. : the post on CSTheory is actually closed, so I don't think the crossposting policy applies. Ideally that post would have been migrated rather than C.Shreve reposting it, but migration of posts from there doesn't seem to be as efficient as it could be. Oct 28 '15 at 8:46
• @NieldeBeaudrap, you're absolutely right -- sorry that I missed that. As for migration, you (or the OP) can arrange for the question to be migrated by clicking "flag" to flag it for moderator attention. It's not automatic: you need to take some specific action to have that happen.
– D.W.
Oct 29 '15 at 17:52

When you apply a 2x2 gate to a single qubit, the gate you are applying to the $n$-qubit system that qubit is in is automatically $2^n$ x $2^n$. If you apply an $H$ to the third qubit out of six, then the operation you applied to the six qubits is $I_2 \otimes I_2 \otimes H \otimes I_2 \otimes I_2 \otimes I_2$. That's a 64x64 matrix; exactly what you needed.
So performing a Hadamard transform on $n$ qubits is actually very easy, even though some very large matrices are being thrown around if you think about what's happening in that way. Just independently hit each qubit with the usual single-qubit $H$ gate.