We present a set of tools for mapping general stochastic programs to thermodynamic hardware designed for energy-efficient stochastic sampling. Given a target stochastic program expressed as a Directed Factor Graph (DFG) of stochastic channels, or equivalently as a Parametrized Stochastic Circuit (PSC), we first introduce a method to approximately compile each factor in the DFG to an Energy-Based Model (EBM) that is native to the hardware. We then analyze how the error of the compiled DFG accumulates from the per-factor errors, and introduce two training refinements, context matching and trajectory-level REINFORCE post-training, which can reduce the residual error left by training each factor in isolation. The \texttt{thermalizers} framework takes a stochastic program expressed in the \texttt{torx} library and replaces its factors with thermodynamic kernels implemented and sampled using the \texttt{thrml} library. We demonstrate it on several example applications, including a market simulator that learns the joint day-to-day dynamics of a panel of financial time series from recorded market history alone, a probabilistic model from mathematical ecology, Gibbs sampling of an EBM the hardware cannot natively express, and a sequential Bayesian design loop over a Gaussian stochastic circuit.
We present a set of tools for mapping general stochastic programs to thermodynamic hardware designed for energy-efficient stochastic sampling. Given a target stochastic program expressed as a Directed Factor Graph (DFG) of stochastic channels, or equivalently as a Parametrized Stochastic Circuit (PSC), we first introduce a method to approximately compile each factor in the DFG to an Energy-Based Model (EBM) that is native to the hardware. We then analyze how the error of the compiled DFG accumulates from the per-factor errors, and introduce two training refinements, context matching and trajectory-level REINFORCE post-training, which can reduce the residual error left by training each factor in isolation. The \texttt{thermalizers} framework takes a stochastic program expressed in the \texttt{torx} library and replaces its factors with thermodynamic kernels implemented and sampled using the \texttt{thrml} library. We demonstrate it on several example applications, including a market simulator that learns the joint day-to-day dynamics of a panel of financial time series from recorded market history alone, a probabilistic model from mathematical ecology, Gibbs sampling of an EBM the hardware cannot natively express, and a sequential Bayesian design loop over a Gaussian stochastic circuit.
We introduce Parametrized Stochastic Circuits (PSCs), a gate-based intermediate representation for programmable stochastic dynamics in which typed local stochastic kernels with tunable parameters compose over explicit binary, categorical, and continuous wires, and \texttt{torx}, an open-source JAX framework for constructing, executing, and differentiating them. PSCs' data types and stochastic kernels are chosen to align closely with the native operations exposed by emerging probabilistic hardware. In this way, stochastic algorithms can be designed directly in terms of the operations the hardware executes natively, so that the energy advantage arising at this level is not lost on mappings that introduce substantial decomposition, communication, or control overhead. We demonstrate the framework on a variety of example applications such as random walks on graphs, discrete diffusion, stochastic graph networks, jump diffusion and Ising sampling. We also report a hardware experiment in which probabilistic bits on the X0 subthreshold CMOS test chip, hosted by the XTR-0 desktop platform, provide physical randomness for Metropolis-Hastings and importance-sampling estimators, yielding estimates consistent with a software pseudorandom baseline.
Efficient sampling from Boltzmann distributions over discrete variables is a fundamental operation in a wide range of applications. While fast non-MCMC samplers have recently emerged as promising alternatives to conventional MCMC methods, their practical use for probabilistic learning remains hindered by the difficulty of estimating the effective temperature of the generated samples. In this work, we begin by introducing Langevin simulated bifurcation (LSB), a Boltzmann sampler that enables fast and parallel sampling with accuracy comparable to sequential MCMC methods. To address the challenge of unknown effective temperature, we propose conditional expectation matching (CEM), an efficient estimation method applicable to energy-based models (EBMs) with exploitable conditional independence structures. Building on these components, we further develop a learning framework, termed sampler adaptive learning (SAL), which adaptively adjusts the model temperature to match that of the distribution induced by fast non-MCMC sampling. We demonstrate the effectiveness of LSB, CEM, and SAL on semi-restricted Boltzmann machines (SRBMs), a class of EBMs that are difficult to train using conventional approaches. LSB achieves orders-of-magnitude acceleration over Gibbs sampling while maintaining comparable or higher accuracy, and CEM enables accurate temperature estimation of the resulting distribution with negligible computational overhead. As a consequence, SAL enables efficient training of SRBMs and outperforms conventional Boltzmann machine learning methods on synthetic spin-glass datasets. In addition, the trained models achieve strong performance across multiple tasks. These results establish LSB as a fast and accurate Boltzmann sampler and provide key insights that enable practical applications of fast non-MCMC sampling methods via efficient temperature estimation with CEM.
Understanding whether environmental conditions bias the statistical weight of specific genomic configurations requires a framework connecting molecular interactions, thermal fluctuations, and sequence-level observables. Here, we model DNA as an open quantum system coupled to an environmental thermal bath (represented as an external bosonic field) and parameterize the underlying molecular interaction energies (effective Hamiltonian terms) directly from prescribed nucleotide sequences. To evaluate sequence distributions at thermodynamic equilibrium, we compare two finite-temperature strategies at fixed inverse temperature (β=1): classical Bayesian optimization targeting the exact thermodynamic equilibrium distribution (the Gibbs state), and quantum simulation using a Variational Quantum Thermalizer (VQT) implemented via a nine-layer parameterized quantum circuit. Both methods optimize the same interaction energy model and target-sequence objective across short oligomers (N=2--5 base pairs), using 200 outer evaluations. Benchmarking against a uniform sequence distribution, exact-Gibbs optimization enhances target-sequence probabilities by factors of 9.11, 25.64, 54.51, and 159.87. The VQT approach similarly yields substantial target enrichment across all sequence lengths, achieving enhancement factors between 9.85 and 62.77. By evaluating the VQT-selected Hamiltonians against exact Gibbs calculations, we decouple optimization errors in parameter learning from approximation errors inherent to the variational quantum circuit. While concordance with the exact-Gibbs optimum is high in shorter oligomers, larger systems exhibit heightened sensitivity to variational thermal approximations. These results demonstrate that environment-induced sequence biases can be systematically captured within a variational quantum simulation framework, bridging biophysical models of DNA thermodynamics with quantum algorithms for finite-temperature state preparation. Crucially, the resulting equilibrium probabilities represent intrinsic thermodynamic biases rather than realized evolutionary substitution rates, which remain governed by kinetic activation barriers, replication fidelity, and enzymatic DNA repair.
Programmable quantum annealers are used for optimization, probabilistic sampling, and simulation, but their performance is commonly reported without the energy exchanged during computation. Here we characterize the D-Wave quantum annealer as a closed thermodynamic cycle. From initial and final Ising energies and an effective temperature fitted to the output distribution, we obtain lower bounds on entropy production, environment energy exchange, work, and power. By varying the prepared distribution and the reverse annealing turning point, we map heater-, accelerator-, refrigerator-, and engine-compatible regimes in one dimensional chains and higher connectivity instances, and apply the same analysis to Advantage and Advantage2 hardware. For an encoded optimization problem, the measured processor energy change states whether final candidates improve or worsen the programmed objective on average. For sampling, the fitted temperature provides an operational measure of how strongly probability is concentrated among low energy configurations. The thermodynamic mode therefore adds information absent from solution quality or runtime alone: it distinguishes driven refinement, net heating, and heat pumping while quantifying their energetic consequences. This framework connects quantum optimization, probabilistic computing, statistical physics simulation, hardware diagnostics, and energy-aware assessment without assuming that a thermodynamic label alone determines computational performance.
Various emerging technologies promise advantages with respect to integration density, performance or power consumption, at the cost of approximate or probabilistic behavior. Approximate computing, where limited computational inaccuracies are tolerated at the system or application level is therefore of increasing interest. This paper investigates the use of stochastic computing (SC) as a tool for approximate simulation of probabilistic behavior. SC has the advantage of processing probabilities directly at very low hardware cost. It also allows accuracy to be traded for run-time in a natural way (progressive precision). AS a target technology to be simulated, we choose quantum computing circuits, whose behavior is inherently probabilistic and cannot be efficiently simulated by conventional (classical) means. We show how complex operations such as superposition and entanglement can be handled by SC. Finally, we report experimental results on software-based simulation of representative quantum circuits, both stand-alone and FPGA-supported. The results show that the SC implementations are orders of magnitude more compact than those based on classical circuits. Accurate results may require very long simulation runs, but run-times can be reduced by exploiting SC's progressive precision property.
Thermal equilibrium states of many-body Hamiltonians are essential for probing quantum chaos, finite-temperature phases of matter, and training quantum machine learning models, yet generating large collections of such states across different Hamiltonians remains costly with existing methods. We introduce a powerful operation, the quantum thermal-drift channel, to construct a measurement-controlled sampling algorithm that autonomously generates thermal states together with their system Hamiltonians as labels for general physical models. We prove that our algorithm is efficient: the total gate count scales polynomially with system size and quadratically with inverse temperature, providing the first polynomial resource bound for random thermal state generation. We characterize the distribution of sampled Hamiltonians as a normal distribution reweighted by partition functions, which quantifies a trade-off between sampling accuracy and effective label range. Level-spacing statistics computed from sampled thermal states of a 2D transverse-field Ising model show a crossover to Wigner-Dyson universality, confirming that the sampler captures nontrivial chaotic correlations. Finally, a variational quantum classifier trained on the generated dataset achieves near-optimal accuracy in predicting Hamiltonian properties of unseen states. These results establish a scalable, quantum-native route for thermodynamic simulation and labeled quantum data generation in many-body systems.