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
| p | row weight | naive gates p((p-1)/2 - 1) | best found (ours, Paar greedy) |
|---|---|---|---|
| 7 | 3 | 14 | 14 |
| 11 | 5 | 44 | 34 |
| 13 | 6 | 65 | 46 |
| 17 | 8 | 119 | 76 |
| 19 | 9 | 152 | 96 |
| 23 | 11 | 230 | 136 |
| 29 | 14 | 377 | 206 |
| 31 | 15 | 434 | 238 |
| 37 | 18 | 629 | 321 |
| 41 | 20 | 779 | 393 |
| 43 | 21 | 860 | 430 |
| 47 | 23 | 1034 | 506 |
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.
| Cell | p | Value | Status |
|---|---|---|---|
| qr-xor-11 | 11 | 34 | best known |
| qr-xor-13 | 13 | 46 | best known |
| qr-xor-17 | 17 | 76 | best known |
| qr-xor-19 | 19 | 96 | best known |
| qr-xor-23 | 23 | 136 | best known |
| qr-xor-29 | 29 | 206 | best known |
| qr-xor-31 | 31 | 238 | best known (headline) |
| qr-xor-37 | 37 | 321 | best known |
| qr-xor-41 | 41 | 393 | best known |
| qr-xor-43 | 43 | 430 | best known |
| qr-xor-47 | 47 | 506 | best known |
| qr-xor-53 | 53 | 627 | best known |
| qr-xor-59 | 59 | 768 | best known |
| qr-xor-61 | 61 | 811 | best 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