Write-Once Photonic Meshes for Epistasis Tests

Tests for gene–gene interaction ("epistasis") in quantitative trait mapping have become tractable at scale because tools such as smer turn the problem into many products of one fixed genotype-derived matrix with random vectors. Those products estimate matrix traces; each trace is a sum of diagonal entries. This workload fits an optical chip whose settings are written once and then held with no power at all. Phase-change materials, which are glasses that latch into amorphous or crystalline states with different refractive indices, can set the phases of an interferometer mesh, a grid of tunable beam-splitters that multiplies light-encoded vectors by a programmed matrix. Once written, these phases cost zero static power. The catch is that the settings are coarse (32 levels), they drift, they wear out after roughly a thousand writes, and each chip has its own fabrication errors. An estimator can shrug off random noise but not systematic error. A fixed chip error biases every trace in the same direction. That shifts the estimated interaction variance and miscalibrates the p-values that decide which loci are declared epistatic.

We propose to treat the problem the way quantum compilers treat qubit placement. We reuse the core idea of noise-aware qubit mapping: put sensitive operations on the best hardware. We then add one new ingredient. We re-map the matrix onto the chip a small number of times, within the material's write budget, and draw each mapping at random. Across mappings the chip's fixed errors no longer point the same way, so they average out: bias becomes variance that shrinks with more mappings. The claim to be tested is sharp. Under realistic phase-change constraints, a handful of randomized, sensitivity-aware mappings brings the hardware-induced bias below the estimator's own sampling noise, so that p-values remain calibrated. Naive write-once programming does not achieve this.

Core Claim

Hutchinson trace estimation approximates $\mathrm{tr}(A)$ by $\hat t = \frac{1}{B}\sum_{b=1}^{B} z_b^\top \hat A z_b$. Here $A$ is the kinship-type matrix, $z_b$ are random sign vectors, $B$ is the number of probes, and $\hat A = A + E$ is what the chip actually computes, with $E$ the hardware error. The estimator's sampling spread is roughly $\sqrt{2\lVert A\rVert_F^2/B}$, which follows from the variance of quadratic forms in sign vectors, where $\lVert A\rVert_F$ is the Frobenius norm of $A$. Its hardware bias is $\mathrm{tr}(E)$, which does not shrink with $B$. If we program $M$ mappings $\pi_1,\dots,\pi_M$, each a random relabeling of individuals and markers that leaves the test statistic unchanged but moves which matrix entries land on which physical beam-splitters, the bias becomes

$$ \frac{1}{M}\sum_{m=1}^{M}\mathrm{tr}(E_{\pi_m}) \;\approx\; \bar b + O\!\left(\sigma_E/\sqrt{M}\right), $$

In this expression, $\bar b$ is the part of the error that no relabeling can remove, such as global loss, and $\sigma_E$ is the spread of the mapping-dependent error. The $1/\sqrt{M}$ form assumes the errors are roughly independent across random mappings, and this assumption is exactly what the experiments test.

Each mapping costs one write of every phase-change cell. $M$ is therefore capped by the endurance budget of more than 1600 switching events reported in Non-volatile electrically programmable integrated photonics with a 5-bit operation. The compiler has to trade $M$ against tiling, which we describe next.

Research Program

The proposal borrows from three lines of work, each in a different role.

The photonic device work constrains the design. Non-volatile electrically programmable integrated photonics with a 5-bit operation demonstrates Sb₂S₃-clad silicon phase shifters with 32 levels, 0.50 ± 0.16 dB per step, sub-millisecond crystallization, and more than 1600 switching events. The same paper uses power-free trimming of a Mach-Zehnder interferometer, a two-path interferometer, to reach 24 dB extinction. Deterministic quasi-continuous tuning of phase-change material integrated on a high-volume 300-mm silicon photonics platform and the stochastic-drift limitations noted there tell us that intermediate levels are noisy. These papers fix our hardware model. They do not address what computation a write-limited mesh should run.

The error-sensitivity work motivates the placement idea. Effect of component variations on the gate fidelity in linear optical networks shows that mathematically equivalent optical circuits differ sharply in error tolerance: the KLM layout lets peripheral beam-splitters tolerate 3× larger deviations. The same paper proposes Quantum Fisher Information, a measure of how strongly the output reacts to each component, as a cheap sensitivity map. We reuse that sensitivity idea per beam-splitter to decide where coarse phase-change cells are acceptable. We then route the few most sensitive positions to a small number of conventional thermo-optic (heater-based) shifters that are kept powered.

The qubit-mapping work supplies the method. QuantumNAS co-searches circuit structure and qubit placement against measured device errors. SABRE improves its initial placement by routing forward and then in reverse. Our analogue of placement is the choice of permutation $\pi$ together with the choice of matrix decomposition into beam-splitter angles. We score each candidate by predicted $|\mathrm{tr}(E_\pi)|$ under a per-chip error model and then sample $M$ low-scoring, mutually diverse mappings. Unlike these compilers, we do not route data by swapping it between neighbors. The mesh has no swaps, and the objective is estimator bias rather than gate count.

The statistical side supplies the workload. In smer and mvMAPIT, the marginal-epistasis kernel for focal SNP $i$ is the genome-wide kernel scaled elementwise by that SNP's genotypes. The scaling can therefore be applied electronically to the input and output vectors, and the genotype blocks are programmed once and reused across all focal SNPs and all probes.

The compiler also reorders the computation so that the outer loop runs over matrix tiles. Each tile of the genotype matrix is written once per mapping, and every probe for every focal SNP streams through it before the next tile is written. Total writes per cell then equal $M$, independent of the number of SNPs tested.

The clinical diagnostic-gap studies set a small-matrix regime rather than the headline application. The congenital hydrocephalus study found a cilia-gene rare-variant burden at $p = 0.0082$ in 28 probands and an IFT172–TTC21B digenic pair (Congenital hydrocephalus). A kernel restricted to a pre-specified gene set, such as the 304 SYScilia genes, is small enough to fit on a single mesh without tiling. We include it only as a simulated secondary setting.

We will build three pieces. The first is a differentiable simulator of a rectangular interferometer mesh. It includes per-chip beam-splitter angle and path-length errors drawn at the scales studied in the linear-optics paper, 5-bit phase quantization with step noise matched to 0.50 ± 0.16 dB, and random drift of intermediate levels. The second is the mapping compiler. The third is a harness that runs smer-style trace estimation and marginal-epistasis tests end to end with the simulated chip in the loop.

Baselines

The reference point for correctness is exact double-precision marginal-epistasis testing on a CPU using smer's own trace estimator with the same probe count $B$ and the same probe vectors. Every photonic variant is judged against it, so the only difference is the matrix-vector engine. No reported speed or accuracy number was found on Lacuna for smer or mvMAPIT; the file lists only their simulation sizes. We therefore regenerate the CPU numbers ourselves.

The naive photonic baseline is "program once, identity mapping." The matrix is decomposed into beam-splitter angles by the standard method, every angle is snapped to the nearest of 32 phase-change levels, and the chip is written a single time. This is what one would do without a compiler, and it isolates the cost of systematic bias.

The strongest competitor on accuracy is a fully volatile thermo-optic mesh. It uses the same decomposition and continuous phases with per-chip calibration trimming, and it runs on the same simulated chips. It avoids quantization and endurance limits and pays continuous heater power. No reported static-power figure for thermo-optic meshes was found on Lacuna, so we report power in terms of the number of powered shifters rather than invent milliwatt values. The most relevant device figure is the 24 dB power-free trimmed extinction in Non-volatile electrically programmable integrated photonics with a 5-bit operation. We use it to set the post-trim residual error in our hardware model.

Beating the volatile mesh means matching its type I error calibration and power while keeping at most 5% of shifters powered. Beating the naive baseline means removing its miscalibration.

Two ablations isolate the key ingredients. The first uses sensitivity-aware placement with a single mapping ($M = 1$), which tests whether placement alone suffices. The second uses $M$ random mappings with no sensitivity-aware assignment, which tests whether randomization alone suffices. All variants share chips, probes, data, and an equal compiler search budget measured in simulated candidate evaluations.

Why not just…?

Why not just run the tests on GPUs? This is a real threat. For cohorts at the scale of smer's 5,000-individual simulation, a GPU will likely finish faster in wall-clock time, and we do not claim otherwise. Our claim concerns whether a zero-static-power, write-limited analog engine can produce statistically valid epistasis tests at all, and what compiler it needs. We will report energy per completed test for both the GPU and the photonic system only from the simulator's operation counts, clearly labeled as estimates. If the photonic system cannot be made calibrated within the write budget, that is a clean negative result for this class of hardware.

Why not just use volatile thermo-optic meshes and skip phase-change materials? Volatile meshes are the accuracy baseline above. They are expected to be well calibrated, but every shifter stays powered, and the file notes their thermal crosstalk (Nonvolatile Phase Change Materials for Programmable Photonics). The experiment settles the question by showing how much of the volatile mesh's calibration a hybrid design recovers as the powered fraction falls. If recovery requires most shifters to stay powered, the phase-change route is not worth it here.

Why not just calibrate harder or quantize more finely, without re-mapping? Better trimming reduces the size of $E$, but a nonzero fixed $\mathrm{tr}(E)$ still yields bias that probes cannot average away. The $M = 1$ placement ablation measures how far careful single-mapping calibration goes. If it already brings bias below sampling spread, randomized re-mapping is unnecessary, and we would report that and drop it.

Why not just use an off-the-shelf qubit mapper such as SABRE? SABRE minimizes inserted swap gates on a coupling graph, and a feed-forward mesh has no swaps to minimize. The transferable part is noise-aware placement in the style of QuantumNAS, which our compiler already includes.

Proposed Experiments

The main experiment uses smer's built-in simulation of 5,000 individuals and 6,000 SNPs, with traits simulated through simulate_traits under a no-epistasis null and under planted pairwise interactions. It is repeated on mvMAPIT's 500 × 1,000 synthetic set and its phillips_data antibody-affinity data. For each of 50 simulated chips we measure several quantities. The first is the ratio of hardware bias $|\hat t - t|$ to Hutchinson sampling spread across $B \in \{10, 50, 100\}$. The second is the downstream bias in the estimated epistatic variance. The third is type I error at nominal 0.05 and $5\times10^{-8}$ under the null, and the fourth is power under planted interactions. We also count total writes per cell against the 1600-cycle budget and the fraction of shifters that remain powered.

The decisive check has three possible outcomes. The approach works if bias falls roughly as $1/\sqrt{M}$ and null p-values become calibrated at some $M$ of 20 or fewer while total writes stay within budget. It fails if the bias floor $\bar b$ dominates, meaning errors do not decorrelate across relabelings. It is unnecessary if the $M = 1$ placement ablation is already calibrated.

A secondary check replaces the gene-wide kernel with a single-mesh kernel restricted to a simulated 304-gene set in a 28-proband-like cohort. It asks whether the small-matrix regime makes write-once operation trivially safe. We expect it to be safe, because no tiling is needed there.