# Hodge-dual electrostatic loss

- ID: 1315
- Canonical URL: https://synthcore.org/idea/1315/hodge-dual-electrostatic-loss
- API JSON: https://synthcore.org/api/idea/1315.json
- API Markdown: https://synthcore.org/api/idea/1315.md
- Verification status: beats_baseline
- Source: [arXiv:2607.23315](https://arxiv.org/abs/2607.23315)
- Category: optimization
- Solves: stability, speedup, accuracy
- ML areas: loss, training, architecture
- Math tags: convex-analysis, geometry, pde, optimization
- Ratings: usefulness 7/10; difficulty 6/10; novelty 8/10

## Idea description

Replace a jointly optimized scalar electrostatic potential in a neural PDE solver with a dual flux represented by a Hodge curl correction. The resulting inner problem is a positive quadratic minimization with the divergence constraint satisfied exactly, avoiding unstable primal-dual training dynamics.

## Mathematical statement

The paper gives the one-constant elastic density \(W_e(\widetilde{\mathbf n})=\frac K2|\nabla\widetilde{\mathbf n}|^2\), obtained from \(2W_e=K_1(\operatorname{div}\widetilde{\mathbf n})^2+K_2(\widetilde{\mathbf n}\cdot\operatorname{curl}\widetilde{\mathbf n})^2+K_3|\widetilde{\mathbf n}\times\operatorname{curl}\widetilde{\mathbf n}|^2\) when \(K_1=K_2=K_3=K\). Let \(\mathbf n:\Omega\to\mathbb R^3\) be the predicted unit director, \(\varepsilon(\mathbf n)\succ0\) the dielectric tensor, \(\rho\) the charge density, \(\phi\) the scalar potential, and \(\mathbf p=\varepsilon(\mathbf n)\nabla\phi\) the electric displacement. Convex duality transforms the electrostatic solve into \(\min_{\mathbf p:\operatorname{div}\mathbf p=\rho}\frac12\int_\Omega\mathbf p^T\varepsilon(\mathbf n)^{-1}\mathbf p\,dx\). Choose a reference flux \(\mathbf p_0\) with \(\operatorname{div}\mathbf p_0=\rho\), and parameterize \(\mathbf p=\mathbf p_0+\operatorname{curl}\mathbf A\); since \(\operatorname{div}(\operatorname{curl}\mathbf A)=0\), Gauss' law is automatic. Positive definiteness of \(\varepsilon\) makes the flux minimizer unique, apart from vector-potential gauge freedom.

## Key formulas

- $$2W_e(\widetilde{\mathbf n})=K_1(\operatorname{div}\widetilde{\mathbf n})^2+K_2(\widetilde{\mathbf n}\cdot\operatorname{curl}\widetilde{\mathbf n})^2+K_3|\widetilde{\mathbf n}\times\operatorname{curl}\widetilde{\mathbf n}|^2,$$
- $$W_e(\widetilde{\mathbf n})=\frac K2|\nabla\widetilde{\mathbf n}|^2\qquad(K_1=K_2=K_3=K),$$
- $$\min_{\mathbf p:\,\operatorname{div}\mathbf p=\rho}\frac12\int_\Omega\mathbf p^T\varepsilon(\mathbf n)^{-1}\mathbf p\,dx,$$
- $$\mathbf p=\mathbf p_0+\operatorname{curl}\mathbf A,\qquad \mathcal L(\theta,\psi)=\frac K2\int_\Omega|\nabla\mathbf n_\theta|^2dx+\frac12\int_\Omega(\mathbf p_0+\operatorname{curl}\mathbf A_\psi)^T\varepsilon(\mathbf n_\theta)^{-1}(\mathbf p_0+\operatorname{curl}\mathbf A_\psi)dx.$$

## Implementation notes

Integrate this into a neural PDE solver or differentiable field simulator whose network currently predicts both a material field and a scalar electrostatic potential. Let `n_theta(x)` output three channels and normalize them pointwise as `n = raw_n / (norm(raw_n) + 1e-8)`. Let `A_psi(x)` output three vector-potential channels. On a regular 2-D or 3-D grid, calculate spatial derivatives with finite differences or automatic differentiation, compute `curl(A_psi)`, and form `p = p0 + curl(A_psi)`. Construct `p0` once using a constant-coefficient Poisson solve or an analytic flux satisfying `div(p0)=rho`. Use `eps(n) = eps_perp*I + eps_a*n*n^T`, requiring `eps_perp > abs(eps_a)`, and evaluate `0.5 * p.T @ inverse(eps(n)) @ p` at quadrature points. Add the elastic loss `0.5*K*|grad(n)|^2` and any boundary penalties. Alternate 1–5 Adam updates of `psi` with one update of `theta`, or differentiate through 10–30 conjugate-gradient iterations for the inner quadratic solve. The curl parameterization is computed exactly; only `p0`, derivatives, and quadrature are numerical approximations. First test on a unit square or cube with manufactured smooth `rho` and known dielectric tensor. Compare against a primal PINN that alternates optimization of `n` and `phi`. Record Gauss-law residual, total energy, gradient variance, failed runs, and wall-clock time to a fixed energy tolerance. Success is lower residual and fewer unstable runs at equal network evaluations.

## Verification

- Status: beats_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: helps
- Verdict: Built a periodic-grid Hodge-dual electrostatic loss with p=p0+curl(A), anisotropic positive dielectric energy, and exact discrete divergence preservation. The mechanism checks passed: div(curl A) was <=7.45e-9 even at amplitude 1e4, lambda_max*epsilon had 0% spread across epsilon={0.5,1,2,4}, and the gradient-descent transition occurred near the predicted eta*lambda_max=2 boundary. The toy primal and dual quadratic problems had identical nonzero condition numbers, so no universal speedup was observed.

### Mechanism check

- Verdict: Built a periodic-grid Hodge-dual electrostatic loss with p=p0+curl(A), anisotropic positive dielectric energy, and exact discrete divergence preservation. The mechanism checks passed: div(curl A) was <=7.45e-9 even at amplitude 1e4, lambda_max*epsilon had 0% spread across epsilon={0.5,1,2,4}, and the gradient-descent transition occurred near the predicted eta*lambda_max=2 boundary. The toy primal and dual quadratic problems had identical nonzero condition numbers, so no universal speedup was observed.
- Confidence: 8/10
- Limitations: Only a small 2-D periodic finite-difference toy was tested, with constant dielectric scaling and a hand-constructed flux/potential rather than trained neural networks. Boundary conditions, nonconstant anisotropic dielectric fields, manufactured nonzero charge solves, wall-clock comparisons, alternating theta/psi optimization, and CUDA behavior were not tested.

### 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/519/bench_report.json)
- [bench_stage2.py](https://synthcore.org/code/519/bench_stage2.py)
- [hodge_dual.py](https://synthcore.org/code/519/hodge_dual.py)
- [report.md](https://synthcore.org/code/519/report.md)
- [report_bench_2026-08-31T164528.md](https://synthcore.org/code/519/report_bench_2026-08-31T164528.md)
- [results.json](https://synthcore.org/code/519/results.json)
- [run_experiment.py](https://synthcore.org/code/519/run_experiment.py)
- [Download all files as ZIP](https://synthcore.org/download/519)

## Disclaimer

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