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
22 changes: 17 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,33 @@ name: corrected-analysis-tests
on:
push:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install corrected package
run: python -m pip install -e .[test]
- name: Run exact and numerical regression tests
run: pytest -q
run: python -m pip install -e '.[test]'
- name: Verify complete checksum manifest
run: python scripts/verify_checksums.py
- name: Run exact, numerical, and corruption regression tests
run: python -m pytest -q
- name: Verify historical root scripts
run: python scripts/verify_historical_files.py
- name: Validate committed scientific results
- name: Validate every committed scientific result field
run: python scripts/validate_committed_results.py
- name: Reproduce decisive exact counterexample
run: python examples/reproduce_counterexample.py
Expand All @@ -29,3 +39,5 @@ jobs:
run: python examples/reproduce_figure5.py
- name: Check minimal four-qubit circuit
run: python examples/simulate_minimal_four_qubit_circuit.py
- name: Confirm validation did not modify tracked files
run: git diff --exit-code
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 1.1.1-author-correction - 2026-09-07

- Replaced overflow-prone binomial evaluation with scaled recurrence and log-tail APIs; positive underflow raises explicitly.
- Expanded result validation to all five result files and 458 fields, including schemas, archived Monte Carlo metadata, and Wilson arithmetic.
- Added tests corrupting every result field, checksum integrity tests, and exact rational statistical references.
- Added complete manifest verification and Python 3.10-3.13 CI coverage.
- Kept the August correction PDF, mathematics, results, historical scripts, and original release unchanged.
- Fast checks explicitly distinguish archived Monte Carlo records from fresh simulation.

## 1.1.0-author-correction - 2026-08-17

### Referee-level revision
Expand Down
29 changes: 18 additions & 11 deletions CHECKSUMS.sha256
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
f6d1edcdabe82a8c9a6b8676470dca4755bd72abc667f9a542c0996794c8cef0 ./.github/workflows/tests.yml
3f8c91e32f752f38c51834eeb0a38abfd791921d0be7e247ac840bb48a93ee26 ./.github/workflows/tests.yml
f0e43839ec4fe3f086a0997f1aa238429543c8784776b05e019a719629ee1d90 ./.gitignore
03353aa4d79773163b3c22bacc52f368149ef0b37abf8858a904169ebc7455c0 ./AI_ASSISTED_REANALYSIS.md
73e68d44953e332f88f65ac908a872fad3fe8e39473c5c6fbbcc470af25e31d7 ./CHANGELOG.md
7aaede28f7b53fdfa7f997bdb208fadb1c2339f3908812edbe9553003446d1d0 ./CITATION.cff
e9e71e870915420013b31dd5f23d5c1c41ba87cbdca3eb4f752a50a91c5cb747 ./CHANGELOG.md
ca826a2121e718472fff0f5d148f246467a519a7e4aa1d52bebe0ca7845a2cc6 ./CITATION.cff
0c4959711013692777b7e98a35a0c8aa9e6fb85dc2583d617b303ed0cf3b0bfb ./IBM.py
aec03ca89a1ad1db2feba926dc30a6414e297a245987b3a77fdfa0af5efa24dc ./ORIGINAL_2022_CODE.md
8b2ce91ce9eb49e17cb281a9231aadbea1194c7cf6b71429631be4f156b6b430 ./README.md
0fa3c0c2a8785e07f02f6898180e58e7e3abe2b1a1bbffed2791c5c4f3a2c9da ./REPRODUCIBILITY.md
fcf40b8f974ba65a7ec932643886a951d0860c10656934fec757ffb03ded0261 ./README.md
7ad37e80a44290ad50c57c1aaa8479e52da51ccb952eea20cda8ee53ad1eb065 ./REPRODUCIBILITY.md
52a7415b170f3ce96863c792633132fdfc2cf69fbd78bddd7eff38c5553b0b7d ./SCIENTIFIC_STATUS.md
e949ae83ccc8224a136145832fed7d91a161a8e2cb13853e69225812498a5baf ./VALIDATION_RECORD.md
c432acd797b3f422af4a1101c90d4b6c8b5cce94a05492cc8e14fc142a1a7bd8 ./VALIDATION_RECORD.md
5a9b4e0129e44dbb52d368f9939a12cdedbd58e07d8e7bcd0945555377c8008d ./benchmarking.py
98b3c914732d1ff2b626e41de64619f058463956b997a7fad0eac6d41afb831d ./circuit.py
b368fa72d84696531f234263a75b4f7fa4de528885f91cd205a679d7e61682d3 ./compare.py
Expand All @@ -23,7 +23,7 @@ ccf0d83d58cf3645d17d8eef9b928471ee07958c1831a2a2fe47375dad7f4b2d ./examples/rep
e9d3750e58d51dff274a505f82f24fa9f3b4540de3e696053443868f28c12f83 ./examples/reproduce_one_sample_optimality.py
b0e02e239a277b63f7a4cd64182aea155052359e708d095a9be30e90bb872bdd ./examples/simulate_minimal_four_qubit_circuit.py
657a73bbc6425559834b35866ae103f8fe57f01417fd37ef7876fa0de6da01ed ./proba.py
0eea87da078b39bde7ebf921849fc4d0bd8d87f3a9062f1f0e13b730a03a4c7a ./pyproject.toml
a843ca2838df028e56d6eb19dfcdb9c3e8712f11a74fb3bf97e8998ea1bca729 ./pyproject.toml
ece8e18e5ab0401e138785179855e47b4ac46560c4e578f6e1a5d44c45eb539f ./requirements-legacy.txt
06c182a1b9b0a31420d26fba2d45a224dc71a1c84bcc1fd55784830b89c9164f ./requirements.txt
c4f52c8bf20bb65d0eba320aa1aef5d4b889e4c438156a42fc47307f251965f1 ./results/README.md
Expand All @@ -32,21 +32,28 @@ fac5d6248ca774cb4d3fe506518bb36594bbdbaf31dc0c46aca0a0f3524a576a ./results/figu
6b366e9a1765ffa38e259c78729c80855e6162dcfa6fa5b258b10e18951b72e3 ./results/heralded_witness_results.json
02cb0b5ee8b241a556ce8c35a13829555aeeea14a0275f0bf869c06c2f58eeb6 ./results/one_sample_optimality.json
da1935b2bd325cb523f313fa19a02270aa59e6acbcda00579a73a422b978294c ./results/validation_crosschecks.json
dec1ba0d29bc57db7507220340a34cf5ebe626212e8a670d80819604aee83e2f ./scripts/generate_results.py
3dfe8dc79a664ee9e8c11ae658981467fb54b8857080a8c66985e4d643fb1d2f ./scripts/validate_committed_results.py
1df70b11fc9a97b13aa9a91415508b0a0e40deaec8dc0f4fbfac0dd55125b458 ./scripts/generate_results.py
7f75e8208141a8f5e17418991900d55599dea78d123e5fe86687046d73e1c6f1 ./scripts/validate_committed_results.py
3b361b0be66dcda83398b443a4b39128548d5e9b3e2cb5623e2247cf1018ce70 ./scripts/verify_checksums.py
636c2fe2c246e6806e21982e1696675f4dadd295d46d00269bce26f7dafac211 ./scripts/verify_historical_files.py
134afb8cb64247983777b2698a5485686e88a2591936b55e3afb5945f05928d0 ./src/dcp_challenge/__init__.py
86b2a62c29e84eea3bf15f6476f81883a7ccf43952e65261d96535aadc414e3a ./src/dcp_challenge/__init__.py
f520a4c550afa95ca11cf5a9b3cf656e4b0433c99b6f84a4088877d597062a35 ./src/dcp_challenge/exact_probabilities.py
0e5b18c70d8c71ebf1ee90b37e8970dba76658ec6d10507dc2cf1b0e5f573f16 ./src/dcp_challenge/heralded_witness.py
a6d6bfe51cc8d75a919487458e1ad622cd8ed5f2cb61559136d7318140e0ad13 ./src/dcp_challenge/integrity.py
aa47265cc5fd3c4a2ca8f96b5b8c607ae35f74ec7db54d965c3dbfa7ea9e5f91 ./src/dcp_challenge/likelihood_decoder.py
4de797931f4767f99b2bce6f09d46ea115e337180465287dec66fec062f02293 ./src/dcp_challenge/minimal_circuit.py
adc35aed3c8c0d8d905cb35e2afc4fb9200057bb7567c81cdcae74a8b223e1e9 ./src/dcp_challenge/original_protocol.py
d05eeb96dfb95747c49135ea9940ea31eb32e54db2d414723b91dbc9afd25f27 ./src/dcp_challenge/statistics.py
a8858a11540d6b009184a0511e3e5bbda6d04626373c8f900233bbd44e5408b7 ./src/dcp_challenge/reference_results.py
f92e394437cad537f44ef857f66b869bafa136fa66e0fb3f157d02e9c2731d13 ./src/dcp_challenge/result_validation.py
bd90bfbd09791bc87c218ff1ad2fa00b765c4d738198b5b66d1577b1a3161981 ./src/dcp_challenge/statistics.py
392a038abfb7ef5d14c445e11af42a942d97e75e322544ce16b045a9f372a5eb ./tests/test_exact_probabilities.py
61f2a3ef4c199710199f3dd378d85ba98e84ddaf5cca1017f7b9e0d86e1af36e ./tests/test_heralded_witness.py
862a3b357b0a2b9787274ee4186b060cbc7fe3d45c70ad510b46844138a98f12 ./tests/test_historical_files.py
1e02e495cfa86b53854279bd644382c1aa631a11dec92d691e1bf3e9b1dacaae ./tests/test_integrity.py
d0202d343cb21e85e98b36241b2af4e261fd67c91603876a72f08404017b5f78 ./tests/test_likelihood_decoder.py
ac3e495151c74a79eeb6a4cbcd135b6bddf7fd70e38ad6b1e3abd0bbb9a08075 ./tests/test_original_protocol.py
32d3c06a6756f27efc13f6cc25f386f75ba4b7ae2638a7e21dae66b93f0249a3 ./tests/test_result_validation.py
66b56beeb81973a82068e6c5f129e8a2f1f97d116ab90ef74167468174e9db54 ./tests/test_stable_statistics.py
d482ef8a39d42dbfa8485abd79bb939699383928b544639abe5767697d83bd88 ./tests/test_statistics.py
1bccb732feb1a5403164d875e304e13446ebc7162cf86634141b59b11dc3c33c ./verification.py
c4376bfd9dc74b1a1d781c062aab8d6a4c6150f89464e552138face53c1a654d ./witness/CIRCUIT.md
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ message: >-
corrected probability, soundness, or statistical analysis.
title: "DCP Challenge: Author Correction and Follow-Up Analysis"
type: software
version: 1.1.0-author-correction
date-released: 2026-08-17
version: 1.1.1-author-correction
date-released: 2026-09-07
repository-code: "https://github.com/GoGoKo699/DCP-challenge"
authors:
- family-names: Lin
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ python examples/reproduce_counterexample.py
python examples/reproduce_one_sample_optimality.py
python examples/reproduce_figure5.py
python scripts/verify_historical_files.py
python scripts/verify_checksums.py
python scripts/validate_committed_results.py
pytest -q
```
Expand All @@ -89,6 +90,14 @@ Same measurements, better decoder: 25/32 = 0.781250

See [REPRODUCIBILITY.md](REPRODUCIBILITY.md) for fixed seeds, exact-versus-numerical distinctions, and validation tolerances. The completed checks are summarized in [VALIDATION_RECORD.md](VALIDATION_RECORD.md).

### Numerical maintenance - 7 September 2026

Software version 1.1.1 adds stable binomial and log-probability calculations,
validation of every committed result field, deliberate-corruption tests, and
complete checksum verification. The August scientific correction, PDF, and
historical scripts are unchanged. See the [reproducibility guide](REPRODUCIBILITY.md)
for the distinction between recomputation and archived Monte Carlo checks.

## Separate follow-up: phase-twirled heralded DCP witness

The directory [witness/](witness/) contains a new 2026 follow-up. It is not part of the 2022 article and is not a general proof of quantum computation.
Expand Down
78 changes: 70 additions & 8 deletions REPRODUCIBILITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,84 @@ The tests cover:

```bash
python scripts/validate_committed_results.py
python scripts/verify_checksums.py
```

Validation policy:
The result validator checks all five JSON/CSV records, every field, duplicate
representations in the core JSON, schemas, and finite-number requirements.
It recomputes exact counterexamples, one-sample records, all Figure 5 analytical
probabilities, the exact Figure 5(a) likelihood result, witness summaries,
dense-matrix diagnostics, the 20,000-product-effect diagnostic, and tail examples.
Expected values are built without reading the files under validation.

Integer and rational fields must agree exactly. Ordinary nonzero floating
quantities use relative tolerance `1e-12` and zero absolute tolerance. Only the
dense-matrix marginal residual permits absolute tolerance `1e-12`; this is not
used to round small probabilities to zero. Byte-identical floating-point
portability is not claimed. Validation uses explicit exceptions, so it also
runs under `python -O`.

**Monte Carlo boundary:** fast validation does not repeat the million-trial
Figure 5(b) or the 60,000-trial Figure 5(c) experiment. It checks archived success
counts, seeds, trial counts, estimates, and recomputed Wilson intervals, including
the independent-seed cross-check records. These are archived evidence, not fresh
simulation results. Deliberate-corruption tests alter each of the 458 result
fields and require rejection, including changes made to duplicate records together.

The checksum verifier additionally checks all tracked file bytes and complete
manifest coverage. For an extracted source ZIP without Git, it checks the file
tree excluding recognized local caches/build directories. Checksums detect
snapshot changes, not scientific correctness or authenticity.

To regenerate outputs without overwriting the archived files:

- exact rational, integer, and combinatorial quantities are compared exactly;
- fixed Monte Carlo records include seeds, trial counts, estimates, and Wilson intervals;
- floating-point linear-algebra diagnostics are compared within the numerical tolerances encoded by the tests;
- byte-identical portability of floating-point JSON across all numerical libraries and processors is not claimed.
```bash
python scripts/generate_results.py --output /tmp/dcp-reference-results
```

To regenerate the quick committed outputs:
To explicitly rerun the larger Figure 5 simulations, use:

```bash
python scripts/generate_results.py
python scripts/generate_results.py --monte-carlo --output /tmp/dcp-fresh-monte-carlo
```

The latter still retains the separate historical independent-seed cross-check
records. Fresh Monte Carlo output need not be byte-identical across numerical
environments; it must not silently replace the archived record or be confused
with the fast validator. Regeneration may change harmless last-bit diagnostics.

## 8. Stable statistical evaluation

The binomial routines use a scaled probability-mass recurrence and logarithms
instead of multiplying huge coefficients by tiny powers. They require no new
runtime dependency. For example, `binomial_lower_tail(2000, 400)` evaluates to
approximately `7.183777008e-8` instead of overflowing.

```python
from dcp_challenge.statistics import (
binomial_lower_tail,
binomial_log_lower_tail,
adaptive_sequential_log_lower_tail_bound,
)

probability = binomial_lower_tail(2000, 400)
log_probability = binomial_log_lower_tail(10000, 0)
# log_probability is approximately -2876.8207245, not negative infinity.
log_bound = adaptive_sequential_log_lower_tail_bound(10000, 0)
```

## 8. Historical software
All logarithms are natural. When a positive tail would underflow to zero, the
ordinary probability function raises `FloatingPointError` directing callers to
the log API. A zero return is reserved for an exact-zero endpoint. Counts must
be integers and probabilities must be finite and in `[0, 1]`.

These are floating-point evaluations of the analytical bound, not certified
interval-arithmetic enclosures. They do not validate physical trust assumptions,
experimental stopping rules, or repeated selective restarts. Work and integer
storage increase with experiment size. Tests include exact rational references,
endpoint checks, tail monotonicity, and the previously overflowing cases.

## 9. Historical software

The original scripts require their 2022 Qibo environment and are not imported by the corrected test suite. `requirements-legacy.txt` records the historical dependency request. The proof-of-concept IBM experiment is preserved but is outside the present correction.

Expand Down
13 changes: 13 additions & 0 deletions VALIDATION_RECORD.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Validation Record

## Software hardening - 7 September 2026

- Baseline tree: `93caf96908663f256de153feee54afccb358d342`, matching published `main` at `449548426b83fc22a9939fb2c2f6dede74dcd6f4`.
- Local suite: **59 tests passed**, including 458 individual result-field mutations.
- Previously overflowing binomial cases now agree with independent exact rational sums.
- Positive probability underflow is explicit; finite log tails remain available.
- All five committed result records and complete SHA-256 manifest coverage validate.
- Historical scripts and the August scientific documents/PDF are unchanged.
- The fast validator reuses archived large Monte Carlo counts and recomputes their arithmetic; it does not claim a fresh large simulation.
- The automated workflow repeats tests and integrity checks on Python 3.10, 3.11, 3.12, and 3.13. Its live execution status is recorded in GitHub Actions, not inferred from this document.

## August scientific validation

**Validation date:** 17 August 2026
**Target:** author-correction repository state

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "dcp-challenge-correction"
version = "1.1.0"
version = "1.1.1"
description = "Corrected analytical tools and follow-up checks for the 2022 DCP challenge"
readme = "README.md"
requires-python = ">=3.10"
Expand Down
Loading
Loading