Gates · Single-qubit gate
P phase gate
The generalized phase gate that fixes the |0⟩ amplitude at 1 and applies e^{iλ} to |1⟩, unifying S, T, and Z as special cases of one continuous parameter.
Exact & formalUpdated
A small worked example, computed in your browser. It is not a result from this record's papers.
P(θ), phase by any angle you like
One qubit, put into |+⟩ = (|0⟩ + |1⟩)/√2 first, because on |0⟩ or |1⟩ alone this gate changes nothing a measurement or another gate can ever detect.
Step 1 of 2 · H
Probability of each outcome after this step
- 050%
- 150%
Puts the qubit into an equal superposition. Without this there is no second amplitude for the gate's phase to be measured against, and a phase on the whole state is not observable.
Probability spreads from 1 outcome to 2. All 2 are equally likely.
Multiplies the |1⟩ half of the state by a phase of 2π/5, and leaves |0⟩ alone. P takes any angle at all; Z, S and T are simply the three of them that earned their own names. The two outcomes stay equally likely — the difference is carried entirely in the phase between them, which is what the panel beside the bars shows.
The outcome probabilities do not move at all. What this step changes is phase — 2 distinct relative phases across the state now — which no measurement can see until a later step turns it back into probability.
Readout Measuring gives 0 or 1, each half the time — exactly as it did before the gate. A single measurement of this qubit cannot detect this gate at all. Its effect becomes visible only when the phase is turned back into probability by a later interference step, which is what every algorithm that uses it does.
Open in Studio- Steps1
- Wires1
- Qubits1
- Depth1 gate
- Parameterλ (radians)
- Papers2
P(λ) is the OpenQASM 3 standard-library phase gate and the natural way to express a whole family of fixed phase gates with a single parametrized definition.
Takes1 qubitWhat joins here
Takes a 1-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 1 qubits can feed it.
15 entries meet this end. Named below.
Returns1 qubitWhat joins here
Returns a 1-qubit register a next stage can take. This is the end that joins.
13 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 →
Definition
fixes the amplitude at exactly and rotates only the amplitude by — a convention choice, since any diagonal unitary is determined by its two phases up to an overall factor.
Action on basis states
Applied to a superposition , only the relative phase between the two amplitudes changes, by exactly .
Key identities and special cases
so is the continuous parent of the entire discrete phase-gate ladder built from repeated steps.
- : and implement the same rotation up to a global phase; is the more convenient convention when composing controlled-phase gates, since a controlled- needs no extra correction for the global phase (a controlled- does).
- : phases add, so repeated gates telescope into one gate at synthesis time.
- Controlled- is the entangling phase primitive used at every stage of the quantum Fourier transform, where the angles are .
Takes1 qubitWhat joins here
Takes a 1-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 1 qubits can feed it.
15 entries meet this end. Named below.
Returns1 qubitWhat joins here
Returns a 1-qubit register a next stage can take. This is the end that joins.
13 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 →
- Qubits
- 1
- Depth
- 1 gate
- Parameter
- λ (radians)
- Matrix
- diag(1, e^{iλ})
- Special cases
- P(π/2)=S, P(π/4)=T, P(π)=Z
- Relation to RZ
- P(λ) = e^{iλ/2} RZ(λ)
- Gate family
- Clifford at λ=π/2,π; non-Clifford otherwise
P(π/4)on q[0]
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.
Nobody has reviewed this record for gaps yet.
OPENQASM 3.0;
include "stdgates.inc";
qubit q;
p(pi/4) q;Related entries
- RZ rotation gate
Gates
- S phase gate
Gates
- T phase gate
Gates
- Controlled-phase gate (CP)
Gates
References
- OpenQASM 3: A broader and deeper quantum assembly language
Andrew W. Cross, Ali Javadi-Abhari, Thomas Alexander, Niel de Beaudrap, Lev S. Bishop, Steven Heidel, Colm A. Ryan, Prasahnt Sivarajah, John Smolin, Jay M. Gambetta, Blake R. Johnson · 2021
Defines the standard gate library (rx, ry, rz, p, u3-equivalent U, sx) used natively by the code snippets on this record.
- Quantum Computation and Quantum Information: 10th Anniversary Edition
Michael A. Nielsen and Isaac L. Chuang · 2010
Standard reference for single- and multi-qubit gate matrices, Euler-angle decomposition, and universal gate sets.