# The Hadamard Gate is Underrated

The fundamental unit of information in regards to a classical computer is called a bit. Bits can be described either as a 1 or a 0 (on and off respectively). However quantum computers use qubits. A good way to distinguish the two is the glass metaphor. Bits can be one of two things: a full glass or an empty glass. Qubits can be anywhere in between. So, just like classical bits, qubits can be in one of the two states 0 or 1. Bits, however, cannot be in a superposition of the two while qubits can.

In the case of qubits, 0 and 1 are represented in the Dirac notation:

|1>

|0>

However, a more general state of a qubit is represented by the equation:

|𝜓> = 𝛼|0⟩+𝛽|1⟩

Where alpha and beta are complex numbers that follow the rule:

|𝛼|² + |𝛽|² = 1

It is much more explanatory to use this general equation to see how much 1 or how much 0 a qubit is rather than saying “both 1 and 0 at the same time”. From that general equation, we can derive that the state of a qubit |𝜓> is represented by the two dimensional vector:

Qubits are 2 dimensional quantum systems however, it is completely possible for a quantum system to be way more than 2 dimensions. However, for the purpose of computing and efficiency, qubits remain 2D.

Now what does this |𝜓> mean? For this, we will bring out the double slit experiment: quantum mechanics’ most fundamental discovery. If you would like some background information on the topic, I wrote a short article about it here. The only way for the interference pattern to show up on the detector screen would be for the quantum particle to pass through, informally speaking, both slits at the same time similar to how we think of qubits being both 1 and 0. However we may observe which of the two slits the quantum particle passes through by setting up an observer. The state of observing whether the qubit is 1 or 0 is referred to as measurement. So when we measure the qubit to be one or the other, it will collapse to |1> or |0> depending on the measurement. The probability as to which one you will measure is determined in the generalized equation mentioned above.

The qubit will collapse to |0> with the probability |𝛼|² and it will collapse to |1> with the probability |𝛽|²

Now we end up with a distinct value of either on or off. This is the phenomenon that is being uncovered today by many quantum physicists and quantum computing scientists.

Now when I first read over all of this information, I had a big lingering question.

## Since we *collapse* qubits, does that mean we have to continuously dispose and replace them?

And the answer? No.

There is actually a very important quantum gate that is used in quantum computers that has the ability to put qubits back into superposition and even entangle particles. The Hadamard gate is widely underrated and rarely spoken of in pop-science.

What the Hadamard Gate does is it takes our collapsed qubit which is now either in the 2D vector [1…0] (|0>) or [0…1] (|1>) and multiplies it by the Hadamard Matrix:

Our qubit is now in superposition with both 𝛼 and 𝛽 being equal to 1/rt(2).

To entangle a pair of qubits, you must use a combination of the Hadamard gate and the controlled NOT or CNOT gate. The CNOT gate takes two bits or qubits and puts them through the CNOT matrix:

With the CNOT matrix, one of the qubits is deemed the control qubit and one is deemed the target qubit. The control qubit will never change and will have a uniform input and output. The target qubit, however, may change depending on the state of the control qubit. If the control qubit reads |1>, then the target qubit will change(|1> →|0> or |0> → |1>). If the control qubit reads |0>, then the target qubit will remain as it was inputted.

So to put two qubits into an entangled state is actually fairly simple. You just first put one qubit through the Hadamard gate to put it into super position which you then use as the control qubit in a CNOT.

That final 4 dimensional vector are our entangled qubits. Measuring one of the qubits, the other will collapse in a coordinated state no matter where they are in the universe. That means you could predict the value of a qubit outside of the Milky Way as long you measured its entangled pair.

There are many other fundamentals such as quantum teleportation which use the very underrated Hadamard gate. In the future surge of quantum computing, the Hadamard gate will play an extremely significant role.