MerLean-example

39 Rem 16: Practical Measurement Rounds

This chapter formalizes the observation that the \(d\) rounds of quantum error correction in the original code before and after the gauging measurement are required for the proof of fault tolerance but are overkill in practice. In a full fault-tolerant computation, the number of rounds required before and after a gauging measurement depends on the surrounding operations: if the gauging measurement occurs in the middle of a large computation, a constant number of rounds before and after are expected to be sufficient. However, this choice affects the effective distance and threshold depending on the surrounding operations.

39.1 Round Requirements

Definition 1238 Round Requirement Type
#

An inductive type classifying round requirements:

  • theoretical: required for the formal proof of fault tolerance,

  • practical: sufficient in practice.

Definition 1239 Round Requirement
#

A round requirement specifies how many error correction rounds are needed before and after gauging. It consists of:

  • a code distance \(d \in \mathbb {N}\) with \(d {\gt} 0\),

  • the number of rounds before gauging, \(r_{\mathrm{before}} \in \mathbb {N}\),

  • the number of rounds after gauging, \(r_{\mathrm{after}} \in \mathbb {N}\),

  • a requirement type (theoretical or practical).

Definition 1240 Theoretical Round Requirement

Given a code distance \(d {\gt} 0\), the theoretical round requirement sets both \(r_{\mathrm{before}} = d\) and \(r_{\mathrm{after}} = d\), with type theoretical.

Definition 1241 Practical Round Requirement

Given a code distance \(d {\gt} 0\) and chosen values \(r_{\mathrm{before}}, r_{\mathrm{after}} \in \mathbb {N}\), the practical round requirement records these values with type practical.

Definition 1242 Uses Full Rounds
#

A round requirement uses full rounds if \(r_{\mathrm{before}} = d\) and \(r_{\mathrm{after}} = d\).

Definition 1243 Uses Fewer Rounds
#

A round requirement uses fewer rounds if \(r_{\mathrm{before}} {\lt} d\) or \(r_{\mathrm{after}} {\lt} d\).

Theorem 1244 Theoretical Rounds Equal \(d\)

For any code distance \(d {\gt} 0\), the theoretical round requirement uses full \(d\) rounds, i.e., \(r_{\mathrm{before}} = d\) and \(r_{\mathrm{after}} = d\).

Proof

Both equalities hold by reflexivity from the definition of the theoretical round requirement.

Theorem 1245 Theoretical Rounds Before

For any code distance \(d {\gt} 0\), the theoretical round requirement has \(r_{\mathrm{before}} = d\).

Proof

This holds by reflexivity (definitional equality).

Theorem 1246 Theoretical Rounds After

For any code distance \(d {\gt} 0\), the theoretical round requirement has \(r_{\mathrm{after}} = d\).

Proof

This holds by reflexivity (definitional equality).

39.2 Computation Context

Definition 1247 Gauging Position
#

An inductive type describing where in a computation the gauging measurement occurs:

  • beginning: at the start of a computation,

  • middle: in the middle of a large computation,

  • end_: at the end of a computation,

  • isolated: a standalone gauging measurement.

Definition 1248 Computation Context
#

The surrounding computation context for a gauging measurement, consisting of:

  • the position of the gauging measurement (beginning, middle, end, or isolated),

  • the total number of logical operations,

  • a Boolean indicating whether surrounding operations provide additional error correction,

  • the effective number of EC rounds provided by surrounding operations.

Definition 1249 Mid-Computation Context

A mid-computation context where the position is middle, surrounding EC is present, and the given number of surrounding EC rounds is recorded.

Definition 1250 Isolated Context
#

An isolated context where the position is isolated, there is one total operation, no surrounding EC is present, and zero surrounding EC rounds.

Definition 1251 Has Surrounding EC

A computation context has surrounding EC if \(\mathtt{surroundingECPresent} = \mathtt{true}\) and \(\mathtt{surroundingECRounds} {\gt} 0\).

39.3 Practical Round Configuration

Definition 1252 Practical Round Config
#

A configuration for practical round counts based on context, consisting of:

  • a code distance \(d {\gt} 0\),

  • a computation context,

  • practical rounds before and after gauging,

  • proofs that both practical round counts are at most \(d\).

Theorem 1253 Practical Rounds \(\leq d\)

For any practical round configuration, the practical rounds before and after gauging are each at most \(d\).

Proof

This follows directly from the fields before_le_d and after_le_d of the configuration.

Definition 1254 Uses Fewer Rounds (Practical)

A practical configuration uses fewer rounds if \(r_{\mathrm{before}} {\lt} d\) or \(r_{\mathrm{after}} {\lt} d\).

Definition 1255 Uses Constant Rounds

A practical configuration uses constant rounds \(c\) if \(r_{\mathrm{before}} \leq c\) and \(r_{\mathrm{after}} \leq c\).

Definition 1256 Constant Round Config
#

Given a code distance \(d {\gt} 0\), a constant \(c \leq d\), and a computation context, the constant round configuration sets both practical round counts to \(c\).

Theorem 1257 Constant Rounds Suffice in Mid-Computation

If a gauging measurement occurs in the middle of a large computation with surrounding error correction, then for any constant \(c\) with \(0 {\lt} c \leq d\), the constant round configuration satisfies: it uses constant rounds \(c\), and both the practical rounds before and after are positive.

Proof

By simplification using the definitions of constantRoundConfig and usesConstantRounds, the goal reduces to showing \(c \leq c\), \(c \leq c\), \(0 {\lt} c\), and \(0 {\lt} c\). The first two hold by reflexivity of \(\leq \), and the latter two follow from the hypothesis \(0 {\lt} c\).

Theorem 1258 Constant Rounds Fewer Than \(d\)

If \(c {\lt} d\), then the constant round configuration with constant \(c\) uses strictly fewer rounds than \(d\).

Proof

By simplification using the definitions, the goal reduces to \(c {\lt} d \lor c {\lt} d\). We take the left disjunct, which holds by hypothesis.

39.4 Effective Code Parameters

Definition 1259 Effective Code Parameters
#

Effective code parameters under a given round configuration, consisting of:

  • the original code distance \(d\),

  • the effective distance (which may be reduced with fewer rounds),

  • a Boolean indicating whether a fault-tolerance threshold exists,

  • the round configuration used.

Definition 1260 Full Rounds Parameters

With full \(d\) rounds, the effective distance equals the original distance \(d\), and a threshold exists.

Definition 1261 Reduced Rounds Parameters

With fewer rounds, the effective distance may be reduced to some given value.

Theorem 1262 Full Rounds Preserve Distance

With full \(d\) rounds, the effective distance equals \(d\).

Proof

This holds by reflexivity (definitional equality).

Theorem 1263 Fewer Rounds Affect Effective Distance

If the round configuration uses fewer rounds, and the effective distance is at most the original distance, and the original distance equals \(d\), then the effective distance is at most \(d\).

Proof

This follows by integer arithmetic (omega) from the hypotheses \(d_{\mathrm{eff}} \leq d_{\mathrm{orig}}\) and \(d_{\mathrm{orig}} = d\).

Theorem 1264 Full Rounds Effective Distance Equals Original

With full \(d\) rounds, the effective distance equals the original distance.

Proof

This holds by reflexivity (definitional equality).

39.5 Worst-Case vs Practical Guarantees

Definition 1265 Guarantee Type
#

An inductive type classifying fault-tolerance guarantees:

  • worstCase: holds for any surrounding computation,

  • contextDependent: depends on the specific context.

Definition 1266 Fault Tolerance Guarantee
#

A fault-tolerance guarantee with its type, code distance, round counts before and after, and a Boolean indicating validity.

Definition 1267 Worst-Case Guarantee
#

The worst-case guarantee with \(d\) rounds before and after, of type worstCase, marked as valid.

Definition 1268 Context-Dependent Guarantee

A context-dependent guarantee with constant \(c\) rounds before and after, of type contextDependent, marked as valid for appropriate contexts.

Theorem 1269 \(d\) Rounds Is a Worst-Case Guarantee

The theoretical requirement of \(d\) rounds serves as a worst-case guarantee: the guarantee type is worstCase, the rounds before and after are both \(d\), and the guarantee is valid.

Proof

By simplification using the definition of worstCaseGuarantee, all four conjuncts hold trivially.

Theorem 1270 Context-Dependent Fewer Rounds

If \(c {\lt} d\), then the context-dependent guarantee uses fewer rounds before gauging than the worst-case guarantee.

Proof

By simplification using the definitions, the goal reduces to \(c {\lt} d\), which holds by hypothesis.

Theorem 1271 Both Guarantees Valid

Both the worst-case and context-dependent guarantees are valid (for their respective contexts).

Proof

By simplification using both definitions, the validity fields are both true.

39.6 Practical Implementations

Definition 1272 Practical Implementation
#

A practical implementation choice for round counts, consisting of:

  • a code distance \(d {\gt} 0\),

  • the surrounding context,

  • chosen rounds before and after gauging, both positive and at most \(d\).

Definition 1273 Uses Fewer (Implementation)
#

A practical implementation uses fewer rounds if \(r_{\mathrm{before}} {\lt} d\) or \(r_{\mathrm{after}} {\lt} d\).

Theorem 1274 Practical Choice Depends on Context

Given two practical implementations with the same code distance but different computation contexts and different chosen rounds before gauging, their chosen rounds before gauging are indeed different.

Proof

This follows directly from the hypothesis that the chosen rounds are different.

Theorem 1275 Mid-Computation Allows Fewer Rounds

Let \(c {\lt} d\). If a mid-computation implementation uses \(c\) rounds before gauging and an isolated implementation uses \(d\) rounds before gauging (with the same code distance), then the mid-computation implementation uses strictly fewer rounds before gauging.

Proof

Rewriting the chosen rounds using the hypotheses \(r_{\mathrm{mid}} = c\) and \(r_{\mathrm{iso}} = d\), the goal becomes \(c {\lt} d\), which holds by hypothesis.

39.7 Connection to Boundary Conditions

Definition 1276 Practical Config to Error Correction Rounds

Converts a PracticalRoundConfig to an ErrorCorrectionRounds structure (from the boundary conditions formalization), preserving the code distance and round counts.

Theorem 1277 Full Rounds Give Full Protection

With full \(d\) rounds (i.e., \(c = d\)), the conversion to ErrorCorrectionRounds provides full protection.

Proof

By simplification using the definitions of constantRoundConfig, toErrorCorrectionRounds, and providesFullProtection, both conditions (\(r_{\mathrm{before}} \geq d\) and \(r_{\mathrm{after}} \geq d\)) are trivially satisfied when \(c = d\).

Theorem 1278 Fewer Rounds No Full Protection

If \(c {\lt} d\), then the constant round configuration with \(c\) rounds does not provide full protection.

Proof

By simplification using the definitions, the negation of full protection reduces to showing that \(c \geq d\) leads to a contradiction. Assuming \(c \geq d\) and using integer arithmetic with the hypothesis \(c {\lt} d\), we obtain the desired contradiction.

39.8 Summary

Definition 1279 Practical Rounds Summary
#

A summary structure capturing all aspects of the practical measurement rounds trade-off:

  • the theoretical requirement (number of rounds),

  • whether this is a worst-case guarantee,

  • whether practical implementations may use fewer rounds,

  • whether the choice affects distance,

  • whether the choice is context-dependent.

Definition 1280 Practical Rounds Summary Instance
#

The summary capturing all aspects of the remark: the theoretical requirement is \(d\) rounds, it is a worst-case guarantee, practical implementations may use fewer rounds, the choice affects distance, and the choice is context-dependent.

Theorem 1281 \(d\) Rounds Overkill in Practice

The summary satisfies: the theoretical requirement is \(d\), and all Boolean flags (worst-case, practical may use fewer, affects distance, context-dependent) are true.

Proof

By simplification using the definition of practicalRoundsSummary, all five conjuncts hold trivially.

Theorem 1282 Existence of Constant Round Config

For any code distance \(d {\gt} 0\) and any mid-computation context with surrounding error correction, there exists a constant \(c \leq d\) with \(c {\gt} 0\) such that the constant round configuration uses constant rounds \(c\).

Proof

We take \(c = 1\). The condition \(1 \leq d\) follows from \(d {\gt} 0\) by integer arithmetic. Positivity \(0 {\lt} 1\) holds by Nat.one_pos. The constant rounds property \(1 \leq 1 \land 1 \leq 1\) holds by reflexivity.

I’ll read the Lean file first.