# Basis Change Substitution

question: "A spin right $$\frac{1}{\sqrt 2}(|0\rangle + |1\rangle)$$ is sent through a Hadamard gate, creating the superposition of $$|+\rangle$$ and $$|-\rangle$$, given by $$\frac{1}{\sqrt 2}(|+\rangle + |-\rangle)$$. By making a basis change substitution, show that this is equivalent to producing a $$|0\rangle$$ state."

How do I represent a basis change substitution mathematically?

$$|+\rangle$$ and $$|-\rangle$$ represented by $$|0\rangle$$ and $$|1\rangle$$ basis vectors:
$$|+\rangle = \frac{1}{\sqrt{2}} (|0\rangle + |1\rangle) \qquad |-\rangle = \frac{1}{\sqrt{2}} (|0\rangle - |1\rangle)$$
By substituting these expressions that are written in $$|0\rangle$$ and $$|1\rangle$$ basis will prove what is wanted:
$$\frac{1}{\sqrt{2}} (|+\rangle + |-\rangle) = \frac{1}{2}(|0\rangle + |1\rangle + |0\rangle - |1\rangle) = |0\rangle$$