Skip to content

An ideal single-qubit gate is a unitary operator

U∈U(2),U†U=UU†=I,U\in U(2), \qquad U^\dagger U=UU^\dagger=I,

acting on a chosen two-dimensional computational basis

{∣0⟩,∣1⟩}.\left\{ \lvert0\rangle,\lvert1\rangle \right\}.

It changes amplitudes, relative phases, or both. On the Bloch sphere, every one-qubit unitary acts as a proper three-dimensional rotation. Conversely, every proper rotation of the Bloch sphere is represented by two special-unitary matrices, UU and −U-U, and by infinitely many U(2)U(2) matrices if arbitrary global phases are retained.

The matrices below connect common gate names to rotations, phase changes and basis measurements. They describe ideal operations; the final section explains how a control Hamiltonian approximates them.

Helpful background. The Bloch sphere describes one-qubit states and measurement axes; Pauli matrices supplies the algebra; the circuit model fixes how gates are composed.

Unless stated otherwise, matrices below use the ordered computational basis

∣0⟩=(10),∣1⟩=(01),\lvert0\rangle= \begin{pmatrix} 1\\ 0 \end{pmatrix}, \qquad \lvert1\rangle= \begin{pmatrix} 0\\ 1 \end{pmatrix},

and act on state columns from the left. If a diagram applies G1G_1 and then G2G_2, its matrix is

Utotal=G2G1.U_{\mathrm{total}}=G_2G_1.

The rightmost factor acts first. A change of computational basis changes every displayed matrix by conjugation, so a gate name without a basis convention is incomplete.

For gate calculations, distinguish:

  1. Exact matrix equality: U=VU=V.
  2. Equality up to global phase: U=eiγVU=e^{i\gamma}V.
  3. Equality as an isolated quantum channel:
U(ρ)=UρU†=VρV†=V(ρ).\mathcal U(\rho) = U\rho U^\dagger = V\rho V^\dagger = \mathcal V(\rho).

The second implies the third. It does not permit phases to be dropped blindly inside a controlled operation, an interferometer, or any larger construction in which the allegedly global phase becomes branch dependent.

A general element of U(2)U(2) has four real parameters. Factoring out eiγe^{i\gamma} leaves three physically relevant parameters for an isolated one-qubit gate. Those three parameters specify a rotation axis and angle, or equivalently three Euler angles.

The Pauli gates are

X=(0110),Y=(0−ii0),Z=(100−1).\begin{gathered} X= \begin{pmatrix} 0&1\\ 1&0 \end{pmatrix}, \\[4pt] Y= \begin{pmatrix} 0&-i\\ i&0 \end{pmatrix}, \\[4pt] Z= \begin{pmatrix} 1&0\\ 0&-1 \end{pmatrix}. \end{gathered}

Their basis-state actions are

∣0⟩∣1⟩X∣1⟩∣0⟩Yi∣1⟩−i∣0⟩Z∣0⟩−∣1⟩.\begin{array}{c|cc} &\lvert0\rangle&\lvert1\rangle\\ \hline X&\lvert1\rangle&\lvert0\rangle\\ Y&i\lvert1\rangle&-i\lvert0\rangle\\ Z&\lvert0\rangle&-\lvert1\rangle \end{array}.

XX exchanges computational-basis populations. ZZ preserves those populations and reverses the sign of the ∣1⟩\lvert1\rangle amplitude. YY combines both effects with phases fixed by the convention

Y=(0−ii0).Y= \begin{pmatrix} 0&-i\\ i&0 \end{pmatrix}.

The informal names “bit flip,” “phase flip,” and “bit-and-phase flip” are useful mnemonics, but they refer to the chosen computational basis. In another basis, the same operator has a different matrix and operational description.

Each Pauli gate is Hermitian, unitary, traceless, and involutory:

X2=Y2=Z2=I.X^2=Y^2=Z^2=I.

Their products retain noncommutative phase information:

XY=iZ,YZ=iX,ZX=iY,XY=iZ, \qquad YZ=iX, \qquad ZX=iY,

whereas reversing either factor changes the sign. Pauli matrices derives the algebra and its relation to spin.

Define a rotation about a unit vector n^\hat{\mathbf n} by

Rn^(θ)=exp⁡(−iθ2n^⋅σ).R_{\hat{\mathbf n}}(\theta) = \exp\left( -\frac{i\theta}{2} \hat{\mathbf n}\cdot\boldsymbol\sigma \right).

Then

Rx(π)=−iX,Ry(π)=−iY,Rz(π)=−iZ.\begin{aligned} R_x(\pi)&=-iX, \\ R_y(\pi)&=-iY, \\ R_z(\pi)&=-iZ. \end{aligned}

Thus a Pauli gate is a Bloch-sphere rotation by π\pi about its named axis, up to the common phase ii. On a Bloch vector r=(rx,ry,rz)\mathbf r=(r_x,r_y,r_z),

X: (rx,ry,rz)⟼(rx,−ry,−rz),Y: (rx,ry,rz)⟼(−rx,ry,−rz),Z: (rx,ry,rz)⟼(−rx,−ry,rz).\begin{aligned} X:\ &(r_x,r_y,r_z) \longmapsto (r_x,-r_y,-r_z), \\ Y:\ &(r_x,r_y,r_z) \longmapsto (-r_x,r_y,-r_z), \\ Z:\ &(r_x,r_y,r_z) \longmapsto (-r_x,-r_y,r_z). \end{aligned}

The Hadamard gate is

H=12(111−1).H= \frac{1}{\sqrt2} \begin{pmatrix} 1&1\\ 1&-1 \end{pmatrix}.

It exchanges the computational and XX eigenbases:

H∣0⟩=∣+⟩,H∣1⟩=∣−⟩,H∣+⟩=∣0⟩,H∣−⟩=∣1⟩.\begin{aligned} H\lvert0\rangle&=\lvert+\rangle, & H\lvert1\rangle&=\lvert-\rangle, \\ H\lvert+\rangle&=\lvert0\rangle, & H\lvert-\rangle&=\lvert1\rangle. \end{aligned}

This is why HH appears before a computational-basis measurement when one wants to measure in the XX basis. It is better understood as a basis-changing unitary than as a device that “creates randomness.” Applied to ∣0⟩\lvert0\rangle, it creates a coherent superposition. Randomness appears only when that state is measured in an incompatible basis.

Conjugation by HH exchanges XX and ZZ while reversing YY:

HXH=Z,HZH=X,HYH=−Y.\begin{aligned} HXH&=Z, \\ HZH&=X, \\ HYH&=-Y. \end{aligned}

Consequently, its Bloch action is

(rx,ry,rz)⟼(rz,−ry,rx).(r_x,r_y,r_z) \longmapsto (r_z,-r_y,r_x).

Geometrically, HH is a rotation by π\pi about

n^H=x^+z^2\hat{\mathbf n}_H = \frac{\hat{\mathbf x}+\hat{\mathbf z}}{\sqrt2}

up to phase:

H=iRn^H(π).H=iR_{\hat{\mathbf n}_H}(\pi).

The exact Hadamard matrix has determinant −1-1 and lies in U(2)U(2) rather than SU(2)SU(2); −iH-iH and iHiH are its two special-unitary representatives up to phase.

The continuous phase-gate family is

P(ϕ)=(100eiϕ).P(\phi) = \begin{pmatrix} 1&0\\ 0&e^{i\phi} \end{pmatrix}.

It leaves computational-basis probabilities unchanged but changes the relative phase:

P(ϕ)(a∣0⟩+b∣1⟩)=a∣0⟩+eiϕb∣1⟩.P(\phi) \left( a\lvert0\rangle+b\lvert1\rangle \right) = a\lvert0\rangle +e^{i\phi}b\lvert1\rangle.

The common discrete gates are

S=P(π2)=(100i),T=P(π4)=(100eiπ/4).\begin{aligned} S &= P\left(\frac{\pi}{2}\right) = \begin{pmatrix} 1&0\\ 0&i \end{pmatrix}, \\ T &= P\left(\frac{\pi}{4}\right) = \begin{pmatrix} 1&0\\ 0&e^{i\pi/4} \end{pmatrix}. \end{aligned}

They satisfy

S2=Z,T2=S,T4=Z,T8=I.\begin{aligned} S^2&=Z, & T^2&=S, \\ T^4&=Z, & T^8&=I. \end{aligned}

TT is often called the π/8 gate because, up to global phase,

T=eiπ/8exp⁡(−iπZ8).T = e^{i\pi/8} \exp\left(-\frac{i\pi Z}{8}\right).

Its relative phase is π/4\pi/4, while the exponent contains π/8\pi/8. Stating the matrix removes the naming ambiguity.

The zz rotation is

Rz(ϕ)=(e−iϕ/200eiϕ/2).R_z(\phi) = \begin{pmatrix} e^{-i\phi/2}&0\\ 0&e^{i\phi/2} \end{pmatrix}.

Therefore

P(ϕ)=eiϕ/2Rz(ϕ).P(\phi)=e^{i\phi/2}R_z(\phi).

For an isolated qubit, P(ϕ)P(\phi) and Rz(ϕ)R_z(\phi) produce the same density-operator transformation and the same Bloch rotation. They are not the same matrix. The distinction matters when the operation is controlled and the matrix phase becomes relative between branches.

HH, SS, and the Pauli gates belong to the one-qubit Clifford group: they map Pauli operators to Pauli operators under conjugation. TT does not. Universal Gate Sets develops the computational consequences of that distinction; it should not be confused with a claim that one physical TT pulse is intrinsically more difficult on every hardware platform.

For j∈{x,y,z}j\in\{x,y,z\},

Rj(θ)=exp⁡(−iθ2σj)=cos⁡θ2 I−isin⁡θ2 σj.\begin{aligned} R_j(\theta) &= \exp\left( -\frac{i\theta}{2}\sigma_j \right) \\ &= \cos\frac{\theta}{2}\,I -i\sin\frac{\theta}{2}\,\sigma_j. \end{aligned}

With the convention above,

Rx(θ)=(cos⁡θ2−isin⁡θ2−isin⁡θ2cos⁡θ2),R_x(\theta) = \begin{pmatrix} \cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix}, Ry(θ)=(cos⁡θ2−sin⁡θ2sin⁡θ2cos⁡θ2),R_y(\theta) = \begin{pmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix}, Rz(θ)=(e−iθ/200eiθ/2).R_z(\theta) = \begin{pmatrix} e^{-i\theta/2}&0\\ 0&e^{i\theta/2} \end{pmatrix}.

Positive θ\theta gives the active right-hand-rule rotation of the Bloch vector when states transform as ρ↦RjρRj†\rho\mapsto R_j\rho R_j^\dagger. A source using e+iθσj/2e^{+i\theta\sigma_j/2}, a passive coordinate rotation, or a different YY convention will reverse signs. Never compare pulse angles without comparing definitions.

For a general axis,

n^=(nx,ny,nz),∥n^∥=1,\hat{\mathbf n} = (n_x,n_y,n_z), \qquad \lVert\hat{\mathbf n}\rVert=1,

the matrix is

Rn^(θ)=(c−inzs(−inx−ny)s(−inx+ny)sc+inzs),\begin{gathered} R_{\hat{\mathbf n}}(\theta) = \\[2pt] \begin{pmatrix} c-in_zs & (-in_x-n_y)s \\ (-in_x+n_y)s & c+in_zs \end{pmatrix}, \end{gathered}

where

c=cos⁡θ2,s=sin⁡θ2.c=\cos\frac{\theta}{2}, \qquad s=\sin\frac{\theta}{2}.

This formula is useful for checking signs, but the exponential form better exposes the generator and composition structure.

Write

ρ=12(I+r⋅σ).\rho = \frac12 \left( I+\mathbf r\cdot\boldsymbol\sigma \right).

Under a unitary UU,

ρ′=UρU†=12[I+(RUr)⋅σ],\rho' = U\rho U^\dagger = \frac12 \left[ I+(R_U\mathbf r)\cdot\boldsymbol\sigma \right],

where RU∈SO(3)R_U\in SO(3). One convenient definition is

(RU)ij=12Tr⁡(σiUσjU†).(R_U)_{ij} = \frac12 \operatorname{Tr} \left( \sigma_iU\sigma_jU^\dagger \right).

This representation makes several facts immediate:

  • unitaries preserve ∥r∥\lVert\mathbf r\rVert, purity, and angles between Bloch vectors;
  • no isolated one-qubit unitary can turn a mixed state into a pure state;
  • UU and eiγUe^{i\gamma}U give the same RUR_U;
  • after removing a global phase from a general U(2)U(2) matrix, the resulting special-unitary matrix VV and −V-V represent the same spatial rotation;
  • gate composition maps to rotation composition in the same operator order.

The Bloch sphere is exact for one qubit, but it does not scale into a complete picture of a multi-qubit state. A local one-qubit gate acting on one part of an entangled state still has a 2×22\times2 matrix on that subsystem, yet the joint state lives in a tensor-product space. Local unitaries preserve bipartite entanglement measures even while they change local measurement statistics and correlation axes.

The state vectors

∣ψ⟩andeiγ∣ψ⟩\lvert\psi\rangle \quad\text{and}\quad e^{i\gamma}\lvert\psi\rangle

represent the same ray. By contrast,

∣0⟩+∣1⟩2and∣0⟩+eiγ∣1⟩2\frac{ \lvert0\rangle+\lvert1\rangle }{\sqrt2} \quad\text{and}\quad \frac{ \lvert0\rangle+e^{i\gamma}\lvert1\rangle }{\sqrt2}

are generally different rays because only one branch was rephased. Their relative phase changes interference and equatorial measurement probabilities.

Let

V=eiγU.V=e^{i\gamma}U.

Then the isolated channels agree, V=U\mathcal V=\mathcal U. Now define a controlled operation with the control as the first tensor factor:

C(U)=∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗U.C(U) = \lvert0\rangle\langle0\rvert\otimes I + \lvert1\rangle\langle1\rvert\otimes U.

Then

C(eiγU)=[P(γ)⊗I]C(U),\begin{aligned} C(e^{i\gamma}U) &= \left[ P(\gamma)\otimes I \right] C(U), \end{aligned}

so the two controlled gates differ by a phase gate on the control. This is why replacing P(ϕ)P(\phi) by Rz(ϕ)R_z(\phi) is harmless for a standalone target but not automatically harmless after adding a control. Exact phase conventions are part of a reusable gate definition.

The most reliable way to simplify a short gate sequence is to choose one representation and keep the order explicit:

  • multiply exact matrices when phase matters;
  • conjugate Pauli operators for basis-change questions;
  • compose SO(3)SO(3) rotations for Bloch-vector questions;
  • act on basis states for simple circuit semantics.

For example, SH∣0⟩SH\lvert0\rangle means HH acts first:

SH∣0⟩=S∣+⟩=∣0⟩+i∣1⟩2=∣+i⟩.SH\lvert0\rangle = S\lvert+\rangle = \frac{ \lvert0\rangle+i\lvert1\rangle }{\sqrt2} = \lvert+i\rangle.

But

HS∣0⟩=H∣0⟩=∣+⟩.HS\lvert0\rangle = H\lvert0\rangle = \lvert+\rangle.

The two sequences differ because HH and SS do not commute.

Useful inverse and power relations include

H†=H,H2=I,S†=P(−π2),T†=P(−π4),Rj(θ)†=Rj(−θ),Rj(α)Rj(β)=Rj(α+β).\begin{gathered} H^\dagger=H, H^2=I, \\ S^\dagger=P\left(-\frac{\pi}{2}\right), \\ T^\dagger=P\left(-\frac{\pi}{4}\right), \\ R_j(\theta)^\dagger = R_j(-\theta), \\ R_j(\alpha)R_j(\beta) = R_j(\alpha+\beta). \end{gathered}

The last identity holds without a Baker–Campbell–Hausdorff correction because both rotations have the same generator. Rotations about different axes generally do not commute.

A basis change can move complexity from the measurement to a preceding gate. Suppose hardware measures ZZ after a unitary BB. The effective observable on the input is

B†ZB.B^\dagger ZB.

With the conventions on this page:

Desired input basis Gates before ZZ readout Total pre-rotation BB Effective observable
ZZ none II ZZ
XX HH HH XX
YY S†S^\dagger, then HH HS†HS^\dagger YY

For the last row,

B†ZB=SHZHS†=SXS†=Y.\begin{aligned} B^\dagger ZB &= SHZH S^\dagger \\ &= SXS^\dagger = Y. \end{aligned}

This table specifies the temporal order as well as the matrix product. Writing only “use HH and S†S^\dagger” is ambiguous because the gates do not commute.

The reverse viewpoint prepares cardinal states. Starting from ∣0⟩\lvert0\rangle,

H∣0⟩=∣+⟩,SH∣0⟩=∣+i⟩,X∣0⟩=∣1⟩.\begin{aligned} H\lvert0\rangle&=\lvert+\rangle, \\ SH\lvert0\rangle&=\lvert+i\rangle, \\ X\lvert0\rangle&=\lvert1\rangle. \end{aligned}

Preparation and readout circuits are related by adjoints, but a real experiment may assign different errors to preparation pulses, frame updates, and measurement. Gate identities alone do not certify state-preparation-and-measurement performance.

Every one-qubit unitary can be written

U=eiαRz(β)Ry(γ)Rz(δ).U = e^{i\alpha} R_z(\beta) R_y(\gamma) R_z(\delta).

To extract angles, first choose α\alpha so that e2iα=det⁡Ue^{2i\alpha}=\det U. Then

e−iαU=(u−v∗vu∗),∣u∣2+∣v∣2=1.e^{-i\alpha}U=\begin{pmatrix}u&-v^*\\v&u^*\end{pmatrix}, \qquad |u|^2+|v|^2=1.

When u,v≠0u,v\ne0, one choice is

γ=2atan2⁡(∣v∣,∣u∣),β=arg⁡v−arg⁡u,δ=−arg⁡v−arg⁡u.\begin{aligned} \gamma&=2\operatorname{atan2}(|v|,|u|),\\ \beta&=\arg v-\arg u,\\ \delta&=-\arg v-\arg u. \end{aligned}

Indeed, the product has u=e−i(β+δ)/2cos⁡(γ/2)u=e^{-i(\beta+\delta)/2}\cos(\gamma/2) and v=ei(β−δ)/2sin⁡(γ/2)v=e^{i(\beta-\delta)/2}\sin(\gamma/2). If v=0v=0, only β+δ\beta+\delta matters; if u=0u=0, only β−δ\beta-\delta matters. Set one redundant angle to zero rather than taking the argument of a zero matrix entry.

The angles are not unique at coordinate singularities or after periodic shifts. This is a coordinate decomposition, not a claim that a device literally executes three pulses in that form. A compiler may cancel neighboring rotations, absorb zz rotations into a frame, or choose another native basis. Gate Decomposition uses Euler factors as one-qubit leaves inside controlled, Cartan/KAK, dense-unitary, and finite-alphabet synthesis.

The decomposition also gives a direct state-preparation rule. For

∣ψ⟩=cos⁡θ2∣0⟩+eiϕsin⁡θ2∣1⟩,\lvert\psi\rangle = \cos\frac{\theta}{2}\lvert0\rangle + e^{i\phi} \sin\frac{\theta}{2}\lvert1\rangle,

one has

Rz(ϕ)Ry(θ)∣0⟩=e−iϕ/2∣ψ⟩.R_z(\phi)R_y(\theta)\lvert0\rangle = e^{-i\phi/2} \lvert\psi\rangle.

Thus two rotations prepare any pure qubit state from ∣0⟩\lvert0\rangle up to global phase. A general gate needs a third rotation because it must specify the action on an entire basis, not only on one input ray.

Circuit languages often expose a three-angle universal gate, but names, angle order, signs, and global phases are not universal. The OpenQASM 3 specification, for example, defines a built-in three-parameter UU together with an explicit global-phase operation; compatibility gates inherited from earlier versions use related but phase-shifted conventions.

Before translating a matrix into software:

  1. read the versioned gate definition;
  2. check whether the equality is exact or only up to phase;
  3. verify basis and qubit ordering;
  4. test the action on both ∣0⟩\lvert0\rangle and ∣1⟩\lvert1\rangle;
  5. retain the documented phase when the gate may later be controlled.

An ideal gate symbol names a target unitary. A physical device realizes time evolution generated by a control Hamiltonian, often modeled in an appropriate rotating frame as

Hc(t)=ℏ2[Ωx(t)X+Ωy(t)Y+Ωz(t)Z].H_{\mathrm c}(t) = \frac{\hbar}{2} \left[ \Omega_x(t)X + \Omega_y(t)Y + \Omega_z(t)Z \right].

The resulting propagator is

U(tf,ti)=Texp⁡[−iℏ∫titfHc(t) dt].U(t_f,t_i) = \mathcal T \exp\left[ -\frac{i}{\hbar} \int_{t_i}^{t_f} H_{\mathrm c}(t)\,dt \right].

For a constant direction n^\hat{\mathbf n} and pulse area

θ=∫titfΩ(t) dt,\theta = \int_{t_i}^{t_f} \Omega(t)\,dt,

this reduces to Rn^(θ)R_{\hat{\mathbf n}}(\theta) in the ideal rotating-frame model. Detuning, leakage, crosstalk, finite bandwidth, decoherence, and calibration drift turn the implemented operation into a channel E\mathcal E that only approximates the target.

A named ZZ gate need not correspond to a dedicated physical pulse. In many driven-qubit platforms it can be implemented as a software frame update that changes the phases of later drives. Such a virtual Z gate can be effectively instantaneous in the control schedule, but it still changes the interpretation of subsequent axes and must be tracked consistently. Other platforms may implement the same logical matrix by different controls.

Keep four layers separate:

Layer Object Question
Logical ideal matrix UU What transformation is intended?
Compiled sequence in a native gate set How is UU decomposed for this target?
Scheduled pulses, frame updates, and timing What controls are issued and when?
Implemented noisy channel E\mathcal E What transformation did the device realize?

Rabi and Ramsey control develops the driven dynamics; pulse-level control discusses calibrated frames and waveforms; noise in quantum information describes implementation errors.

For two ideal matrices U,V∈U(2)U,V\in U(2), a quick test for equality up to phase is

12∣Tr⁡(U†V)∣=1.\frac12 \left| \operatorname{Tr}(U^\dagger V) \right| = 1.

This criterion assumes both matrices are unitary. It says their isolated channels agree; it does not establish that two noisy implementations have the same error process.

For

∣ψ⟩=a∣0⟩+b∣1⟩,\lvert\psi\rangle = a\lvert0\rangle+b\lvert1\rangle,

compute X∣ψ⟩X\lvert\psi\rangle, Y∣ψ⟩Y\lvert\psi\rangle, and Z∣ψ⟩Z\lvert\psi\rangle. Verify XY∣ψ⟩=iZ∣ψ⟩XY\lvert\psi\rangle=iZ\lvert\psi\rangle.

Solution

Direct matrix action gives

X∣ψ⟩=b∣0⟩+a∣1⟩,Y∣ψ⟩=−ib∣0⟩+ia∣1⟩,Z∣ψ⟩=a∣0⟩−b∣1⟩.\begin{aligned} X\lvert\psi\rangle &= b\lvert0\rangle+a\lvert1\rangle, \\ Y\lvert\psi\rangle &= -ib\lvert0\rangle+ia\lvert1\rangle, \\ Z\lvert\psi\rangle &= a\lvert0\rangle-b\lvert1\rangle. \end{aligned}

Applying YY first and then XX,

XY∣ψ⟩=ia∣0⟩−ib∣1⟩=iZ∣ψ⟩.XY\lvert\psi\rangle = ia\lvert0\rangle-ib\lvert1\rangle = iZ\lvert\psi\rangle.

The phase ii is part of the exact operator identity.

Show that P(ϕ)=eiϕ/2Rz(ϕ)P(\phi)=e^{i\phi/2}R_z(\phi). Then show that their controlled versions differ by P(ϕ/2)P(\phi/2) on the control qubit.

Solution

Multiplying Rz(ϕ)R_z(\phi) by eiϕ/2e^{i\phi/2} gives

eiϕ/2Rz(ϕ)=(100eiϕ)=P(ϕ).e^{i\phi/2}R_z(\phi) = \begin{pmatrix} 1&0\\ 0&e^{i\phi} \end{pmatrix} = P(\phi).

Using

C(eiγU)=[P(γ)⊗I]C(U),C(e^{i\gamma}U) = \left[ P(\gamma)\otimes I \right] C(U),

with γ=ϕ/2\gamma=\phi/2 and U=Rz(ϕ)U=R_z(\phi) gives

C(P(ϕ))=[P(ϕ/2)⊗I]C(Rz(ϕ)).C(P(\phi)) = \left[ P(\phi/2)\otimes I \right] C(R_z(\phi)).

The factor is a relative phase between the control branches and cannot generally be discarded.

Starting from ∣0⟩\lvert0\rangle, compare SH∣0⟩SH\lvert0\rangle with HS∣0⟩HS\lvert0\rangle. Give both final Bloch vectors.

Solution

Since H∣0⟩=∣+⟩H\lvert0\rangle=\lvert+\rangle,

SH∣0⟩=∣0⟩+i∣1⟩2=∣+i⟩,SH\lvert0\rangle = \frac{ \lvert0\rangle+i\lvert1\rangle }{\sqrt2} = \lvert+i\rangle,

whose Bloch vector is (0,1,0)(0,1,0). On the other hand, S∣0⟩=∣0⟩S\lvert0\rangle=\lvert0\rangle, so

HS∣0⟩=H∣0⟩=∣+⟩,HS\lvert0\rangle = H\lvert0\rangle = \lvert+\rangle,

whose Bloch vector is (1,0,0)(1,0,0). The rightmost gate acts first.

Prove that

Rz(ϕ)Ry(θ)∣0⟩R_z(\phi)R_y(\theta)\lvert0\rangle

prepares the Bloch-sphere state with polar angle θ\theta and azimuth ϕ\phi, up to global phase.

Solution

First,

Ry(θ)∣0⟩=cos⁡θ2∣0⟩+sin⁡θ2∣1⟩.R_y(\theta)\lvert0\rangle = \cos\frac{\theta}{2}\lvert0\rangle + \sin\frac{\theta}{2}\lvert1\rangle.

Applying Rz(ϕ)R_z(\phi) gives

Rz(ϕ)Ry(θ)∣0⟩=e−iϕ/2cos⁡θ2∣0⟩+eiϕ/2sin⁡θ2∣1⟩=e−iϕ/2(cos⁡θ2∣0⟩+eiϕsin⁡θ2∣1⟩).\begin{aligned} R_z(\phi)R_y(\theta)\lvert0\rangle &= e^{-i\phi/2} \cos\frac{\theta}{2}\lvert0\rangle + e^{i\phi/2} \sin\frac{\theta}{2}\lvert1\rangle\\ &= e^{-i\phi/2} \left( \cos\frac{\theta}{2}\lvert0\rangle + e^{i\phi} \sin\frac{\theta}{2}\lvert1\rangle \right). \end{aligned}

The prefactor is global. The remaining state has the required polar and azimuthal angles.

Verify HXH=ZHXH=Z and HZH=XHZH=X by matrix multiplication. Use the result to explain why applying HH, measuring ZZ, and forgetting the final state realizes an XX-basis measurement of the input.

Solution

Direct multiplication gives

HXH=(100−1)=Z,HXH = \begin{pmatrix} 1&0\\ 0&-1 \end{pmatrix} = Z,

and

HZH=(0110)=X.HZH = \begin{pmatrix} 0&1\\ 1&0 \end{pmatrix} = X.

The probability of outcome z=±1z=\pm1 after applying HH is

Tr⁡[ρ H†I+zZ2H]=Tr⁡[ρ I+zX2].\operatorname{Tr} \left[ \rho\, H^\dagger \frac{I+zZ}{2} H \right] = \operatorname{Tr} \left[ \rho\, \frac{I+zX}{2} \right].

These are exactly the XX-measurement probabilities of the original state.

Suppose a rotating-frame control Hamiltonian is constant:

Hc=ℏΩ2XH_{\mathrm c} = \frac{\hbar\Omega}{2}X

for a duration τ\tau, with real nonzero Ω\Omega. Find the ideal gate and the earliest positive duration that produces XX up to global phase. How does that phase depend on the sign of Ω\Omega?

Solution

The propagator is

U(τ)=exp⁡(−iΩτ2X)=Rx(Ωτ).U(\tau) = \exp\left( -\frac{i\Omega\tau}{2}X \right) = R_x(\Omega\tau).

Choose τ=π/∣Ω∣\tau=\pi/|\Omega|. Then the pulse area is sgn⁡(Ω)π\operatorname{sgn}(\Omega)\pi, and

U(τ)=−isgn⁡(Ω)X.U(\tau)=-i\operatorname{sgn}(\Omega)X.

For positive Ω\Omega the phase is −i-i; for negative Ω\Omega it is +i+i. Both give the isolated channel of XX. If a coherent controlled implementation is later constructed, its relative branch phase must follow the actual controlled Hamiltonian, including terms omitted as global phases in the isolated-qubit model.

  • A. Barenco, C. H. Bennett, R. Cleve, D. P. DiVincenzo, N. Margolus, P. Shor, T. Sleator, J. A. Smolin, and H. Weinfurter, “Elementary gates for quantum computation,” Physical Review A 52, 3457–3467, 1995, doi:10.1103/PhysRevA.52.3457.
  • D. C. McKay, C. J. Wood, S. Sheldon, J. M. Chow, and J. M. Gambetta, “Efficient ZZ gates for quantum computing,” Physical Review A 96, 022330, 2017, doi:10.1103/PhysRevA.96.022330.
  • N. D. Mermin, Quantum Computer Science: An Introduction, Cambridge University Press, 2007, doi:10.1017/CBO9780511813870.
  • M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press, 2010, doi:10.1017/CBO9780511976667.
  • OpenQASM contributors, OpenQASM 3 Specification, “Gates” and “Standard library,” versioned specification.
  • J. Preskill, Lecture Notes for Physics 219/Computer Science 219: Quantum Computation, Chapter 5, California Institute of Technology, course materials.
  • J. J. Sakurai and J. Napolitano, Modern Quantum Mechanics, 3rd ed., Cambridge University Press, 2020, doi:10.1017/9781108587280.