Identity
qc.id(qubit)Leaves the qubit unchanged. Useful as an explicit idle step.
Bloch sphere: No rotation.
Try in Studio →Generated from the same gate registry the simulator executes, so the matrices below are exactly what runs. Rotation gates follow R_P(θ) = exp(−iθP/2); conventions match Qiskit.
qc.id(qubit)Leaves the qubit unchanged. Useful as an explicit idle step.
Bloch sphere: No rotation.
Try in Studio →qc.x(qubit)Quantum NOT: swaps the amplitudes of |0⟩ and |1⟩.
Bloch sphere: Rotation by π about the X axis.
Try in Studio →qc.y(qubit)Bit flip combined with a relative phase: |0⟩ → i|1⟩, |1⟩ → −i|0⟩.
Bloch sphere: Rotation by π about the Y axis.
Try in Studio →qc.z(qubit)Phase flip: multiplies the |1⟩ amplitude by −1. Probabilities in the computational basis are unchanged.
Bloch sphere: Rotation by π about the Z axis.
Try in Studio →qc.h(qubit)Maps |0⟩ → |+⟩ and |1⟩ → |−⟩, creating an equal-magnitude superposition from a basis state.
Bloch sphere: Rotation by π about the (X+Z)/√2 axis: swaps the Z and X axes.
Try in Studio →qc.s(qubit)Applies a relative phase of i to |1⟩. S² = Z.
Bloch sphere: Rotation by π/2 about the Z axis.
Try in Studio →qc.sdg(qubit)Inverse of S: relative phase −i on |1⟩.
Bloch sphere: Rotation by −π/2 about the Z axis.
Try in Studio →qc.t(qubit)Applies a relative phase e^{iπ/4} to |1⟩. T² = S.
Bloch sphere: Rotation by π/4 about the Z axis.
Try in Studio →qc.tdg(qubit)Inverse of T: relative phase e^{−iπ/4} on |1⟩.
Bloch sphere: Rotation by −π/4 about the Z axis.
Try in Studio →qc.rx(theta, qubit)R_X(θ) = exp(−iθX/2).
Bloch sphere: Rotation by θ about the X axis.
Try in Studio →qc.ry(theta, qubit)R_Y(θ) = exp(−iθY/2). Real-valued rotation; R_Y(θ)|0⟩ = cos(θ/2)|0⟩ + sin(θ/2)|1⟩.
Bloch sphere: Rotation by θ about the Y axis.
Try in Studio →qc.rz(theta, qubit)R_Z(θ) = exp(−iθZ/2). Equals the phase gate P(θ) up to a global phase e^{−iθ/2}.
Bloch sphere: Rotation by θ about the Z axis.
Try in Studio →qc.p(lambda, qubit)P(λ) applies the relative phase e^{iλ} to |1⟩. P(π)=Z, P(π/2)=S, P(π/4)=T.
Bloch sphere: Rotation by λ about the Z axis.
Try in Studio →qc.cx(control, target)Flips the target qubit when the control qubit is |1⟩. With H, creates Bell states.
Try in Studio →qc.measure(qubit, clbit)non-unitaryProjective measurement in the computational basis. Outcome k occurs with probability ‖P_k|ψ⟩‖² and the state collapses to P_k|ψ⟩/‖P_k|ψ⟩‖. The result is stored in a classical bit.
qc.reset(qubit)non-unitaryReturns the qubit to |0⟩ regardless of its state. Non-unitary: if the qubit was entangled or in superposition, the result is a statistical mixture.
qc.barrier(*qubits)non-unitaryDoes not change the state. Marks a boundary that compilers must not optimize across; useful to group a circuit visually.