From Shor's Dead End to the p-Adic Frontier
Spec v0.1 Published DOI: 10.5281/zenodo.20541321
Compute p-adic modular exponentiation on a 256-bit prime (the secp256k1 modulus) using only branch-respecting quantum operations on a hierarchical tree structure. This is the ultrametric analog of elliptic curve point addition targeted by ecdsa.fail.
All quantum operations must respect the p-adic tree — cross-branch gates incur a penalty proportional to tree distance between branches. The challenge is to minimize the product of branch operations and tree depth while computing correctly.
| Gate Type | Base Cost | Penalty | Example |
|---|---|---|---|
| Single-qubit | 1 | ×1 | Initialization, readout |
| Two-qubit (same branch) | 2 | ×1 | CNOT within a digit |
| Two-qubit (cross-branch, distance k) | 2 | ×(1 + 0.5k) | Carry between digits |
| Multi-controlled (n qubits) | n² | ×max(penalty) | Toffoli, modular reduction |
Tree depth = 64. Cross-branch parameter α = 0.5. Minimum score for a valid 256-bit modexp is unknown — set it.
16 known (a, b, p, c) tuples for validating submissions:
| Circuit | Gates | Score | Cross-Branch |
|---|---|---|---|
| minimal | 4 | 1,536 | 2 |
| all_single_qubit | 64 | 4,096 | 0 |
| max_cross_branch | 5 | 20,800 | 5 |
| dense_multi_controlled | 2 | 1,220,608 | 2 |
| small_modexp | 55 | 15,936 | 11 |
| medium_modexp | 135 | 26,432 | 31 |
| large_modexp | 301 | 413,504 | 76 |
The reference verifier is a Python 3.12+ implementation. No external dependencies beyond the standard library.
| Module | Lines | Purpose |
|---|---|---|
tree.py | ~130 | P-adic hierarchical qubit layout (D=64, 4-bit digits, 256 qubits) |
gates.py | ~200 | Gate IR with 4 gate types + scoring engine |
monna.py | ~120 | Monna map (base-16 digit reversal), secp256k1 prime |
test_vectors.py | ~90 | 23 reference vectors + Phase 4: 16 256-bit vectors |
verifier.py | ~520 | Reference verifier: parser, CLI, self-test harness |
stress_test.py | ~320 | Phase 4 stress test suite — generates + validates submissions |
git clone https://github.com/rwnq8/ultrametric-benchmark cd ultrametric-benchmark/src python verifier.py --self-test # 5/5 tests python stress_test.py # 7 circuit stress tests python verifier.py submission.json # Verify a submission
{
"benchmark": "uqc-v0.1",
"target": "p-adic modexp",
"params": {"a": "0x...", "b": "0x...", "p": "secp256k1"},
"circuit": {
"tree_depth": 64,
"gates": [
{"type": "single_qubit", "qubits": [0], "label": "init"},
{"type": "two_qubit_same_branch", "qubits": [0, 1], "label": "cnot_a"},
{"type": "two_qubit_cross_branch", "qubits": [0, 4], "label": "carry_0"},
{"type": "multi_controlled", "qubits": [0, 4, 8, 12], "label": "toffoli_4"}
]
}
}
All qubit indices must be in [0, 255]. Same-branch gates must target qubits within the same 4-qubit digit. Cross-branch gates incur distance-based penalty.
The Monna map reverses the order of p-adic digits. For a 256-bit value with 64 4-bit digits:
It plays the role of the Fourier transform in p-adic computation — converting between the standard and Monna domains. All test vectors verify round-trip consistency.
This benchmark is derived from Section 10 of Quantum Cryptanalysis 2026 v3.0 (QNFO-QWAV, 2026). It formalizes the ultrametric quantum computation model proposed there into a concrete, verifiable target.
No working ultrametric quantum computer exists. The benchmark serves as a target specification for hardware and algorithm development — analogous to how ecdsa.fail guided Shor-circuit optimization before fault-tolerant hardware.