How do two H gates act on two entangled qubits?
The Hadamard gate performs the following operation on a single qubit:
\begin{align}
|0\rangle &amp;\to \frac{|0\rangle + |1\rangle}{\sqrt{2}} \\
|1\rangle &amp;\to \frac{|0\rangle - |1\rangle}{\sqrt{2}}
\end{align}
This gives the action on pure states. The action extends linearly to mixed states:
$$
\alpha|0\rangle + \beta|1\rangle \to \alpha\frac{|0\rangle + |1\rangle}{\sqrt{2}} + \beta\frac{|0\rangle - |1\rangle}{\sqrt{2}}
$$
What happens when there are seveal qubits around? In this case, it is common to denote $|a\rangle \otimes |b\rangle$ by $|ab\rangle$, for brevity. If we apply a Hadamard gate on the first qubit, then it only affects the first qubit:
\begin{align}
|0b\rangle &amp;\to \frac{|0b\rangle + |1b\rangle}{\sqrt{2}} \\
|1b\rangle &amp;\to \frac{|0b\rangle - |1b\rangle}{\sqrt{2}}
\end{align}
Similarly, if we apply a Hadamard gate on the second qubit, then it only affects the second qubit:
\begin{align}
|a0\rangle &amp;\to \frac{|a0\rangle + |a1\rangle}{\sqrt{2}} \\
|a1\rangle &amp;\to \frac{|a0\rangle - |a1\rangle}{\sqrt{2}}
\end{align}
The two operations commute.
What happens to a general mixed state? Denoting by $\stackrel{(i)}\to$ the application of $H$ on the $i$'th bit, we get
\begin{align}
&amp;\alpha|00\rangle + \beta|01\rangle + \gamma|10\rangle + \delta|11\rangle \\
\stackrel{(1)}\to
&amp;\alpha\frac{|00\rangle + |10\rangle}{\sqrt{2}} + \gamma\frac{|00\rangle - |10\rangle}{\sqrt{2}} +
\beta\frac{|01\rangle + |11\rangle}{\sqrt{2}} + \delta\frac{|01\rangle - |11\rangle}{\sqrt{2}} \\ =
&amp;\frac{\alpha+\gamma}{\sqrt{2}} |00\rangle + \frac{\beta+\delta}{\sqrt{2}} |01\rangle +
\frac{\alpha-\gamma}{\sqrt{2}} |10\rangle + \frac{\beta-\delta}{\sqrt{2}} |11\rangle \\
\stackrel{(2)} \to
&amp;\frac{\alpha+\gamma}{\sqrt{2}} \frac{|00\rangle + |01\rangle}{\sqrt{2}} +
\frac{\beta+\delta}{\sqrt{2}} \frac{|00\rangle - |01\rangle}{\sqrt{2}} +
\frac{\alpha-\gamma}{\sqrt{2}} \frac{|10\rangle + |11\rangle}{\sqrt{2}} +
\frac{\beta-\delta}{\sqrt{2}} \frac{|10\rangle - |11\rangle}{\sqrt{2}} \\ =
&amp;\frac{\alpha+\beta+\gamma+\delta}{2} |00\rangle +
\frac{\alpha-\beta+\gamma-\delta}{2} |01\rangle +
\frac{\alpha+\beta-\gamma-\delta}{2} |10\rangle +
\frac{\alpha-\beta-\gamma+\delta}{2} |11\rangle
\end{align}
The Hadamard gate is Hermitian, and so applying it twice in a row results in the starting point: $HH = I$. Therefore if the oracle does nothing, you do get what you started from. But usually the oracle does change the qubits somehow.