added argument 'n' to hadamard_gate()