# Lee-Yang Phase-Diagram Loss for Neural Potentials

- ID: 1999
- Canonical URL: https://synthcore.org/idea/1999/lee-yang-phase-diagram-loss-for-neural-potentials
- API JSON: https://synthcore.org/api/idea/1999.json
- API Markdown: https://synthcore.org/api/idea/1999.md
- Verification status: mechanism_failed
- Source: [arXiv:2608.08546](https://arxiv.org/abs/2608.08546)
- Category: training
- Solves: accuracy, generalization
- ML areas: optimizer, loss, training-dynamics
- Math tags: statistical-mechanics, complex-analysis, optimization
- Ratings: usefulness 7/10; difficulty 8/10; novelty 9/10

## Idea description

Train a neural energy model using a loss that matches the modulus of its partition function in a small complex neighborhood of target phase-transition points. Instead of fitting only local energies or a selected order parameter, the model is forced to place its finite-size Lee-Yang zero minima at the correct temperature, pressure, or chemical-potential coordinates, providing a global thermodynamic constraint.

## Mathematical statement

For a system with neural energy U_theta(x), inverse temperature beta = 1/(k_B T), extensive observable M(x), and complex field h = h_r + i h_i, define Z_theta(beta,h) = integral dx exp[-beta(U_theta(x) - h M(x))]. Relative to samples from a real reference state h_r, the normalized complex partition function is phi_theta(h_i;h_r) = average[exp(i beta h_i M)] over the neural model at h_r. Lee-Yang zeros satisfy Z = 0, equivalently phi = 0 after normalization; in finite systems the minimum h_i*(h_r,N) = argmin over h_i > 0 of |phi_theta(h_i;h_r)| estimates the closest zero. The training loss compares log moduli across state points and imaginary-field values, with epsilon preventing numerical singularities. Near a first-order transition, the closest zero is expected to approach the real axis approximately as N^(-1), while it remains separated from the real axis away from coexistence.

## Key formulas

- $$Z_{theta}(beta,h)=integral dx exp[-beta(U_{theta}(x)-h M(x))], quad h=h_r+i h_i.$$
- $$phi_{theta}(h_i;h_r)=Z_{theta}(beta,h_r+i h_i)/Z_{theta}(beta,h_r)=average[exp(i beta h_i M(x))]_{theta,h_r}, quad h_i^*=argmin_{h_i>0}|phi_{theta}(h_i;h_r)|.$$
- $$L_{LY}(theta)=sum_{j,k} w_{jk}[log(|phi_{theta}(h_{i,k};q_j)|+epsilon)-log(|phi_{target}(h_{i,k};q_j)|+epsilon)]^2+lambda L_{data}(theta).$$
- $$Im(h_1(N)) approximately N^{-1} near a first-order transition, while Im(h_1(N)) does not approach zero away from the transition.$$

## Implementation notes

Integrate this as an auxiliary loss for a neural interatomic potential, neural Hamiltonian, or differentiable energy-based model. For each training state q_j = (T_j,p_j), run short equilibrium simulations using the current U_theta, collect configurations x_n and the extensive observable M_n associated with the field being complexified. For a liquid-gas transition, use particle number or volume; for a magnetic transition, use magnetization; for a structural transition, use an extensive bias variable that distinguishes the phases. Pseudocode: (1) sample x_n from the current model at q_j; (2) for each imaginary-field value h_i,k compute phi_hat_jk = (1/N_s) sum_n exp(i beta_j h_i,k M_n); (3) compute the log-modulus loss against target curves or target minimum locations; (4) backpropagate through differentiable energy evaluations or use a reweighting estimator with the simulation samples treated as fixed; (5) update theta and periodically resample because the distribution changes. The paper supplies the complex partition-function objective and the interpretation of zeros; sampling variance, target curves, and finite-size corrections must be estimated empirically. The first cheap experiment is a two-dimensional Lennard-Jones fluid with a small neural correction to the analytic potential, system sizes N = 64, 128, and 256, coexistence temperatures from reference simulation as targets, and ordinary energy/force fitting as baseline. The quantitative prediction is that the learned model's minimum h_i*(N) decreases approximately as N^(-1) at the target transition but remains bounded away from zero at off-transition temperatures. Accept the mechanism only if the inferred transition agrees with the reference within 20 percent and the fitted finite-size exponent is reasonably close to 1 for the first-order case. Held-out enthalpy and heat capacity should also be measured as secondary validation.

## Verification

- Status: mechanism_failed
- Mechanism evidence: yes
- Mechanism confirmed: no
- Verdict: Built and numerically verified a differentiable Lee–Yang partition-function loss MVP plus an exactly solvable two-phase sweep. The normalized complex-partition identity was correct to 1.1e-16, coexistence gave h1 proportional to N^-1 with observed exponent -1.0000, and the finite-sample modulus floor followed the predicted Ns^-1/2 scaling with exponent -0.540. However, away from coexistence the minimum location still scaled as N^-1 rather than remaining bounded away from zero, and the neural modulus fit did not outperform the moment baseline and showed an identifiability limitation.

### Mechanism check

- Verdict: Built and numerically verified a differentiable Lee–Yang partition-function loss MVP plus an exactly solvable two-phase sweep. The normalized complex-partition identity was correct to 1.1e-16, coexistence gave h1 proportional to N^-1 with observed exponent -1.0000, and the finite-sample modulus floor followed the predicted Ns^-1/2 scaling with exponent -0.540. However, away from coexistence the minimum location still scaled as N^-1 rather than remaining bounded away from zero, and the neural modulus fit did not outperform the moment baseline and showed an identifiability limitation.
- Confidence: 9/10
- Limitations: This was an exactly solvable two-state toy system, not a Lennard-Jones fluid or neural interatomic potential. No molecular-dynamics sampling, pressure/temperature phase diagram, force fitting, held-out thermodynamic observables, resampling drift, or GPU training was tested.

## Artifacts

- [lee_yang_toy.py](https://synthcore.org/code/760/lee_yang_toy.py)
- [ly_mvp.py](https://synthcore.org/code/760/ly_mvp.py)
- [mvp_results.json](https://synthcore.org/code/760/mvp_results.json)
- [report.md](https://synthcore.org/code/760/report.md)
- [results.json](https://synthcore.org/code/760/results.json)
- [Download all files as ZIP](https://synthcore.org/download/760)

## Disclaimer

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