Ultrametric Quantum Computation Benchmark

From Shor's Dead End to the p-Adic Frontier

Spec v0.1 Published DOI: 10.5281/zenodo.20541321

Read the Spec Download Verifier

The Challenge

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.

c = ab mod p   on   D=64 digits, 256 qubits

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.

Scoring

Score = BranchOps(weighted) × TreeDepth
Gate TypeBase CostPenaltyExample
Single-qubit1×1Initialization, readout
Two-qubit (same branch)2×1CNOT 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.

Verifier Status

7/7
Stress tests
16
Test vectors
5/5
Self-tests
301
Max gates tested
413K
Max score tested

Test Vectors

16 known (a, b, p, c) tuples for validating submissions:

Submission Circuit Stress Tests

CircuitGatesScoreCross-Branch
minimal41,5362
all_single_qubit644,0960
max_cross_branch520,8005
dense_multi_controlled21,220,6082
small_modexp5515,93611
medium_modexp13526,43231
large_modexp301413,50476

Reference Verifier

The reference verifier is a Python 3.12+ implementation. No external dependencies beyond the standard library.

Modules

ModuleLinesPurpose
tree.py~130P-adic hierarchical qubit layout (D=64, 4-bit digits, 256 qubits)
gates.py~200Gate IR with 4 gate types + scoring engine
monna.py~120Monna map (base-16 digit reversal), secp256k1 prime
test_vectors.py~9023 reference vectors + Phase 4: 16 256-bit vectors
verifier.py~520Reference verifier: parser, CLI, self-test harness
stress_test.py~320Phase 4 stress test suite — generates + validates submissions

Quick Start

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

GitHub Repository

Submission Format

{
  "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

The Monna map reverses the order of p-adic digits. For a 256-bit value with 64 4-bit digits:

M(x) = digit-reversed x   →   M(M(x)) = x

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.

Context

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.