Coherent Rank-Select in Quantum Algorithms
- The paper introduces a coherent reversible rank-select primitive that maps entangled validity masks to valid bit positions with a sentinel totalization rule to handle out-of-range ranks.
- It employs both a sequential bounded-span scan and a blocked construction to optimize gate count and circuit depth, achieving bounds like O(Nw) and O(N log w).
- The construction integrates into coherent rollout oracles, reversibly mapping basis-state selectors to actions, and plays a role analogous to classical rank-select in succinct indexing.
Searching arXiv for the cited papers to ground the article in current arXiv records. Coherent rank-select is a reversible basis-state selection primitive for quantum algorithms on branch-dependent action spaces. In the formulation studied in "Coherent Rollout Oracles for Finite-Horizon Sequential Decision Problems" (Shukla, 28 Apr 2026), a quantum state register determines an entangled -bit validity mask, a selector register stores a rank , and the primitive returns the position of the -th valid bit or a sentinel when is out of range. The construction is motivated by coherent rollout for sequential decision problems, where randomness must live in explicit quantum registers and basis-state selectors must be mapped to actions reversibly.
1. Formal definition
Let be a state register whose content defines a validity mask
where iff action is valid in branch . Let be a rank register, and let the output register have width
0
so that it can encode positions 1, with 2 used as a sentinel (Shukla, 28 Apr 2026).
The primitive is defined through the partial function
3
where 4, and
5
The coherent rank-select unitary 6 acts as
7
A central structural feature is totalization by sentinel: although the underlying notion is the position of the 8-th valid bit, the unitary must be total on computational basis states, so the output 9 encodes failure. This removes partiality without discarding reversibility.
2. Circuit model and resource measures
The analysis in (Shukla, 28 Apr 2026) distinguishes two reversible-circuit models. In the bounded-fan-in, long-range model, gates act on at most 0 qubits, but any subset of qubits may interact. The primary resources are gate count 1, ancilla qubits 2, and circuit depth 3. In the bounded-span scan model, validity bits are laid out on a line at positions 4, and each gate of support size at most 5 may cross at most 6 adjacent prefix cuts. The same measures 7, 8, and 9 are counted, together with total crossing mass of span.
The persistent registers are the state register 0, the rank selector 1 of width 2, the output register 3 of width 4, and an ancilla pool of size 5, reused and cleaned (Shukla, 28 Apr 2026).
This operational setting is stricter than classical selection over a stored mask. The mask may be entangled with the state register, and the implementation must preserve unitarity, return all ancillae to 6, and avoid implicit randomness. The abstract of (Shukla, 28 Apr 2026) states this requirement directly: coherent quantum rollout requires a unitary simulator, randomness must live in explicit quantum registers, and basis-state selectors must be mapped to actions reversibly.
3. Sequential bounded-span scan
The first construction in (Shukla, 28 Apr 2026) is a left-to-right reversible scan. It maintains a 7-bit running count 8 of previously seen 9-bits and initializes the output register to the sentinel 0. For each position 1, it reads the entangled validity bit 2, compares 3 with 4, forms a match flag 5, conditionally XORs 6 into the output, uncomputes the comparison, and conditionally increments 7. After the forward pass, the increment chain is reversed to uncompute 8.
Per iteration, the construction uses one 9-bit reversible equality check with 0 Toffoli/CNOT gates and depth 1, one multi-target XOR of 2 CNOTs and depth 3, and one 4-bit ripple-carry increment with 5 gates and depth 6. The uncompute steps exactly reverse the same cost (Shukla, 28 Apr 2026).
The resulting resource bounds are
7
The paper further states that this sequential scan is gate-optimal in the bounded-span, bounded-fan-in model. The proof sketch uses a prefix-suffix communication argument: varying the first 8 bits of the mask can force the remainder of the circuit to reveal 9 bits, each cut-crossing gate transmits at most 0 bits, and summing over the 1 cuts yields an 2 lower bound (Shukla, 28 Apr 2026).
4. Blocked construction and lower bounds
When long-range gates are allowed, (Shukla, 28 Apr 2026) gives a blocked construction with asymptotically smaller gate count. Positions are partitioned into 3 blocks of size 4. A global prefix sum 5 and global output register are maintained. For each block 6, the circuit computes the block population
7
by a balanced reversible adder tree, computes a take flag
8
and local rank 9, runs a sequential scan within the block to obtain a local index 0, conditionally XORs 1 into the output, updates 2, and then uncomputes the temporary data.
The corresponding bounds are
3
with long-range fan-in used to build the block adder tree in depth 4 (Shukla, 28 Apr 2026).
The same work also proves an unconditional lower bound in the broader bounded-fan-in setting: any reversible circuit for 5 must have 6. The proof sketch considers rank 7: the all-zero mask produces output 8, while the singleton mask 9 produces output 0. Hence every input bit 1 influences the output, and in a 2-fan-in reversible circuit each gate can bring in at most 3 new inputs into the backward light cone of an output qubit, forcing 4 gates.
| Construction or bound | Model | Resource statement |
|---|---|---|
| Sequential scan | Bounded-span, bounded-fan-in | 5, 6, 7 |
| Blocked construction | Bounded-fan-in with long-range gates | 8, 9, 0 |
| Unconditional lower bound | Any bounded-fan-in model | 1 |
These results isolate a basic trade-off. Bounded-span locality enforces an 2 gate barrier, while long-range interactions permit an 3 construction but do not remove the 4 dependence on the mask length.
5. Composition into coherent rollout oracles
In (Shukla, 28 Apr 2026), coherent rank-select is not treated as an isolated primitive; it is the indexing phase of a larger coherent rollout oracle for finite-horizon planning problems. For each round 5, the oracle composes three phases.
First, 6 decodes 7 to a valid action position. Second, a reversible transition circuit 8 updates the configuration using fresh randomness dice registers that are never discarded, so 9 remains available; the stated cost is 00 gates per round for bounded-neighbors. Third, a reversible predicate 01 writes the payoff into one qubit; the stated cost is 02 if the task compares two 03-bit counts over 04 cells (Shukla, 28 Apr 2026).
The total unitary is
05
with total gate and qubit costs
06
The paper states that this oracle satisfies the access model of the best-arm pipeline of Wang et al. Plugging it into amplitude estimation and Dürr–Høyer maximum finding gives an 07-correct best-arm algorithm using
08
calls to 09 and 10, against the classical 11 rollout-query lower bound (Shukla, 28 Apr 2026). The same work gives a bounded-influence lifting theorem extending the lower-bound construction from a base configuration to an exponential family of configurations, instantiates the framework on SIR epidemic intervention, includes a stochastic placement-game sanity check, and machine-checks the main results in Lean 4.
6. Relation to classical rank-select structures
Classical rank and select are basic operations on sequences and bitvectors, with applications in compressed text indexes and other space-efficient data structures (Chiu et al., 13 Apr 2026, Chiu et al., 8 Sep 2025). In classical notation for bitvectors, for 12,
13
and these operations form the backbone of more complex structures such as wavelet trees (Chiu et al., 8 Sep 2025).
The relationship to coherent rank-select is structural rather than merely terminological. Wavelet forests, as revisited in (Chiu et al., 13 Apr 2026), partition the input sequence into fixed-size blocks, build a separate pointerless canonical Huffman-shaped wavelet tree for each block, and support rank by a three-tier sampled-counts strategy over hyperblocks, superblocks, and blocks. The same paper extends the structure to select queries, reusing the rank-sampling arrays, with select time 14 and rank time 15, while experiments show that wavelet forests are competitive with, and in most cases outperform, standalone wavelet-tree implementations.
At the bitvector level, "Engineering Select Support for Hybrid Bitvectors" (Chiu et al., 8 Sep 2025) augments a hybrid bitvector that already supports constant-time rank so that it also supports constant-time select while using only 16 additional bits beyond the concatenation of the per-block compressed bitstreams. The implementation partitions the bitvector into fixed-size blocks, groups them into superblocks and hyperblocks, and answers 17 through a sparse sampling of superblocks plus a block-local select routine specialized to plain, run-length, or minority encoding.
These classical constructions and the coherent primitive solve different problems. Classical designs optimize succinct storage and local decoding on static sequences or bitvectors, whereas coherent rank-select is a reversible unitary on an entangled validity mask with a sentinel totalization rule (Shukla, 28 Apr 2026). A plausible implication is that the quantum primitive occupies, for reversible decision pipelines, a role analogous to the role classical rank/select occupies in succinct indexing: it is a low-level access mechanism on which larger algorithmic frameworks are built.