# Z gate (Qiskit) [[z-gate|Z gate]] implementation using Qiskit. The Z gate applied to $\lvert 0\rangle$ is invisible at measurement (it leaves $\lvert 0\rangle$ unchanged), so this example prepares $\lvert +\rangle$ first to make the phase flip observable via interference. ```python from qiskit import QuantumCircuit from qiskit.quantum_info import Statevector qc = QuantumCircuit(1) qc.h(0) # |0> -> |+> qc.z(0) # |+> -> |-> print(Statevector(qc)) # Statevector([ 0.70710678+0.j, -0.70710678+0.j], dims=(2,)) ```