Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Simulation and scientific validity

What does a held-out size reveal that an in-sample residual cannot?

A neat finite-size fit can point to the wrong limit

Source research checked . Teaching calculations are ideal models.

A finite quantum simulator answers a finite question. Researchers may then ask how the observable changes as the represented system becomes larger. Extrapolation can be informative, but the inferred limit depends on a functional form and a range of sizes. A narrow fitted residual is evidence about the observed window, not automatic evidence about an unobserved limit.

This lab creates an exact curve with both inverse-size and inverse-size-squared terms. It deliberately fits only the first term. Because the generating limit is known, the error in the extrapolated intercept is visible. Comparing all sizes with the largest two, and testing a new holdout size, reveals sensitivity that the fitted line alone could conceal.

The example avoids simulated measurement noise so the source of error stays clear: the model is misspecified. In a real study, sampling noise, control error and different finite-size corrections can coexist. Comparing fit windows alongside explicit extrapolation assumptions exposes this sensitivity. Readers should be able to distinguish a directly measured finite-size observable from an inferred large-system value.

Synthetic decision model

Start with the assumptions

  • The generating curve is known only because this is synthetic.
  • Fits use exact values without measurement noise.
  • Ordinary least squares weights all supplied sizes equally.

Synthetic observable y(L) = y_infinity + a/L + b/L²

Deliberately restricted fit y_fit(L) = intercept + slope/L

Holdout error = fitted prediction at unused size - generating value

Synthetic a neat finite-size fit can point to the wrong limit plot: Illustrative observable versus Inverse system size, 1/L.
Synthetic baseline case. Horizontal axis: Inverse system size, 1/L. Vertical axis: Illustrative observable. Curves show Generating curve, Linear fit. These are computed teaching examples, not measured hardware results.

Compare the input regimes

Each case uses invented inputs. The results follow from this model and do not describe measured hardware.

Baseline regime
Complete inputs
Infinite-size reference
0.6
Inverse-size coefficient
1.5
Curvature coefficient
2
System sizes
6, 10, 16, 24
Unfitted holdout size
40
  1. Generate y(L) = reference + a/L + b/L² at L = 6, 10, 16, 24. These are exact synthetic function values, not noisy observations.
  2. Fit a straight line in 1/L while omitting curvature. Using all sizes gives intercept 0.582319; the largest two give 0.594792.
  3. At the held-out size 40, the all-size fit predicts 0.630441 and the generating curve gives 0.63875. Their difference is -0.008309.
Baseline regime · synthetic calculated results
Calculated quantitySynthetic result
All-size linear extrapolated intercept0.582318670987
Largest-two extrapolated intercept0.594791666667
Known synthetic infinite-size reference0.6
All-size intercept bias-0.0176813290126
In-sample residual RMS0.00324066979607
Unfitted holdout prediction minus truth-0.00830892942871
Exact generating values used in the fit
System sizeObservable
60.905555555556
100.77
160.7015625
240.665972222222

The known intercept is 0.6, so the fitted intercept error can be measured directly here. A small residual over the observed window does not guarantee an accurate extrapolation outside it. On a real experiment the infinite-size answer is unknown; varying the fit window and testing held-out sizes becomes evidence about model sensitivity, not proof of the limit.

Comparison regime
Complete inputs
Infinite-size reference
0.65
Inverse-size coefficient
1.1
Curvature coefficient
8
System sizes
11, 15, 21, 29
Unfitted holdout size
50
  1. Generate y(L) = reference + a/L + b/L² at L = 11, 15, 21, 29. These are exact synthetic function values, not noisy observations.
  2. Fit a straight line in 1/L while omitting curvature. Using all sizes gives intercept 0.621764; the largest two give 0.636864.
  3. At the held-out size 50, the all-size fit predicts 0.66398 and the generating curve gives 0.6752. Their difference is -0.01122.
Comparison regime · synthetic calculated results
Calculated quantitySynthetic result
All-size linear extrapolated intercept0.621764082501
Largest-two extrapolated intercept0.636863711002
Known synthetic infinite-size reference0.65
All-size intercept bias-0.0282359174994
In-sample residual RMS0.00275852015511
Unfitted holdout prediction minus truth-0.0112197571812
Exact generating values used in the fit
System sizeObservable
110.816115702479
150.758888888889
210.72052154195
290.69744351962

The known intercept is 0.65, so the fitted intercept error can be measured directly here. A small residual over the observed window does not guarantee an accurate extrapolation outside it. On a real experiment the infinite-size answer is unknown; varying the fit window and testing held-out sizes becomes evidence about model sensitivity, not proof of the limit.

Extended regime
Complete inputs
Infinite-size reference
0.71
Inverse-size coefficient
0.62
Curvature coefficient
15.2
System sizes
17, 21, 27, 35
Unfitted holdout size
62
  1. Generate y(L) = reference + a/L + b/L² at L = 17, 21, 27, 35. These are exact synthetic function values, not noisy observations.
  2. Fit a straight line in 1/L while omitting curvature. Using all sizes gives intercept 0.682791; the largest two give 0.693915.
  3. At the held-out size 62, the all-size fit predicts 0.714273 and the generating curve gives 0.723954. Their difference is -0.009681.
Extended regime · synthetic calculated results
Calculated quantitySynthetic result
All-size linear extrapolated intercept0.682790908716
Largest-two extrapolated intercept0.693915343915
Known synthetic infinite-size reference0.71
All-size intercept bias-0.0272090912836
In-sample residual RMS0.00151932667369
Unfitted holdout prediction minus truth-0.00968081314859
Exact generating values used in the fit
System sizeObservable
170.799065743945
210.773990929705
270.753813443073
350.74012244898

The known intercept is 0.71, so the fitted intercept error can be measured directly here. A small residual over the observed window does not guarantee an accurate extrapolation outside it. On a real experiment the infinite-size answer is unknown; varying the fit window and testing held-out sizes becomes evidence about model sensitivity, not proof of the limit.

Try the reasoning: Can a two-point fit with zero residual certify the infinite-size limit? Compare the fit-window change and the held-out-size error.

Back to this lab in the catalog