Quantum gates

The quantum gates with their matrices computed by the engine and their effect on the basis states.

BeginnerIIdentity Gate (I)Identity Gate (I)The identity gate leaves the qubit state unchanged; it marks an idle time step or stands for 'do nothing' in tensor products.BeginnerXPauli-X Gate (NOT)Pauli-X Gate (NOT)The Pauli-X gate is the quantum NOT: it swaps |0⟩ and |1⟩ and is a π rotation about the x axis of the Bloch sphere.BeginnerYPauli-Y GatePauli-Y GateThe Pauli-Y gate flips the bit and adds a phase: Y|0⟩ = i|1⟩, Y|1⟩ = −i|0⟩; it is a π rotation about the y axis.BeginnerZPauli-Z Gate (Phase Flip)Pauli-Z Gate (Phase Flip)The Pauli-Z gate flips the sign of the |1⟩ amplitude (phase flip); it is a π rotation about the z axis.BeginnerHHadamard GateHadamard GateThe Hadamard gate maps |0⟩→|+⟩ and |1⟩→|−⟩, creating equal superpositions and exchanging the z and x bases.IntermediateSS Gate (Phase π/2)S Gate (Phase π/2)The S gate multiplies the |1⟩ amplitude by i (S = P(π/2)), a quarter turn about z; S² = Z.IntermediateS†S-dagger GateS-dagger GateS† is the inverse of S: it multiplies the |1⟩ amplitude by −i, a −π/2 rotation about z.IntermediateTT Gate (π/8 Gate)T Gate (π/8 Gate)The T gate multiplies the |1⟩ amplitude by e^iπ/4; an eighth turn about z that makes the Clifford set approximately universal.IntermediateT†T-dagger GateT-dagger GateT† is the inverse of T: it multiplies the |1⟩ amplitude by e^−iπ/4, a −π/4 rotation about z.Intermediate√XSquare-root of X Gate (SX)Square-root of X Gate (SX)SX is the square root of X (SX² = X), a π/2 rotation about x up to global phase, and a native gate on IBM processors.IntermediateRXRX Rotation GateRX Rotation GateRX(θ) = e^−iθX/2 rotates the Bloch vector by θ about the x axis; a basic parameterized gate in variational circuits.IntermediateRYRY Rotation GateRY Rotation GateRY(θ) = e^−iθY/2 rotates about the y axis and keeps amplitudes real; widely used for state preparation and encoding.IntermediateRZRZ Rotation GateRZ Rotation GateRZ(λ) = e^−iλZ/2 rotates about the z axis, changing only the relative phase; equal to P(λ) up to a global phase.IntermediatePPhase Gate P(λ)Phase Gate P(λ)The phase gate P(λ) = diag(1, e^iλ) multiplies the |1⟩ amplitude by e^iλ; Z, S and T are special cases.AdvancedUGeneral Single-qubit Gate U(θ,φ,λ)General Single-qubit Gate U(θ,φ,λ)U(θ,φ,λ) parameterizes any single-qubit gate up to a global phase with three angles, using Qiskit's convention.IntermediateCXCNOT Gate (Controlled-X)CNOT Gate (Controlled-X)CNOT flips the target qubit when the control is |1⟩; with a Hadamard it creates Bell states and, with single-qubit gates, is universal.IntermediateCYControlled-Y GateControlled-Y GateCY applies Y to the target when the control is |1⟩; it equals a CNOT conjugated by S†/S on the target.IntermediateCZControlled-Z GateControlled-Z GateCZ multiplies the |11⟩ amplitude by −1; it is symmetric in its two qubits and equals a CNOT conjugated by Hadamards on the target.AdvancedCPControlled-Phase Gate CP(λ)Controlled-Phase Gate CP(λ)CP(λ) multiplies only the |11⟩ amplitude by e^iλ; it is symmetric and is the building block of the quantum Fourier transform.IntermediateSWAPSWAP GateSWAP GateSWAP exchanges the states of two qubits, |a⟩|b⟩ → |b⟩|a⟩, and equals three CNOTs.AdvancedCCXToffoli Gate (CCX)Toffoli Gate (CCX)The Toffoli gate flips the target when both controls are |1⟩; it is universal for reversible classical computation.AdvancedCSWAPFredkin Gate (Controlled-SWAP)Fredkin Gate (Controlled-SWAP)The Fredkin gate swaps two target qubits when the control is |1⟩; it conserves the number of ones and is the core of the swap test.AdvancedRZZRZZ (Ising ZZ) GateRZZ (Ising ZZ) GateRZZ(θ) = e^−iθ Z⊗Z/2 adds a phase depending on the parity of two qubits; the building block of QAOA cost layers and Ising models.