Repository: simransummermalik/TheoreticalComputing
Author: Summer Malik, with research collaborators Carolina Amorim and Owen Barnes
Purpose: This manual explains the project from the beginning, defines the mathematical objects, walks through the full quantum-to-classical pipeline, explains what the experiments found, and gives commands for testing and reproducing the repository.
Scope note: This repository does not factor cryptographically large integers and does not claim a new general factoring algorithm. It implements, audits, and tests a finite Regev-style research pipeline on small controlled instances.
This repository began with a Qiskit notebook inspired by Regev's quantum factoring algorithm. The notebook could construct multidimensional quantum circuits and produce samples, but the research question was larger than simply making a circuit run.
A complete factoring pipeline needs both a quantum stage and a classical stage. The quantum circuit produces structured Fourier samples. Those samples must then be converted into an integer lattice, reduced, interpreted as modular relations, classified, and finally tested for factor extraction.
The repository therefore became an audit and reconstruction project. It asks:
The repository now contains circuit construction, exact finite sampling laws, lattice construction, LLL recovery, relation verification, factor extraction, noise and QFT models, frozen experimental protocols, adversarial audits, statistical analysis, and reproducible outputs.
The manual moves from the outside of the project toward the inside.
First, it explains factoring and the overall pipeline. Then it defines the mathematical objects used by the code. After that, it follows one sample through the entire system: roots, circuit bases, state preparation, modular exponentiation, QFT, measurement, lattice construction, LLL, relation classification, and factor extraction.
The later sections explain the current research result, the negative results, the repository structure, and the commands used to test or reproduce the work.
A reader who only wants the main idea can read:
A reader who wants to run the code can skip to:
Factoring means taking a composite integer and finding smaller integers whose product equals it. For example:
15 = 3 × 5
Regev's algorithm is a quantum factoring approach that uses several exponent registers and a substantial classical lattice-reduction stage. The quantum computer does not directly print the factors. It produces measurements containing information about hidden multiplicative relations.
This repository implements and audits a finite version of that idea:
choose N and roots
↓
square the roots to obtain circuit bases
↓
prepare several exponent registers
↓
compute modular products in superposition
↓
apply a QFT to every exponent register
↓
measure Fourier vectors
↓
build an augmented integer lattice
↓
run LLL
↓
verify candidate relations
↓
separate useful relations from useless relations
↓
attempt gcd factor extraction
The current main research question concerns QFT precision. An exact QFT uses every controlled phase rotation. An approximate QFT omits some of the smallest rotations to reduce gate count.
A conservative worst-case certificate used by the project refused to approve any approximation in the frozen five-percent regime. However, a later held-out experiment found that limited truncation could preserve the actual lattice-recovery endpoint in the tested finite models.
The main conclusion is not that approximate QFT is always safe. The conclusion is narrower:
In the tested small finite regime, the worst-case certificate required more precision than the prepared-state lattice-recovery endpoint actually needed.
An integer is prime when its only positive divisors are one and itself. Examples include 2, 3, 5, 7, and 11.
An integer is composite when it can be written as a product of smaller positive integers. For example:
21 = 3 × 7 35 = 5 × 7 77 = 7 × 11
The factoring problem asks us to recover those smaller factors when only the product is given.
Small examples are easy. The cryptographic difficulty comes from very large integers chosen so that ordinary classical factoring methods require too much time.
The project uses small semiprimes because the goal is not to break cryptography. The goal is to inspect the algorithmic structure, verify the implementation, and measure finite behavior in a controlled environment.
Shor's algorithm reduces factoring to an order-finding problem. A quantum circuit creates a periodic state, and a quantum Fourier transform helps expose the period. Classical continued fractions and greatest-common-divisor calculations then convert the period into factors.
Regev proposed a different factoring construction. Instead of relying on one long exponent register, the method distributes the exponent information across several registers. The quantum stage produces multiple high-dimensional Fourier samples. The classical stage then uses lattice reduction to recover a useful multiplicative relation.
The trade is important:
This repository is Regev-style rather than a complete full-scale implementation of every asymptotic component in Regev's paper. It works with small finite states and clearly labels the difference between notebook surrogates, finite Gaussian models, and theorem-consistent synthetic models.
Input: an odd composite integer N
1. Choose stored roots b1, ..., bd.
2. Compute squared circuit bases:
ai = bi² mod N
3. Prepare d exponent registers.
4. Place the exponent registers in superposition.
5. Reversibly compute:
hA(x) = product ai^xi mod N
6. Apply one QFT or inverse QFT to each exponent register.
7. Measure m Fourier vectors.
8. Decode the Qiskit bitstrings into ordered integer vectors.
9. Convert the vectors into an exact augmented integer lattice.
10. Run LLL on that lattice.
11. Extract candidate integer relations z.
12. Verify:
product ai^zi = 1 mod N
13. Compute the stored-root product:
beta = product bi^zi mod N
14. If beta is neither +1 nor -1 modulo N, try:
gcd(beta - 1, N)
gcd(beta + 1, N)
15. Validate any returned factor pair.
Each step has a different correctness condition. A circuit can run successfully while the bit order is wrong. LLL can return a short vector that is not an exact modular relation. A relation can be valid but useless for factoring. A gcd can return one or N instead of a proper factor.
The repository therefore checks every boundary instead of treating the pipeline as one black box.
| Symbol | Meaning |
|---|---|
N |
The odd composite integer being factored. |
n |
The bit length of N. It is not the same as N. |
d |
The number of roots, circuit bases, exponent registers, and relation coordinates. |
nd |
The number of qubits in each exponent register. |
M |
The Fourier modulus. If a register has nd qubits, then M = 2^nd. |
q |
Another notation for log2(M), the number of qubits in one Fourier register. |
m |
The number of Fourier samples passed to classical recovery. |
bi |
A stored modular root used later in factor extraction. |
ai |
The squared circuit base ai = bi² mod N. |
x |
An exponent vector used by modular exponentiation. |
k |
A measured Fourier outcome vector. |
z |
A candidate integer multiplicative relation. |
S |
The scaling factor used in the augmented lattice. |
Delta |
The allowed loss in a downstream recovery-event probability. |
t |
The approximate-QFT distance cutoff. |
L |
The full lattice of exact multiplicative relations among the squared bases. |
L0 |
The valid relations whose stored-root product is +1 or -1 and therefore gives no factor. |
The circuit uses squared bases:
ai = bi² mod N
The value bi is the stored root. The value ai is the base used by the
modular-exponentiation circuit.
The distinction is essential. A modular number can have multiple square roots. If the code stores
only ai and later guesses a root, it may use a different root than the one that
generated the circuit base.
This repository avoids that error by keeping every pair
(bi, ai) together in an immutable rooted-base object.
For example, modulo 15:
4² = 16 = 1 mod 15 gcd(4 - 1, 15) = gcd(3, 15) = 3 gcd(4 + 1, 15) = gcd(5, 15) = 5
The number 4 is a nontrivial square root of one modulo 15. It is not +1 or -1 modulo 15, so its two neighboring gcd calculations reveal the factors.
A candidate root must be coprime to N. The code therefore checks gcd(bi, N). If that
gcd is already a proper factor, the setup process has factored N classically.
The repository records this as a setup factor leak. It is not counted as a successful quantum sample-to-lattice recovery.
This prevents an easy classical discovery from being mislabeled as evidence that the quantum circuit or lattice decoder worked.
Given an exponent vector:
x = (x1, x2, ..., xd)
define:
hA(x) = product over i of ai^xi mod N
Different exponent vectors can produce the same modular output. Those collisions are not an implementation accident. They are the arithmetic structure that later creates interference in the Fourier basis.
For a particular output y, define the fiber:
Fy = { x : hA(x) = y }
A fiber is simply the set of exponent vectors that all produce the same arithmetic result. During the QFT, phases from vectors inside the same fiber can add or cancel.
The repository does not use one word such as “Regev samples” for every possible state model. It keeps four models separate because they answer different questions.
| Model | Definition | What it is used for |
|---|---|---|
| A | Exact finite uniform hard-box state. | Reproduces the state prepared by the audited notebook. |
| B | Exact finite truncated discrete-Gaussian amplitude state. | Moves closer to Regev's intended Gaussian state preparation while remaining finite. |
| C | Synthetic noisy dual-lattice samples satisfying a stated finite noise inequality. | Tests the classical theorem-model endpoint. Generator-side oracle information is hidden from recovery. |
| D | Hard-box samples with readout or whole-shot corruption. | Provides an explicit corruption surrogate without calling it hardware noise. |
A hard-box state assigns equal amplitude to every exponent vector inside a finite Cartesian box. A discrete-Gaussian state gives larger amplitudes near the center and smaller amplitudes farther away.
The two states can produce different Fourier laws and different lattice-recovery behavior. The repository therefore reports results by model instead of pooling them into one conclusion.
Model C does not attempt to reproduce the entire quantum circuit. It generates samples that satisfy the geometric noisy-dual condition needed to test the classical reconstruction stage.
This lets the project ask whether the lattice endpoint behaves correctly when the theorem-style sample assumptions are deliberately satisfied.
A quantum circuit must be reversible. Ordinary programming operations often erase information, but a unitary quantum operation cannot simply discard an unknown input.
The circuit therefore uses reversible modular multiplication and modular exponentiation. Conceptually, it performs:
|x1, ..., xd>|1>|0>
↓
|x1, ..., xd>|product ai^xi mod N>|0>
The exponent registers are preserved. The modular result is written into a shared output register. Temporary ancilla qubits are used as workspace and should be returned to zero.
A circuit diagram with a high-level modular-exponentiation block can look shallow. After decomposition, that block expands into many elementary gates. This is why logical circuit depth and transpiled depth must not be confused.
Each exponent register receives its own one-dimensional QFT. The full transform is a tensor product:
FM ⊗ FM ⊗ ... ⊗ FM
There are d copies, one for each exponent register.
For the inverse-QFT convention used in the main pipeline, the phase associated with outcome k and exponent vector x is:
chi_k(x) = exp(-2πi <k,x> / M)
The inner product <k,x> combines all coordinates. This is why the measured
outcome is a vector rather than one number.
A root of unity is a complex phase that returns to one after an integer number of powers. QFT amplitudes are sums of these phases.
Inside one modular fiber, the exact probability law is:
P_A(k) = M^(-2d) × sum over y of
| sum over x in Fy of chi_k(x) |²
If the phases align, they interfere constructively and increase the probability. If they point in opposing directions, they cancel.
This is the central reason that approximate-QFT error is structured. Omitting a controlled phase changes coherent phase sums before measurement. It is not automatically equivalent to randomly deleting or corrupting a few completed samples.
A sign error changes the transform. A swap-order error changes qubit ordering. A classical-bit decoding error can make a correct quantum distribution appear wrong.
The repository validates the matrix convention directly against roots-of-unity matrices and Qiskit-generated matrices. It audits:
An exact q-qubit QFT includes:
q(q - 1) / 2
controlled-phase gates in one register.
Across d registers, the logical controlled-phase count is:
d × q(q - 1) / 2
Small-angle controlled rotations contribute to precision but also increase circuit size. An approximate QFT removes some of the smallest rotations.
The repository uses a distance cutoff. A controlled phase is kept when the two qubits are separated by at most t positions.
t = q - 1 means exact QFT.t = q - 2 removes only the smallest-angle phase layer.The one-register sum of omitted phase angles is:
eta(q,t) = π × sum from r=t+1 to q-1 of (q-r)/2^r
This quantity enters the conservative error certificate.
Removing controlled phases reduces the QFT gate count. That does not automatically prove a full program speedup.
Modular arithmetic dominates the full circuit, and a transpiler can decompose or optimize gates differently. The repository therefore labels:
Qiskit displays classical bitstrings in an order that does not directly match the logical list of exponent registers.
The decoder must:
k = (k1, k2, ..., kd)
A correct circuit paired with an incorrect decoder produces incorrect mathematical samples. The repository therefore tests the decoding contract instead of treating bit order as a display detail.
The measured Fourier rows are normalized:
wi = ki / M
If the rows are arranged into a matrix W, the rational augmented lattice has the block form:
B = [ I_d 0 ]
[ S W S I_m]
Here:
I_d is a d-dimensional identity matrix;I_m is an m-dimensional identity matrix;W contains the normalized Fourier samples;S controls the geometric scale of the embedding.The lattice should be exact. Converting rational entries to floating-point values and rounding them can silently create a different lattice.
The implementation clears denominators exactly and passes an integer basis to LLL.
The top block represents candidate relation coordinates. The bottom block records how well those coordinates agree with the measured Fourier rows after scaling.
A useful short vector should combine a small relation candidate with a small sample-consistency error.
LLL stands for Lenstra–Lenstra–Lovász lattice-basis reduction.
A lattice can be represented by many different bases. Some bases contain long, nearly dependent vectors and are hard to interpret. LLL transforms the basis into a shorter and better-conditioned basis.
LLL does not always return the mathematically shortest possible vector. It returns vectors that satisfy a polynomial-time approximation guarantee.
The primary endpoint uses exact integer LLL through SymPy. The implementation also checks the unimodular transformation:
transformation × original basis = reduced basis
If this identity fails, the reduced rows cannot be trusted as exact combinations of the original lattice basis.
The implementation evaluates the Regev-style Gram–Schmidt cutoff using exact rational arithmetic. This determines how much of the reduced basis belongs to the short-vector prefix considered by the recovery procedure.
This stopping rule is separate from “take the first LLL row and hope.” The repository records and checks the actual prefix condition.
The full relation lattice is:
L = { z in Z^d :
product ai^zi = 1 mod N }
A candidate vector is not accepted merely because it is short. The code computes the modular product and verifies exact membership in L.
For a verified relation z, compute:
beta = product bi^zi mod N
Because each ai is bi², a valid relation in L makes beta a square root of one modulo N.
If:
beta = +1 mod N or beta = -1 mod N
then the relation is valid but does not split N. These relations form L0.
A relation in:
L \ L0
has a nontrivial square root of one and can yield a proper factor.
LLL may successfully recover a short exact relation that lies in L0. That is not an implementation failure. It is a valid arithmetic relation that happens to be useless for factoring.
This distinction motivated the quotient-deflation study described later in the manual.
After verifying z in L and computing beta, the code attempts:
p = gcd(beta - 1, N) q = gcd(beta + 1, N)
A successful factor must satisfy:
1 < p < N or 1 < q < N
If both factors are returned, the repository validates:
p × q = N
Known factors are not given to the recovery algorithm. They are stored separately and used only after a result is returned, so that the output can be checked.
The code tries to prevent accidental use of the answer during recovery.
The project derived a conservative bound connecting QFT approximation to a downstream recovery event.
Its dimensionless decision variable is:
B(d,M,m,t;Delta) = m × min(1, 2d × eta(q,t)) / Delta
The certificate approves a cutoff only when:
B ≤ 1
The variables mean:
d: number of exponent registers;M: Fourier modulus;m: number of measured samples;t: retained controlled-phase distance;Delta: maximum allowed loss in recovery-event probability.The derived no-certificate condition is:
M < 4πdm / Delta
Under that condition, the implemented worst-case certificate cannot authorize even the first non-exact QFT cutoff.
The certificate is a sufficient guarantee. If it approves a cutoff, the stated worst-case error budget is respected.
Failure to approve is not the same as proof of failure. The certificate may lose information when it replaces the actual prepared state, fiber structure, interference pattern, measurement, and recovery event with worst-case inequalities.
The final frozen holdout used:
The experiment produced 12,288 raw endpoint trials.
The original worst-case certificate approved zero omitted phase layers. In every tested configuration, it selected the exact QFT.
| M | Largest passing omission for hard-box model A | Largest passing omission for finite-Gaussian model B |
|---|---|---|
| 8 | 1 phase layer | 1 phase layer |
| 16 | 1 phase layer | 2 phase layers |
| 32 | 1 phase layer | 2 phase layers |
A cell passed only when both of the following approximate-minus-exact lower confidence bounds remained above the frozen -0.10 non-inferiority margin:
The largest passing cells saved:
These are not demonstrated full-device speedups. The modular arithmetic remains much larger than the QFT, and no hardware experiment was performed.
The exact-QFT decision made by the original worst-case certificate was mainly a limitation of that proof technique in this finite regime. It was not a necessary condition for the tested prepared-state lattice-recovery endpoint.
This conclusion is limited to the tested semiprimes, dimensions, Fourier sizes, sample count, state models, and current LLL decoder.
The repository intentionally preserves failed hypotheses. A negative result is useful when the experiment was frozen, the comparison was fair, and the claim boundary is clear.
The first hypothesis was that selecting modular bases with greater bounded-product diversity would improve lattice recovery.
The relationship was model-dependent. It appeared negatively associated with recovery in the finite hard-box and Gaussian models and disappeared in the theorem-consistent noisy-dual model.
The repository therefore does not claim a general Regev base-selection improvement.
Another hypothesis was that LLL wasted effort repeatedly finding short L0 relations. The project implemented exact quotient construction, verified deflation, adaptive resampling, bounded enumeration, and matched-cost baselines.
The complete method did not beat the matched reference on the frozen 20-modulus holdout. It was worse in models A, B, and D and tied in saturated model C.
The selector was intended to choose a resource-saving approximate QFT while remaining inside a five-percent loss certificate.
It never selected a non-exact cutoff in the frozen grid. That positive selector hypothesis was falsified.
The later certification-gap experiment did not make the selector successful. It showed that the selector was too conservative relative to the finite endpoint.
The project recovered the register sizes, imported arithmetic behavior, QFT conventions, measurement order, and circuit path. It identified the notebook state as a finite uniform box, not the full Gaussian state from Regev's formulation.
A bounded diversity metric was implemented. The first evaluation was later recognized as circular because the selector and evaluator examined the same bounded relation region.
The revision permanently paired roots with bases, built the real augmented-lattice endpoint, separated the sampling models, added factor-blind controls, and ran held-out base-selection ablations.
The project tested whether quotienting or suppressing L0 directions would improve factor-bearing recovery. The positive hypothesis failed under the frozen budget.
A small d=3, M=8 experiment showed that aggressive truncation damaged recovery, but the register was too small to support fine cutoff choices. The study was retained as background.
The project derived the certificate-scaling law and evaluated a large analytic grid. The five-percent selector chose exact QFT everywhere.
A theorem audit found and corrected a reversed gate-order bug in the custom approximate QFT. All affected rows were invalidated and regenerated. Sharper factor-blind certificates and an eight-semiprime held-out endpoint then measured the gap between theorem rejection and actual recovery.
regev_research/
Python library modules for circuits, exact distributions,
lattices, quotient methods, experiments, and certificates
scripts/
Reproducible command-line entry points
tests/
Unit, regression, matrix, arithmetic, lattice, and protocol tests
results/
Frozen raw trials, aggregate summaries, bootstrap draws,
completion records, and resource tables
figures/
Generated plots from the original and red-team studies
external/
Audited external reversible-arithmetic dependency
*.ipynb
Original and generated executable notebooks
*.md
Reports, theory notes, frozen protocols, and adversarial audits
The repository is designed so that implementation, frozen experiment configuration, raw output, statistical analysis, and written claims can be inspected separately.
| Module | Purpose |
|---|---|
core.py |
Rooted-base objects, modular arithmetic, factor-blind relation diagnostics, exact hard-box Fourier law, and factor extraction. |
circuits.py |
Qiskit circuit construction, exact or truncated product QFTs, and compiled resource reports. |
qft_noise.py |
Roots-of-unity matrices, exact and approximate fiber laws, noise mappings, gate counts, and cutoff formulas. |
qft_certificate.py |
Worst-case theorem decision, boundary checks, sharper state/distribution certificates, and proof-slack utilities. |
dual.py |
Factor-blind exact relation-lattice construction for oracle-side validation and theorem-consistent noisy-dual sampling. |
lattice.py |
Exact denominator clearing, augmented integer lattice, verified LLL transform, Claim-5.1 prefix, L/L0 classification, and factor endpoint. |
redteam.py |
Exact finite sampling laws and the frozen rooted-base ablations. |
redteam_experiments.py |
The 24-modulus, six-method, three-model red-team study with clustered inference. |
quotient.py |
Exact integer quotient construction using HNF and SNF. |
quotient_metrics.py |
Oracle-side relation and quotient diagnostics that are not passed to the recovery selector. |
quotient_predictors.py |
Post-hoc joins and clustered predictor comparisons on frozen study rows. |
quotient_recovery.py |
Bounded enumeration, quotient deduplication, L0 suppression, LDAR, BKZ comparisons, and matched baselines. |
quotient_experiments.py |
Frozen quotient-study parameters and sample-model definitions. |
quotient_study.py |
Checkpointed held-out execution and aggregation for the large quotient study. |
rv_filter.py |
A finite structural comparator inspired by Ragavan–Vaikuntanathan, with unmet theorem assumptions reported explicitly. |
experiments.py |
Superseded first-stage experiments retained for audit reproduction. |
__init__.py |
Public imports for core rooted-base, lattice, quotient, and QFT utilities. |
| Script | What it runs |
|---|---|
scripts/run_qft_certificate_gap.py |
The current eight-semiprime certification-gap holdout, sharper certificates, resources, comparisons, and figures. |
scripts/run_qft_precision_scaling.py |
The earlier QFT certificate-scaling grid, matrix checks, feasible finite endpoints, and resource summaries. |
scripts/run_qft_noise_experiment.py |
The superseded first finite QFT/noise experiment. |
scripts/run_redteam.py |
The frozen base-selection red-team experiment. |
scripts/run_quotient_study.py |
The expensive held-out quotient experiment. |
scripts/analyze_quotient_study.py |
Reanalyzes the checked-in quotient trial table without rerunning recovery. |
scripts/run_research.py |
The superseded first-stage analysis. |
scripts/build_revised_notebook.py |
Builds the revised executable notebook from one Python source. |
scripts/execute_revised_notebook.py |
Executes the generated notebook with errors disallowed. |
The checked-in quotient outputs are large. Re-running the quotient study can create large checkpoint files. The current certification-gap study is much smaller.
git clone https://github.com/simransummermalik/TheoreticalComputing.git cd TheoreticalComputing
python3 -m venv .venv
A virtual environment keeps the research dependencies separate from the computer's global Python installation.
source .venv/bin/activate
Activation is optional when commands explicitly use .venv/bin/python, but it is
convenient during interactive work.
.venv/bin/python -m pip install -r requirements-research.txt
The environment includes Qiskit and Aer for circuits, NumPy and SciPy for numerical work, SymPy for exact integer algebra, pandas and Matplotlib for analysis, fpylll for verified BKZ comparisons, notebook tooling, and pytest.
Only run the clone command if the external directory is missing:
git clone --depth 1 \ https://github.com/Wlitkopa/regev-quantum-algorithm.git \ external/regev-quantum-algorithm git -C external/regev-quantum-algorithm fetch --depth 1 \ origin a18f75d414485086db9b257407e0bd01f8a8f81c git -C external/regev-quantum-algorithm checkout \ a18f75d414485086db9b257407e0bd01f8a8f81c
The fixed commit keeps the reversible-arithmetic dependency reproducible.
Run the full test suite from the repository root:
MPLCONFIGDIR=/tmp/mpl \ PYTHONPATH=. \ .venv/bin/python -m pytest -q
The current repository documentation reports this expected final line:
104 passed
PYTHONPATH=. tells Python that the repository root should be searched for imports.
MPLCONFIGDIR=/tmp/mpl gives Matplotlib a writable temporary cache directory and
avoids permission warnings in restricted environments.
Run:
MPLCONFIGDIR=/tmp/mpl \ PYTHONPATH=. \ .venv/bin/python scripts/run_qft_certificate_gap.py
This rewrites:
results/qft_certificate_gap/
The output directory includes:
A result directory can be copied, edited, or partially regenerated. A completion record lets a reader check whether the files match the output produced by one completed run.
This does not prove the scientific claim by itself. It proves that the result bundle is internally tied to a recorded execution.
MPLCONFIGDIR=/tmp/mpl \ PYTHONPATH=. \ .venv/bin/python scripts/run_qft_precision_scaling.py
MPLCONFIGDIR=/tmp/mpl \ PYTHONPATH=. \ .venv/bin/python scripts/run_qft_noise_experiment.py
MPLCONFIGDIR=/tmp/mpl \ PYTHONPATH=. \ .venv/bin/python scripts/run_redteam.py
PYTHONPATH=. \ .venv/bin/python scripts/analyze_quotient_study.py
The quotient study is expensive and already has a complete checked-in trial table. Use the analysis script unless a full rerun is specifically required.
.venv/bin/python scripts/build_revised_notebook.py .venv/bin/python -m ipykernel install \ --prefix .jupyter \ --name regev-research \ --display-name "Regev Research" JUPYTER_DATA_DIR="$PWD/.jupyter/share/jupyter" \ IPYTHONDIR=/tmp/ipython \ MPLBACKEND=Agg \ MPLCONFIGDIR=/tmp/mpl \ .venv/bin/python scripts/execute_revised_notebook.py
A raw trial row represents one frozen combination of modulus, model, cutoff, replicate, and recovery result. Raw rows should not be pooled without respecting the experimental unit.
Thousands of repeated shots on one modulus do not create thousands of independently generalized factoring problems.
The repository therefore aggregates and resamples at the whole-N level when making across-modulus claims.
Factor success means the recovery path returned a proper factor pair that multiplied back to N. Setup gcd leaks are excluded.
This is a stricter structural endpoint. It records whether recovery found an exact relation whose stored-root product belonged to a factor-bearing class.
Cluster intervals resample whole moduli. They reflect uncertainty across the tested N values, not merely uncertainty across repeated shots at one N.
Non-inferiority asks whether the approximate method is not worse than the exact method by more than a predeclared margin.
In the current holdout, the frozen absolute margin was 0.10. The approximate-minus-exact lower confidence bound had to remain above -0.10.
Run the command from the repository root and include:
PYTHONPATH=.
Confirm that this file exists:
external/regev-quantum-algorithm/gates/r_haner/modular_exponentiation.py
Verify the dependency commit:
git -C external/regev-quantum-algorithm rev-parse HEAD
Expected:
a18f75d414485086db9b257407e0bd01f8a8f81c
Prefix the command with:
MPLCONFIGDIR=/tmp/mpl
Install it from the virtual environment:
.venv/bin/python -m ipykernel install \ --prefix .jupyter \ --name regev-research \ --display-name "Regev Research"
The primary endpoint uses exact integer LLL through SymPy. BKZ experiments use fpylll only when the transformation can be verified.
A deterministic fallback is labeled as a surrogate. It should not be reported as actual BKZ.
Do not rerun it by default. Analyze the checked-in 117,760-row trial table:
PYTHONPATH=. \ .venv/bin/python scripts/analyze_quotient_study.py
No. A toy success may be caused by easy group structure, setup gcd leakage, a favorable root family, or repeated tuning on the same input.
The evidence must be tied to the labeled sample-to-lattice endpoint and the tested finite model.
In the tested finite hard-box and finite-Gaussian models, limited QFT phase-layer omission met a frozen lattice-recovery non-inferiority endpoint even though the original worst-case certificate rejected every non-exact cutoff.
This is a finite certification-gap result. It is not a general faster factoring algorithm.
This manual reflects the repository's documented main-branch state when generated in July 2026. The GitHub repository remains the authoritative source for later corrections, new tests, and new results.