import { useState } from "react"; import { ChevronLeft, ChevronRight, Minus, Plus } from "lucide-react"; import { gloss } from "../../lib/glossary"; import { TipIcon } from "../TipIcon"; /** * Frame step 7 (of 10) — "Every qubit doubles the arrows" (marker: * learn-scale): why classical computers struggle, said honestly. One * interactive: a qubit-count stepper (1–30, slider + buttons). Up to * 5 qubits the wall shows the ACTUAL 2^n arrow slots as tiny bars; * beyond that drawing is hopeless (the point!) and the wall becomes * a log-scale bar plus the plain count, with anchors kept modest and * defensible (a spreadsheet, a photo's pixels, a laptop's RAM — no * atoms-in-the-universe hype at 30 qubits). * * The pedagogical crux is the HONESTY TURN, given its own graphic: a * readout funnel — 2^n arrows go in, one look returns just n bits * (each qubit answers 0 or 1, nothing more). The doubling wall is * only half the story; the art is step 5's cancelling, choreographed * so the few bits you CAN read carry the answer — which is exactly * what the next step's game does. Cross-link chips jump both ways. */ const MAX_N = 30; const ANCHORS: { n: number; text: string }[] = [ { n: 10, text: "a thousand — a spreadsheet" }, { n: 20, text: "a million — a photo's pixels" }, { n: 30, text: "a billion — more numbers than a laptop's RAM holds comfortably as amplitudes", }, ]; export function Step6Scale({ goToStep, }: { goToStep?: (i: number) => void; }) { const [n, setN] = useState(3); const count = 2 ** n; const fmt = count.toLocaleString("en-US"); return (
{/* the stepper — slider + buttons, 1..30 qubits */}
setN(Number(e.target.value))} className="flex-1 accent-current text-accent" aria-label={`qubit count: ${n}`} /> {n} qubit{n === 1 ? "" : "s"}
{/* the wall of arrows */}
{n <= 5 ? ( <>
{Array.from({ length: count }).map((_, i) => (
{n <= 3 && ( {i.toString(2).padStart(n, "0")} )}
))}
{fmt} arrows — one for every answer {n === 1 ? "the qubit" : `the ${n} qubits`}{" "} could give
) : ( <>
2{n} = {fmt} arrows
{/* log-scale bar: each pixel-step is a DOUBLING */}
{ANCHORS.map((a) => (
))}
this bar is logarithmic: every step to the right is a doubling, not an addition
{ANCHORS.map((a) => (
= a.n ? "text-ink" : "text-mute/60" }`} > {a.n} qubits: {a.text}
))}
)}
a classical computer must{" "} TRACK every arrow;{" "} {n} entangled qubit{n === 1 ? "" : "s"}{" "} ARE them{" "}
{/* THE HONESTY TURN — the readout funnel */}
but here is the catch
{/* incoming arrows (suggested, not literal) */} {Array.from({ length: 9 }).map((_, i) => ( ))} {/* the funnel body */} {/* the few bits that come out */} {Array.from({ length: Math.min(n, 6) }).map((_, i) => ( ))} {n > 6 && ( …×{n} )} {fmt} arrows in {n} bit{n === 1 ? "" : "s"} out — per look

you can't read the arrows out — one look returns just{" "} {n} bit {n === 1 ? "" : "s"}, one per qubit{" "} . The art is step 5's cancelling: make the arrows compute, so the few bits you{" "} can read carry the answer. The next step plays that art out.

{/* cross-links: the mechanism behind, the payoff ahead */}
); }