△ Mechanism confirmed, baseline not beaten 2026

Spectral Hamiltonian Neuron

Implementation & benchmark of arXiv:2607.05000 — Canonical quantization of neurons

Usefulness6/10
Difficulty6/10
Novelty7/10

Source paper: Canonical quantization of neurons arXiv:2607.05000 ⓘ · analyzed Aug 30, 2026

AI-generated research hypothesis, automatically tested. Not peer-reviewed.

Idea description

Replace a scalar neuron activation with a matrix function of a learned Hamiltonian. Fixed Hermitian interaction operators are combined as a trainable linear Hamiltonian, the activation is applied to its eigenvalues, and the resulting observable is measured on an input quantum state. Noncommuting interaction terms provide a controlled source of expressivity beyond an ordinary scalar neuron.

Formulas

$$H_{\theta}\coloneqq\sum_{j\in[J]}\theta_jH_j$$
$$H_\theta=U\operatorname{diag}(\lambda_1,\ldots,\lambda_d)U^\dagger,\qquad \varphi(H_\theta)=U\operatorname{diag}(\varphi(\lambda_1),\ldots,\varphi(\lambda_d))U^\dagger$$
$$f_\theta(\rho)=\operatorname{Tr}\!\left(\rho\,\varphi(H_\theta)\right)$$
$$\frac{\partial f_\theta(\rho)}{\partial\theta_j}=\operatorname{Tr}\!\left(\rho\,U\left[G^{(j)}\odot(U^\dagger H_jU)\right]U^\dagger\right),\quad G^{(j)}_{ab}=\begin{cases}\frac{\varphi(\lambda_a)-\varphi(\lambda_b)}{\lambda_a-\lambda_b},&\lambda_a\ne\lambda_b,\\\varphi'(\lambda_a),&\lambda_a=\lambda_b.\end{cases}$$

Mathematical statement

The canonical quantization construction defines the Hamiltonian H_theta = sum over j of theta_j H_j, where theta_j are trainable real coefficients and H_j are fixed Hermitian interaction operators. If H_theta = U diag(lambda_1,...,lambda_d) U^dagger, matrix functional calculus defines phi(H_theta) = U diag(phi(lambda_1),...,phi(lambda_d)) U^dagger for a scalar activation phi. For an input density matrix rho, the prediction is f_theta(rho) = Tr(rho phi(H_theta)). Noncommutativity means that [H_i,H_j] = H_i H_j - H_j H_i is nonzero for at least one pair, so the terms cannot be simultaneously diagonalized. To train the layer without incorrectly using an elementwise derivative, use the Frechet derivative. In the eigenbasis of H_theta, the derivative with respect to theta_j is D phi at H_theta applied to H_j = U (G^(j) elementwise-multiplied by U^dagger H_j U) U^dagger. The divided-difference matrix has entries G^(j)_ab = (phi(lambda_a)-phi(lambda_b))/(lambda_a-lambda_b) when lambda_a is not equal to lambda_b, and G^(j)_aa = phi'(lambda_a) otherwise. For squared loss L = B^(-1) sum_b (f_theta(rho_b)-y_b)^2, the parameter gradient is dL/dtheta_j = 2 B^(-1) sum_b (f_theta(rho_b)-y_b) Tr(rho_b D phi at H_theta applied to H_j).

Implementation notes

Integrate the construction as the first layer that maps a quantum state to a scalar feature, or as one channel in a hybrid quantum-classical model. Store fixed Hermitian matrices H[1:J], trainable coefficients theta[1:J], input density matrices rho[b], and scalar labels y[b]. For each minibatch, first construct H = sum_j theta[j] * H[j]. Rescale it by H <- H / max(1, spectral_norm(H)) so that its eigenvalues remain in a stable interval. Eigensolve H = U diag(lambda) U^dagger, compute A = U diag(phi(lambda)) U^dagger, and predict yhat[b] = real(trace(rho[b] @ A)). Compute the squared minibatch loss. For every j, transform H[j] into the eigenbasis, construct G[j] using the divided-difference formula, form dA[j] = U @ (G[j] elementwise-multiplied by U^dagger @ H[j] @ U) @ U^dagger, and set grad_theta[j] = 2 times the batch average of (yhat[b]-y[b]) times real(trace(rho[b] @ dA[j])). Update theta with Adam or SGD. A hardware version can estimate trace(rho A) by repeated observable measurements and approximate phi(H) with a truncated polynomial p_K(H) = sum_k c_k H^k implemented through Hamiltonian simulation. The eigendecomposition, divided differences, and gradients are exact in the simulator; shot noise and polynomial truncation are empirical approximations on hardware. Begin with 4 to 8 qubits, random shallow-circuit states, and labels generated by a target observable containing two noncommuting Pauli strings. Compare equal-parameter commuting H_j, noncommuting H_j, and a classical linear-energy neuron. Success is lower test MSE or fewer training examples at the same parameter count, with an ablation confirming that the gain disappears when all H_j commute.

Verification

Mechanism confirmed, baseline not beaten

Stage 1 · Toy mechanism gate: Passed ✓

Stage 2 · Mechanism transferred to benchmark: Confirmed ✓

Stage 2 · Practical benchmark result: Significantly worse ✗

Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works

Stage 1 — Mechanism check agent confidence 8/10

Built a NumPy spectral Hamiltonian neuron using matrix functional calculus and divided-difference Fréchet derivatives. The derivative check matched finite differences with relative error 8.3e-11. On the synthetic target, the noncommuting spectral model achieved test MSE 3.35e-31, versus 0.0603 for the commuting spectral control and 0.00137 for the classical linear-energy control, showing a clear expressivity signal, though the teacher used the same noncommuting operator family.

Agent confidence
8/10
Baseline
Classical linear-energy test MSE 0.0013715; commuting spectral test MSE 0.0602644.
Idea
Noncommuting spectral test MSE 3.35e-31; Fréchet-gradient relative finite-difference error 8.26e-11.

Limitations: Small noiseless d=4 simulator, one seed, exact eigendecomposition, and a synthetic teacher sharing the noncommuting operator family. Shot noise, polynomial Hamiltonian simulation, larger systems, multiple seeds, speed/FLOPs, and spectral-norm rescaling were not tested.

How to run: python3 spectral_neuron_experiment.py

Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.05000)

Significantly WORSE than the tuned baseline (+13276.3%, p=0.0081, wins 0 / 8 paired seeds).

Benchmark
Dynamics forecasting
Model
rnn_small_matched_spectral_head
Paired seeds
8
Baseline mean
0.0007
Idea mean
0.0902
Effect (Δ)
0.0895 (+13276.3%; negative = idea better)
Wins
0 / 8 paired seeds
p-value
0.0081 (permutation test, 20 000 shuffles)
Smallest detectable effect
±1858.9%
Mechanism
Confirmed ✓
Practical effect
Hurts
Baseline tuning
swept over 3 configs
Limitations:

Only the registered built-in dynamics track was tested. The MVP used exact 4x4 eigendecomposition and a pure-state density matrix from the RNN feature; hardware shots, polynomial Hamiltonian simulation, larger operators, and other tracks were not tested.

How to run: python3 stage2_bench.py

Verdict computed by deterministic test code from paired-seed statistics — not by the language model.

Stage 2 — Benchmark latest Failed ✗

Agent confidence: 9/10

The matched spectral Hamiltonian RNN system significantly underperformed the matched trained linear-readout baseline on the structurally appropriate dynamics track. The nonlinear mechanism signature was confirmed on trained-model behavior, but this did not translate into a task-metric win: delta_mean was positive and permutation p_value was 0.0081.

Baseline
8-seed dynamics test MSE mean 0.0006743473; best lr 0.01, 18 epochs
Idea
8-seed dynamics test MSE mean 0.09020258; best lr 0.01, 18 epochs

Benchmark result

Significantly WORSE than the tuned baseline (+13276.3%, p=0.0081, wins 0 / 8 paired seeds).

Benchmark
Dynamics forecasting
Model
rnn_small_matched_spectral_head
Paired seeds
8
Baseline mean
0.0007
Idea mean
0.0902
Effect (Δ)
0.0895 (+13276.3%; negative = idea better)
Wins
0 / 8 paired seeds
p-value
0.0081 (permutation test, 20 000 shuffles)
Smallest detectable effect
±1858.9%
Mechanism
Confirmed ✓
Practical effect
Hurts
Baseline tuning
swept over 3 configs
Limitations:

Only the registered built-in dynamics track was tested. The MVP used exact 4x4 eigendecomposition and a pure-state density matrix from the RNN feature; hardware shots, polynomial Hamiltonian simulation, larger operators, and other tracks were not tested.

How to run: python3 stage2_bench.py

Artifacts

Implementation overview ⬇ Download all as ZIP 5 files · code, reports and structured results