Site Tools


z-gate

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

z-gate [May 22, 2026 at 20:56] – created Ivan Janevskiz-gate [June 13, 2026 at 03:13] (current) – external edit 127.0.0.1
Line 1: Line 1:
-# Z-gate+# Z gate 
 +**Z gate** (or **Pauli-Z gate**, or **phase flip gate**) is a single-qubit gate that applies a phase flip to the $\lvert 1\rangle$ state while leaving $\lvert 0\rangle$ unchanged. It is the third [[pauli-gates|Pauli gate]] and a special case of the [[p-gate|phase gate]] with $\phi = \pi$.
  
 $$Z = \begin{pmatrix}1 & 0\\ 0 & -1\end{pmatrix}$$ $$Z = \begin{pmatrix}1 & 0\\ 0 & -1\end{pmatrix}$$
 +
 +The gate leaves the computational basis states $\lvert 0\rangle$ and $\lvert 1\rangle$ as eigenstates, and swaps the Hadamard basis states:
 +
 +$$Z\lvert 0\rangle = \lvert 0\rangle \qquad Z\lvert 1\rangle = -\lvert 1\rangle$$
 +$$Z\lvert +\rangle = \lvert -\rangle \qquad Z\lvert -\rangle = \lvert +\rangle$$
 +
 +The phase flip does not change measurement outcomes in the computational basis — $|-1|^2 = 1$ — but it changes interference patterns, making it observable in rotated bases. On the [[bloch-sphere|Bloch sphere]], $Z$ corresponds to a $\pi$ rotation about the $z$-axis. The $S$ and $T$ gates are the square root and fourth root of $Z$ respectively: $S^2 = Z$ and $T^2 = S$.
 +
 +## List of code implementations
 +
 +- [[z-gate-qiskit|Z gate (Qiskit)]]
 +- [[z-gate-custatevec|Z gate (cuStateVec)]]
 +- [[z-gate-cudaq|Z gate (CUDA-Q)]]
 +
z-gate.1779483382.txt.gz · Last modified: by Ivan Janevski