Sign in
← Atlas
Exact & formalGatesControlled gate

Controlled-Hadamard gate

A controlled version of the Hadamard gate that puts the target into superposition only when the control qubit is |1⟩, a canonical example of promoting a single-qubit gate to a controlled operation.

controlled gatetwo qubitsuperposition

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

CH is a useful teaching record because H is not diagonal and not a Pauli, so building its controlled version requires the general controlled-U machinery rather than a one-line native gate.

Circuit & simulation
Control 0 → target unchanged100%
Control 1 → P(target 0)50%
Control 1 → P(target 1)50%
What this takes and returns
Takes2 qubitsWhat joins here

Takes a 2-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 2 qubits can feed it.

16 entries meet this end. Named below.

Returns2 qubitsWhat joins here

Returns a 2-qubit register a next stage can take. This is the end that joins.

11 entries meet this end. Named below.

A unitary. The same register goes in and comes out, and this entry states no assumption about what is on it — which is what lets anything of the same width feed it. See all 29 →

How it works

Definition

CH=00I+11H=(10000100001212001212)\mathrm{CH} = |0\rangle\langle 0|\otimes I + |1\rangle\langle 1|\otimes H = \begin{pmatrix} 1&0&0&0\\0&1&0&0\\0&0&\tfrac{1}{\sqrt2}&\tfrac{1}{\sqrt2}\\0&0&\tfrac{1}{\sqrt2}&-\tfrac{1}{\sqrt2} \end{pmatrix}

with the control as the first (leftmost) qubit. Unlike CZ\mathrm{CZ} or CP\mathrm{CP}, this matrix is not diagonal, and unlike CX\mathrm{CX}, the applied operation HH is not a Pauli matrix.

Action on basis states

CH0,t=0,t,CH1,0=10+12,CH1,1=1012\mathrm{CH}|0,t\rangle = |0,t\rangle, \qquad \mathrm{CH}|1,0\rangle = |1\rangle\otimes\tfrac{|0\rangle+|1\rangle}{\sqrt2}, \qquad \mathrm{CH}|1,1\rangle = |1\rangle\otimes\tfrac{|0\rangle-|1\rangle}{\sqrt2}

When the control is 0|0\rangle the target is left completely untouched; when the control is 1|1\rangle the target is put into superposition exactly as a bare HH would.

Decomposition

Because HH is neither diagonal nor Pauli, CH\mathrm{CH} is not directly native on most hardware and is built with the general controlled-UU recipe of Barenco et al. (1995): find single-qubit gates A,B,CA,B,C with

ABC=I,AXBXC=H (up to global phase)ABC = I, \qquad AXBXC = H \text{ (up to global phase)}

and implement controlled-HH as CC–CNOT–BB–CNOT–AA on the target, conditioned on the control via two CNOTs. A common concrete choice uses A=RY(π/4)A = R_Y(\pi/4), B=RY(π/4)B = R_Y(-\pi/4), and a compensating phase gate for CC, giving a 2-CNOT circuit.

Key identities

  • CH2=I\mathrm{CH}^2 = I: applying the same controlled-Hadamard twice restores the input, since H2=IH^2 = I.
  • CH\mathrm{CH} conditioned on +|+\rangle on the control produces genuine entanglement between control and target, unlike CZ\mathrm{CZ}/CP\mathrm{CP} acting on product states, because HH mixes the target's basis rather than only phasing it.
Implementation
Native
controlled-hadamard.qasm
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
ch q[0], q[1];
Quantum vs classical

Classical baseline

Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.

Quantum claim

The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.

How to compare

Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Elementary gates for quantum computation1995 · Adriano Barenco, Charles H. Bennett, Richard Cleve, David P. DiVincenzo, Norman Margolus, Peter Shor, Tycho Sleator, John A. Smolin, Harald Weinfurter

Shows that single-qubit U(2) gates plus CNOT are universal and gives explicit decompositions for controlled-U, Toffoli, and Fredkin gates.

arxiv.org/abs/quant-ph/9503016
Quantum Computation and Quantum Information: 10th Anniversary Edition2010 · Michael A. Nielsen and Isaac L. Chuang

Standard reference for single- and multi-qubit gate matrices, Euler-angle decomposition, and universal gate sets.

doi.org/10.1017/cbo9780511976667