P.1.1 Where to apply second Hadamard

I am kind of confused with the accepted solution. Can anyone please explain, why the second solution is wrong and the first one is correct? I thought the second Hadamard gate was also applied on the first wire i.e wire = 0.
Thanks.

Hi @raven_of_asgard,

Welcome to the forum!

This is in fact a mistake. You’re correct in your understanding that the second Hadamard should be applied to the first wire.

For some reason if you use qml.ctrl(qml.QubitUnitary, control=0)(unitary, wires=1) then it works as it should, with the second Hadamard on wire 0.

We will look into the cause of this issue. Thank you for pointing it out.

1 Like

Hey @raven_of_asgard !

I just pushed a fix for this problem. It’s live! Thank you for pointing this error out! We really really appreciate it :grin:

1 Like