-nuts = NUTS(δ; integrator=integrator)</code></pre><h2 id="GPU-Sampling-with-CUDA"><a class="docs-heading-anchor" href="#GPU-Sampling-with-CUDA">GPU Sampling with CUDA</a><a id="GPU-Sampling-with-CUDA-1"></a><a class="docs-heading-anchor-permalink" href="#GPU-Sampling-with-CUDA" title="Permalink"></a></h2><p>There is experimental support for running static HMC on the GPU using CUDA. To do so, the user needs to have <a href="https://github.com/JuliaGPU/CUDA.jl">CUDA.jl</a> installed, ensure the logdensity of the <code>Hamiltonian</code> can be executed on the GPU and that the initial points are a <code>CuArray</code>. A small working example can be found at <code>test/cuda.jl</code>.</p><h2 id="Footnotes"><a class="docs-heading-anchor" href="#Footnotes">Footnotes</a><a id="Footnotes-1"></a><a class="docs-heading-anchor-permalink" href="#Footnotes" title="Permalink"></a></h2><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-1"><a class="tag is-link" href="#citeref-1">1</a>The Euclidean metric is also known as the mass matrix in the physical perspective. See <a href="@ref hamiltonian-mm">Hamiltonian mass matrix</a> for available metrics.</li><li class="footnote" id="footnote-2"><a class="tag is-link" href="#citeref-2">2</a>About the leapfrog integration scheme: Suppose <span>${\bf x}$</span> and <span>${\bf v}$</span> are the position and velocity of an individual particle respectively; <span>$i$</span> and <span>$i+1$</span> are the indices for time values <span>$t_i$</span> and <span>$t_{i+1}$</span> respectively; <span>$dt = t_{i+1} - t_i$</span> is the time step size (constant and regularly spaced intervals), and <span>${\bf a}$</span> is the acceleration induced on a particle by the forces of all other particles. Furthermore, suppose positions are defined at times <span>$t_i, t_{i+1}, t_{i+2}, \dots $, spaced at constant intervals $dt$</span>, the velocities are defined at halfway times in between, denoted by <span>$t_{i-1/2}, t_{i+1/2}, t_{i+3/2}, \dots $, where $t_{i+1} - t_{i + 1/2} = t_{i + 1/2} - t_i = dt / 2$</span>, and the accelerations <span>${\bf a}$</span> are defined only on integer times, just like the positions. Then the leapfrog integration scheme is given as: <span>$x_{i} = x_{i-1} + v_{i-1/2} dt; \quad v_{i+1/2} = v_{i-1/2} + a_i dt$</span>. For available integrators refer to <a href="../api/#integrator">Integrator</a>.</li><li class="footnote" id="footnote-3"><a class="tag is-link" href="#citeref-3">3</a>On kernels: In the classical HMC approach, during the first step, new values for the momentum variables are randomly drawn from their Gaussian distribution, independently of the current values of the position variables. A Metropolis update is performed during the second step, using Hamiltonian dynamics to provide a new state. For available kernels refer to <a href="../api/#kernel">Kernel</a>.</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« AdvancedHMC.jl</a><a class="docs-footer-nextpage" href="../autodiff/">Automatic Differentiation Backends »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.16.1 on <span class="colophon-date" title="Wednesday 21 January 2026 16:49">Wednesday 21 January 2026</span>. Using Julia version 1.12.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
0 commit comments