The Gottesman–Kitaev–Preskill code stores a finite-dimensional qubit inside one infinite-dimensional oscillator by arranging its wavefunction on a lattice in phase space. Small displacement errors become measurable shifts modulo that lattice, so analogue noise can be converted into discrete logical error information.
Guide 37 introduced bosonic modes and quadratures, while Guide 38 developed phase-space covariance geometry. The GKP code adds a different structure: not a Gaussian blob, but a comb-like lattice of sharply localised peaks. The ideal codewords are mathematically useful but unphysical because they require infinite energy and infinitely sharp quadrature peaks. Real GKP states are finite-energy approximations with finite-width peaks and an overall envelope.
This guide uses dimensionless quadratures q and p satisfying [q,p]=i. In this convention the square-lattice qubit GKP stabilizers are generated by displacements of size 2√π in q and p, while logical Pauli displacements have half that period, √π.
Continuous displacement error → measure position inside a phase-space unit cell → round to the nearest lattice point → update the oscillator → retain only the residual logical class.
1. Displacements are the natural oscillator errors
A phase-space displacement can be written
D(α)=exp(αa†−α* a).
Equivalently, real shifts in q and p are generated by the conjugate quadratures:
e^{-iu p}shifts q by u;e^{iv q}shifts p by v.
Small random displacement noise therefore means the oscillator state is translated slightly in phase space. GKP coding is designed so sufficiently small translations can be diagnosed without learning the encoded logical amplitudes.
2. Build a lattice in q
The ideal logical zero has support on q values
q=2s√π, s∈ℤ.
The ideal logical one is shifted by √π:
q=(2s+1)√π.
Thus |0L⟩ and |1L⟩ occupy alternating teeth of a comb with spacing √π, while each individual logical comb repeats every 2√π.
In the conjugate p representation, the state is also comb-like. The two-dimensional phase-space lattice is what permits simultaneous protection against small q and p shifts without violating the uncertainty principle: the ideal peaks are distributions rather than normalisable finite-energy wavefunctions.
3. Stabilizers as commuting large displacements
The square-lattice qubit GKP stabilizers can be written
S_q=e^{i2√π q}
and
S_p=e^{-i2√π p}.
They commute because the phase generated by exchanging the two displacements is an integer multiple of 2π.
An ideal codeword is a simultaneous +1 eigenstate of both stabilizers. The stabilizer lattice therefore defines the code space in the same abstract way that Pauli stabilizers defined finite-dimensional codes in Guide 12, but the generators are oscillator displacements rather than tensor products of qubit Paulis.
4. Logical Pauli operators are half-lattice displacements
A convenient logical choice is
Z_L=e^{i√π q}
and
X_L=e^{-i√π p}.
XL shifts q by √π, exchanging the even and odd combs. ZL changes the relative phase between them.
Because the logical displacements have half the stabilizer period, XL and ZL commute with the stabilizers but anticommute with one another, exactly as qubit Pauli X and Z should.
5. Modular quadratures
The stabilizer measurements do not reveal absolute q and p. They reveal each quadrature modulo √π or 2√π depending on the chosen syndrome convention.
For error correction it is useful to reduce a measured displacement to the nearest representative inside the interval
[−√π/2, √π/2).
This is modular arithmetic on a continuous variable. The syndrome says where the state lies inside a repeating unit cell, while the encoded logical bit is stored in which coset of the stabilizer lattice the state belongs to.
6. Nearest-lattice-point decoding
Suppose the oscillator suffers a q shift u. Ideal syndrome extraction determines u modulo √π. The decoder chooses the nearest multiple of √π and applies the opposite displacement.
If
|u|<√π/2
around the correct lattice point, nearest-neighbour rounding returns to the original logical coset.
If the shift crosses the midpoint, the decoder rounds toward the neighbouring logical coset and introduces a logical Pauli error.
7. Worked q-shift examples
Since √π≈1.77245, the half-cell boundary is
√π/2≈0.88623.
- A shift u=0.30 is safely inside the correctable nearest-cell region.
- A shift u=0.80 is still inside but close to the boundary.
- A shift u=0.95 crosses the nearest-cell boundary and is decoded to the neighbouring lattice point, corresponding to a logical X-type error in this coordinate convention.
The same geometry applies to p shifts and logical Z-type errors.
8. Why correcting q alone is not enough
A state tightly localised around the q lattice can still suffer momentum displacement. Because q and p are conjugate, a complete GKP correction cycle extracts both modular quadratures using suitable ancilla interactions and measurements.
The two syndrome measurements must be designed so the logical information is not measured directly. As in stabilizer quantum error correction, the measured observables commute with logical operators strongly enough to reveal the error syndrome without collapsing the logical superposition.
9. Ideal GKP states have infinite energy
An infinitely sharp q comb contains delta-function peaks. Fourier duality produces an infinitely extended p structure. Such a state is not normalisable and has unbounded mean photon number.
Physical GKP states replace each delta peak by a narrow wavepacket and multiply the infinite comb by a broad envelope. Two parameters are therefore relevant: local peak width and global envelope width, often tied together in simplified symmetric models.
Finite squeezing turns perfect lattice distinguishability into a statistical decoding problem.
10. Approximate GKP states and effective Gaussian shift noise
A common modelling approximation treats finite GKP peak width and channel imperfections as random Gaussian shifts in q and p with standard deviation σ.
If one quadrature shift U is normally distributed with mean zero and variance σ², the leading probability of crossing the nearest decision boundary is approximately
P_fail≈2Q(√π/(2σ))
when wraparound to farther cells is negligible. Q(x) is the upper tail of a standard normal distribution.
This formula is a nearest-boundary approximation. Exact wrapped-Gaussian logical error probabilities sum over all alternating lattice intervals.
11. Worked Gaussian-shift estimate
Take σ=0.20. The normalised boundary is
z=(√π/2)/0.20≈4.431.
The standard-normal upper tail Q(4.431) is approximately 4.7×10−6, giving
P_fail≈9.4×10^-6
for that one quadrature in the nearest-boundary approximation.
The result shows why modest changes in effective shift width can dramatically change logical error: Gaussian tails fall exponentially in the squared boundary-to-noise ratio.
12. Analogue syndrome information should not be discarded too early
A hard decoder records only whether the measured modular shift lies closer to one lattice point or another. A soft decoder also records how close the measurement was to the decision boundary.
A syndrome near zero is more trustworthy than one near ±√π/2. When GKP qubits are concatenated with a higher-level code such as a surface code, feeding this analogue confidence information into the outer decoder can improve logical performance.
This is a distinctive advantage of oscillator codes: the inner syndrome is continuous and therefore carries reliability information richer than one binary syndrome bit.
13. Error correction by coupling to an ancilla
GKP syndrome extraction can be implemented by coupling the data oscillator to an ancilla prepared in a suitable GKP-like state, applying Gaussian entangling operations and measuring an ancilla quadrature.
The measurement produces a modular estimate of the data displacement. A corrective displacement or frame update then returns the data toward the nearest lattice point.
Ancilla finite squeezing, gate noise and homodyne inefficiency all broaden the effective syndrome distribution. Error correction is therefore only as good as the ancillary lattice reference used to measure the displacement.
14. GKP Clifford gates are Gaussian-friendly
Many logical Clifford operations on square-lattice GKP qubits correspond to Gaussian symplectic transformations of the oscillator phase space.
For example, a π/2 phase-space rotation exchanges q and p up to sign and acts as a logical Hadamard under the appropriate convention. Shears and two-mode SUM/CZ-like Gaussian gates implement other Clifford transformations.
The non-Gaussian difficulty is pushed into preparing high-quality GKP resource states and implementing non-Clifford universality.
15. GKP plus surface code
An oscillator can encode one GKP qubit, and many GKP qubits can then be arranged in an outer surface code.
The inner GKP layer converts small continuous shifts into effective qubit Pauli error probabilities. The outer topological code handles the residual discrete logical errors.
This concatenation connects Guides 26 and 41 directly: local phase-space lattice decoding becomes the physical layer beneath a geometric qubit code.
16. Finite-energy GKP states are not exact stabilizer eigenstates
Because their peaks have finite width and envelope, approximate states are only approximately invariant under the ideal stabilizer displacements.
Different approximate-state definitions distribute finite-energy error differently. Some use Gaussian envelopes in q, some apply an energy-damping operator to ideal codewords, and experimental preparation may introduce asymmetric noise.
A quoted “GKP squeezing in dB” therefore depends on the convention used to translate peak variance into a squeezing parameter.
17. Squeezing and peak width
If the GKP peak quadrature variance is Δ² and vacuum variance is 1/2, a common relative squeezing measure is
S_dB=-10log₁₀(Δ²/(1/2)).
If Δ²=0.05, the ratio to vacuum is 0.1, corresponding to 10 dB of peak squeezing under this definition.
The overall envelope also contributes energy and logical overlap. Peak squeezing alone does not fully specify an approximate code state.
18. Displacement noise versus photon loss
GKP codes are naturally matched to small displacement noise. Photon loss is not literally a random displacement; it attenuates the mode and injects environmental vacuum noise.
However, after suitable rescaling or amplification, loss can often be converted into an effective Gaussian-noise channel for GKP error analysis, with a trade-off between attenuation compensation and added noise.
Cat codes in Guide 42 instead organise the oscillator around photon-number parity and can be naturally matched to photon-loss events. Different bosonic codes exploit different hardware error biases.
19. Lattice choice can change error geometry
The square GKP lattice is not the only possibility. Hexagonal lattices pack equal-radius correctable regions more efficiently in two-dimensional Euclidean geometry and can improve thresholds for isotropic displacement noise under appropriate decoding.
The code lattice is therefore a geometric design variable. One should match lattice shape to noise covariance and available Gaussian controls rather than assuming the square grid is always optimal.
20. Common misconception: ideal GKP combs can be prepared exactly
Exact delta-function combs are nonnormalisable and require infinite energy. Experiments can only prepare finite-energy approximations.
21. Common misconception: every shift below √π/2 is always corrected perfectly in hardware
The √π/2 rule describes ideal nearest-cell geometry with perfect syndrome extraction. Finite-energy ancillas, noisy gates and measurement error can cause miscorrection even when the physical shift lies inside that interval.
22. Common misconception: GKP converts an analogue oscillator into a perfect digital qubit once
Noise continues between correction rounds. The code repeatedly estimates modular displacement, and residual analogue information can remain useful to an outer decoder.
23. Worked synthesis problem
A GKP q-syndrome reports a displacement equivalent to u=0.73 in the principal interval. Use √π≈1.77245.
Step 1: Decision boundary. √π/2≈0.88623.
Step 2: Nearest-cell decision. Since |0.73|<0.88623, the nearest ideal correction returns to the original lattice point rather than the neighbouring logical coset.
Step 3: Reliability. The margin to the boundary is only 0.15623. The syndrome is therefore less reliable than a measurement near zero if syndrome noise is significant.
Step 4: Outer decoder. A concatenated decoder should ideally receive a likelihood reflecting this small margin rather than only a hard “no logical flip” bit.
Step 5: Hardware interpretation. The correction guarantee depends on the total effective displacement uncertainty, including finite-energy code peaks and ancilla/readout noise.
24. Practice set
- What commutator convention does this guide use for q and p?
- What physical error does
e^{-iup}generate? - Where are ideal logical-zero q peaks located?
- Where are logical-one q peaks located?
- State the two square-lattice stabilizer generators.
- Why do logical Pauli displacements use √π rather than 2√π?
- What is a modular quadrature syndrome?
- What is the ideal nearest-neighbour decision boundary?
- Why are ideal GKP states unphysical?
- What does soft decoding preserve that hard decoding discards?
- Why is GKP naturally compatible with an outer surface code?
- What two features besides peak width matter for a realistic GKP state?
Answers
[q,p]=i.- A shift of q by u.
2s√πfor integer s.(2s+1)√π.e^{i2√πq}ande^{-i2√πp}.- They must move between the two logical cosets while commuting with full-period stabilizers.
- The displacement remainder inside a repeating phase-space unit cell rather than the absolute quadrature value.
√π/2in each square-lattice quadrature under ideal nearest-cell decoding.- Delta-function lattice peaks are nonnormalisable and require infinite energy.
- Distance from a decision boundary and therefore likelihood/confidence information.
- The GKP layer converts continuous shifts into residual qubit-like Pauli error probabilities that a surface-code decoder can process.
- The global envelope/energy distribution and all preparation/measurement noise parameters.
Sources and further study
[1] Daniel Gottesman, Alexei Kitaev and John Preskill, Encoding a qubit in an oscillator. The foundational GKP construction of finite-dimensional codes embedded in continuous-variable oscillators.
[2] Nicolas C. Menicucci, Fault-Tolerant Measurement-Based Quantum Computing with Continuous-Variable Cluster States. A fault-tolerance route combining finite-squeezing CV cluster states with encoded qubits.
[3] Kyungjoo Noh, S. M. Girvin and Liang Jiang, Encoding an oscillator into many oscillators. A modern bosonic-code perspective including GKP concatenation and Gaussian-noise structure.
Continue through Quantum Mathematics
Guide 42: Cat Codes, Bosonic Quantum Error Correction, Photon Loss and Parity uses oscillator parity rather than a phase-space displacement lattice. Guide 43: Continuous-Variable Cluster States, Graph Nullifiers and Measurement-Based Quantum Computation uses GKP states as a route toward fault-tolerant CV computation. Guide 44: Boson Sampling, Matrix Permanents, Linear Optics and Photonic Quantum Advantage develops a different nonuniversal photonic computation model.

