Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/hosted-math.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Hosted mathematics

on:
pull_request:
paths:
- '**.md'
- 'verification/hosted_math/**'
- '.github/workflows/hosted-math.yml'

permissions:
contents: read

concurrency:
group: hosted-math-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
capture:
if: github.event.pull_request.head.repo.full_name == github.repository
runs-on: ubuntu-24.04
timeout-minutes: 20
env:
CAPTURE_REVISION: ${{ github.event.pull_request.head.sha }}
steps:
- name: Check out the exact proposed source
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
ref: ${{ env.CAPTURE_REVISION }}
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: '22'
- name: Install the capture runtime
run: |
npm install --prefix "$RUNNER_TEMP/math-runtime" playwright@1.56.1 mathjax-full@3.2.1
node "$RUNNER_TEMP/math-runtime/node_modules/playwright/cli.js" install --with-deps chromium
- name: Probe a representative page
continue-on-error: true
run: |
export NODE_PATH="$RUNNER_TEMP/math-runtime/node_modules"
node verification/hosted_math/probe_hosted_math.cjs \
--root "$GITHUB_WORKSPACE" \
--repository "$GITHUB_REPOSITORY" \
--revision "$CAPTURE_REVISION" \
--page science/moment_frontier.md \
--output "$RUNNER_TEMP/hosted-probe"
- name: Compare every hosted mathematical expression
run: |
export NODE_PATH="$RUNNER_TEMP/math-runtime/node_modules"
node verification/hosted_math/capture_hosted_math.cjs \
--root "$GITHUB_WORKSPACE" \
--repository "$GITHUB_REPOSITORY" \
--revision "$CAPTURE_REVISION" \
--output "$RUNNER_TEMP/hosted-math"
- name: Capture settled top-scroll screenshots
run: |
export NODE_PATH="$RUNNER_TEMP/math-runtime/node_modules"
node verification/hosted_math/capture_top_screenshots.cjs \
"$RUNNER_TEMP/hosted-math" "$RUNNER_TEMP/hosted-visual"
- name: Retain the actual captures and comparison report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: hosted-math-${{ env.CAPTURE_REVISION }}
path: |
${{ runner.temp }}/hosted-math
${{ runner.temp }}/hosted-probe
${{ runner.temp }}/hosted-visual
if-no-files-found: error
retention-days: 14
30 changes: 17 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,33 @@

**How does the accuracy of a nonlinear quantum training loss change the number of examples needed when inputs cannot be replayed?**

This project establishes an accuracy-dependent sample exponent for selecting among a fixed finite collection of known measurement hypotheses. Each passive example supplies a classical context, sampled uniformly from a known set of size $M$, and one fresh copy of its unknown conditional quantum state. The state table is fixed throughout the experiment.
This project establishes an accuracy-dependent sample exponent for selecting among a fixed finite collection of known measurement hypotheses. Each passive example supplies a classical context, sampled uniformly from a known set of size $`M`$, and one fresh copy of its unknown conditional quantum state. The state table is fixed throughout the experiment.

For loss $\ell_h(x)=1-\operatorname{Tr}[\Pi_h(x)\rho_x]$ and fixed tilt $a>0$, minimize
For loss $`\ell_h(x)=1-\mathrm{Tr}[\Pi_h(x)\rho_x]`$ and fixed tilt $`a>0`$, minimize

```math
R_a(h)=\frac{1}{a}\log\left(\frac{1}{M}\sum_{x=1}^{M}e^{a\ell_h(x)}\right).
```

Let $\Gamma_r(a)$ be the largest logarithmic separation between exponential moments of two distributions on $[0,1]$ whose first $r$ moments agree. Equivalently, it is the best multiplicative distortion of a degree-$r$ polynomial envelope of $e^{au}$; the scalar approximation duality is inherited and credited in the [moment account](science/moment_frontier.md).
Let $`\kappa_r(a)`$ be the largest ratio between exponential moments of two distributions on $`[0,1]`$ whose first $`r`$ moments agree, and set $`\Gamma_r(a)=a^{-1}\log\kappa_r(a)`$. Equivalently, $`\kappa_r(a)`$ is the best multiplicative distortion of a degree-$`r`$ polynomial envelope of $`e^{au}`$; the scalar approximation duality is inherited and credited in the [moment account](science/moment_frontier.md).

For every fixed integer $k\ge1$, at accuracies strictly between adjacent thresholds,
For every fixed integer $`k\ge1`$, at accuracies strictly between adjacent thresholds,

```math
\Gamma_k(a)<\varepsilon<\Gamma_{k-1}(a)
\quad\Longrightarrow\quad
N_{\mathrm{worst}}(M)
=\Theta_{a,\varepsilon,H,\delta}\!\left(M^{1-1/k}\right).
=\Theta_{a,\varepsilon,H,\delta}\left(M^{1-1/k}\right).
```

Here $H$ is the fixed finite number of hypotheses, the failure target satisfies $0<\delta<1/2$, and $M$ tends to infinity while the other parameters remain fixed. The upper bound holds for every such class; a particular two-hypothesis class on two-qubit outputs witnesses the worst-case lower bound. Arbitrary collective quantum measurements are allowed.
Here $`H\ge2`$ is a fixed finite cap on the number of hypotheses, the failure target satisfies $`0\lt \delta\lt 1/2`$, and $`M`$ tends to infinity while the other parameters remain fixed. The upper bound holds for every such class; a particular two-hypothesis class on two-qubit outputs witnesses the worst-case lower bound. Arbitrary collective quantum measurements are allowed.

| Same-context observations that become necessary | Passive source exponent |
|---|---:|
| One | $0$ |
| Two | $1/2$ |
| Three | $2/3$ |
| $k$ | $1-1/k$ |
| One | $`0`$ |
| Two | $`1/2`$ |
| Three | $`2/3`$ |
| $`k`$ | $`1-1/k`$ |

The first threshold is explicit:

Expand All @@ -38,19 +38,23 @@ The first threshold is explicit:
=\frac{a}{8}+O(a^3).
```

At $a=1$, the first three thresholds are approximately $0.12330156$, $0.01029531$ and $0.00064456$. These values are checked numerically; the theorem uses the exact variational thresholds.
At $`a=1`$, the first three thresholds are approximately $`0.12330156`$, $`0.01029531`$ and $`0.00064456`$. These values are checked numerically; the theorem uses the exact variational thresholds.

## Read the science

Start with the [scientific route](science/README.md), or go directly to the [model](science/model.md), [moment thresholds](science/moment_frontier.md), [passive sampling theorem and proof](science/passive_frontier.md), and [replay and resource account](science/replay_and_resources.md). The [interpretation](science/interpretation.md) explains what the frontier changes in quantum learning. The [related-work comparison](references/related_work.md) separates the result from established ensemble, classical moment and multi-observation methods.

## Learn the project

The [learning route](learning/README.md) starts with a concrete two-context example, connects Watrous's *The Theory of Quantum Information* (2018) to the project notation, and follows a shared map of exactly 30 milestones from the data model to the theorem and its resource limits.

## Meaning and scope

A nonlinear objective depends on within-context outcome probabilities, rather than only their mean across contexts. Better accuracy can require higher same-context occupancies. Passive sampling must wait for these coincidences; selected-input replay supplies them directly and removes the support-size factor.

The lower bound rules out bypassing this repetition cost with collective quantum processing. For fixed $H$, matching source exponents also admit immediate per-hypothesis measurements and classical storage of their outcomes. This is a data-access law, with a classical latent-variable core. It establishes no processing-time speedup or hardware crossover.
The lower bound rules out bypassing this repetition cost with collective quantum processing. For fixed $`H`$, matching source exponents also admit immediate per-hypothesis measurements and classical storage of their outcomes. This is a data-access law, with a classical latent-variable core. It establishes no processing-time speedup or hardware crossover.

The theorem concerns proper selection from the supplied hypothesis class, uniform contexts, independent source draws, arbitrary fixed conditional states, fixed parameters and strict threshold gaps. It does not determine the critical accuracies $\varepsilon=\Gamma_r(a)$, joint precision/support limits, or nonuniform-context rates. Source preparation, classical caching, quantum storage when used, and known measurement circuits are accounted for separately.
The theorem concerns proper selection from the supplied hypothesis class, uniform contexts, independent source draws, arbitrary fixed conditional states, fixed parameters and strict threshold gaps. It does not determine the critical accuracies $`\varepsilon=\Gamma_r(a)`$, joint precision/support limits, or nonuniform-context rates. Source preparation, classical caching, quantum storage when used, and known measurement circuits are accounted for separately.

## Reproduce the finite checks

Expand Down
18 changes: 18 additions & 0 deletions learning/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Learning route

Start with [the story](story.md): two hypotheses can have the same mean loss while a tilted objective prefers one, and the accuracy required of that preference determines which repeated contexts the source must supply.

The project uses one educational anchor: John Watrous, *The Theory of Quantum Information* (2018). [The anchor and notation bridge](anchor.md) identifies the relevant sections and connects states, measurements and distinguishability to this learning model. It also identifies the classical approximation and collision arguments supplied locally rather than covered by the book.

[The common 30-milestone map](milestones.md) records the understanding targets and their dependencies. Its 12 background milestones assemble the model; its 18 narrative milestones connect the example, proof mechanisms, theorem and resource interpretation. The map is a guide to the project, not a requirement to read the entire anchor first.

| Reading purpose | Route |
| --- | --- |
| See the task and main mechanism | [Story](story.md), then milestones M13–M27 |
| Translate quantum-information notation | [Anchor bridge](anchor.md), with M01–M12 |
| Follow the complete common map | [Milestones M01–M30](milestones.md) |
| Check exact statements and proofs | [Scientific account](../science/README.md) |
| Check imported ingredients and scientific comparisons | [Related work](../references/related_work.md) |
| Inspect numerical checks | [Verification](../verification/README.md) |

The canonical theorem, assumptions and limits are in the scientific account. The learning route preserves its distinction between proper PAC selection and expected regret, between passive data and replay, and between a quantum-data access frontier and a quantum processing advantage.
78 changes: 78 additions & 0 deletions learning/anchor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Watrous and the bridge to this project

The sole educational anchor is **John Watrous, *The Theory of Quantum Information*, Cambridge University Press (2018)**, [publisher DOI](https://doi.org/10.1017/9781316848142). The [author's book page](https://cs.uwaterloo.ca/~watrous/TQI/) provides the manuscript and errata. The manuscript is linked rather than reproduced here. Section numbers below were checked against its author-hosted contents and chapters.

The useful route is selective. Chapter 1 supplies mathematical language, Chapter 2 supplies the physical data and measurement model, and Chapter 3 supplies the operational meaning of indistinguishable training states. The local moment and collision arguments then connect these foundations to nonlinear-risk learning.

## A short source route

| Anchor location | Foundation to take from it | Project connection |
| --- | --- | --- |
| [Chapter 1](https://cs.uwaterloo.ca/~watrous/TQI/TQI.1.pdf), §§1.1.1–1.1.3 | Finite-dimensional spaces, tensor products, positive operators and norms | Registers, diagonal witness states and tensor-copy expansions; M01, M04 |
| Chapter 1, §1.2.1, especially Carathéodory's theorem (Theorem 1.9) | Compactness, convex combinations and finite-dimensional convex hulls | Moment vectors and finitely supported extremizers; M11, M14–M15 |
| Chapter 1, §1.2.2 | Expectations and elementary probability notation | Conditional loss, sampled contexts and bounded statistics; M03, M07, M09 |
| [Chapter 2](https://cs.uwaterloo.ca/~watrous/TQI/TQI.2.pdf), §§2.1.1–2.1.2 | Classical registers and density operators | The classical–quantum source and its fixed conditional table; M01, M05 |
| Chapter 2, §2.2.1 and §§2.3.1–2.3.2 | Channels, measurement probabilities and projective measurements | Known hypothesis measurements and arbitrary processing of supplied data; M02, M10 |
| [Chapter 3](https://cs.uwaterloo.ca/~watrous/TQI/TQI.3.pdf), §3.1.1, especially Theorem 3.4 | Binary state discrimination and the trace norm | Turning equality of the entire averaged dataset into a lower bound for every learner; M10, M21–M23 |

The optional binary-effect implementation in [the passive proof](../science/passive_frontier.md) also uses the dilation viewpoint of Chapter 2, §2.3.2, Theorem 2.42. It is not needed for the immediate-measurement construction.

## Notation translation

Watrous uses matrix notation rather than Dirac notation. The project uses both.

| Book notation | Project notation or role |
| --- | --- |
| A complex Euclidean space such as $`\mathcal X`$ | A finite-dimensional register space, here $`\mathsf Q\cong\mathbb C^d`$ |
| $`\mathrm D(\mathcal X)`$ | The density operators, written $`\mathcal D(\mathsf Q)`$ here |
| $`u u^{\ast }`$ and $`E_{x,x}=e_xe_x^{\ast }`$ | $`\lvert u\rangle\langle u\rvert`$ and $`\lvert x\rangle\langle x\rvert`$ |
| A measurement $`\mu`$ with outcome operator $`\mu(1)`$ | The loss outcome operator $`I-\Pi_h(x)`$ |
| $`\langle A,\rho\rangle=\mathrm{Tr}(A^{\ast }\rho)`$ | $`\mathrm{Tr}[(I-\Pi_h(x))\rho_x]=\ell_h(x)`$ for the Hermitian loss projector |
| $`\lVert A\rVert_1`$ | The same trace norm; our trace distance is $`D(\rho,\sigma)=\tfrac12\lVert\rho-\sigma\rVert_1`$ |

## From registers to the source

The context is a readable classical register. A table $`x\mapsto\rho_x`$ defines

$$
\Omega_\rho=\frac1M\sum_{x=1}^M
\lvert x\rangle\langle x\rvert\otimes\rho_x.
$$

Its block-diagonal form means a context label is sampled with probability $`1/M`$ and its associated state is supplied. The table is unknown but fixed. Receiving another example means another independent source preparation, not a coherent query to that table. Reading the context does not supply a preparation circuit or the ability to choose the next context. These are local modeling assumptions, made explicit in [the model](../science/model.md); they are not consequences of the density-operator formalism.

Measuring $`I-\Pi_h(x)`$ produces a bit $`Y`$ with conditional mean $`\ell_h(x)`$. If the same context supplies $`j`$ independent specimens, the product of the $`j`$ loss bits has conditional mean $`\ell_h(x)^j`$. This is the first bridge from tensor-product copies to the classical moments required by the nonlinear objective.

## From indistinguishable states to a learning converse

The lower bound constructs two priors over fixed tables. Under either prior, consider the density operator of **all** labeled training registers. When no context occurs $`k`$ times, matching moments make these operators exactly equal. This statement concerns the complete quantum input, not just the outcomes of a preferred hypothesis measurement.

If the exceptional collision event has probability $`q`$, the two averaged training states $`\omega_0,\omega_1`$ satisfy

$$
D(\omega_0,\omega_1)\le q.
$$

For equal prior probabilities, Watrous's Theorem 3.4 bounds every binary decision by

$$
p_{\mathrm{correct}}\le\frac12+\frac14
\lVert\omega_0-\omega_1\rVert_1
\le\frac{1+q}{2}.
$$

An entire adaptive learning computation ending in a binary hypothesis choice defines such a measurement on its supplied data. It therefore cannot evade this bound. The local proof must still show that typical frozen tables have opposite risk-minimizing hypotheses with a gap exceeding the requested tolerance. [The passive proof](../science/passive_frontier.md) supplies that concentration step. State indistinguishability alone does not establish the risk gap.

## What the local account adds to the book

The exponential-loss approximation problem and the generalized birthday calculation are additional **classical** machinery. The bridge is:

1. Repeated loss measurements estimate moments of the conditional probability.
2. A degree-$`k`$ envelope $`e^{au}\le P(u)\le\kappa_k(a)e^{au}`$ turns those moments into a surrogate risk with distortion $`\Gamma_k(a)`$.
3. The dual moment pair makes a larger gap invisible below the necessary repetition level.
4. Uniform-context occupancy supplies, and limits, that repetition level at $`M^{1-1/k}`$ samples.
5. Concentration and proper hypothesis selection connect these facts to a PAC guarantee for each fixed table.

The complete derivations are [the moment frontier](../science/moment_frontier.md) and [the passive frontier](../science/passive_frontier.md), corresponding to M14–M27 in [the map](milestones.md). This machinery is not attributed to Watrous.

The primary proof dependencies are separate research citations: [Adibi–Krysta, Appendix I](https://arxiv.org/abs/2610.28999) for exact relative-approximation duality; [Brun](https://arxiv.org/abs/quant-ph/0401067) for multi-copy polynomial observables; and classical [population-parameter inference](https://arxiv.org/abs/1709.02707), [multi-observation learning](https://proceedings.mlr.press/v89/frongillo19a.html) and [collision estimation](https://arxiv.org/abs/1408.1000) for the surrounding methods. These are attribution and proof pointers, not additional educational anchors. [Related work](../references/related_work.md) delimits the comparison.
Loading
Loading