Localized topological defects inherently possess a multiscale character. While their microstructure configuration depends on the specific physical system, their topological features and mutual interactions can be described on the macroscale in terms of a particle representation. However, determining the physical properties associated with a given defect pattern often requires knowledge of the underlying microscopic structure. In this study, we extend a Wasserstein generative adversarial neural network by incorporating physical constraints and Fourier-space information to generate microscopic spin configurations consistent with prescribed macroscopic patterns and thermodynamic parameters. Using the two-dimensional XY model as a test case, where vortex-antivortex pairs act as long-range interacting defects, we show that the model generates spin configurations that accurately reproduce magnetization, susceptibility, helicity modulus, and spin-spin correlations over a wide range of temperatures below the Kosterlitz-Thouless transition. At the same time, deviations in the specific heat reveal limitations in reproducing higher-order energy fluctuations. A complementary analysis based on topological data analysis uncovers subtle differences in global spin-correlation structures at near-critical temperatures that are not apparent from conventional correlation functions alone. These results demonstrate both the promise and current limitations of generative approaches for multiscale studies of defect-dominated spin systems and, at the same time, highlight topological methods as valuable tools for characterizing critical behavior.
Localized topological defects inherently possess a multiscale character. While their microstructure configuration depends on the specific physical system, their topological features and mutual interactions can be described on the macroscale in terms of a particle representation. However, determining the physical properties associated with a given defect pattern often requires knowledge of the underlying microscopic structure. In this study, we extend a Wasserstein generative adversarial neural network by incorporating physical constraints and Fourier-space information to generate microscopic spin configurations consistent with prescribed macroscopic patterns and thermodynamic parameters. Using the two-dimensional XY model as a test case, where vortex-antivortex pairs act as long-range interacting defects, we show that the model generates spin configurations that accurately reproduce magnetization, susceptibility, helicity modulus, and spin-spin correlations over a wide range of temperatures below the Kosterlitz-Thouless transition. At the same time, deviations in the specific heat reveal limitations in reproducing higher-order energy fluctuations. A complementary analysis based on topological data analysis uncovers subtle differences in global spin-correlation structures at near-critical temperatures that are not apparent from conventional correlation functions alone. These results demonstrate both the promise and current limitations of generative approaches for multiscale studies of defect-dominated spin systems and, at the same time, highlight topological methods as valuable tools for characterizing critical behavior.
The application of generative modeling to many-body physics offers a promising pathway for analyzing high-dimensional state spaces of spin systems. However, unlike computer vision tasks where visual fidelity suffices, physical systems require the rigorous reproduction of higher-order statistical moments and thermodynamic quantities. While Score-Based Generative Models (SGMs) have emerged as a powerful tool, their standard formulation on Euclidean embedding space is ill-suited for continuous spin systems, where variables inherently reside on a manifold. In this work, we demonstrate that training on the Euclidean space compromises the model's ability to learn the target distribution as it prioritizes to learn the manifold constraints. We address this limitation by proposing the use of Manifold-Aware Score-Based Generative Modeling framework applied to the 64x64 2D XY model (a 4096-dimensional torus). We show that our method estimates the theoretical Boltzmann score with superior precision compared to standard diffusion models. Consequently, we successfully capture the Berezinskii-Kosterlitz Thouless (BKT) phase transition and accurately reproduce second-moment quantities, such as heat capacity without explicit feature engineering. Furthermore, we demonstrate zero-shot generalization to unseen lattice sizes, accurately recovering the physics of variable system scales without retraining. Since this approach bypasses domain-specific feature engineering, it remains intrinsically generalizable to other continuous spin systems.
Detecting the topological Kosterlitz-Thouless (KT) transition in the prototypical two-dimensional (2D) XY model using unsupervised machine learning methods has long been a challenging problem due to the lack of suitable order parameters. To address this issue, we begin with a conventional real-valued restricted Boltzmann machine (RBM) (RBM-xy), which uses exponential conditional probabilities to generate visible units. We then develop a novel real-valued RBM (RBM-CosSin) featuring nonlinear cos/sin activation, whose visible units follow the von Mises distribution. Our findings reveal that RBM-CosSin effectively learns the underlying Boltzmann distribution of 2D XY systems and generates authentic XY configurations that accurately capture both thermodynamics and topological order (vortex). Furthermore, we demonstrate that it is possible to extract phase transition information, including the KT transition, from the weight matrices without relying on prior physics knowledge.
In this paper, we apply machine learning methods to study phase transitions in certain statistical mechanical models on the two-dimensional lattices, whose transitions involve nonlocal or topological properties, including site and bond percolations, the XY model, and the generalized XY model. We find that using just one hidden layer in a fully connected neural network, the percolation transition can be learned and the data collapse by using the average output layer gives correct estimate of the critical exponent ν. We also study the Berezinskii-Kosterlitz-Thouless transition, which involves binding and unbinding of topological defects, vortices and antivortices, in the classical XY model. The generalized XY model contains richer phases, such as the nematic phase, the paramagnetic and the quasi-long-range ferromagnetic phases, and we also apply machine learning method to it. We obtain a consistent phase diagram from the network trained with only data along the temperature axis at two particular parameter Δ values, where Δ is the relative weight of pure XY coupling. Aside from using the spin configurations (either angles or spin components) as the input information in a convolutional neural network, we devise a feature engineering approach using the histograms of the spin orientations in order to train the network to learn the three phases in the generalized XY model and demonstrate that it indeed works. The trained network by using system size L×L can be used to the phase diagram for other sizes (L^{'}×L^{'}, where L^{'}≠L) without any further training.
This study presents a temperature-conditioned deep generative approach for efficiently generating spin configurations of the two-dimensional (2D) Ising model. The method employs a convolutional generator network, conditioned on spin states, temperature embeddings, and random noise, to generate thermodynamically accurate spin configurations on a 2D square lattice. Physics-based constraints, derived from magnetization, energy, and nearest-neighbor correlations obtained via Monte Carlo simulations, are integrated as auxiliary loss terms during training to ensure physical consistency. The model accurately captures phase transition behaviors near the critical temperature and supports the scalable generation of synthetic configurations for further analysis. Investigations across lattice sizes L=16, 32, and 64 demonstrate close alignment with Monte Carlo baselines, with generated configurations achieving mean absolute errors as low as 0.0016 for magnetization, 0.0063 for energy, and 0.0016 for correlation in the L=64 case. Phase classification using standard machine learning models further validates the quality of the generated data, with ensemble classifiers yielding F1 scores above 0.99. These findings highlight the proposed framework as a scalable, computationally efficient solution for generating spin configurations in an Ising model.
Abstract In this work, we explore the statistical system's configuration generation with generative models from Deep Learning to go beyond conventional Monte Carlo methods. Specifically, we devise a conditional generative adversarial network (cGAN) for the Ising system spin configuration generation, and we demonstrate it's working outside the training range of temperature for the ensemble of configurations. Being different from the original GAN design, we add a further recognizer network for the constraint on the conditional parameters (in our case temperature) and also provide a diversity benefit for the generative model. We showed that the newly proposed cGAN here can learn the distribution of the Ising model for different temperatures, which can generate spin configuration efficiently with correct (within a probability distribution) temperature estimation for the microscopic configurations. Moreover, without information about criticality provided inside the training data set, it is also shown that the developed cGAN can generate Ising spin configurations around the phase transition point with the order parameter (mean magnetization) reasonably well-match to the conventional MCMC simulation but with parallel sampling advantage. We also compared typical spin configurations from cGAN with specified conditional temperature to be the critical temperature with samples simulated by MCMC, which visibly is not distinguishable. This thus can possibly help to avoid critical slowing-down as shown in the traditional Monte Carlo method.
In recent years Machine Learning has proved to be successful in many technological applications and scientific tasks, such as image and speech recognition, natural language
understanding and more. In this work we apply both supervised and unsupervised Machine Learning to three key problems in statistical physics: design of Hamiltonian from data,
phase recognition and study of critical properties of a system undergoing phase transition.
As an example of model design, we use a dataset with spin configurations and corresponding energies randomly sampled from a one dimensional Ising model. We then make two
guesses for the correct Hamiltonian: the former involving interactions of spins with an external local field, the latter involving two body interactions among spins.
The coupling constants are determined with a linear penalized regression, comparing the effects of L1 and L2 penalization terms of the cost function. We pay specific attention
to the problem of overfitting and to the validation process, which is critical for accepting or rejecting the proposed model.
The phase recognition problem is faced with the two dimensional Ising and XY models as examples. After showing the limits of a simple softmax regression for this task,
we build suitable neural networks to overcome these limits. In particular, a feed forward network is built and the learning process is investigated for the Ising model;
while a more sophisticated convolutional network is proposed for the XY model in order to detect local topological structures.
The last part of the work is dedicated to the unsupervised study of phase transitions, and the determination of critical properties (order parameter, critical
temperature, critical exponents). The discussed techniques are Principal Component Analysis (PCA) for dimensional reduction and K-means clustering for organizing data into
subsets with specific properties. PCA is applied to the two dimensional Ising, Potts and XY models, and it is used to find suitable order parameters. The study of the
proposed order parameter as a function of temperature provides evidence of phase transition, and a finite size scaling allows to extrapolate both the critical temperature
in the thermodynamic limit, and the ν critical exponent for the correlation length. K-means clustering is applied to equilibrium configurations of the two dimensional
Ising model, before and after the dimensional reduction, and the critical temperature is estimated. Moreover, a clustering of relaxation curves of magnetization in a
Monte Carlo dynamics is used to build a phase diagram on the parameter space of temperature and magnetic field.
A synergy of C++, Python and Wolfram Mathematica 12.0 is used throughout this work in order to sample input datasets and to build and control customized neural networks
and learning tools. The most relevant codes are provided in the appendix.