{"id":13474879,"url":"https://github.com/saforem2/lattice23","last_synced_at":"2026-01-05T16:03:03.126Z","repository":{"id":184482757,"uuid":"671943337","full_name":"saforem2/lattice23","owner":"saforem2","description":"Slides for Lattice 2023","archived":false,"fork":false,"pushed_at":"2024-09-10T14:28:20.000Z","size":25464,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-01T04:43:43.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://saforem2.github.io/lattice23/","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saforem2.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-28T14:01:06.000Z","updated_at":"2025-09-23T09:15:28.000Z","dependencies_parsed_at":"2024-03-18T19:30:34.840Z","dependency_job_id":"f3ccc774-62bb-489d-aed7-73f8430a7061","html_url":"https://github.com/saforem2/lattice23","commit_stats":null,"previous_names":["saforem2/lattice23"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/saforem2/lattice23","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saforem2%2Flattice23","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saforem2%2Flattice23/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saforem2%2Flattice23/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saforem2%2Flattice23/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saforem2","download_url":"https://codeload.github.com/saforem2/lattice23/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saforem2%2Flattice23/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28217524,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-05T02:00:06.358Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:01:15.627Z","updated_at":"2026-01-05T16:03:03.088Z","avatar_url":"https://github.com/saforem2.png","language":"TeX","funding_links":[],"categories":["TeX"],"sub_categories":[],"readme":"# MLMC: Machine Learning Monte Carlo\nSam Foreman\n2024-04-03\n\n# \n\n\u003cdiv style=\"background-color: rgba(22,22,22,0.75); border-radius: 10px; text-align:center; padding: 0px; padding-left: 1.5em; padding-right: 1.5em; max-width: min-content; min-width: max-content; margin-left: auto; margin-right: auto; padding-top: 0.2em; padding-bottom: 0.2em; line-height: 1.5em!important;\"\u003e\n\n\u003cspan style=\"color:#939393; font-size:1.5em; font-weight: bold;\"\u003eMLMC:\nMachine Learning Monte Carlo\u003c/span\u003e  \n\u003cspan style=\"color:#777777; font-size:1.2em; font-weight: bold;\"\u003efor\nLattice Gauge Theory\u003c/span\u003e  \n\u003cspan style=\"padding-bottom: 0.5rem;\"\u003e\u003cbr\u003e \u003c/span\u003e  \n[](https://samforeman.me) Sam Foreman  \n\u003cspan class=\"dim-text\" style=\"font-size:0.8em;\"\u003eXiao-Yong Jin, James C.\nOsborn\u003c/span\u003e  \n\u003cspan style=\"font-size:0.8em;\"\u003e\u003cspan style=\"border-bottom: 0.5px solid #00ccff;\"\u003e[\n`saforem2/`](https://github.com/saforem2/)\u003c/span\u003e`{`\u003cspan style=\"border-bottom: 0.5px solid #00ccff;\"\u003e[`lattice23`](https://github.com/saforem2/lattice23)\u003c/span\u003e,\n\u003cspan style=\"border-bottom: 0.5px solid #00ccff;\"\u003e[`l2hmc-qcd`](https://github.com/saforem2/l2hmc-qcd)\u003c/span\u003e`}`\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"footer\"\u003e\n\n\u003cspan class=\"dim-text\" style=\"\u0026quot;text-align:left;'\"\u003e2023-07-31 @\n[Lattice\n2023](https://indico.fnal.gov/event/57249/contributions/271305/)\u003c/span\u003e\n\n\u003c/div\u003e\n\n# Overview\n\n1.  [Background:\n    `{MCMC,HMC}`](#markov-chain-monte-carlo-mcmc-centeredslide)\n    - [Leapfrog Integrator](#leapfrog-integrator-hmc-centeredslide)\n    - [Issues with HMC](#sec-issues-with-hmc)\n    - [Can we do better?](#sec-can-we-do-better)\n2.  [L2HMC: Generalizing MD](#sec-l2hmc)\n    - [4D $SU(3)$ Model](#sec-su3)\n    - [Results](#sec-results)\n3.  [References](#sec-references)\n4.  [Extras](#sec-extras)\n\n# Markov Chain Monte Carlo (MCMC)\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e ### Goal\n\u003e\n\u003e Generate **independent** samples $\\{x_{i}\\}$, such that[^1]\n\u003e $$\\{x_{i}\\} \\sim p(x) \\propto e^{-S(x)}$$ where $S(x)$ is the *action*\n\u003e (or potential energy)\n\n- Want to calculate observables $\\mathcal{O}$:  \n  $\\left\\langle \\mathcal{O}\\right\\rangle \\propto \\int \\left[\\mathcal{D}x\\right]\\hspace{4pt} {\\mathcal{O}(x)\\, p(x)}$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"49%\"\u003e\n\n![](https://raw.githubusercontent.com/saforem2/deep-fridays/main/assets/normal_distribution.dark.svg)\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\nIf these were \u003cspan style=\"color:#00CCFF;\"\u003eindependent\u003c/span\u003e, we could\napproximate:\n$\\left\\langle\\mathcal{O}\\right\\rangle \\simeq \\frac{1}{N}\\sum^{N}_{n=1}\\mathcal{O}(x_{n})$  \n$$\\sigma_{\\mathcal{O}}^{2} = \\frac{1}{N}\\mathrm{Var}{\\left[\\mathcal{O} (x)\n  \\right]}\\Longrightarrow \\sigma_{\\mathcal{O}} \\propto \\frac{1}{\\sqrt{N}}$$\n\n\u003cdiv class=\"footer\"\u003e\n\n[ `saforem2/lattice23`](https://saforem2.github.io/lattice23)\n\n\u003c/div\u003e\n\n# Markov Chain Monte Carlo (MCMC)\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e ### Goal\n\u003e\n\u003e Generate **independent** samples $\\{x_{i}\\}$, such that[^2]\n\u003e $$\\{x_{i}\\} \\sim p(x) \\propto e^{-S(x)}$$ where $S(x)$ is the *action*\n\u003e (or potential energy)\n\n- Want to calculate observables $\\mathcal{O}$:  \n  $\\left\\langle \\mathcal{O}\\right\\rangle \\propto \\int \\left[\\mathcal{D}x\\right]\\hspace{4pt} {\\mathcal{O}(x)\\, p(x)}$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"49%\"\u003e\n\n![](https://raw.githubusercontent.com/saforem2/deep-fridays/main/assets/normal_distribution.dark.svg)\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\nInstead, nearby configs are \u003cspan class=\"red-text\"\u003ecorrelated\u003c/span\u003e,\nand we incur a factor of\n$\\textcolor{#FF5252}{\\tau^{\\mathcal{O}}_{\\mathrm{int}}}$:\n$$\\sigma_{\\mathcal{O}}^{2} =\n  \\frac{\\textcolor{#FF5252}{\\tau^{\\mathcal{O}}_{\\mathrm{int}}}}{N}\\mathrm{Var}{\\left[\\mathcal{O}\n  (x) \\right]}$$\n\n\u003cdiv class=\"footer\"\u003e\n\n[ `saforem2/lattice23`](https://github.com/saforem2/lattice23)\n\n\u003c/div\u003e\n\n# Hamiltonian Monte Carlo (HMC)\n\n- Want to (sequentially) construct a chain of states:\n  $$x_{0} \\rightarrow x_{1} \\rightarrow x_{i} \\rightarrow \\cdots \\rightarrow x_{N}\\hspace{10pt}$$\n\n  such that, as $N \\rightarrow \\infty$:\n  $$\\left\\{x_{i}, x_{i+1}, x_{i+2}, \\cdots, x_{N} \\right\\} \\xrightarrow[]{N\\rightarrow\\infty} p(x)\n  \\propto e^{-S(x)}$$\n\n\u003e [!TIP]\n\u003e\n\u003e ### Trick\n\u003e\n\u003e - Introduce \u003cspan class=\"green-text\"\u003efictitious\u003c/span\u003e momentum\n\u003e   $v \\sim \\mathcal{N}(0, \\mathbb{1})$\n\u003e   - Normally distributed **independent** of $x$, i.e. $$\\begin{align*}\n\u003e     p(x, v) \u0026\\textcolor{#02b875}{=} p(x)\\,p(v) \\propto e^{-S{(x)}} e^{-\\frac{1}{2} v^{T}v}\n\u003e     = e^{-\\left[S(x) + \\frac{1}{2} v^{T}{v}\\right]}\n\u003e     \\textcolor{#02b875}{=} e^{-H(x, v)}\n\u003e     \\end{align*}$$\n\n## Hamiltonian Monte Carlo (HMC)\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"55%\"\u003e\n\n- \u003cspan class=\"green-text\"\u003e**Idea**\u003c/span\u003e: Evolve the\n  $(\\dot{x}, \\dot{v})$ system to get new states $\\{x_{i}\\}$❗\n\n- Write the **joint distribution** $p(x, v)$: $$\n  p(x, v) \\propto e^{-S[x]} e^{-\\frac{1}{2}v^{T} v} = e^{-H(x, v)}\n  $$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"45%\"\u003e\n\n\u003e [!TIP]\n\u003e\n\u003e ### Hamiltonian Dynamics\n\u003e\n\u003e $H = S[x] + \\frac{1}{2} v^{T} v \\Longrightarrow$\n\u003e $$\\dot{x} = +\\partial_{v} H,\n\u003e \\,\\,\\dot{v} = -\\partial_{x} H$$\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/deep-fridays/main/assets/hmc1.svg\"\nclass=\"r-stretch\" /\u003e\n\n## Leapfrog Integrator (HMC)\n\n\u003cdiv class=\"columns\" style=\"text-align:center; font-size: 0.9em;\"\nheight=\"100%\"\u003e\n\n\u003cdiv class=\"column\" width=\"48%\"\u003e\n\n\u003e [!TIP]\n\u003e\n\u003e ### Hamiltonian Dynamics\n\u003e\n\u003e $\\left(\\dot{x}, \\dot{v}\\right) = \\left(\\partial_{v} H, -\\partial_{x} H\\right)$\n\n\u003e [!NOTE]\n\u003e\n\u003e ### Leapfrog Step\n\u003e\n\u003e `input` $\\,\\left(x, v\\right) \\rightarrow \\left(x', v'\\right)\\,$\n\u003e `output`\n\u003e\n\u003e $$\\begin{align*}\n\u003e \\tilde{v} \u0026:= \\textcolor{#F06292}{\\Gamma}(x, v)\\hspace{2.2pt} = v - \\frac{\\varepsilon}{2} \\partial_{x} S(x) \\\\\n\u003e x' \u0026:= \\textcolor{#FD971F}{\\Lambda}(x, \\tilde{v}) \\, =  x + \\varepsilon \\, \\tilde{v} \\\\\n\u003e v' \u0026:= \\textcolor{#F06292}{\\Gamma}(x', \\tilde{v}) = \\tilde{v} - \\frac{\\varepsilon}{2} \\partial_{x} S(x')\n\u003e \\end{align*}$$\n\n\u003e [!WARNING]\n\u003e\n\u003e ### Warning!\n\u003e\n\u003e - Resample $v_{0} \\sim \\mathcal{N}(0, \\mathbb{1})$  \n\u003e   at the \u003cspan class=\"yellow-text\"\u003ebeginning\u003c/span\u003e of each trajectory\n\n\u003cdiv style=\"font-size:0.8em; margin-left:13%;\"\u003e\n\n\u003cspan class=\"dim-text\"\u003e**Note**: $\\partial_{x} S(x)$ is the\n*force*\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"49%\"\nstyle=\"text-align:left; margin-left:2%;\"\u003e\n\n\u003cimg src=\"./assets/hmc1/hmc-update-light.svg\" style=\"width:60.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## HMC Update\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"65%\"\u003e\n\n- We build a trajectory of $N_{\\mathrm{LF}}$ **leapfrog steps**[^3]\n  $$\\begin{equation*}\n  (x_{0}, v_{0})%\n  \\rightarrow (x_{1}, v_{1})\\rightarrow \\cdots%\n  \\rightarrow (x', v')\n  \\end{equation*}$$\n\n- And propose $x'$ as the next state in our chain\n\n$$\\begin{align*}\n  \\textcolor{#F06292}{\\Gamma}: (x, v) \\textcolor{#F06292}{\\rightarrow} v' \u0026:= v - \\frac{\\varepsilon}{2} \\partial_{x} S(x) \\\\\n  \\textcolor{#FD971F}{\\Lambda}: (x, v) \\textcolor{#FD971F}{\\rightarrow} x' \u0026:= x + \\varepsilon v\n\\end{align*}$$\n\n- We then accept / reject $x'$ using Metropolis-Hastings criteria,  \n  $A(x'|x) = \\min\\left\\{1, \\frac{p(x')}{p(x)}\\left|\\frac{\\partial x'}{\\partial x}\\right|\\right\\}$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"30%\"\u003e\n\n![](./assets/hmc1/hmc-update-light.svg)\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## HMC Demo\n\n\u003ciframe data-src=\"https://chi-feng.github.io/mcmc-demo/app.html\" width=\"90%\" height=\"500\" title=\"l2hmc-qcd\"\u003e\n\u003c/iframe\u003e\n\n# Issues with HMC\n\n- What do we want in a good sampler?\n  - **Fast mixing** (small autocorrelations)\n  - **Fast burn-in** (quick convergence)\n- Problems with HMC:\n  - Energy levels selected randomly $\\rightarrow$ **slow mixing**\n  - Cannot easily traverse low-density zones $\\rightarrow$ **slow\n    convergence**\n\n![HMC Samples with\n$\\varepsilon=0.25$](https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/hmc_traj_eps025.svg)\n\n![HMC Samples with\n$\\varepsilon=0.5$](https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/hmc_traj_eps05.svg)\n\n# Topological Freezing\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"45%\"\u003e\n\n\u003cdiv style=\"text-align:left; font-size: 0.9em;\"\u003e\n\n**Topological Charge**:\n$$Q = \\frac{1}{2\\pi}\\sum_{P}\\left\\lfloor x_{P}\\right\\rfloor  \\in \\mathbb{Z}$$\n\n\u003c/div\u003e\n\n\u003cspan class=\"dim-text\" style=\"font-size:0.8em;\"\u003e**note:**\n$\\left\\lfloor x_{P} \\right\\rfloor = x_{P} - 2\\pi\n\\left\\lfloor\\frac{x_{P} + \\pi}{2\\pi}\\right\\rfloor$\u003c/span\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e ### Critical Slowing Down\n\u003e\n\u003e - $Q$ gets stuck!\n\u003e   - as $\\beta\\longrightarrow \\infty$:\n\u003e     - $Q \\longrightarrow \\text{const.}$\n\u003e     - $\\delta Q = \\left(Q^{\\ast} - Q\\right) \\rightarrow 0 \\textcolor{#FF5252}{\\Longrightarrow}$\n\u003e   - \\# configs required to estimate errors  \n\u003e     **grows exponentially**:\n\u003e     \u003cspan class=\"red-text\"\u003e$\\tau_{\\mathrm{int}}^{Q} \\longrightarrow \\infty$\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"45%\"\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/critical_slowing_down.svg\"\nstyle=\"width:80.0%\"\nalt=\"Note \\delta Q \\rightarrow 0 at increasing \\beta\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n# Can we do better?\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n- Introduce two (**invertible NNs**) `vNet` and `xNet`[^4]:\n  - \u003cspan style=\"font-size:0.9em;\"\u003e`vNet:`\n    $(x, F) \\longrightarrow \\left(s_{v},\\, t_{v},\\, q_{v}\\right)$\u003c/span\u003e  \n  - \u003cspan style=\"font-size:0.9em;\"\u003e`xNet:`\n    $(x, v) \\longrightarrow \\left(s_{x},\\, t_{x},\\, q_{x}\\right)$\u003c/span\u003e\n\n \n\n- Use these $(s, t, q)$ in the *generalized* MD update:\n  - \u003cspan class=\"pink-text\"\u003e$\\Gamma_{\\theta}^{\\pm}$\u003c/span\u003e\n    $: ({x}, \\textcolor{#07B875}{v}) \\xrightarrow[]{\\textcolor{#F06292}{s_{v}, t_{v}, q_{v}}} (x, \\textcolor{#07B875}{v'})$\n  - \u003cspan class=\"orange-text\"\u003e$\\Lambda_{\\theta}^{\\pm}$\u003c/span\u003e\n    $: (\\textcolor{#AE81FF}{x}, v) \\xrightarrow[]{\\textcolor{#FD971F}{s_{x}, t_{x}, q_{x}}} (\\textcolor{#AE81FF}{x'}, v)$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"48%\"\u003e\n\n\u003cimg src=\"./assets/leapfrog-layer-2D-U1-vertical.light.svg\"\nstyle=\"width:85%; text-align:center;\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n# L2HMC: Generalizing the MD Update\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003e [!NONE]\n\u003e\n\u003e ### L2HMC Update\n\u003e\n\u003e - Introduce $d \\sim \\mathcal{U}(\\pm)$ to determine the direction of\n\u003e   our update\n\u003e\n\u003e   1.  $\\textcolor{#07B875}{v'} =$\n\u003e       \u003cspan class=\"pink-text\"\u003e$\\Gamma^{\\pm}$\u003c/span\u003e$({x}, \\textcolor{#07B875}{v})$\n\u003e       \u003cspan class=\"dim-text\" style=\"font-size:0.9em;\"\u003e$\\hspace{46pt}$\n\u003e       update $v$\u003c/span\u003e\n\u003e\n\u003e   2.  $\\textcolor{#AE81FF}{x'} =$\n\u003e       \u003cspan class=\"blue-text\"\u003e$x_{B}$\u003c/span\u003e$\\,+\\,$\u003cspan class=\"orange-text\"\u003e$\\Lambda^{\\pm}$\u003c/span\u003e$($\u003cspan class=\"red-text\"\u003e$x_{A}$\u003c/span\u003e$, {v'})$\n\u003e       \u003cspan class=\"dim-text\" style=\"font-size:0.9em;\"\u003e$\\hspace{10pt}$\n\u003e       update first **half**: $x_{A}$\u003c/span\u003e\n\u003e\n\u003e   3.  $\\textcolor{#AE81FF}{x''} =$\n\u003e       \u003cspan class=\"red-text\"\u003e$x'_{A}$\u003c/span\u003e$\\,+\\,$\u003cspan class=\"orange-text\"\u003e$\\Lambda^{\\pm}$\u003c/span\u003e$($\u003cspan class=\"blue-text\"\u003e$x'_{B}$\u003c/span\u003e$, {v'})$\n\u003e       \u003cspan class=\"dim-text\" style=\"font-size:0.9em;\"\u003e$\\hspace{8pt}$\n\u003e       update other half: $x_{B}$\u003c/span\u003e\n\u003e\n\u003e   4.  $\\textcolor{#07B875}{v''} =$\n\u003e       \u003cspan class=\"pink-text\"\u003e$\\Gamma^{\\pm}$\u003c/span\u003e$({x''}, \\textcolor{#07B875}{v'})$\n\u003e       \u003cspan class=\"dim-text\" style=\"font-size:0.9em;\"\u003e$\\hspace{36pt}$\n\u003e       update $v$\u003c/span\u003e\n\n\u003e [!NONE]\n\u003e\n\u003e ### 🎲 Re-Sampling\n\u003e\n\u003e - Resample both $v\\sim \\mathcal{N}(0, 1)$, and\n\u003e   $d \\sim \\mathcal{U}(\\pm)$ at the beginning of each trajectory\n\u003e   - To ensure ergodicity + reversibility, we split the\n\u003e     \u003cspan class=\"purple-text\"\u003e$x$\u003c/span\u003e update into sequential\n\u003e     (complementary) updates\n\u003e - Introduce directional variable $d \\sim \\mathcal{U}(\\pm)$, resampled\n\u003e   at the beginning of each trajectory:\n\u003e   - Note that $\\left(\\Gamma^{+}\\right)^{-1} = \\Gamma^{-}$, i.e.\n\u003e     $$\\Gamma^{+}\\left[\\Gamma^{-}(x, v)\\right] = \\Gamma^{-}\\left[\\Gamma^{+}(x,\n\u003e     v)\\right] = (x, v)$$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003cimg src=\"./assets/leapfrog-layer-2D-U1-vertical.light.svg\"\nstyle=\"width:85%; text-align:center;\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## L2HMC: Leapfrog Layer\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"35%\"\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/drawio/update_steps.svg\"\nclass=\"absolute\" style=\"width:40.0%\" data-top=\"30\" /\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"65%\"\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/drawio/leapfrog_layer_dark2.svg\"\nstyle=\"width:100.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/drawio/network_functions.svg\"\nclass=\"absolute\" style=\"width:100.0%\" data-top=\"440\" /\u003e\n\n## L2HMC Update\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\" style=\"font-size:0.99em;\"\u003e\n\n\u003e [!NONE]\n\u003e\n\u003e ### Algorithm\n\u003e\n\u003e 1.  `input`: \u003cspan class=\"purple-text\"\u003e$x$\u003c/span\u003e\n\u003e\n\u003e     - Resample:\n\u003e       $\\textcolor{#07B875}{v} \\sim \\mathcal{N}(0, \\mathbb{1})$;\n\u003e       $\\,\\,{d\\sim\\mathcal{U}(\\pm)}$\n\u003e     - Construct initial state:\n\u003e       $\\textcolor{#939393}{\\xi} =(\\textcolor{#AE81FF}{x}, \\textcolor{#07B875}{v}, {\\pm})$\n\u003e\n\u003e 2.  `forward`: Generate \u003cspan style=\"color:#f8f8f8\"\u003eproposal\n\u003e     $\\xi'$\u003c/span\u003e by passing \u003cspan style=\"color:#939393\"\u003einitial\n\u003e     $\\xi$\u003c/span\u003e through $N_{\\mathrm{LF}}$ leapfrog layers  \n\u003e     $$\\textcolor{#939393} \\xi \\hspace{1pt}\\xrightarrow[]{\\tiny{\\mathrm{LF} \\text{ layer}}}\\xi_{1} \\longrightarrow\\cdots \\longrightarrow \\xi_{N_{\\mathrm{LF}}} = \\textcolor{#f8f8f8}{\\xi'} := (\\textcolor{#AE81FF}{x''}, \\textcolor{#07B875}{v''})$$\n\u003e\n\u003e     - Accept / Reject: $$\\begin{equation*}\n\u003e       A({\\textcolor{#f8f8f8}{\\xi'}}|{\\textcolor{#939393}{\\xi}})=\n\u003e       \\mathrm{min}\\left\\{1,\n\u003e       \\frac{\\pi(\\textcolor{#f8f8f8}{\\xi'})}{\\pi(\\textcolor{#939393}{\\xi})} \\left| \\mathcal{J}\\left(\\textcolor{#f8f8f8}{\\xi'},\\textcolor{#939393}{\\xi}\\right)\\right| \\right\\}\n\u003e       \\end{equation*}$$\n\u003e\n\u003e 3.  `backward` (if training):\n\u003e\n\u003e     - Evaluate the **loss function**[^5]\n\u003e       $\\mathcal{L}\\gets \\mathcal{L}_{\\theta}(\\textcolor{#f8f8f8}{\\xi'}, \\textcolor{#939393}{\\xi})$\n\u003e       and backprop\n\u003e\n\u003e 4.  `return`: $\\textcolor{#AE81FF}{x}_{i+1}$  \n\u003e     Evaluate MH criteria $(1)$ and return accepted config,\n\u003e     $$\\textcolor{#AE81FF}{{x}_{i+1}}\\gets\n\u003e       \\begin{cases}\n\u003e       \\textcolor{#f8f8f8}{\\textcolor{#AE81FF}{x''}} \\small{\\text{ w/ prob }} A(\\textcolor{#f8f8f8}{\\xi''}|\\textcolor{#939393}{\\xi}) \\hspace{26pt} ✅ \\\\\n\u003e       \\textcolor{#939393}{\\textcolor{#AE81FF}{x}} \\hspace{5pt}\\small{\\text{ w/ prob }} 1 - A(\\textcolor{#f8f8f8}{\\xi''}|{\\textcolor{#939393}{\\xi}}) \\hspace{10pt} 🚫\n\u003e       \\end{cases}$$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003cimg src=\"./assets/leapfrog-layer-2D-U1-vertical.light.svg\"\nstyle=\"width:75%; text-align:center;\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n# 4D $SU(3)$ Model\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e ### Link Variables\n\u003e\n\u003e - Write link variables $U_{\\mu}(x) \\in SU(3)$:\n\u003e\n\u003e   $$ \\begin{align*} \n\u003e   U_{\\mu}(x) \u0026= \\mathrm{exp}\\left[{i\\, \\textcolor{#AE81FF}{\\omega^{k}_{\\mu}(x)} \\lambda^{k}}\\right]\\\\\n\u003e   \u0026= e^{i \\textcolor{#AE81FF}{Q}},\\quad \\text{with} \\quad \\textcolor{#AE81FF}{Q} \\in \\mathfrak{su}(3)\n\u003e   \\end{align*}$$\n\u003e\n\u003e   \u003cspan style=\"font-size:0.9em;\"\u003ewhere\n\u003e   \u003cspan class=\"purple-text\"\u003e$\\omega^{k}_{\\mu}(x)$\u003c/span\u003e\n\u003e   $\\in \\mathbb{R}$, and $\\lambda^{k}$ are the generators of\n\u003e   $SU(3)$\u003c/span\u003e\n\n\u003e [!TIP]\n\u003e\n\u003e ### Conjugate Momenta\n\u003e\n\u003e - Introduce\n\u003e   \u003cspan class=\"green-text\"\u003e$P_{\\mu}(x) = P^{k}_{\\mu}(x) \\lambda^{k}$\u003c/span\u003e\n\u003e   conjugate to \u003cspan class=\"purple-text\"\u003e$\\omega^{k}_{\\mu}(x)$\u003c/span\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e ### Wilson Action\n\u003e\n\u003e $$ S_{G} = -\\frac{\\beta}{6} \\sum\n\u003e \\mathrm{Tr}\\left[U_{\\mu\\nu}(x)\n\u003e + U^{\\dagger}_{\\mu\\nu}(x)\\right] $$\n\u003e\n\u003e where $U_{\\mu\\nu}(x) = U_{\\mu}(x) U_{\\nu}(x+\\hat{\\mu})\n\u003e U^{\\dagger}_{\\mu}(x+\\hat{\\nu}) U^{\\dagger}_{\\nu}(x)$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"45%\"\u003e\n\n\u003cimg src=\"./assets/u1lattice.dark.svg\" style=\"width:90.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## HMC: 4D $SU(3)$\n\nHamiltonian: $H[P, U] = \\frac{1}{2} P^{2} + S[U] \\Longrightarrow$\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" style=\"font-size:0.9em; text-align: center;\"\u003e\n\n\u003e [!NONE]\n\u003e\n\u003e - \u003cspan style=\"border-bottom: 2px solid #AE81FF;\"\u003e$U$ update\u003c/span\u003e:\n\u003e   \u003cspan class=\"purple-text\"\n\u003e   style=\"font-size:1.5em;\"\u003e$\\frac{d\\omega^{k}}{dt} = \\frac{\\partial H}{\\partial P^{k}}$\u003c/span\u003e\n\u003e   $$\\frac{d\\omega^{k}}{dt}\\lambda^{k} = P^{k}\\lambda^{k} \\Longrightarrow \\frac{dQ}{dt} = P$$\n\u003e   $$\\begin{align*}\n\u003e   Q(\\textcolor{#FFEE58}{\\varepsilon}) \u0026= Q(0) + \\textcolor{#FFEE58}{\\varepsilon} P(0)\\Longrightarrow\\\\\n\u003e   -i\\, \\log U(\\textcolor{#FFEE58}{\\varepsilon}) \u0026= -i\\, \\log U(0) + \\textcolor{#FFEE58}{\\varepsilon} P(0) \\\\\n\u003e   U(\\textcolor{#FFEE58}{\\varepsilon}) \u0026= e^{i\\,\\textcolor{#FFEE58}{\\varepsilon} P(0)} U(0)\\Longrightarrow \\\\\n\u003e   \u0026\\hspace{1pt}\\\\\n\u003e   \\textcolor{#FD971F}{\\Lambda}:\\,\\, U \\longrightarrow U' \u0026:= e^{i\\varepsilon P'} U\n\u003e   \\end{align*}$$\n\n\u003cdiv class=\"aside\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"font-size:0.8em;\"\u003e$\\textcolor{#FFEE58}{\\varepsilon}$ is the step\nsize\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" style=\"font-size:0.9em; text-align: center;\"\u003e\n\n\u003e [!NONE]\n\u003e\n\u003e - \u003cspan style=\"border-bottom: 2px solid #07B875;\"\u003e$P$ update\u003c/span\u003e:\n\u003e   \u003cspan class=\"green-text\"\n\u003e   style=\"font-size:1.5em;\"\u003e$\\frac{dP^{k}}{dt} = - \\frac{\\partial H}{\\partial \\omega^{k}}$\u003c/span\u003e\n\u003e   $$\\frac{dP^{k}}{dt} = - \\frac{\\partial H}{\\partial \\omega^{k}}\n\u003e   = -\\frac{\\partial H}{\\partial Q} = -\\frac{dS}{dQ}\\Longrightarrow$$\n\u003e   $$\\begin{align*}\n\u003e   P(\\textcolor{#FFEE58}{\\varepsilon}) \u0026= P(0) - \\textcolor{#FFEE58}{\\varepsilon} \\left.\\frac{dS}{dQ}\\right|_{t=0} \\\\\n\u003e   \u0026= P(0) - \\textcolor{#FFEE58}{\\varepsilon} \\,\\textcolor{#E599F7}{F[U]} \\\\\n\u003e   \u0026\\hspace{1pt}\\\\\n\u003e   \\textcolor{#F06292}{\\Gamma}:\\,\\, P \\longrightarrow P' \u0026:= P - \\frac{\\varepsilon}{2} F[U]\n\u003e   \\end{align*}$$\n\n\u003cdiv class=\"aside\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"font-size:0.8em;\"\u003e$\\textcolor{#E599F7}{F[U]}$ is the force\nterm\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## HMC: 4D $SU(3)$\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"47%\" style=\"text-align:left;\"\u003e\n\n- \u003cspan style=\"border-bottom: 2px solid #F06292;\"\u003eMomentum\n  Update\u003c/span\u003e:\n  $$\\textcolor{#F06292}{\\Gamma}: P \\longrightarrow P' := P - \\frac{\\varepsilon}{2} F[U]$$\n\n- \u003cspan style=\"border-bottom: 2px solid #FD971F;\"\u003eLink Update\u003c/span\u003e:\n  $$\\textcolor{#FD971F}{\\Lambda}: U \\longrightarrow U' := e^{i\\varepsilon P'} U\\quad\\quad$$\n\n- We maintain a batch of `Nb` lattices, all updated in parallel\n\n  - $U$`.dtype = complex128`\n  - $U$`.shape`  \n    \u003cspan style=\"font-size: 0.95em;\"\u003e`= [Nb, 4, Nt, Nx, Ny, Nz, 3, 3]`\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"47%\" style=\"text-align:right;\"\u003e\n\n\u003cimg src=\"./assets/hmc/hmc-update-light.svg\" style=\"width:60.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n# Networks 4D $SU(3)$\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"54%\" style=\"font-size:0.9em;\"\u003e\n\n \u003cbr\u003e\n\n \u003cbr\u003e\n\n\u003cspan class=\"purple-text\"\u003e$U$\u003c/span\u003e-Network:\n\n\u003cspan style=\"font-size:0.9em;\"\u003e`UNet:`\n$(U, P) \\longrightarrow \\left(s_{U},\\, t_{U},\\, q_{U}\\right)$\u003c/span\u003e\n\n \u003cbr\u003e\n\n\u003cdiv style=\"border: 1px solid #1c1c1c; border-radius: 6px; padding:1%;\"\u003e\n\n\u003cspan class=\"green-text\"\u003e$P$\u003c/span\u003e-Network:\n\n\u003cspan style=\"font-size:0.9em;\"\u003e`PNet:`\n$(U, P) \\longrightarrow \\left(s_{P},\\, t_{P},\\, q_{P}\\right)$\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"45%\" style=\"text-align:right;\"\u003e\n\n\u003cimg src=\"./assets/leapfrog-layer-4D-SU3-vertical.light.svg\"\nstyle=\"width:80.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n# Networks 4D $SU(3)$\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"54%\" style=\"font-size:0.9em;\"\u003e\n\n \u003cbr\u003e\n\n \u003cbr\u003e\n\n\u003cspan class=\"purple-text\"\u003e$U$\u003c/span\u003e-Network:\n\n\u003cspan style=\"font-size:0.9em;\"\u003e`UNet:`\n$(U, P) \\longrightarrow \\left(s_{U},\\, t_{U},\\, q_{U}\\right)$\u003c/span\u003e\n\n \u003cbr\u003e\n\n\u003cdiv style=\"border: 1px solid #07B875; border-radius: 6px; padding:1%;\"\u003e\n\n\u003cspan class=\"green-text\"\u003e$P$\u003c/span\u003e-Network:\n\n\u003cspan style=\"font-size:0.9em;\"\u003e`PNet:`\n$(U, P) \\longrightarrow \\left(s_{P},\\, t_{P},\\, q_{P}\\right)$\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cspan class=\"dim-text\"\u003e$\\uparrow$\u003c/span\u003e  \n\u003cspan class=\"dim-text\" style=\"padding-top: 0.5em!important;\"\u003elet’s look\nat this\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"45%\" style=\"text-align:right;\"\u003e\n\n\u003cimg src=\"./assets/leapfrog-layer-4D-SU3-vertical.light.svg\"\nstyle=\"width:80.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## $P$-`Network` (pt. 1)\n\n\u003cdiv style=\"text-align:center;\"\u003e\n\n![](./assets/SU3/PNetwork.light.svg)\n\n\u003c/div\u003e\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n- \u003cspan style=\"border-bottom: 2px solid rgba(131, 131, 131, 0.493);\"\u003e`input`[^6]:\n  $\\hspace{7pt}\\left(U, F\\right) := (e^{i Q}, F)$\u003c/span\u003e\n  $$\\begin{align*}\n  h_{0} \u0026= \\sigma\\left( w_{Q} Q + w_{F} F + b \\right) \\\\\n  h_{1} \u0026= \\sigma\\left( w_{1} h_{0} + b_{1} \\right) \\\\\n  \u0026\\vdots \\\\\n  h_{n} \u0026= \\sigma\\left(w_{n-1} h_{n-2} + b_{n}\\right) \\\\\n  \\textcolor{#FF5252}{z} \u0026 := \\sigma\\left(w_{n} h_{n-1} + b_{n}\\right) \\longrightarrow \\\\\n  \\end{align*}$$\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n- \u003cspan style=\"border-bottom: 2px solid rgba(131, 131, 131, 0.5);\"\u003e`output`[^7]:\n  $\\hspace{7pt} (s_{P}, t_{P}, q_{P})$\u003c/span\u003e\n\n  - $s_{P} = \\lambda_{s} \\tanh(w_s \\textcolor{#FF5252}{z} + b_s)$\n  - $t_{P} = w_{t} \\textcolor{#FF5252}{z} + b_{t}$\n  - $q_{P} = \\lambda_{q} \\tanh(w_{q} \\textcolor{#FF5252}{z} + b_{q})$\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## $P$-`Network` (pt. 2)\n\n\u003cdiv style=\"text-align:center;\"\u003e\n\n![](./assets/SU3/PNetwork.light.svg)\n\n\u003c/div\u003e\n\n- Use $(s_{P}, t_{P}, q_{P})$ to update\n  $\\Gamma^{\\pm}: (U, P) \\rightarrow\n  \\left(U, P_{\\pm}\\right)$[^8]:\n\n  - \u003cspan style=\"color:#FF5252\"\u003eforward\u003c/span\u003e\n    $(d = \\textcolor{#FF5252}{+})$:\n    $$\\Gamma^{\\textcolor{#FF5252}{+}}(U, P) := P_{\\textcolor{#FF5252}{+}} = P \\cdot e^{\\frac{\\varepsilon}{2} s_{P}} - \\frac{\\varepsilon}{2}\\left[ F \\cdot e^{\\varepsilon q_{P}} + t_{P} \\right]$$\n\n  - \u003cspan style=\"color:#1A8FFF;\"\u003ebackward\u003c/span\u003e\n    $(d = \\textcolor{#1A8FFF}{-})$:\n    $$\\Gamma^{\\textcolor{#1A8FFF}{-}}(U, P) := P_{\\textcolor{#1A8FFF}{-}} = e^{-\\frac{\\varepsilon}{2} s_{P}} \\left\\{P + \\frac{\\varepsilon}{2}\\left[ F \\cdot e^{\\varepsilon q_{P}} + t_{P} \\right]\\right\\}$$\n\n# Results: 2D $U(1)$\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\" style=\"align:top;\"\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/autocorr_new.svg\"\nstyle=\"width:90.0%\" /\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"33%\"\nstyle=\"text-align:left; padding-top: 5%;\"\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e ### Improvement\n\u003e\n\u003e We can measure the performance by comparing $\\tau_{\\mathrm{int}}$ for\n\u003e the \u003cspan style=\"color:#FF2052;\"\u003e**trained model**\u003c/span\u003e vs.\n\u003e \u003cspan style=\"color:#9F9F9F;\"\u003e**HMC**\u003c/span\u003e.\n\u003e\n\u003e **Note**: \u003cspan style=\"color:#FF2052;\"\u003elower\u003c/span\u003e is better\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/charge_histories.svg\"\nclass=\"absolute\"\nstyle=\"margin-bottom: 1em;margin-top: 1em;;width:100.0%\" data-top=\"400\"\ndata-left=\"0\" /\u003e\n\n## Interpretation\n\n\u003cdiv class=\"columns\" style=\"margin-left:1pt;\"\u003e\n\n\u003cdiv class=\"column\" width=\"36%\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"text-align:center; font-size:0.8em\"\u003eDeviation in $x_{P}$\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"30%\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"text-align:right; font-size:0.8em\"\u003eTopological charge\nmixing\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"32%\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"text-align:right!important; font-size:0.8em;\"\u003eArtificial influx\nof energy\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/ridgeplots.svg\"\nstyle=\"width:100.0%\" /\u003e\n\n## Interpretation\n\n![Average plaquette: $\\langle x_{P}\\rangle$ vs LF\nstep](https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/plaqsf_ridgeplot.svg)\n\n![Average energy:\n$H - \\sum\\log|\\mathcal{J}|$](https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/Hf_ridgeplot.svg)\n\n# 4D $SU(3)$ Results\n\n- Distribution of $\\log|\\mathcal{J}|$ over all chains, at each *leapfrog\n  step*, $N_{\\mathrm{LF}}$ ($= 0, 1, \\ldots, 8$) during training:\n\n\u003cdiv\u003e\n\n\u003c/div\u003e\n\n## 4D $SU(3)$ Results: $\\delta U_{\\mu\\nu}$\n\n![](./assets/SU3/pdiff.svg)\n\n## 4D $SU(3)$ Results: $\\delta U_{\\mu\\nu}$\n\n![](./assets/SU3/pdiff-robust.svg)\n\n# Next Steps\n\n- Further code development\n\n  -  [`saforem2/l2hmc-qcd`](https://github.com/saforem2/l2hmc-qcd)\n\n- Continue to use / test different network architectures\n\n  - Gauge equivariant NNs for $U_{\\mu}(x)$ update\n\n- Continue to test different loss functions for training\n\n- Scaling:\n\n  - Lattice volume\n  - Network size\n  - Batch size\n  - \\# of GPUs\n\n## Thank you!\n\n \u003cbr\u003e\n\n\u003cdiv\u003e\n\n\u003c/div\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e ### Acknowledgements\n\u003e\n\u003e This research used resources of the Argonne Leadership Computing\n\u003e Facility,  \n\u003e which is a DOE Office of Science User Facility supported under\n\u003e Contract DE-AC02-06CH11357.\n\n## \n\n\u003cdiv style=\"text-align:center;\"\u003e\n\n[![](https://raw.githubusercontent.com/saforem2/l2hmc-qcd/main/assets/logo-small.svg)](https://github.com/saforem2/l2hmc-qcd)\n\n\u003ca href=\"https://hits.seeyoufarm.com\"\u003e\u003cimg alt=\"hits\" src=\"https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fsaforem2%2Fl2hmc-qcd\u0026count_bg=%2300CCFF\u0026title_bg=%23555555\u0026icon=\u0026icon_color=%23111111\u0026title=👋\u0026edge_flat=false\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/saforem2/l2hmc-qcd/\"\u003e\u003cimg alt=\"l2hmc-qcd\" src=\"https://img.shields.io/badge/-l2hmc--qcd-252525?style=flat\u0026logo=github\u0026labelColor=gray\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.codefactor.io/repository/github/saforem2/l2hmc-qcd\"\u003e\u003cimg alt=\"codefactor\" src=\"https://www.codefactor.io/repository/github/saforem2/l2hmc-qcd/badge\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://arxiv.org/abs/2112.01582\"\u003e\u003cimg alt=\"arxiv\" src=\"http://img.shields.io/badge/arXiv-2112.01582-B31B1B.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://arxiv.org/abs/2105.03418\"\u003e\u003cimg alt=\"arxiv\" src=\"http://img.shields.io/badge/arXiv-2105.03418-B31B1B.svg\"\u003e\u003c/a\u003e\n\n\u003ca href=\"https://hydra.cc\"\u003e\u003cimg alt=\"hydra\" src=\"https://img.shields.io/badge/Config-Hydra-89b8cd\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pytorch.org/get-started/locally/\"\u003e\u003cimg alt=\"pyTorch\" src=\"https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch\u0026logoColor=white\"\u003e\u003c/a\u003e\n\u003ca href=\"https://www.tensorflow.org\"\u003e\u003cimg alt=\"tensorflow\" src=\"https://img.shields.io/badge/TensorFlow-%23FF6F00.svg?\u0026logo=TensorFlow\u0026logoColor=white\"\u003e\u003c/a\u003e\n[\u003cimg src=\"https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg\" alt=\"Weights \u0026 Biases monitoring\" height=20\u003e](https://wandb.ai/l2hmc-qcd/l2hmc-qcd)\n\n\u003c/div\u003e\n\n## Acknowledgements\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n- **Links**:\n  - [ Link to github](https://github.com/saforem2/l2hmc-qcd)\n  - [ reach out!](mailto:foremans@anl.gov)\n- **References**:\n  - [Link to slides](https://saforem2.github.io/lattice23/)\n    - [ link to github with\n      slides](https://github.com/saforem2/lattice23)\n  -  (Foreman et al. 2022; Foreman, Jin, and Osborn 2022, 2021)\n  -  (Boyda et al. 2022; Shanahan et al. 2022)\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n- Huge thank you to:\n  - Yannick Meurice\n  - Norman Christ\n  - Akio Tomiya\n  - Nobuyuki Matsumoto\n  - Richard Brower\n  - Luchang Jin\n  - Chulwoo Jung\n  - Peter Boyle\n  - Taku Izubuchi\n  - Denis Boyda\n  - Dan Hackett\n  - ECP-CSD group\n  - \u003cspan class=\"red-text\"\u003e**ALCF Staff + Datascience Group**\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## \n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n### Links\n\n- [ `saforem2/l2hmc-qcd`](https://github.com/saforem2/l2hmc-qcd)\n\n- [📊 slides](https://saforem2.github.io/lattice23) (Github: [\n  `saforem2/lattice23`](https://github.com/saforem2/lattice23))\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n### References\n\n- [Title Slide Background (worms)\n  animation](https://saforem2.github.io/grid-worms-animation/)\n  - Github: [\n    `saforem2/grid-worms-animation`](https://github.com/saforem2/grid-worms-animation)\n- [Link to HMC demo](https://chi-feng.github.io/mcmc-demo/app.html)\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## References\n\n(I don’t know why this is broken 🤷🏻‍♂️ )\n\n\u003cdiv id=\"refs\" class=\"references csl-bib-body hanging-indent\"\nentry-spacing=\"0\"\u003e\n\n\u003cdiv id=\"ref-Boyda:2022nmh\" class=\"csl-entry\"\u003e\n\nBoyda, Denis et al. 2022. “\u003cspan class=\"nocase\"\u003eApplications of Machine\nLearning to Lattice Quantum Field Theory\u003c/span\u003e.” In *Snowmass 2021*.\n\u003chttps://arxiv.org/abs/2202.05838\u003e.\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-Foreman:2021ljl\" class=\"csl-entry\"\u003e\n\nForeman, Sam, Taku Izubuchi, Luchang Jin, Xiao-Yong Jin, James C.\nOsborn, and Akio Tomiya. 2022. “\u003cspan class=\"nocase\"\u003eHMC with\nNormalizing Flows\u003c/span\u003e.” *PoS* LATTICE2021: 073.\n\u003chttps://doi.org/10.22323/1.396.0073\u003e.\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-Foreman:2021ixr\" class=\"csl-entry\"\u003e\n\nForeman, Sam, Xiao-Yong Jin, and James C. Osborn. 2021. “Deep Learning\nHamiltonian Monte Carlo.” In *\u003cspan class=\"nocase\"\u003e9th International\nConference on Learning Representations\u003c/span\u003e*.\n\u003chttps://arxiv.org/abs/2105.03418\u003e.\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-Foreman:2021rhs\" class=\"csl-entry\"\u003e\n\n———. 2022. “\u003cspan class=\"nocase\"\u003eLeapfrogLayers: A Trainable Framework\nfor Effective Topological Sampling\u003c/span\u003e.” *PoS* LATTICE2021 (May):\n508. \u003chttps://doi.org/10.22323/1.396.0508\u003e.\n\n\u003c/div\u003e\n\n\u003cdiv id=\"ref-Shanahan:2022ifi\" class=\"csl-entry\"\u003e\n\nShanahan, Phiala et al. 2022. “Snowmass 2021 Computational Frontier\nCompF03 Topical Group Report: Machine Learning,” September.\n\u003chttps://arxiv.org/abs/2209.07559\u003e.\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n# Extras\n\n## Integrated Autocorrelation Time\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/tint1.svg\"\nstyle=\"width:100.0%\" /\u003e\n\n## Comparison\n\n\u003cimg src=\"https://saforem2.github.io/anl-job-talk/assets/dQint_eval.svg\"\ndata-ref-parent=\"fig-comparison\" /\u003e\n\n\u003cimg src=\"https://saforem2.github.io/anl-job-talk/assets/dQint_hmc.svg\"\ndata-ref-parent=\"fig-comparison\" /\u003e\n\n## Plaquette analysis: $x_{P}$\n\n\u003cdiv class=\"columns\"\u003e\n\n\u003cdiv class=\"column\" width=\"55%\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"text-align:center; font-size:0.9em;\"\u003eDeviation from\n$V\\rightarrow\\infty$ limit, $x_{P}^{\\ast}$\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"45%\"\u003e\n\n\u003cspan class=\"dim-text\"\nstyle=\"text-align:right!important; font-size:0.9em;\"\u003eAverage\n$\\langle x_{P}\\rangle$, with $x_{P}^{\\ast}$ (dotted-lines)\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/plaqsf_vs_lf_step1.svg\"\nstyle=\"width:100.0%\" /\u003e\n\n## Loss Function\n\n- Want to maximize the *expected* squared charge difference[^9]:\n  $$\\begin{equation*}\n  \\mathcal{L}_{\\theta}\\left(\\xi^{\\ast}, \\xi\\right) =\n  {\\mathbb{E}_{p(\\xi)}}\\big[-\\textcolor{#FA5252}{{\\delta Q}}^{2}\n  \\left(\\xi^{\\ast}, \\xi \\right)\\cdot A(\\xi^{\\ast}|\\xi)\\big]\n  \\end{equation*}$$\n\n- Where:\n\n  - $\\delta Q$ is the *tunneling rate*: $$\\begin{equation*}\n    \\textcolor{#FA5252}{\\delta Q}(\\xi^{\\ast},\\xi)=\\left|Q^{\\ast} - Q\\right|\n    \\end{equation*}$$\n\n  - $A(\\xi^{\\ast}|\\xi)$ is the probability[^10] of accepting the\n    proposal $\\xi^{\\ast}$: $$\\begin{equation*}\n    A(\\xi^{\\ast}|\\xi) = \\mathrm{min}\\left( 1,\n    \\frac{p(\\xi^{\\ast})}{p(\\xi)}\\left|\\frac{\\partial \\xi^{\\ast}}{\\partial\n    \\xi^{T}}\\right|\\right)\n    \\end{equation*}$$\n\n## Networks 2D $U(1)$\n\n- Stack gauge links as `shape`$\\left(U_{\\mu}\\right)$`=[Nb, 2, Nt, Nx]`\n  $\\in \\mathbb{C}$\n\n  $$ x_{\\mu}(n) ≔ \\left[\\cos(x), \\sin(x)\\right]$$\n\n  with `shape`$\\left(x_{\\mu}\\right)$`= [Nb, 2, Nt, Nx, 2]`\n  $\\in \\mathbb{R}$\n\n- $x$-Network:\n\n  - \u003cspan class=\"purple-text\"\u003e$\\psi_{\\theta}: (x, v) \\longrightarrow \\left(s_{x},\\, t_{x},\\, q_{x}\\right)$\u003c/span\u003e\n\n- $v$-Network:\n\n  - \u003cspan class=\"green-text\"\u003e$\\varphi_{\\theta}: (x, v) \\longrightarrow \\left(s_{v},\\, t_{v},\\, q_{v}\\right)$\u003c/span\u003e\n    \u003cspan class=\"dim-text\"\u003e$\\hspace{2pt}\\longleftarrow$ lets look at\n    this\u003c/span\u003e\n\n## $v$-Update[^11]\n\n- \u003cspan style=\"color:#FF5252\"\u003eforward\u003c/span\u003e\n  $(d = \\textcolor{#FF5252}{+})$:\n\n$$\\Gamma^{\\textcolor{#FF5252}{+}}: (x, v) \\rightarrow v' := v \\cdot e^{\\frac{\\varepsilon}{2} s_{v}} - \\frac{\\varepsilon}{2}\\left[ F \\cdot e^{\\varepsilon q_{v}} + t_{v} \\right]$$\n\n- \u003cspan style=\"color:#1A8FFF;\"\u003ebackward\u003c/span\u003e\n  $(d = \\textcolor{#1A8FFF}{-})$:\n\n$$\\Gamma^{\\textcolor{#1A8FFF}{-}}: (x, v) \\rightarrow v' := e^{-\\frac{\\varepsilon}{2} s_{v}} \\left\\{v + \\frac{\\varepsilon}{2}\\left[ F \\cdot e^{\\varepsilon q_{v}} + t_{v} \\right]\\right\\}$$\n\n## $x$-Update\n\n- \u003cspan style=\"color:#FF5252\"\u003eforward\u003c/span\u003e\n  $(d = \\textcolor{#FF5252}{+})$:\n\n$$\\Lambda^{\\textcolor{#FF5252}{+}}(x, v) = x \\cdot e^{\\frac{\\varepsilon}{2} s_{x}} - \\frac{\\varepsilon}{2}\\left[ v \\cdot e^{\\varepsilon q_{x}} + t_{x} \\right]$$\n\n- \u003cspan style=\"color:#1A8FFF;\"\u003ebackward\u003c/span\u003e\n  $(d = \\textcolor{#1A8FFF}{-})$:\n\n$$\\Lambda^{\\textcolor{#1A8FFF}{-}}(x, v) = e^{-\\frac{\\varepsilon}{2} s_{x}} \\left\\{x + \\frac{\\varepsilon}{2}\\left[ v \\cdot e^{\\varepsilon q_{x}} + t_{x} \\right]\\right\\}$$\n\n## Lattice Gauge Theory (2D $U(1)$)\n\n\u003cdiv class=\"columns\" layout-valign=\"top\"\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003cdiv style=\"text-align:center;\"\u003e\n\n\u003e [!NOTE]\n\u003e\n\u003e ### Link Variables\n\u003e\n\u003e $$U_{\\mu}(n) = e^{i x_{\\mu}(n)}\\in \\mathbb{C},\\quad \\text{where}\\quad$$\n\u003e $$x_{\\mu}(n) \\in [-\\pi,\\pi)$$\n\n\u003cdiv\u003e\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e ### Wilson Action\n\u003e\n\u003e $$S_{\\beta}(x) = \\beta\\sum_{P} \\cos \\textcolor{#00CCFF}{x_{P}},$$\n\u003e\n\u003e $$\\textcolor{#00CCFF}{x_{P}} = \\left[x_{\\mu}(n) + x_{\\nu}(n+\\hat{\\mu})\n\u003e - x_{\\mu}(n+\\hat{\\nu})-x_{\\nu}(n)\\right]$$\n\n\u003cspan class=\"dim-text\" style=\"font-size:0.8em;\"\u003e**Note**:\n$\\textcolor{#00CCFF}{x_{P}}$ is the product of links around $1\\times 1$\nsquare, called a \u003cspan class=\"blue-text\"\u003e“plaquette”\u003c/span\u003e\u003c/span\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n\u003cdiv class=\"column\" width=\"50%\"\u003e\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/deep-fridays/main/assets/u1lattice.dark.svg\"\nstyle=\"width:80.0%\" alt=\"2D Lattice\" /\u003e\n\n\u003c/div\u003e\n\n\u003c/div\u003e\n\n## \n\n\u003ciframe data-src=\"https://nbviewer.org/github/saforem2/l2hmc-qcd/blob/SU3/src/l2hmc/notebooks/l2hmc-2dU1.ipynb\" width=\"100%\" height=\"650\" title=\"l2hmc-qcd\"\u003e\n\u003c/iframe\u003e\n\n## Annealing Schedule\n\n- Introduce an *annealing schedule* during the training phase:\n\n  $$\\left\\{ \\gamma_{t}  \\right\\}_{t=0}^{N} = \\left\\{\\gamma_{0}, \\gamma_{1},\n  \\ldots, \\gamma_{N-1}, \\gamma_{N} \\right\\}$$\n\n  where $\\gamma_{0} \u003c \\gamma_{1} \u003c \\cdots \u003c \\gamma_{N} \\equiv 1$, and\n  $\\left|\\gamma_{t+1} - \\gamma_{t}\\right| \\ll 1$\n\n- \u003cspan class=\"green-text\"\u003e**Note**\u003c/span\u003e:\n\n  - for $\\left|\\gamma_{t}\\right| \u003c 1$, this rescaling helps to reduce\n    the height of the energy barriers $\\Longrightarrow$\n  - easier for our sampler to explore previously inaccessible regions of\n    the phase space\n\n## Networks 2D $U(1)$\n\n- Stack gauge links as `shape`$\\left(U_{\\mu}\\right)$`=[Nb, 2, Nt, Nx]`\n  $\\in \\mathbb{C}$\n\n  $$ x_{\\mu}(n) ≔ \\left[\\cos(x), \\sin(x)\\right]$$\n\n  with `shape`$\\left(x_{\\mu}\\right)$`= [Nb, 2, Nt, Nx, 2]`\n  $\\in \\mathbb{R}$\n\n- $x$-Network:\n\n  - \u003cspan class=\"purple-text\"\u003e$\\psi_{\\theta}: (x, v) \\longrightarrow \\left(s_{x},\\, t_{x},\\, q_{x}\\right)$\u003c/span\u003e\n\n- $v$-Network:\n\n  - \u003cspan class=\"green-text\"\u003e$\\varphi_{\\theta}: (x, v) \\longrightarrow \\left(s_{v},\\, t_{v},\\, q_{v}\\right)$\u003c/span\u003e\n\n## Toy Example: GMM $\\in \\mathbb{R}^{2}$\n\n\u003cimg\nsrc=\"https://raw.githubusercontent.com/saforem2/l2hmc-dwq25/main/docs/assets/iso_gmm_chains.svg\"\nid=\"fig-gmm\" class=\"r-stretch\" /\u003e\n\n## Physical Quantities\n\n- To estimate physical quantities, we:\n  - Calculate physical observables at **increasing** spatial resolution\n  - Perform extrapolation to continuum limit\n\n![](https://raw.githubusercontent.com/saforem2/physicsSeminar/main/assets/static/continuum.svg)\n\n# Extra\n\n\u003cspan class=\"preview-image\"\nstyle=\"text-align:center; margin-left:auto; margin-right: auto;\"\u003e![](./assets/thumbnail.png)\u003c/span\u003e\n\n[^1]: Here, $\\sim$ means “is distributed according to”\n\n[^2]: Here, $\\sim$ means “is distributed according to”\n\n[^3]: We **always** start by resampling the momentum, $v_{0} \\sim\n    \\mathcal{N}(0, \\mathbb{1})$\n\n[^4]: [L2HMC:](https://github.com/saforem2/l2hmc-qcd) (Foreman, Jin, and\n    Osborn 2021, 2022)\n\n[^5]: For simple $\\mathbf{x} \\in \\mathbb{R}^{2}$ example,\n    $\\mathcal{L}_{\\theta} =\n    A(\\xi^{\\ast}|\\xi)\\cdot \\left(\\mathbf{x}^{\\ast} - \\mathbf{x}\\right)^{2}$\n\n[^6]: $\\sigma(\\cdot)$ denotes an activation function\n\n[^7]: $\\lambda_{s},\\, \\lambda_{q} \\in \\mathbb{R}$ are trainable\n    parameters\n\n[^8]: Note that $\\left(\\Gamma^{+}\\right)^{-1} = \\Gamma^{-}$,\n    i.e. $\\Gamma^{+}\\left[\\Gamma^{-}(U, P)\\right] = \\Gamma^{-}\\left[\\Gamma^{+}(U, P)\\right] = (U, P)$\n\n[^9]: Where $\\xi^{\\ast}$ is the *proposed* configuration (prior to\n    Accept / Reject)\n\n[^10]: And $\\left|\\frac{\\partial \\xi^{\\ast}}{\\partial \\xi^{T}}\\right|$\n    is the Jacobian of the transformation from\n    $\\xi \\rightarrow \\xi^{\\ast}$\n\n[^11]: \u003cspan style=\"font-size:0.8em;\"\u003eNote that\n    $\\left(\\Gamma^{+}\\right)^{-1} = \\Gamma^{-}$,\n    i.e. $\\Gamma^{+}\\left[\\Gamma^{-}(x, v)\\right] = \\Gamma^{-}\\left[\\Gamma^{+}(x, v)\\right] = (x, v)$\u003c/span\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaforem2%2Flattice23","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaforem2%2Flattice23","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaforem2%2Flattice23/lists"}