The Hadamard gate is a single-qubit operation that maps the basis state to and to , thus creating an equal superposition of the two basis states.
H q # execute Hadamard gate on qubit 0 H q[1:2,5] # execute Hadamard gate on qubits 1,2 and 5
The Hadamard gate can also be expressed as a 90º rotation around the Y-axis, followed by a 180º rotation around the X-axis. So, .
Useful XY-decompositions (also visualized below) are given by:
Useful YZ-decompositions are: