$$
% Dirac notation
\newcommand{\ket}[1]{\left|#1\right\rangle}
\newcommand{\bra}[1]{\left\langle#1\right|}
\newcommand{\braket}[2]{\left\langle#1\middle|#2\right\rangle}
\newcommand{\expect}[1]{\left\langle#1\right\rangle}
% Common operators
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\Tr}{\operatorname{Tr}}
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}
% Complexity
\newcommand{\bigO}[1]{\mathcal{O}\!\left(#1\right)}
$$
1. Logical Error Rate vs Code Distance
The surface code suppresses logical errors exponentially with code distance \(d\) . The leading-order formula is:
\[p_L \approx \left(\frac{p}{p_\text{th}}\right)^{\lfloor d/2 \rfloor}\]
where \(p\) is the physical error rate per gate and \(p_\text{th} \approx 1\%\) is the threshold. Each +2 in distance multiplies the exponent by one, suppressing \(p_L\) by another factor of \((p/p_\text{th})\) .
Formula caveat: This is a leading-order approximation. Stim-based simulations give slightly different values — the formula captures the qualitative scaling but not the exact prefactors.
viewof p_1 = Inputs. range ([0.0001 , 0.02 ], {
value : 0.001 , step : 0.0001 ,
label : "Physical error rate p"
})
viewof p_th_1 = Inputs. range ([0.005 , 0.02 ], {
value : 0.01 , step : 0.0005 ,
label : "Threshold p_th"
})
viewof logScale1 = Inputs. toggle ({ label : "Log y-axis" , value : true })
{
const distances = [3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 21 ];
const lerFn1 = (d) => Math . pow (p_1 / p_th_1, Math . floor (d / 2 ));
const data = distances. map (d => {
const ler = lerFn1 (d);
const quality = ler < 1e-10 ? "excellent" : ler < 1e-6 ? "marginal" : "poor" ;
const color = quality === "excellent" ? "#16a34a" : quality === "marginal" ? "#ca8a04" : "#dc2626" ;
return { d, ler : Math . max (ler, 1e-20 ), quality, color };
});
const ratio = p_1 / p_th_1;
return Plot. plot ({
title : `p/p_th = ${ ratio. toFixed (3 )} — each +2 distance multiplies LER by ${ ratio. toFixed (3 )} ` ,
width,
height : 380 ,
marginLeft : 70 ,
x : { label : "Code distance d" , tickValues : distances },
y : {
label : "Logical error rate pL" ,
type : logScale1 ? "log" : "linear" ,
... (logScale1 ? { domain : [1e-20 , 1 ] } : {})
},
color : {
domain : ["excellent" , "marginal" , "poor" ],
range : ["#16a34a" , "#ca8a04" , "#dc2626" ]
},
marks : [
Plot. ruleY ([0 ]),
Plot. line (data, { x : "d" , y : "ler" , stroke : "#6366f1" , strokeWidth : 2.5 }),
Plot. dot (data, { x : "d" , y : "ler" , fill : "color" , r : 7 , stroke : "white" , strokeWidth : 2 }),
... (logScale1 ? [
Plot. ruleY ([1e-10 ], { stroke : "#16a34a" , strokeDasharray : "6,4" , strokeWidth : 1 }),
Plot. text ([{ d : 21 , ler : 1e-10 }], {
x : "d" , y : "ler" ,
text : ["← deep circuit target" ],
dy : - 10 , fontSize : 10 , fill : "#16a34a" , textAnchor : "end"
}),
Plot. ruleY ([1e-6 ], { stroke : "#ca8a04" , strokeDasharray : "6,4" , strokeWidth : 1 }),
] : [])
]
});
}
{
const distances = [3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 21 ];
const lerFn1 = (d) => Math . pow (p_1 / p_th_1, Math . floor (d / 2 ));
const rows = distances. map (d => {
const ler = lerFn1 (d);
const quality = ler < 1e-10 ? "excellent" : ler < 1e-6 ? "marginal" : "poor" ;
const color = quality === "excellent" ? "#16a34a" : quality === "marginal" ? "#ca8a04" : "#dc2626" ;
const label = quality === "excellent" ? "✓ deep circuits" : quality === "marginal" ? "~ shallow only" : "✗ no benefit" ;
return html `<tr>
<td style="padding:4px 12px; font-weight:bold;">d = ${ d} </td>
<td style="padding:4px 12px; font-family:monospace;"> ${ ler < 1e-15 ? ler. toExponential (1 ) : ler. toExponential (2 )} </td>
<td style="padding:4px 12px; color: ${ color} ; font-weight:bold;"> ${ label} </td>
</tr>` ;
});
return html `<table style="border-collapse:collapse; margin-top:8px; font-size:14px;">
<thead><tr>
<th style="padding:4px 12px; text-align:left; border-bottom:1px solid #e5e7eb;">Distance</th>
<th style="padding:4px 12px; text-align:left; border-bottom:1px solid #e5e7eb;">p_L</th>
<th style="padding:4px 12px; text-align:left; border-bottom:1px solid #e5e7eb;">Quality</th>
</tr></thead>
<tbody> ${ rows} </tbody>
</table>` ;
}
For algorithms requiring billions of gates , you need \(p_L \lesssim 10^{-12}\) per logical gate. With \(p = 0.001\) and \(p_\text{th} = 0.01\) , that requires \(d \geq 25\) . Notice how the distance requirement scales: halving the physical error rate (to 0.0005) lets you drop two distance levels for the same \(p_L\) .
2. Below vs Above Threshold
The threshold \(p_\text{th}\) is a phase transition: on one side, more distance helps; on the other, it hurts.
When \(p < p_\text{th}\) : the ratio \(p/p_\text{th} < 1\) , so raising \(d\) drives \(p_L \to 0\) . QEC works.
When \(p > p_\text{th}\) : the ratio \(p/p_\text{th} > 1\) , so raising \(d\) makes \(p_L\) explode . You are encoding an error into larger and larger structures.
viewof p_2 = Inputs. range ([0.001 , 0.015 ], {
value : 0.005 , step : 0.0001 ,
label : "Physical error rate p"
})
{
const p_th2 = 0.01 ;
const isAbove = p_2 > p_th2;
const distances = [3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 21 ];
const lerFn2 = (d) => Math . pow (p_2 / p_th2, Math . floor (d / 2 ));
const data = distances. map (d => ({ d, ler : Math . max (lerFn2 (d), 1e-20 ) }));
const curveColor = isAbove ? "#dc2626" : "#3b82f6" ;
const plot = Plot. plot ({
title : isAbove
? "⚠ Above threshold — increasing d WORSENS logical error rate"
: "✓ Below threshold — increasing d improves logical error rate" ,
width,
height : 360 ,
marginLeft : 70 ,
x : { label : "Code distance d" , tickValues : distances },
y : { label : "Logical error rate pL" , type : "log" , domain : [1e-12 , 10 ] },
marks : [
Plot. ruleY ([1 ], { stroke : "#e5e7eb" }),
Plot. ruleY ([p_th2], { stroke : "#6b7280" , strokeDasharray : "6,4" , strokeWidth : 1.5 }),
Plot. text ([{ d : 21 , ler : p_th2 }], {
x : "d" , y : "ler" , text : ["← p_th = 1%" ],
dy : - 10 , fontSize : 11 , fill : "#6b7280" , textAnchor : "end"
}),
Plot. line (data, { x : "d" , y : "ler" , stroke : curveColor, strokeWidth : 3 }),
Plot. dot (data, { x : "d" , y : "ler" , fill : curveColor, r : 6 , stroke : "white" , strokeWidth : 2 }),
]
});
const banner = html `<div style="
background: ${ isAbove ? "#fef2f2" : "#eff6ff" } ;
border-left: 4px solid ${ curveColor} ;
padding: 12px 18px; border-radius: 6px; margin: 10px 0; font-size: 15px;
">
<strong>p = ${ p_2. toFixed (4 )} </strong> | p/p_th = <strong> ${ (p_2/ p_th2). toFixed (2 )} </strong>
—
${ isAbove
? `<span style="color:#dc2626; font-weight:bold;">ABOVE threshold</span> — more distance hurts`
: `<span style="color:#3b82f6; font-weight:bold;">BELOW threshold</span> — more distance helps` }
</div>` ;
return html ` ${ plot}${ banner} ` ;
}
Try sweeping p across the threshold at 1%. Watch the curve flip from downward-sloping (exponential suppression) to upward-sloping (exponential amplification). This is the single most important phenomenon in all of QEC: below threshold, spending more qubits always helps. Above it, spending more qubits makes things worse.
3. Physical Qubit Cost
Every logical qubit requires many physical qubits. For the rotated surface code (the variant Chipmunq targets):
Data qubits: \(d^2\)
Ancilla qubits: \(d^2 - 1\)
Total per logical qubit: \(2d^2 - 1\)
Lattice surgery CNOT (3 patches: control, target, ancilla): \(3(2d^2 - 1)\)
viewof d_3 = Inputs. range ([3 , 21 ], {
value : 7 , step : 2 ,
label : "Code distance d"
})
viewof targetLERInput = Inputs. text ({
label : "Target logical error rate (e.g. 1e-10)" ,
placeholder : "1e-10" ,
value : "1e-10"
})
{
const data_q = d_3 * d_3;
const ancilla_q = d_3 * d_3 - 1 ;
const per_patch = 2 * d_3 * d_3 - 1 ;
const per_cnot = 3 * per_patch;
// Min d for target LER: (p/p_th)^floor(d/2) <= target
// floor(d/2) >= log(target) / log(p/p_th) [only valid if p < p_th]
const p_ref = 0.001 , p_th_ref = 0.01 ;
const target = parseFloat (targetLERInput) || 1e-10 ;
let minD = null , minQubits = null ;
if (p_ref < p_th_ref && target > 0 && target < 1 ) {
const minHalf = Math . ceil (Math . log (target) / Math . log (p_ref / p_th_ref));
if (minHalf >= 1 ) {
minD = Math . max (3 , 2 * minHalf + 1 ); // always odd: 2*k+1
minQubits = 3 * (2 * minD * minD - 1 );
}
}
return html `<div style="display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:10px 0;">
<div style="background:#f8fafc; border-left:4px solid #6366f1; padding:14px 18px; border-radius:6px;">
<div style="font-size:13px; color:#64748b; margin-bottom:4px;">At d = ${ d_3} </div>
<div style="font-size:15px;"><strong> ${ data_q} </strong> data + <strong> ${ ancilla_q} </strong> ancilla = <strong> ${ per_patch} </strong> qubits per logical qubit</div>
<div style="font-size:15px; margin-top:6px;">Lattice surgery CNOT: <strong style="font-size:18px;"> ${ per_cnot} </strong> physical qubits</div>
</div>
<div style="background:#f8fafc; border-left:4px solid #0ea5e9; padding:14px 18px; border-radius:6px;">
<div style="font-size:13px; color:#64748b; margin-bottom:4px;">To reach p_L ≤ ${ target. toExponential (0 )} (at p=0.001)</div>
${ minD
? html `<div style="font-size:15px;">Need <strong>d = ${ minD} </strong> → <strong style="font-size:18px;"> ${ minQubits} </strong> qubits for a CNOT</div>`
: html `<div style="font-size:15px; color:#dc2626;">Not achievable at p = 0.001 (above threshold)</div>` }
</div>
</div>` ;
}
{
const distances = [3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 21 ];
const barData = distances. flatMap (d => [
{ d, count : d * d, type : "Data qubits" },
{ d, count : d * d - 1 , type : "Ancilla qubits" }
]);
return Plot. plot ({
title : "Physical qubits per logical qubit (one surface code patch)" ,
width,
height : 340 ,
marginLeft : 60 ,
x : { label : "Code distance d" , tickValues : distances },
y : { label : "Physical qubits" },
color : {
domain : ["Data qubits" , "Ancilla qubits" ],
range : ["#6366f1" , "#a5b4fc" ],
legend : true
},
marks : [
Plot. barY (barData, Plot. stackY ({
x : "d" , y : "count" , fill : "type" ,
order : ["Data qubits" , "Ancilla qubits" ],
title : d => ` ${ d. type } : ${ d. count } ` ,
opacity : d => d. d === d_3 ? 1 : 0.5
})),
Plot. ruleY ([0 ])
]
});
}
Key insight: The cost grows as \(\approx 2d^2\) — quadratic, not linear. Going from \(d=7\) to \(d=15\) (roughly doubling distance) quadruples the qubit count per logical qubit. Yet the LER suppression per \(+2\) in distance is always the same multiplicative factor \((p/p_\text{th})\) . This is the fundamental trade-off in fault-tolerant computing.
4. Compilation Impact on Logical Error Rate
Compilation is not free: every routing decision, every SWAP insertion, affects the physical noise profile the surface code must correct. The question is whether QEC still works after compilation.
The paper measures: - Chipmunq: 2.2× LER increase over the ideal (no-compilation) baseline - LightSABRE: 128× LER increase — at this level, QEC is qualitatively broken
These multipliers come from Stim-based simulation. They are applied to the approximate formula here for illustration; the qualitative behavior is accurate, the exact values are simulation-derived.
viewof p_4 = Inputs. range ([0.0001 , 0.015 ], {
value : 0.001 , step : 0.0001 ,
label : "Physical error rate p"
})
{
const p_th4 = 0.01 ;
const distances = [3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 , 21 ];
const idealLER = d => Math . pow (p_4 / p_th4, Math . floor (d / 2 ));
const chipmunqLER = d => 2.2 * idealLER (d);
// LightSABRE: apply noise floor at p (physical error rate — the minimum meaningful LER)
const lightsabreLER = d => Math . max (128 * idealLER (d), p_4);
const data = distances. flatMap (d => [
{ d, ler : Math . max (idealLER (d), 1e-20 ), compiler : "Ideal (no compilation)" },
{ d, ler : Math . max (chipmunqLER (d), 1e-20 ), compiler : "Chipmunq (2.2×)" },
{ d, ler : Math . max (lightsabreLER (d), 1e-20 ), compiler : "LightSABRE (128×)" }
]);
// Find where LightSABRE bottoms out (hits noise floor)
let lightsabreFloorD = null ;
for (const d of distances) {
if (128 * idealLER (d) <= p_4) { lightsabreFloorD = d; break ; }
}
const plot = Plot. plot ({
title : "LER vs code distance: ideal vs compiled" ,
width, height : 400 , marginLeft : 70 ,
x : { label : "Code distance d" , tickValues : distances },
y : { label : "Logical error rate pL" , type : "log" , domain : [1e-16 , 1 ] },
color : {
domain : ["Ideal (no compilation)" , "Chipmunq (2.2×)" , "LightSABRE (128×)" ],
range : ["#16a34a" , "#3b82f6" , "#dc2626" ],
legend : true
},
marks : [
Plot. ruleY ([p_4], { stroke : "#9ca3af" , strokeDasharray : "4,4" }),
Plot. text ([{ d : 21 , ler : p_4 }], {
x : "d" , y : "ler" , text : ["← physical error rate p (noise floor)" ],
dy : - 8 , fontSize : 10 , fill : "#9ca3af" , textAnchor : "end"
}),
Plot. line (data, {
x : "d" , y : "ler" , stroke : "compiler" , strokeWidth : 2.5 ,
strokeDasharray : d => d. compiler === "LightSABRE (128×)" ? "6,3" : null
}),
Plot. dot (data, { x : "d" , y : "ler" , fill : "compiler" , r : 5 , stroke : "white" , strokeWidth : 1.5 }),
]
});
const lerD7_ideal = idealLER (7 );
const lerD7_chipmunq = chipmunqLER (7 );
const lerD7_lightsabre = lightsabreLER (7 );
const cards = html `<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin:10px 0; font-size:13px;">
<div style="background:#f0fdf4; border-left:3px solid #16a34a; padding:10px 14px; border-radius:6px;">
<strong style="color:#16a34a;">Ideal</strong><br>
d=7 LER: <strong> ${ lerD7_ideal. toExponential (2 )} </strong><br>
QEC works ✓
</div>
<div style="background:#eff6ff; border-left:3px solid #3b82f6; padding:10px 14px; border-radius:6px;">
<strong style="color:#3b82f6;">Chipmunq</strong><br>
d=7 LER: <strong> ${ lerD7_chipmunq. toExponential (2 )} </strong><br>
Exponential suppression preserved ✓
</div>
<div style="background:#fef2f2; border-left:3px solid #dc2626; padding:10px 14px; border-radius:6px;">
<strong style="color:#dc2626;">LightSABRE</strong><br>
d=7 LER: <strong> ${ lerD7_lightsabre. toExponential (2 )} </strong><br>
${ lightsabreFloorD ? `Hits noise floor at d= ${ lightsabreFloorD} — QEC broken ✗` : "QEC degraded ✗" }
</div>
</div>` ;
return html ` ${ plot}${ cards} ` ;
}
Key insight: LightSABRE’s 128× LER degradation is not just a quantitative setback — it is a qualitative failure. Once LER hits the noise floor (the physical error rate \(p\) ), increasing \(d\) provides no further benefit. All the physical qubits spent on error correction are wasted. Chipmunq’s 2.2× overhead, by contrast, just means you need 1–2 extra distance levels to hit your target — a manageable constant-factor cost.
5. Inter-Chiplet Link Threshold
Not all chiplet designs are equal. The key constraint: each chip boundary must have at least \(d\) inter-chiplet quantum links for Chipmunq to achieve low LER. Below that, syndrome information cannot flow fast enough across chip boundaries, and errors accumulate.
This is a schematic illustration based on the paper’s RQ4 anchor points: \(n_\text{inter} = 8\) (fully connected, 2.2× ideal) vs \(n_\text{inter} = 1\) (50× the fully-connected baseline, i.e., ~110× ideal). Curve between these points uses exponential interpolation.
viewof d_5 = Inputs. range ([3 , 15 ], {
value : 7 , step : 2 ,
label : "Code distance d"
})
viewof links_5 = Inputs. range ([1 , 16 ], {
value : 4 , step : 1 ,
label : "Inter-chiplet links ℓ"
})
{
const p_ref5 = 0.001 , p_th5 = 0.01 ;
const idealLER5 = Math . pow (p_ref5 / p_th5, Math . floor (d_5 / 2 ));
const baseline5 = 2.2 * idealLER5; // Chipmunq fully-connected
// LER(l): exponential interpolation
// l=1: 50 × baseline
// l >= d: 1 × baseline
const lerAtLinks = l => {
if (l >= d_5) return baseline5;
// lerAtLinks(1) = 50 * baseline, lerAtLinks(d) = baseline
// Use: baseline * 50^((d-l)/(d-1))
return baseline5 * Math . pow (50 , (d_5 - l) / (d_5 - 1 ));
};
const maxL = d_5 + 3 ;
const linkData = Array . from ({ length : maxL }, (_, i) => i + 1 ). map (l => ({
l,
ler : lerAtLinks (l)
}));
const currentLER = lerAtLinks (links_5);
const isAboveThreshold = links_5 < d_5;
const plot = Plot. plot ({
title : `LER vs inter-chiplet link count (d= ${ d_5} , schematic)` ,
width, height : 360 , marginLeft : 70 ,
x : { label : "Inter-chiplet links ℓ" , domain : [1 , maxL] },
y : { label : "Logical error rate pL" , type : "log" },
marks : [
Plot. ruleX ([d_5], {
stroke : isAboveThreshold ? "#dc2626" : "#16a34a" ,
strokeWidth : 2 , strokeDasharray : "6,4"
}),
Plot. text ([{ l : d_5, ler : currentLER * 3 }], {
x : "l" , y : "ler" ,
text : [`ℓ = d = ${ d_5} ` ],
fontSize : 11 , fill : isAboveThreshold ? "#dc2626" : "#16a34a" ,
dx : 6 , textAnchor : "start"
}),
Plot. line (linkData, {
x : "l" , y : "ler" , stroke : "#6366f1" , strokeWidth : 2.5
}),
Plot. dot (linkData, {
x : "l" , y : "ler" , fill : "#6366f1" , r : 5 , stroke : "white" , strokeWidth : 1.5
}),
// Highlight current selection
Plot. dot ([{ l : links_5, ler : currentLER }], {
x : "l" , y : "ler" ,
fill : isAboveThreshold ? "#dc2626" : "#16a34a" ,
r : 9 , stroke : "white" , strokeWidth : 2
})
]
});
const banner = html `<div style="
background: ${ isAboveThreshold ? "#fef2f2" : "#f0fdf4" } ;
border-left: 4px solid ${ isAboveThreshold ? "#dc2626" : "#16a34a" } ;
padding:12px 18px; border-radius:6px; margin:10px 0; font-size:15px;
">
<strong>ℓ = ${ links_5} </strong> links | d = ${ d_5}
—
${ isAboveThreshold
? `<span style="color:#dc2626; font-weight:bold;">Bandwidth bottleneck</span> (ℓ < d) — LER = ${ currentLER. toExponential (2 )} , ${ (currentLER / baseline5). toFixed (1 )} × above Chipmunq baseline`
: `<span style="color:#16a34a; font-weight:bold;">Sufficient links</span> (ℓ ≥ d) — LER = ${ currentLER. toExponential (2 )} , at Chipmunq baseline` }
</div>` ;
return html ` ${ plot}${ banner} ` ;
}
Hardware design rule: If you are building a chiplet system for distance-\(d\) surface codes, make sure each chip boundary has at least \(d\) quantum links. Below this, syndrome information from one chiplet cannot reach the decoder fast enough — errors accumulate in the queue while waiting. Each +1 in distance requires +1 inter-chiplet link to maintain the same LER performance.
6. Noise-Aware Routing
Chipmunq’s router assigns costs to edges proportional to their expected noise:
\[c(e) = -\log(1 - p_e)\]
This is the only cost function where the total path cost equals \(-\log P(\text{no error on path})\) , making shortest-path algorithms equivalent to minimum-error routing.
viewof p_intra_6 = Inputs. range ([0.0001 , 0.005 ], {
value : 0.001 , step : 0.0001 ,
label : "Intra-chiplet error rate p_intra"
})
viewof noise_ratio_6 = Inputs. range ([1 , 100 ], {
value : 10 , step : 1 ,
label : "Inter/intra noise ratio"
})
{
const p_inter6 = p_intra_6 * noise_ratio_6;
const c_intra6 = - Math . log (1 - p_intra_6);
const c_inter6 = - Math . log (1 - Math . min (p_inter6, 0.999 ));
// Path A: 5 intra-chiplet hops
const costA = 5 * c_intra6;
// Path B: 1 intra + 1 inter (shorter hop count but crosses noisy link)
const costB = c_intra6 + c_inter6;
const preferA = costA <= costB;
return html `<div style="display:grid; grid-template-columns:1fr 1fr 1fr; gap:12px; margin:14px 0; font-size:14px;">
<div style="background:#f8fafc; border-left:4px solid #6366f1; padding:12px 16px; border-radius:6px;">
<div style="font-size:12px; color:#64748b;">Cost model</div>
<div style="margin-top:4px;">
c_intra = −log(1 − ${ p_intra_6. toFixed (4 )} ) = <strong> ${ c_intra6. toExponential (3 )} </strong><br>
c_inter = −log(1 − ${ p_inter6. toFixed (4 )} ) = <strong> ${ c_inter6. toExponential (3 )} </strong><br>
Ratio: <strong> ${ (c_inter6 / c_intra6). toFixed (1 )} ×</strong>
</div>
</div>
<div style="background: ${ preferA ? "#eff6ff" : "#f8fafc" } ; border-left:4px solid ${ preferA ? "#3b82f6" : "#9ca3af" } ; padding:12px 16px; border-radius:6px;">
<div style="font-size:12px; color:#64748b;">Path A: 5 intra hops</div>
<div style="margin-top:4px;">Total cost: <strong> ${ costA. toExponential (3 )} </strong></div>
${ preferA ? html `<div style="color:#3b82f6; font-weight:bold; margin-top:4px;">✓ Router takes this path</div>` : "" }
</div>
<div style="background: ${ ! preferA ? "#eff6ff" : "#f8fafc" } ; border-left:4px solid ${ ! preferA ? "#3b82f6" : "#9ca3af" } ; padding:12px 16px; border-radius:6px;">
<div style="font-size:12px; color:#64748b;">Path B: 1 intra + 1 inter (shortcut)</div>
<div style="margin-top:4px;">Total cost: <strong> ${ costB. toExponential (3 )} </strong></div>
${ ! preferA ? html `<div style="color:#3b82f6; font-weight:bold; margin-top:4px;">✓ Router takes this path</div>` : "" }
</div>
</div>` ;
}
{
// LER improvement factor vs noise ratio
// Schematic: anchored at ratio=1 → 1× improvement, ratio=10 → ~10× improvement
// Shape: 1 + 9 * log10(ratio) clamped at ~10
const ratioData6 = Array . from ({ length : 200 }, (_, i) => 1 + i * 0.5 ). map (r => ({
ratio : r,
improvement : Math . min (10 , 1 + 9 * Math . log10 (Math . max (r, 1 )))
}));
const currentImprovement = Math . min (10 , 1 + 9 * Math . log10 (Math . max (noise_ratio_6, 1 )));
return Plot. plot ({
title : "LER improvement: noise-aware vs uniform routing (schematic)" ,
width, height : 300 , marginLeft : 60 ,
x : { label : "Inter/intra noise ratio" , type : "log" },
y : { label : "LER improvement factor (×)" },
marks : [
Plot. ruleY ([1 ], { stroke : "#e5e7eb" }),
Plot. ruleY ([10 ], { stroke : "#16a34a" , strokeDasharray : "6,4" , strokeWidth : 1 }),
Plot. text ([{ r : 100 , imp : 10 }], {
x : "r" , y : "imp" , text : ["~10× (from paper, RQ5)" ],
dy : - 8 , fontSize : 10 , fill : "#16a34a" , textAnchor : "end"
}),
Plot. line (ratioData6, { x : "ratio" , y : "improvement" , stroke : "#6366f1" , strokeWidth : 2.5 }),
Plot. ruleX ([noise_ratio_6], { stroke : "#6366f1" , strokeDasharray : "4,3" , strokeOpacity : 0.5 }),
Plot. dot ([{ ratio : noise_ratio_6, improvement : currentImprovement }], {
x : "ratio" , y : "improvement" ,
fill : "#6366f1" , r : 8 , stroke : "white" , strokeWidth : 2
}),
Plot. text ([{ ratio : noise_ratio_6, improvement : currentImprovement }], {
x : "ratio" , y : "improvement" ,
text : [` ${ currentImprovement. toFixed (1 )} ×` ],
dy : - 14 , fontSize : 12 , fontWeight : "bold" , fill : "#6366f1"
})
]
});
}
Why \(-\log(1-p_e)\) ? The probability of an error-free path through edges \(e_1, e_2, \ldots\) is \(\prod_i (1-p_{e_i})\) . Taking the log turns this into a sum: \(\log P = \sum_i \log(1-p_{e_i}) = -\sum_i c(e_i)\) . Minimizing \(\sum c(e_i)\) is exactly maximizing the probability of an error-free path. Standard Dijkstra’s algorithm, applied to this cost function, becomes a minimum-error router.