# Introduction to Quantum Computing — 2026

A single-source textbook and browser quantum laboratory. Research cutoff: **5 September 2026**.

The independently authored manuscript has 25 chapters, a reading guide, two appendices, 120 exercises with solutions, six integrated projects, and 76 references. The static web edition contains 26 computational laboratories. The code uses q0 as the most significant wire; the Qiskit comparison explicitly maps wire j to n−1−j.

## Read and run

Open the hosted site or serve `dist/` with a local static HTTP server:

```sh
python3 -m http.server 8000 --directory dist
```

Open `http://localhost:8000/`. ES modules and the search index need HTTP; double-clicking an HTML file with a `file:` URL is not sufficient. Everything in the labs computes locally. There are no cloud credentials, hardware submissions, or paid API dependencies.

The PDF is in `dist/downloads/Introduction-to-Quantum-Computing-2026.pdf`. The source archive excludes the supplied copyrighted textbook and does not copy its figures or prose.

## Shared source and build

- `content/*.md`: authoritative chapter text, mathematics, exercises and lab specifications.
- `content/references.json`: numbered bibliographic records with evidence status.
- `dist/quantum.js`: pure mathematical kernels and seeded sampling.
- `dist/labs.js` and `dist/labs-advanced.js`: laboratory controls and computed outputs.
- `dist/app.js`, `dist/style.css`: navigation, local reading progress, search and presentation.
- `scripts/build.py`: shared Markdown to chapter HTML and LaTeX.
- `scripts/figures.py`: original SVG/PDF diagrams.
- `scripts/book-header.tex`, `scripts/book-cover.tex`, `scripts/pdf.lua`: formal PDF design.

Building requires Python 3.12+, NumPy, matplotlib, lxml, Pandoc 3.1.3+, and XeLaTeX with the listed LaTeX packages and DejaVu/Latin Modern fonts. The verified environment used TeX Live 2023. Rendering uses native MathML in modern browsers. The static site has no runtime npm dependencies.

```sh
python3 scripts/figures.py
python3 scripts/build.py
xelatex -interaction=nonstopmode -halt-on-error -output-directory=build build/book.tex
xelatex -interaction=nonstopmode -halt-on-error -output-directory=build build/book.tex
xelatex -interaction=nonstopmode -halt-on-error -output-directory=build build/book.tex
```

Copy the verified `build/book.pdf` to the download filename after visual inspection. Both editions must be rebuilt when the manuscript changes. Do not edit chapter HTML directly. `site-origin.txt` sets PDF laboratory links. The manifest records chapter hashes, exercise counts, and laboratory routes.

## Verification

```sh
npm install
npm test
python3 scripts/validate_book.py
python3 -m venv .venv
.venv/bin/python -m pip install -r dist/downloads/requirements.txt
.venv/bin/python dist/downloads/qiskit_examples.py
.venv/bin/python tests/compare_qiskit.py
```

`tests/quantum.test.mjs` checks independent mathematical properties, boundary cases, all teleportation branches, algorithm distributions, code distance and all single-Pauli surface-code recoveries. `tests/ui.test.mjs` uses jsdom to exercise controls, invalid inputs, exact projection derivations, randomized guidance and the laboratory manifest. These are DOM integration tests, not a claim of cross-browser visual certification. `tests/compare_qiskit.py` compares 48 independently generated asymmetric circuits and reduced states with Qiskit 2.5.2.

The validation record describes performed checks and their limits. Floating-point calculations use tolerances. No test suite constitutes an external scientific peer review or proof of correctness for arbitrary future edits.

## Model boundaries

The circuit builder handles at most eight qubits and forty operations. It reruns measurement trajectories per shot. The Shor experiment calculates exact modular-group Fourier marginals for N=15 or 21 and performs verified classical reconstruction; it does not compile cryptographic modular arithmetic into a hardware gate sequence. The surface-code model has nine data qubits, ideal checks, and minimum-weight Pauli recovery. The repetition model protects against independent X errors. The resource estimator is an explicitly illustrative scaling model. BB84 exposes a classroom transcript and is not production cryptographic software.

Reading progress stays in browser local storage and can be reset. The laboratories use reproducible noncryptographic pseudo-random sampling. References to current experiments retain their publication or preprint status and the cutoff date.
