Phase gate
The Z gate is a single-qubit Pauli quantum operation that leaves |0⟩ unchanged and multiplies |1⟩ by −1.
Building Quantum Software with Python
The Z gate is a single-qubit quantum gate that multiplies the amplitude of the one basis state by negative one.
- How it is used
- Uses a single-qubit state transformation to reverse the |1⟩ amplitude direction without changing measurement probabilities.
- How deep it goes
- Explains amplitude signs, geometric direction, probability preservation, and a direct state-list implementation.
- Examples
- Demonstrates negating the second state-list entry and transforming [sqrt(0.3), sqrt(0.7)].
- What you can do after
- Apply the gate via a two-entry state-list transformation and verify direction reversal while preserving probabilities.
Read how Building Quantum Software with Python explains phase gate →
Quantum Programming in Depth
The Z gate is the single-qubit Pauli gate that leaves ket zero unchanged and multiplies ket one by negative one.
- How it is used
- Distinguishes candidate unitaries and extracts eigenvalues through controlled-Z phase kickback.
- How deep it goes
- Develops basis-state action, discrimination by measurement, eigenvectors, eigenvalues, and controlled phase kickback, stopping at the ±1 case.
- Examples
- Uses X-versus-Z identification on |0⟩ and controlled-Z experiments with target eigenstates |0⟩ and |1⟩.
- What you can do after
- Apply it to distinguish X from Z and read ±1 eigenvalues through a controlled-Z experiment.
Related concepts
- quantum gatekind of · A quantum gate is an operation that transforms the state of one or more qubits, typically represented by a unitary transformation.
- target qubitconfigures · A target qubit is the qubit designated to receive or participate in the action of a quantum operation.
- phase kickbackused by · Phase kickback is a quantum effect in which a controlled operation transfers a phase associated with its target to the relative phase of the control-qubit state.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

