# How does a Hadamard gate impact the initial/previous values of a Qubit? [closed]

I've been studying Quantum Computing and one thing that intrigued me is:

given a qubit q1 with an initial value x, when I apply a Hadamard gate on it, then it goes to superposition, so the probability of it collapsing to 1 or 0 is 50%.

So, does it mean that I just don't care about the previous value x at all anymore? Also, if that's in the middle of a circuit, that kind of cancels everything that happened before... For example, in the circuit for teleportation, we have a H gate on Qubit one before measuring it:

In this case, the first qubit goes to superposition, meaning that now it has a 50/50 chance of being 0 or 1. Is this the right interpretation of this concept?

Same thing happens for Deutsch-Jozsa:

We measure on the "H basis", as explained in the example. So, both qubits go in superposition, making their outcome depend on a probability. I didn't get it how these gates help on the calculation.

• I'm not sure I understand your question, you seem to think that creating a superposition will immediately cause the wavefunction to collapse afterwards? That's not the case, that will only happen if you also measure the qubit Jun 23, 2022 at 17:11
• I'm voting to not close this question because a single answer will clarify all of the confusion raised in this question (that the Hadamard gate does not always create the same output regardless of input, but rather that the Hadamard gate yields different outputs depending on the inputs; it's true that each of the computational basis states get transformed to equal-magnitude superpositions of the computational basis states, but other initial superpositions get transformed into non-equal-magnitude superposition states) Jun 24, 2022 at 1:58

I think you might just be misunderstanding the Hadamard gate slightly. In the computational basis, $$H= \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1\end{pmatrix}$$ maps $$|0\rangle \leftrightarrow |+\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$$ and $$|1\rangle \leftrightarrow |-\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$$ since the Hadamard gate is its own inverse.
In words, the Hadamard gate sends computational basis states to equal superposition states (with phase/sign determined by the input state), and sends superposition states back to the computational basis depending on the phase between $$|0\rangle$$ and $$|1\rangle$$.