quantum gate directory

Gates Groups SDKs GitHub
$\mathrm{C}S$

controlled· 2 qubits

Controlled-S

Applies a phase of $i$ to the $|11\rangle$ state, the square root of controlled-$Z$.

Open in Quirk ↗

The controlled-$S$ gate is a two-qubit diagonal gate, and the special case $\phi = \pi/2$ of the controlled phase gate.

$$ \mathrm{C}S = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & i \end{bmatrix} $$

Properties

  • Diagonal and symmetric: control and target are interchangeable.
  • Squares to controlled-$Z$: $\mathrm{C}S^2 = \mathrm{C}Z$, hence the notation $\sqrt{\mathrm{C}Z}$.
  • Not Clifford. Like the $T$ gate, it sits in the third level of the Clifford hierarchy, so it is a genuine resource beyond stabilizer circuits.

Decompositions

  • In terms of $T$ gates and CNOTs: $$\mathrm{C}S = (T \otimes T) \, \mathrm{CNOT} \, (I \otimes T^\dagger) \, \mathrm{CNOT}$$ Three $T$ gates is the minimum for an exact, ancilla-free circuit.

Usage

  • Appears throughout the QFT, which is built from controlled phase gates of decreasing angle: $\mathrm{C}Z$, $\mathrm{C}S$, $\mathrm{C}T$, and so on.

Also written

  • $\Lambda(S)$
  • $\sqrt{\mathrm{C}Z}$
  • $\mathrm{CP}(\pi/2)$

Related

  • Controlled version of Phase

Groups

  • diagonal
  • number-preserving

Data

  • This gate as JSON
  • Edit this page on GitHub

The unitary, drawn

Every entry of the matrix as a disc. The area is the transition probability $|U_{jk}|^2$; the colour and the hand are the phase. Rows are outputs $\langle j|$, columns inputs $|k\rangle$, in the computational basis.

Phase

Disc area $= |U_{jk}|^2$. Hover an entry for its value, or take the JSON.

Weyl chamber

Where this gate sits among all two-qubit gates, up to single-qubit rotations before and after.

  • this gate
  • other gates
  • perfect entanglers

Coordinates:

not entangling entangling perfect entangler

$(a, b, c)$ means the gate equals $e^{i(a\,XX + b\,YY + c\,ZZ)}$ up to single-qubit gates, reduced to the chamber $\pi/4 \ge a \ge b \ge |c|$ (the convention of the canonical gate, Qiskit and Cirq). The $a = \pi/4$ face is a mirror: $(\pi/4, b, c)$ and $(\pi/4, b, -c)$ are the same gate. Drag the figure to rotate it, double-click to reset.

SDK support

How to call this gate in each framework. Hover a ⓘ for a note; the support matrix compares every gate at once.

SDKName
Qiskit qiskit.circuit.library.CSGate
PennyLane — ⓘ
Cirq cirq.CZPowGate ⓘ
Q# — ⓘ
PyQuil — ⓘ
Braket — ⓘ
BQSKit bqskit.ir.gates.CSGate
Qibo — ⓘ
pytket pytket.circuit.OpType.CS
Stim —
OpenQASM — ⓘ

← All gates

gate.directory made by nts $\oplus$ rdls