quantum gate directory

Gates Groups SDKs GitHub

Group· 16 gates

Diagonal Group

Gates that only attach a phase to each computational basis state, so they all commute with one another.

The diagonal group contains the gates that are diagonal in the computational basis: they never change which basis state you are in, only attach a phase to each one. Unitarity forces every diagonal entry onto the unit circle.

$$\mathsf{D}(n) := \left\{ \mathrm{diag}(\mathrm{e}^{i\theta_1}, \ldots, \mathrm{e}^{i\theta_n}) \mid \theta_j \in \mathbb{R} \right\} \subset \mathsf{U}(n)$$

As a group it is the $n$-torus $\mathsf{U}(1)^n$, and it is a maximal abelian subgroup of the unitary group (a maximal torus): you cannot enlarge it without adding gates that fail to commute.

Properties

  • Action on basis states: $|x\rangle \mapsto \mathrm{e}^{i\theta_x}|x\rangle$. A phase oracle is nothing but a diagonal gate with $\pm 1$ entries.
  • Abelian: diagonal gates all commute, so they can be freely reordered, merged, and canceled — this is what compiler "phase folding" passes exploit.
  • Closed under adding controls: controlling a diagonal gate gives another diagonal gate. This generates the ladder $Z$ → $\mathrm{C}Z$ → $\mathrm{CC}Z$, and likewise $S$ → $\mathrm{C}S$, $P(\phi)$ → $\mathrm{C}P(\phi)$.
  • Invisible to final measurements: diagonal gates commute with computational-basis projectors, so one applied just before measurement changes nothing and can be deleted.
  • The diagonal gates at each level of the Clifford hierarchy form the sequence $Z$, $S$, $T$, ... — each the square root of the previous.
  • Contained in the number-preserving group: a gate that fixes every basis state certainly preserves its excitation count.

Hardware

Diagonal $z$-axis rotations are special on most platforms: $R_z$ is implemented virtually, as a bookkeeping change to the phase of subsequent pulses, taking zero time and introducing zero error. Compilers therefore work hard to push phases into diagonal form.

All groups

  • clifford
  • diagonal
  • matchgate
  • number-preserving
  • orthogonal
  • pauli
  • permutation
  • unitary

Edit this page on GitHub

Gates in this group

In the order of the table on the home page; the colour bar is the gate's family.

1 $Z$ Pauli-Z n $I$ Identity 1 $S$ Phase 1 $T$ T 1 1 $R_z$ z Rotation 1 1 $P$ Phase Shift 2 1 $R_{zz}$ zz Rotation 2 1 $\mathrm{C}R_z$ Controlled z Rotation 2 $\mathrm{C}Z$ Controlled-Z 2 1 $\mathrm{C}P$ Controlled Phase 2 $\mathrm{C}S$ Controlled-S 3 $\mathrm{CC}Z$ Controlled-CZ 1 $Z_d$ Clock 2 $\mathrm{C}Z_d$ Controlled Clock n 1 $\mathrm{Ph}$ Global Phase n $O_f^\pm$ Phase Oracle

On the map

How the diagonal group sits among the others: nested regions are subgroups, overlaps are shared gates, and the small labels are one example gate per region.

unitary clifford orthogonal number-preserving diagonal pauli permutation matchgate YXZI HCNOTSWAP ToffoliCSWAPS TCZCCZiSWAP XYfSWAP GivensRy FSimRxRxx

← All groups

gate.directory made by nts $\oplus$ rdls