Harmonic (Quantum) Neural Networks

Atiyo Ghosh, Antonio A. Gentile, Mario Dagrada, Chul Lee, Seong-Hyok Sean Kim, Hyukgeun Cha, Yunjun Choi, Brad Kim, Jeong-Il Kye, Vincent E. ElfvingarXiv 2022 · DOI

Abstract

Traditional Physics-Informed Neural Networks (PINNs) treat physical laws as soft constraints within a loss function, often leading to optimization challenges and systematic inaccuracies. We present Harmonic Neural Networks, a class of architectures that "bake" the properties of harmonic functions directly into the network structure. By leveraging complex analysis in 2D and vector calculus identities in higher dimensions, these models—both classical and quantum—guarantee adherence to Laplace’s equation by design. Our results demonstrate significant improvements in accuracy and convergence across electrostatics, heat distribution, and fluid dynamics tasks.

Introduction

Many fundamental physical phenomena, including steady-state heat conduction, electrostatics, and potential fluid flow, are governed by Laplace’s equation ($\nabla^2 \phi = 0$). Solutions to this equation are known as harmonic functions. While deep learning has shown promise in solving partial differential equations (PDEs), the standard approach—PINNs—relies on penalizing deviations from the PDE in the loss function. This "soft constraint" often results in a trade-off where the model satisfies the differential equation but fails to accurately fit boundary conditions, leading to the "Laplacian Paradox" where a model appears harmonic but remains numerically inaccurate compared to the ground truth.

Methodology

To address the limitations of soft constraints, we propose architectures that are mathematically incapable of producing non-harmonic outputs.

1. Holomorphic Networks (2D)

In two-dimensional space, any holomorphic (complex-differentiable) function has a real part that is inherently harmonic. By constructing neural networks with complex-valued weights and holomorphic activation functions (e.g., $\sin(z)$, $\exp(z)$), we ensure the output's real component strictly satisfies Laplace’s equation by design.

2. Curl-Driven Networks (CurlNet)

For higher-dimensional problems where complex analysis is less straightforward, we utilize the vector calculus identity $\nabla \cdot (\nabla \times \mathbf{A}) = 0$. Since the gradient of a harmonic function must be divergence-free, representing a conservative field as the curl of a neural network's vector potential provides a robust architectural bias toward harmonicity.

3. Quantum Harmonic Neural Networks

We extend these principles to the quantum realm by employing a specific "imaginary feature map" ($e^{-(x+iy)\hat{H}}$) within a Variational Quantum Circuit. This configuration produces an output guaranteed to be harmonic. Notably, a 4-qubit quantum harmonic network can represent a complex series expansion with 16 terms, showcasing the potential for high expressivity on small quantum devices.

Experimental Results

We evaluated our models against four benchmark problems: electrostatics in heterogeneous media, heat distribution in multiply-connected domains (heat around a triangular heater), robot navigation via potential fields, and 3D fluid flow.

Visual comparison of potential fields around a triangular obstacle for various neural architectures.

As shown in Figure 1, Harmonic NNs (such as the Multiholomorphic and Holomorphic variants) produce significantly cleaner and more physically consistent fields compared to standard PINNs, especially near complex boundaries. Standard PINNs often exhibit jitter or systematic offsets in these regions despite appearing harmonic on the surface.

Quantitative comparison of Harmonic NNs against PINN baselines across physical tasks.

Quantitatively, the architectural constraints lead to dramatic reductions in Root Mean Squared Error (RMSE). In the electrostatics task, the Holomorphic NN achieved an RMSE of $0.3 \pm 0.09$, compared to $6.7 \pm 1.8$ for the PINN. Similarly, in the complex heat distribution task, the Multiholomorphic approach reached an RMSE of $0.2 \pm 0.09$, significantly outperforming the PINN's $2.4 \pm 0.0006$ (see Figure 3).

Discussion and Conclusion

The primary insight of this work is that hard architectural constraints are superior to soft loss-function penalties for physical modeling. While PINNs often achieve low Laplacian error, they frequently fail to capture the true underlying field. In contrast, Harmonic NNs maintain physical validity while accurately fitting boundary data.

Future research will explore Quaternionic Neural Networks to extend exact harmonicity to 3D and 4D spaces. Additionally, while our quantum simulations are promising, validating these models on noisy intermediate-scale quantum (NISQ) hardware remains a critical next step.

Summary updated

BibTeX
@misc{ghosh2022harmonic,
  author = {Atiyo Ghosh and Antonio A. Gentile and Mario Dagrada and Chul Lee and Seong-Hyok Sean Kim and Hyukgeun Cha and Yunjun Choi and Brad Kim and Jeong-Il Kye and Vincent E. Elfving},
  title = {{Harmonic (Quantum) Neural Networks}},
  year = {2022},
  eprint = {2212.07462},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.07462},
}
Figure