# Commutant-gated spectral loss

- ID: 1815
- Canonical URL: https://synthcore.org/idea/1815/commutant-gated-spectral-loss
- API JSON: https://synthcore.org/api/idea/1815.json
- API Markdown: https://synthcore.org/api/idea/1815.md
- Verification status: beats_baseline
- Source: [arXiv:2608.04903](https://arxiv.org/abs/2608.04903)
- Category: regularization
- Solves: stability, accuracy, generalization
- ML areas: loss, training-dynamics, architecture
- Math tags: linear-algebra, representation-theory, spectral-theory, symmetry
- Ratings: usefulness 8/10; difficulty 5/10; novelty 8/10

## Idea description

Replace per-eigenvector spectral supervision on symmetry-forced multiplets by a projector-trace target determined from the operator family's commutant. Use individual eigenvalue or eigenvector targets only outside detected forced blocks, avoiding arbitrary basis choices and exploding gradients at protected crossings.

## Mathematical statement

For observed Hermitian operators M_a in C^{n x n}, the linear commutant is C = {C : [C,M_a] = 0 for every a}, where [C,M_a] = C M_a - M_a C. Compute it as the nullspace of the linear map C -> ([C,M_1], ..., [C,M_K]). If C_1, ..., C_r is a Hermitian basis of the commutant, compute its center Z(C) = {Z in C : [Z,C_b] = 0 for every b}. A generic Hermitian element Z of this center has eigenspaces defining structural symmetry blocks and orthogonal projectors P_s. These blocks are determined algebraically rather than by accidental eigenvalue gaps. For an observable A, the block target is tr(P_s A) divided by rank(P_s), whereas a simple-level target is v_i^* A v_i. Proposition 2 gives the instability of the latter: the derivative with respect to a model parameter theta is 2 Re sum over k not equal to i of (v_i^* A v_k)(v_k^* (partial_theta M) v_i)/(lambda_i-lambda_k). At a protected crossing coupled by B = partial_theta M, the gap is 2 times the absolute value of theta_break times the absolute value of v_j^* B v_i, plus O(theta_break^2), so the ungated gradient scales as 1 divided by theta_break. The proposed loss uses block traces for forced sectors and per-level observables for simple sectors.

## Key formulas

- $$\partial_{\theta}\langle v_i|A|v_i\rangle=2\,\mathrm{Re}\!\!\sum_{k\neq i}\frac{\langle v_i|A|v_k\rangle\,\langle v_k|\partial_{\theta}M|v_i\rangle}{\lambda_i-\lambda_k}$$
- $$\mathcal{C}=\{C\in\mathbb{C}^{n\times n}:CM_a-M_aC=0\ \text{for every }a=1,\ldots,K\}$$
- $$\mathcal{Z}(\mathcal{C})=\{Z\in\mathcal{C}:ZC_b-C_bZ=0\ \text{for every commutant basis element }C_b\}$$
- $$\mathcal{L}_{\mathrm{gate}}=\sum_{s\in\mathcal{S}_{\mathrm{forced}}}w_s\left(\frac{\operatorname{tr}(P_sA)}{\operatorname{rank}(P_s)}-\bar a_s^{\,\mathrm{target}}\right)^2+\sum_{i\in\mathcal{S}_{\mathrm{simple}}}w_i\left(\langle v_i|A|v_i\rangle-a_i^{\mathrm{target}}\right)^2$$

## Implementation notes

First integrate the method as the spectral supervision loss for a network f_phi(x) that predicts a Hermitian matrix M_hat_phi(x) and, optionally, an observable A_hat_phi(x). Do not differentiate through individual eigenvectors for symmetry-forced blocks. If the symmetry is fixed across the dataset, compute the gate once; otherwise recompute it every few epochs from reference operators. For pseudocode, vectorize a complex matrix C into real and imaginary coordinates, construct a real linear constraint matrix L encoding vec(C M_a - M_a C) = 0, and compute L = U Sigma V transpose. Retain right singular vectors with singular value below tau_comm, reshape them into a commutant basis C_b, and Hermitian-symmetrize each basis element. Construct a second constraint matrix encoding vec(Z C_b - C_b Z) = 0, compute its nullspace, draw a random Hermitian linear combination Z of the resulting basis, and eigendecompose Z = Q diag(z) Q conjugate-transpose. Group eigenvalues of Z within tau_center and form P_s = Q_s Q_s conjugate-transpose. During each training step, eigendecompose M_hat. For forced blocks compute tr(P_s A_hat) divided by rank(P_s); for simple sectors compute v_i conjugate-transpose A_hat v_i. Add squared errors to the appropriate reference targets. The mathematical quantities are the two nullspaces, the center element, and the projectors. Estimate tau_comm from known operator noise, initially using c times the estimated noise standard deviation times square root of n, and sweep c. The first experiment should use an MLP predicting 8 by 8 Hermitian matrices in a synthetic two-sector family with a tunable protected crossing. Compare ordinary eigenvector loss, fixed epsilon gap regularization, and this gated loss. Record gradient norms near the crossing, NaN rate, final observable error, and robustness under additive operator noise. Success requires bounded gradients and accurate block observables at the crossing without sacrificing per-level accuracy away from it.

## Verification

- Status: beats_baseline
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: helps
- Verdict: Built commutant and center nullspace extraction, projector construction, and gated block-trace targets in commutant_gate.py. The toy verification confirmed the predicted inverse-gap gradient law exactly (log-log slope -1.000, ratios 1.0 across six gaps), recovered rank-2 forced sectors with zero commutation error, and showed rotation and internal-splitting sensitivity below 1.2e-16 and 0 respectively. This demonstrates the proposed mechanism, though it is not yet a neural-network training win.

### Mechanism check

- Verdict: Built commutant and center nullspace extraction, projector construction, and gated block-trace targets in commutant_gate.py. The toy verification confirmed the predicted inverse-gap gradient law exactly (log-log slope -1.000, ratios 1.0 across six gaps), recovered rank-2 forced sectors with zero commutation error, and showed rotation and internal-splitting sensitivity below 1.2e-16 and 0 respectively. This demonstrates the proposed mechanism, though it is not yet a neural-network training win.
- Confidence: 9/10
- Limitations: No MLP training experiment, equal-step loss comparison, additive-noise robustness sweep, CUDA test, finite-epsilon regularization baseline, or large-scale numerical conditioning analysis was performed. The verification uses an exactly known two-sector synthetic family and fixed projectors.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0081
- Paired wins: 8/8
- Benchmark verdict: idea better (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/650/bench_report.json)
- [commutant_gate.py](https://synthcore.org/code/650/commutant_gate.py)
- [operator_track.py](https://synthcore.org/code/650/operator_track.py)
- [report.md](https://synthcore.org/code/650/report.md)
- [report_bench_2026-08-31T210537.md](https://synthcore.org/code/650/report_bench_2026-08-31T210537.md)
- [results.json](https://synthcore.org/code/650/results.json)
- [run_bench.py](https://synthcore.org/code/650/run_bench.py)
- [run_experiment.py](https://synthcore.org/code/650/run_experiment.py)
- [Download all files as ZIP](https://synthcore.org/download/650)

## Disclaimer

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