# Harmonic-coordinate neural PDE ansatz

- ID: 892
- Canonical URL: https://synthcore.org/idea/892/harmonic-coordinate-neural-pde-ansatz
- API JSON: https://synthcore.org/api/idea/892.json
- API Markdown: https://synthcore.org/api/idea/892.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2607.14132](https://arxiv.org/abs/2607.14132)
- Category: architecture
- Solves: accuracy, stability, sample-efficiency
- ML areas: mlp, world-model, geometry
- Math tags: pde, differential-geometry, complex-analysis, geometry
- Ratings: usefulness 7/10; difficulty 5/10; novelty 7/10

## Idea description

Build a complex-valued coordinate map q(x) whose components are harmonic and whose gradients are mutually null, then feed q(x) into an otherwise unconstrained neural function v. Any learned output of the form u(x)=v(q(x)) is analytically harmonic when the constraints are satisfied, so the network does not need to rediscover the Laplace structure from collocation data. This is especially suitable for two-dimensional elliptic PDEs, where q=x+iy is the canonical example.

## Mathematical statement

Definition 1 states that q=q(x,y) is harmonic if u(x,y)=v(q(x,y)) solves the Laplace equation for every smooth v. For a scalar complex variable q and Euclidean Laplacian, the chain rule gives Delta[v(q)]=v'(q)Delta q+v''(q)[(partial_x q)^2+(partial_y q)^2]. Therefore the sufficient differential conditions are Delta q=0 and (partial_x q)^2+(partial_y q)^2=0; the second condition is the complex eikonal or null-gradient condition. For q=x+iy, Delta q=0 and 1^2+i^2=0, explaining why arbitrary analytic v(q) is harmonic. The trainable model estimates q and v, while automatic differentiation evaluates these residuals.

## Key formulas

- $$\left(\dfrac{\partial^{2}}{\partial x^{2}}+\dfrac{\partial^{2}}{\partial y^{2}}\right)u(x,y)=0.$$
- $$u(x,y)=v(q(x,y))\quad\text{is harmonic for every smooth }v\ \Longleftrightarrow\ \Delta q=0,\qquad (\partial_xq)^2+(\partial_yq)^2=0.$$
- $$\Delta[v(q)]=v'(q)\,\Delta q+v''(q)\left[(\partial_xq)^2+(\partial_yq)^2\right].$$
- $$\mathcal L=\mathcal L_{\mathrm{data}}+\lambda_h\frac{1}{B}\sum_{i=1}^{B}|\Delta q_\phi(x_i)|^2+\lambda_e\frac{1}{B}\sum_{i=1}^{B}\left|(\partial_xq_\phi(x_i))^2+(\partial_yq_\phi(x_i))^2\right|^2.$$

## Implementation notes

Integrate this as a coordinate front-end for a neural PDE solver. The input is a collocation point x=(x,y); a small complex MLP q_phi(x)=q_R(x)+i q_I(x) produces one complex coordinate, and a second MLP v_theta receives [q_R,q_I] and predicts the physical field u. Use real automatic differentiation: compute q_x, q_y, q_xx, and q_yy separately for the real and imaginary parts. At each batch, form lap_q=q_xx+q_yy and eik=q_x*q_x+q_y*q_y, retaining complex arithmetic as pairs of real tensors. Optimize loss = PDE residual for u plus boundary/data loss plus lambda_h*mean(abs(lap_q)^2) + lambda_e*mean(abs(eik)^2). A practical loop is: x.requires_grad=True; q=q_phi(x); u=v_theta(real(q),imag(q)); r_pde=laplacian(u)-f(x); r_h=laplacian(q); r_e=qx*qx+qy*qy; loss=mean(r_pde**2)+boundary_loss+lambda_h*mean(abs(r_h)**2)+lambda_e*mean(abs(r_e)**2); backpropagate and update phi and theta. Initialize q close to x+i*y by setting the final layer to a fixed affine map plus a small trainable residual, and ramp lambda_h and lambda_e over the first 10 percent of training. The mathematical constraints are exact in the infinite-capacity limit; residual magnitudes are estimated empirically by autodiff. First test on harmonic functions and Poisson problems on the unit square or disk, comparing a standard MLP and a Fourier-feature MLP at equal parameter count and collocation budget. Success means lower Laplace residual and boundary error with fewer collocation points, especially on out-of-sample interior points; also test whether freezing q after pretraining makes v train faster.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: harms
- Verdict: Built a PyTorch harmonic-coordinate PDE ansatz with autodiff Laplacian and complex null-gradient residuals, plus a direct MLP baseline. The toy sweep confirmed the mechanism: the canonical q=x+iy identity had zero residual, the perturbed coordinate harmonic defect was exactly 2ε, and the null-gradient defect scaled as ε with observed exponent 1.000 and coefficient 2.0645, matching 4E|x|=2.0645. The ansatz was not an optimization win in this tiny test: baseline test MSE/Laplacian residual were 6.72e-5/0.0438 versus 2.56e-4/0.0875 for the ansatz.

### Mechanism check

- Verdict: Built a PyTorch harmonic-coordinate PDE ansatz with autodiff Laplacian and complex null-gradient residuals, plus a direct MLP baseline. The toy sweep confirmed the mechanism: the canonical q=x+iy identity had zero residual, the perturbed coordinate harmonic defect was exactly 2ε, and the null-gradient defect scaled as ε with observed exponent 1.000 and coefficient 2.0645, matching 4E|x|=2.0645. The ansatz was not an optimization win in this tiny test: baseline test MSE/Laplacian residual were 6.72e-5/0.0438 versus 2.56e-4/0.0875 for the ansatz.
- Confidence: 8/10
- Limitations: Only a small 2D manufactured harmonic problem was tested, with one seed, 500 optimization steps, and no Fourier-feature or Poisson benchmark. The mechanism check verifies coordinate defect scaling but does not test broad PDE families, freezing or pretraining q, equal-FLOP comparisons, or sparse-collocation generalization.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.03935
- Paired wins: 1/8
- Benchmark verdict: idea worse (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/372/bench_report.json)
- [custom_pde_track.py](https://synthcore.org/code/372/custom_pde_track.py)
- [experiment.py](https://synthcore.org/code/372/experiment.py)
- [report.md](https://synthcore.org/code/372/report.md)
- [report_bench_2026-08-31T094230.md](https://synthcore.org/code/372/report_bench_2026-08-31T094230.md)
- [results.json](https://synthcore.org/code/372/results.json)
- [stage2_bench.py](https://synthcore.org/code/372/stage2_bench.py)
- [Download all files as ZIP](https://synthcore.org/download/372)

## Disclaimer

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