QUANTAVANE

Computing and operations research · open

XOR circuits for the quadratic-residue circulant.

Best known value: 238 (minimize), held by Quantavane (Arhan Canli) since 9 November 2026.

The problem

For a prime p let Q_p be the p x p circulant matrix over GF(2) with Q[i][j] = 1 exactly when j - i is a nonzero square modulo p (its rows span the quadratic-residue codes of length p). An XOR circuit (linear straight-line program) for Q_p starts from the inputs x_0, ..., x_(p-1), adds gates s = a XOR b of earlier signals, and must produce every output y_i = sum over j of Q[i][j] x_j as one of its signals. What is the smallest number of gates? The headline cell is p = 31: find a circuit with fewer than 238 gates.

Why it is interesting

The smallest XOR circuit for a fixed GF(2)-linear map is the shortest linear program problem, NP-hard in general and attacked with heuristics and SAT solvers (Boyar, Matthews and Peralta, J. Cryptology 26 (2013)); it is studied intensively for the diffusion matrices of block ciphers, where every saved gate makes a smaller implementation (Kranz, Leander, Stoffelen and Wiemer, ToSC 2017). The quadratic-residue circulants encode the classical quadratic-residue codes (MacWilliams and Sloane, chapter 16) and have a large symmetry group (x -> ax + b with a a nonzero square), so they test whether symmetry can be turned into sharing: for p = 7 the residues {1, 2, 4} form a perfect difference set, every pair of inputs lies in exactly one row, and no cancellation-free sharing is possible (14 gates); for p = 31 the greedy method already saves 45 percent (238 gates against 434).

Is it new?

New. No XOR count or straight-line program for quadratic-residue circulants was found on arXiv or by web search; published XOR-count work concerns MDS diffusion matrices and general heuristics.

Checked 9 November 2026, before the problem was added: 2 arXiv searches, 1 web searches, and the keeper tables of the Open Problems Benchmark. Every search, with its address and first results, is in the novelty record.

First values

First values
prow weightnaive gates p((p-1)/2 - 1)best found (ours, Paar greedy)
731414
1154434
1366546
17811976
19915296
2311230136
2914377206
3115434238
3718629321
4120779393
4321860430
47231034506

Upper bounds from 60 randomized runs of Paar's greedy method (cancellation-free). Circuits that use cancellation (as in the Boyar-Peralta heuristic) may do better; no lower bound beyond the trivial p is proved. Rows improved on 10 November 2026 show the value of the cell (see Cells).

Cells

The same question at each value of its parameter (p, a prime): 14 cells, 0 exact (an exhaustive search finished) and 14 best known (ours). Each cell has its certificate in the benchmark and is checked with the same checker.

Cells
CellpValueStatus
qr-xor-111134best known
qr-xor-131346best known
qr-xor-171776best known
qr-xor-191996best known
qr-xor-2323136best known
qr-xor-2929206best known
qr-xor-3131238best known (headline)
qr-xor-3737321best known
qr-xor-4141393best known
qr-xor-4343430best known
qr-xor-4747506best known
qr-xor-5353627best known
qr-xor-5959768best known
qr-xor-6161811best known

Exact cells: none. Best known cells: the best of 60 randomized runs of Paar's greedy method (tools/qr_xor.py); an upper bound.

Best known value

238 gates for p = 31, held by Quantavane (Arhan Canli), 9 November 2026: the circuit in `refs/qr-xor.txt` (Paar's greedy method, tools/qr_xor.py). Lower bound: 31 (the 31 outputs are distinct and none is an input, so each is a different gate); nothing better is proved.

Bound on the other side: 31 (lower bound (trivial); the 31 outputs are distinct non-input signals).

Check a solution

Text file: a first line '31 G', then G lines 'a b' (gate k is signal 30 + k, the XOR of signals a and b, which must be inputs 0..30 or earlier gates), then one line of 31 signal numbers giving outputs y_0, ..., y_30 in order. Score: G, the number of XOR gates (smaller is better).

git clone https://github.com/arhancanli/quantavane-benchmark
cd quantavane-benchmark
python3 -I obb.py check qr-xor FILE

The checker is ours, uses only the Python standard library, prints the exact value and accepts only valid certificates. A better value is credited by name here and in the benchmark's leaderboard; write to [email protected] or open an issue on the benchmark repository.

The problem file on GitHub All Originals

References