implementation of hadamard gate