# QuantumControlled U gate

Can someone please clarify what is the difference between the two circuits below? The first one is the controlled-Hadamard gate (c-H). But what is the second one?! What is the difference between the matrix of the second and the first? What I'm guessing is that the first one is going to be controlled by the first compound qubit, and the second by the second compound qubit, is that right?!

Thanks!

The first gate embodies the unitary transform:\begin{align}|00\rangle &\mapsto |00\rangle,\\ |01\rangle &\mapsto |01\rangle,\\ |10\rangle &\mapsto \sqrt{\frac12}|10\rangle + \sqrt{\frac12}|11\rangle,\\ |11\rangle &\mapsto \sqrt{\frac12}|10\rangle - \sqrt{\frac12}|11\rangle.\end{align}That is, it is a Hadamard gate on the second qubit conditioned on the first qubit being $|1\rangle.$ The second gate embodies the unitary transform, \begin{align}|00\rangle &\mapsto |00\rangle,\\ |01\rangle &\mapsto \sqrt{\frac12}|01\rangle + \sqrt{\frac12}|11\rangle,\\ |10\rangle &\mapsto |10\rangle,\\ |11\rangle &\mapsto \sqrt{\frac12}|01\rangle - \sqrt{\frac12}|11\rangle.\end{align}That is, it is a Hadamard gate on the first qubit conditioned on the second qubit being $|1\rangle.$