It is a long-standing challenge to accurately and efficiently compute thermodynamic quantities of many-body systems at thermal equilibrium. The conventional methods, e.g., Markov chain Monte Carlo (MCMC), require many steps to equilibrate. The recently developed deep learning methods can perform direct sampling, but only work at a single trained temperature point and risk biased sampling. Here, we propose a variational method for canonical ensembles with differentiable temperature, which gives thermodynamic quantities as continuous functions of temperature akin to an analytical solution. The proposed method is a general framework that works with any explicit density generative model. At optimal, the model is theoretically guaranteed to be the unbiased Boltzmann distribution. We validated our method by calculating phase transitions (PTs)in the Ising and XY models, demonstrating that our direct-sampling simulations are as accurate as MCMC, but more efficient. Moreover, our differentiable free energy aligns closely with the exact one to the second-order derivative, indicating that the variational model captures the subtle thermal transitions at the PTs. This functional dependence on external parameters is a fundamental advancement in combining the exceptional fitting ability of deep learning with rigorous physical analysis.
Shuo-Hui Li is a Research Assistant Professor in the Department of Physics at the Hong Kong University of Science and Technology (HKUST). Prior to this role, he completed his PhD at the Institute of Physics, Chinese Academy of Sciences (2020) and served as a postdoctoral scholar at HKUST from 2020 to 2022. His research bridges the intersection of deep generative models and statistical physics, with a focus on developing innovative methodologies for direct-sampling simulations and physics-informed deep learning models. These contributions advance computational approaches to complex systems analysis and interdisciplinary applications in theoretical physics and artificial intelligence.