<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://ulysseszh.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://ulysseszh.github.io/" rel="alternate" type="text/html" hreflang="en-US" /><updated>2026-04-30T17:49:58-07:00</updated><id>https://ulysseszh.github.io/feed.xml</id><title type="html"><![CDATA[Ulysses’ trip]]></title><subtitle>Here we are at the awesome (awful) blog written by UlyssesZhan!</subtitle><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><entry><title type="html"><![CDATA[Ways of reducing mass rebuilds in Nix without changing Nix]]></title><link href="https://ulysseszh.github.io/programming/2026/04/16/reduce-nix-rebuild.html" rel="alternate" type="text/html" title="Ways of reducing mass rebuilds in Nix without changing Nix" /><published>2026-04-16T09:45:36-07:00</published><updated>2026-04-16T09:45:36-07:00</updated><id>https://ulysseszh.github.io/programming/2026/04/16/reduce-nix-rebuild</id><content type="html" xml:base="https://ulysseszh.github.io/programming/2026/04/16/reduce-nix-rebuild.html"><![CDATA[<h2 data-label="0.1" id="introduction">Introduction</h2>
<p>Nix as a software package manager is amazing in its reproducibility, the cost of which, however, is the problem of mass rebuilds. When a package gets an update, every package that depends on it, directly or indirectly, will be rebuilt. This means that even a small update can lead to conceptually unnecessary mass rebuilds involving thousands of packages or even much more if the update touches a package on which many packages depend, such as <code>glibc</code>. This imposes huge burden on all kinds of resources, such as CPU resources (compiling software is generally CPU intense), storage resources (different rebuilds of a software reside in different store paths), and network resources (all users of rebuilt packages have to redownload them from the binary caches).</p>
<p>Nixpkgs has staging branches to manage such mass rebuilds. Every update in Nixpkgs that triggers mass rebuilds will go through a staging process, which takes some time for it to be merged into the master branch. If updates that conceptually do not require mass rebuilds can actually be done without mass rebuilds, then they can be applied to the master branch much more quickly than going through the staging process.</p>
<p>This article aims at brainstorming some ways to reduce mass rebuilds without changing Nix itself. In other words, I will think of some ways in which we can refactor Nixpkgs or develop alternative package sets to avoid some mass rebuilds without switching to another implementation of Nix language or ditching Nix altogether.</p>
<p>The most common kinds of dependencies between Nix derivations are:</p>
<ol type="1">
<li>The output of the dependent derivation includes the out path of the depended derivation. This happens when you use <code>autoPatchelf</code> and <code>patchShebangs</code>.</li>
<li>Besides the point above, the builder of the dependent derivation actually also needs to look at the file contents of the output of the depended derivation. This happens when you compile a software against the depended library.</li>
<li>The builder of the dependent derivation runs executables or calls functions in the depended derivation. This happens when the depended software is a compiler used to compile the dependent software.</li>
</ol>
<p class="no-indent">
I am going to try to pose some ideas to improve the situation for each of the three kinds of dependencies.
</p>
<h2 data-label="0.2" id="store-path-replacements">Store path replacements</h2>
<p>For the first kind of dependencies, conceptually there is absolutely no need to rebuild the dependent software. Building the dependent derivation is bound to succeed, and the result in the output will differ by nothing more than the updated store path of the depended derivation. Therefore, the idea to solve this is simple: instead of rebuilding the dependent derivation from scratch, simply substitute the store path in the output of the dependent derivation.</p>
<p>Now, let us take a simple example. Assume that <code>foo_1</code> is a program that simply outputs <code>hello</code> to the standard output and that <code>foo_2</code> is a program that simply outputs <code>howdy</code> to the standard output. Assume that <code>bar</code> is simply a wrapper around <code>foo</code> made using <code>makeWrapper</code>. In the builder of <code>bar</code>, I will include a <code>sleep</code> command to simulate a time-consuming building process. An update in its dependent is then simulated as we switch from <code>foo = foo_1</code> to <code>foo = foo_2</code>. When you build <code>bar</code>, it will take you 5 seconds of waiting during the build. Then, when you switch to <code>foo = foo_2</code> and build <code>bar</code> again, it will take you another 5 seconds of waiting during the build, which is conceptually totally unnecessary because that part does not change for the <code>foo</code> update at all.</p>
<details>
<summary>
Supposed packaging in Nixpkgs
</summary>
<p>This is what it would look like if <code>bar</code> is packaged in Nixpkgs:</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-nix"><pre><code><span class="line line-1"><span class="c"># bar.nix</span>
</span><span class="line line-2"><span class="p">{</span>
</span><span class="line line-3">	<span class="nv">lib</span><span class="p">,</span>
</span><span class="line line-4">	<span class="nv">stdenv</span><span class="p">,</span>
</span><span class="line line-5">	<span class="nv">writeShellScriptBin</span><span class="p">,</span>
</span><span class="line line-6">	<span class="nv">makeWrapper</span><span class="p">,</span>
</span><span class="line line-7"><span class="p">}:</span>
</span><span class="line line-8">
</span><span class="line line-9"><span class="kd">let</span>
</span><span class="line line-10">	<span class="nv">foo_1</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"echo hello"</span><span class="p">;</span>
</span><span class="line line-11">	<span class="nv">foo_2</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"echo howdy"</span><span class="p">;</span>
</span><span class="line line-12">	<span class="nv">foo</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="p">;</span>
</span><span class="line line-13"><span class="kn">in</span>
</span><span class="line line-14"><span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-15">	<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-16">	<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-17">
</span><span class="line line-18">	<span class="nv">dontUnpack</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-19">
</span><span class="line line-20">	<span class="nv">nativeBuildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">makeWrapper</span> <span class="p">];</span>
</span><span class="line line-21">
</span><span class="line line-22">	<span class="nv">buildPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-23"><span class="s2">		runHook preBuild</span>
</span><span class="line line-24"><span class="s2">		sleep 5 # simulate a time-consuming building process</span>
</span><span class="line line-25"><span class="s2">		runHook postBuild</span>
</span><span class="line line-26"><span class="s2">	''</span><span class="p">;</span>
</span><span class="line line-27">
</span><span class="line line-28">	<span class="nv">installPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-29"><span class="s2">		runHook preInstall</span>
</span><span class="line line-30"><span class="s2">		makeWrapper </span><span class="si">${</span><span class="nv">lib</span><span class="o">.</span><span class="nv">getExe</span> <span class="nv">foo</span><span class="si">}</span><span class="s2"> $out/bin/bar</span>
</span><span class="line line-31"><span class="s2">		runHook postInstall</span>
</span><span class="line line-32"><span class="s2">	''</span><span class="p">;</span>
</span><span class="line line-33">
</span><span class="line line-34">	<span class="nv">meta</span><span class="o">.</span><span class="nv">mainProgram</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-35"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
To build it, run
</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-bash"><pre><code><span class="line line-1">nix-build <span class="nt">-E</span> <span class="s1">'(import &lt;nixpkgs&gt; {}).callPackage ./bar.nix {}'</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
After that, you can run <code>bar</code> by running <code>result/bin/bar</code>.
</p>
</details>
<p>How can we prevent this rebuild? We can have an intermediate derivation <code>barWithStub</code>, which references the out path of a derivation <code>fooStub</code> instead of <code>foo</code>. Because <code>fooStub</code> does not care about <code>foo</code>, neither does <code>barWithStub</code>. Then, the builder of <code>bar</code> then takes everything from the output of <code>barWithStub</code>, and replace the store path of <code>fooStub</code> with that of <code>foo</code>.</p>
<details>
<summary>
Implementation
</summary>
<p>Here is an implementation of this idea:</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-nix"><pre><code><span class="line line-1"><span class="c"># bar.nix</span>
</span><span class="line line-2"><span class="p">{</span>
</span><span class="line line-3">	<span class="nv">lib</span><span class="p">,</span>
</span><span class="line line-4">	<span class="nv">stdenv</span><span class="p">,</span>
</span><span class="line line-5">	<span class="nv">writeScriptBin</span><span class="p">,</span>
</span><span class="line line-6">	<span class="nv">writeShellScriptBin</span><span class="p">,</span>
</span><span class="line line-7">	<span class="nv">makeWrapper</span><span class="p">,</span>
</span><span class="line line-8"><span class="p">}:</span>
</span><span class="line line-9">
</span><span class="line line-10"><span class="kd">let</span>
</span><span class="line line-11">	<span class="nv">fooStub</span> <span class="o">=</span> <span class="nv">writeScriptBin</span> <span class="s2">"foo"</span> <span class="s2">""</span><span class="p">;</span>
</span><span class="line line-12">
</span><span class="line line-13">	<span class="nv">foo_1</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"echo hello"</span><span class="p">;</span>
</span><span class="line line-14">	<span class="nv">foo_2</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"echo howdy"</span><span class="p">;</span>
</span><span class="line line-15">	<span class="nv">foo</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="p">;</span>
</span><span class="line line-16">
</span><span class="line line-17">	<span class="nv">barWithStub</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-18">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-19">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-20">
</span><span class="line line-21">		<span class="nv">dontUnpack</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-22">
</span><span class="line line-23">		<span class="nv">nativeBuildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">makeWrapper</span> <span class="p">];</span>
</span><span class="line line-24">
</span><span class="line line-25">		<span class="nv">buildPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-26"><span class="s2">			runHook preBuild</span>
</span><span class="line line-27"><span class="s2">			sleep 5 # simulate a time-consuming building process</span>
</span><span class="line line-28"><span class="s2">			runHook postBuild</span>
</span><span class="line line-29"><span class="s2">		''</span><span class="p">;</span>
</span><span class="line line-30">
</span><span class="line line-31">		<span class="nv">installPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-32"><span class="s2">			runHook preInstall</span>
</span><span class="line line-33"><span class="s2">			makeWrapper </span><span class="si">${</span><span class="nv">lib</span><span class="o">.</span><span class="nv">getExe</span> <span class="nv">fooStub</span><span class="si">}</span><span class="s2"> $out/bin/bar</span>
</span><span class="line line-34"><span class="s2">			runHook postInstall</span>
</span><span class="line line-35"><span class="s2">		''</span><span class="p">;</span>
</span><span class="line line-36">
</span><span class="line line-37">		<span class="nv">meta</span><span class="o">.</span><span class="nv">mainProgram</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-38">	<span class="p">};</span>
</span><span class="line line-39"><span class="kn">in</span>
</span><span class="line line-40"><span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-41">	<span class="kn">inherit</span> <span class="p">(</span><span class="nv">barWithStub</span><span class="p">)</span> <span class="nv">pname</span> <span class="nv">version</span> <span class="nv">meta</span><span class="p">;</span>
</span><span class="line line-42">	<span class="nv">dontUnpack</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-43">
</span><span class="line line-44">	<span class="nv">installPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-45"><span class="s2">		runHook preInstall</span>
</span><span class="line line-46"><span class="s2">		cp -ar </span><span class="si">${</span><span class="nv">barWithStub</span><span class="si">}</span><span class="s2"> $out</span>
</span><span class="line line-47"><span class="s2">		chmod +w $out/bin/bar</span>
</span><span class="line line-48"><span class="s2">		substituteInPlace $out/bin/bar --replace-fail </span><span class="si">${</span><span class="nv">fooStub</span><span class="si">}</span><span class="s2"> </span><span class="si">${</span><span class="nv">foo</span><span class="si">}</span>
</span><span class="line line-49"><span class="s2">		runHook postInstall</span>
</span><span class="line line-50"><span class="s2">	''</span><span class="p">;</span>
</span><span class="line line-51"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<p>It still needs some polishing because the package as it is right now cannot have overridden attributes. However, you can easily fix it by exposing <code>barWithStub</code> in <code>bar.passthru</code>. The fully polished packaging is not important here as this code snippet already presents my idea neatly.</p>
<p>The code snippet also looks a bit redundant with boilerplate codes, but we can fix this by defining a packaging helper function to remove the common codes. We can also add a feature to <code>makeWrapper</code> to let it write something to <code>$out/nix-support</code> of the intermediate package with stub to instruct the builder of the final package about where and what the stub store paths are.</p>
</details>
<p>Notice that for cases resembling this specific example, there is actually another pattern commonly used in Nixpkgs, which is to have an intermediate package called <code>bar-unwrapped</code>, which does not use <code>makeWrapper</code> in its install phase. The final package <code>bar</code> is a <code>symlinkJoin</code> that takes the unwrapped intermediate package into its output through symbolic links instead of copying, and it has <code>makeWrapper</code> in its builder. This approach is better for this example for two reasons: (1) it saves the operation of copying the entire output of the intermediate package, which can be heavy on disk IO; (2) it does not require users consuming the binary caches to download the entire store path if the unwrapped package does not change. However, the approach of substituting stub store paths can be extended to more use cases than <code>makeWrapper</code>, notably those with <code>autoPatchelf</code> and <code>patchShebangs</code>. A natural thought is to combine the advantages of the two: use symbolic links for files that do not contain stub store paths and copy files that contain stub store paths. This interesting approach, however, has its own downsides: (1) it makes the stub derivation included in the closure of the final package; (2) it takes up more space than both alternatives if the copied files take up most of the space.</p>
<p>As a side note, it is actually a separate problem that a user consuming binary caches has to download entire store paths for what could be very small changes from store paths that already exist on the user’s machine. There is a <a href="https://alternativebit.fr/posts/nixos/future-of-nix-substitution" target="_blank" rel="external">blog article</a> by <a href="https://alternativebit.fr" target="_blank" rel="external">PicNoir</a> that explores how Nix may be improved to solve this very problem.</p>
<h2 data-label="0.3" id="separating-compiling-and-linking">Separating compiling and linking</h2>
<p>It sounds completely reasonable that a software should be rebuilt when the library it depends on gets an update. However, a certain fact makes this statement only half-true: building a software from its source code actually involves two steps, compiling and linking. What compiling needs from the depended library is only the header files, and what linking needs from the depended library is only the library files. The catch is that, in most cases, the resources taken in the build phase are dominantly taken by the compiling, but the library files are often the only files that get updated.</p>
<p>This observation is especially important for indirect dependencies. Supose that <code>foo</code> and <code>bar</code> are libraries, where <code>bar</code> depends on <code>foo</code>, and that <code>baz</code> is a program that depends on <code>bar</code>. When <code>foo</code> gets an update, <code>bar</code> is rebuilt. However, because <code>bar</code> does not get an update, its header files do not change, so <code>baz</code> does not need to be recompiled. However, how people typically package <code>baz</code> in Nixpkgs will make it have to recompile whenever <code>foo</code> gets an update.</p>
<details>
<summary>
Supposed packaging in Nixpkgs
</summary>
<p>First, I will give the source codes of <code>foo</code>, <code>bar</code>, and <code>baz</code>. For simplicity, they will be very simple: <code>foo</code> contains a function <code>kat</code>; <code>bar</code> contains a function <code>mar</code> that returns the return value of <code>kat</code>; and <code>baz</code> has a <code>main</code> function that returns the return value of <code>mar</code>. After that, I will give the Nix code that packages them.</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-c"><pre><code><span class="line line-1"><span class="c1">// foo/foo.h</span>
</span><span class="line line-2"><span class="cp">#ifndef FOO_H</span>
</span><span class="line line-3"><span class="cp">#define FOO_H</span>
</span><span class="line line-4"><span class="cp">#ifndef FOO_VERSION</span>
</span><span class="line line-5"><span class="cp">#define FOO_VERSION 1</span>
</span><span class="line line-6"><span class="cp">#endif</span>
</span><span class="line line-7"><span class="kt">int</span> <span class="nf">kat</span><span class="p">();</span>
</span><span class="line line-8"><span class="cp">#endif</span>
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-c"><pre><code><span class="line line-1"><span class="c1">// foo/foo.c</span>
</span><span class="line line-2"><span class="cp">#include</span> <span class="cpf">"foo.h"</span>
</span><span class="line line-3"><span class="kt">int</span> <span class="nf">kat</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="n">FOO_VERSION</span><span class="p">;</span> <span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-makefile"><pre><code><span class="line line-1"><span class="c"># foo/Makefile</span>
</span><span class="line line-2"><span class="nl">libfoo.so</span><span class="o">:</span> <span class="nf">foo.o</span>
</span><span class="line line-3">	<span class="p">$(</span>CC<span class="p">)</span> <span class="nt">-shared</span> <span class="nt">-o</span> libfoo.so foo.o
</span><span class="line line-4">
</span><span class="line line-5"><span class="nl">foo.o</span><span class="o">:</span>
</span><span class="line line-6">	<span class="p">$(</span>CC<span class="p">)</span> <span class="nt">-c</span> foo.c <span class="nt">-o</span> foo.o
</span><span class="line line-7">
</span><span class="line line-8"><span class="nl">install</span><span class="o">:</span> <span class="nf">install-lib install-include</span>
</span><span class="line line-9">
</span><span class="line line-10"><span class="nl">install-lib</span><span class="o">:</span> <span class="nf">libfoo.so</span>
</span><span class="line line-11">	<span class="nb">install</span> <span class="nt">-Dm644</span> libfoo.so <span class="nt">-t</span> <span class="p">$(</span>out<span class="p">)</span>/lib
</span><span class="line line-12">
</span><span class="line line-13"><span class="nl">install-include</span><span class="o">:</span>
</span><span class="line line-14">	<span class="nb">install</span> <span class="nt">-Dm644</span> foo.h <span class="nt">-t</span> <span class="p">$(</span>out<span class="p">)</span>/include
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-c"><pre><code><span class="line line-1"><span class="c1">// bar/bar.h</span>
</span><span class="line line-2"><span class="cp">#ifndef BAR_H</span>
</span><span class="line line-3"><span class="cp">#define BAR_H</span>
</span><span class="line line-4"><span class="kt">int</span> <span class="nf">mar</span><span class="p">();</span>
</span><span class="line line-5"><span class="cp">#endif</span>
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-c"><pre><code><span class="line line-1"><span class="c1">// bar/bar.c</span>
</span><span class="line line-2"><span class="cp">#include</span> <span class="cpf">"bar.h"</span>
</span><span class="line line-3"><span class="cp">#include</span> <span class="cpf">&lt;foo.h&gt;</span>
</span><span class="line line-4"><span class="kt">int</span> <span class="nf">mar</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="n">kat</span><span class="p">();</span> <span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-makefile"><pre><code><span class="line line-1"><span class="c"># bar/Makefile</span>
</span><span class="line line-2"><span class="nl">libbar.so</span><span class="o">:</span> <span class="nf">bar.o</span>
</span><span class="line line-3">	<span class="p">$(</span>CC<span class="p">)</span> <span class="nt">-shared</span> <span class="nt">-o</span> libbar.so bar.o <span class="nt">-lfoo</span>
</span><span class="line line-4">
</span><span class="line line-5"><span class="nl">bar.o</span><span class="o">:</span>
</span><span class="line line-6">	<span class="p">$(</span>CC<span class="p">)</span> <span class="nt">-c</span> bar.c <span class="nt">-o</span> bar.o
</span><span class="line line-7">
</span><span class="line line-8"><span class="nl">install</span><span class="o">:</span> <span class="nf">install-include install-lib</span>
</span><span class="line line-9">
</span><span class="line line-10"><span class="nl">install-lib</span><span class="o">:</span> <span class="nf">libbar.so</span>
</span><span class="line line-11">	<span class="nb">install</span> <span class="nt">-Dm644</span> libbar.so <span class="nt">-t</span> <span class="p">$(</span>out<span class="p">)</span>/lib
</span><span class="line line-12">
</span><span class="line line-13"><span class="nl">install-include</span><span class="o">:</span>
</span><span class="line line-14">	<span class="nb">install</span> <span class="nt">-Dm644</span> bar.h <span class="nt">-t</span> <span class="p">$(</span>out<span class="p">)</span>/include
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-c"><pre><code><span class="line line-1"><span class="c1">// baz/baz.c</span>
</span><span class="line line-2"><span class="cp">#include</span> <span class="cpf">&lt;bar.h&gt;</span>
</span><span class="line line-3"><span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="n">mar</span><span class="p">();</span> <span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-makefile"><pre><code><span class="line line-1"><span class="c"># baz/Makefile</span>
</span><span class="line line-2"><span class="nl">baz</span><span class="o">:</span> <span class="nf">baz.o</span>
</span><span class="line line-3">	<span class="p">$(</span>CC<span class="p">)</span> <span class="nt">-o</span> baz baz.o <span class="nt">-lbar</span>
</span><span class="line line-4">
</span><span class="line line-5"><span class="nl">baz.o</span><span class="o">:</span>
</span><span class="line line-6">	<span class="p">$(</span>CC<span class="p">)</span> <span class="nt">-c</span> baz.c <span class="nt">-o</span> baz.o
</span><span class="line line-7">	<span class="nb">sleep </span>5 <span class="c"># simulate time-consuming building process</span>
</span><span class="line line-8">
</span><span class="line line-9"><span class="nl">install</span><span class="o">:</span> <span class="nf">baz</span>
</span><span class="line line-10">	<span class="nb">install</span> <span class="nt">-Dm755</span> baz <span class="nt">-t</span> <span class="p">$(</span>out<span class="p">)</span>/bin
</span></code></pre></td></tr></tbody></table>
<table class="rouge-table"><tbody><tr><td class="highlight language-nix"><pre><code><span class="line line-1"><span class="c"># baz.nix</span>
</span><span class="line line-2"><span class="p">{</span> <span class="nv">stdenv</span> <span class="p">}:</span>
</span><span class="line line-3">
</span><span class="line line-4"><span class="kd">let</span>
</span><span class="line line-5">	<span class="nv">foo_1</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-6">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"foo"</span><span class="p">;</span>
</span><span class="line line-7">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-8">		<span class="nv">src</span> <span class="o">=</span> <span class="sx">./foo</span><span class="p">;</span>
</span><span class="line line-9">		<span class="nv">outputs</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"out"</span> <span class="s2">"dev"</span> <span class="p">];</span>
</span><span class="line line-10">	<span class="p">};</span>
</span><span class="line line-11">	<span class="nv">foo_2</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="o">.</span><span class="nv">overrideAttrs</span> <span class="p">{</span> <span class="nv">NIX_CFLAGS_COMPILE</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"-DFOO_VERSION=2"</span> <span class="p">];</span> <span class="p">};</span>
</span><span class="line line-12">	<span class="nv">foo</span> <span class="o">=</span> <span class="nv">foo_2</span><span class="p">;</span>
</span><span class="line line-13">
</span><span class="line line-14">	<span class="nv">bar</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-15">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-16">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-17">		<span class="nv">src</span> <span class="o">=</span> <span class="sx">./bar</span><span class="p">;</span>
</span><span class="line line-18">		<span class="nv">buildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">foo</span> <span class="p">];</span>
</span><span class="line line-19">		<span class="nv">outputs</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"out"</span> <span class="s2">"dev"</span> <span class="p">];</span>
</span><span class="line line-20">	<span class="p">};</span>
</span><span class="line line-21">
</span><span class="line line-22"><span class="kn">in</span>
</span><span class="line line-23"><span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-24">	<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"baz"</span><span class="p">;</span>
</span><span class="line line-25">	<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-26">	<span class="nv">src</span> <span class="o">=</span> <span class="sx">./baz</span><span class="p">;</span>
</span><span class="line line-27">	<span class="nv">buildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">bar</span> <span class="p">];</span>
</span><span class="line line-28">	<span class="nv">meta</span><span class="o">.</span><span class="nv">mainProgram</span> <span class="o">=</span> <span class="s2">"baz"</span><span class="p">;</span>
</span><span class="line line-29"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
Build <code>baz</code> by running
</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-bash"><pre><code><span class="line line-1">nix-build <span class="nt">-E</span> <span class="s1">'(import &lt;nixpkgs&gt; {}).callPackage ./baz.nix {}'</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
and then you can run <code>result/bin/baz</code>. It will immediately terminate with exit code <code>1</code>. If you switch from <code>foo = foo_1</code> to <code>foo = foo_2</code> and build <code>baz</code> after that, <code>baz</code> will be recompiled, and <code>result/bin/baz</code> now will terminate with exit code <code>2</code>.
</p>
<p>Note that this is very bare-bone and overlooks a lot of things. For example, using <code>pkgsStatic.callPackage</code> on it will not work.</p>
</details>
<p>However, in principle, we should be able to skip recompiling <code>baz</code> when <code>foo</code> updates because compiling <code>baz</code> only needs the header files of <code>bar</code>. We can have an intermediate derivation <code>bazObj</code>, whose builder only compiles but not links <code>baz</code>, and the derivation output is the unlinked object files. The final package <code>baz</code> then uses <code>bazObj</code> as an input and produces the linked binaries. The input of <code>bazObj</code> consists of <code>baz.src</code> and <code>bar.dev</code>, and the input of <code>baz</code> consists of <code>bazObj</code> and <code>bar.out</code> (we are assuming <code>bar</code> has two outputs <code>dev</code> and <code>out</code>, respectively containing the header files and the library files).</p>
<p>There is still one problem here, though, which is that a change in <code>foo</code> will lead to a change in <code>bar.dev</code> for two reasons: (1) Nix derivations are input-addressed but not content-address, which means that even if the contents of <code>bar.dev</code> does not change, it is still a different derivation if the input <code>foo</code> changes; (2) the default fixup phase of <code>stdenv.mkDerivation</code> in Nixpkgs will put <code>bar.out</code>, which helplessly has to reference <code>foo</code>, in the propagated build inputs of <code>bar.dev</code>. Therefore, instead of relying on the default fixup phase of <code>stdenv.mkDerivation</code> in Nixpkgs to create <code>bar.dev</code> for us, we have to write our own implementation so that it does not reference <code>foo</code> directly or indirectly.</p>
<details>
<summary>
Implementation
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-nix"><pre><code><span class="line line-1"><span class="c"># baz.nix</span>
</span><span class="line line-2"><span class="p">{</span> <span class="nv">stdenv</span> <span class="p">}:</span>
</span><span class="line line-3">
</span><span class="line line-4"><span class="kd">let</span>
</span><span class="line line-5">	<span class="nv">foo_1</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-6">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"foo"</span><span class="p">;</span>
</span><span class="line line-7">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-8">		<span class="nv">src</span> <span class="o">=</span> <span class="sx">./foo</span><span class="p">;</span>
</span><span class="line line-9">		<span class="nv">outputs</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"out"</span> <span class="s2">"dev"</span> <span class="p">];</span>
</span><span class="line line-10">	<span class="p">};</span>
</span><span class="line line-11">	<span class="nv">foo_2</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="o">.</span><span class="nv">overrideAttrs</span> <span class="p">{</span> <span class="nv">NIX_CFLAGS_COMPILE</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"-DFOO_VERSION=2"</span> <span class="p">];</span> <span class="p">};</span>
</span><span class="line line-12">	<span class="nv">foo</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="p">;</span>
</span><span class="line line-13">
</span><span class="line line-14">	<span class="nv">bar</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">(</span><span class="nv">finalAttrs</span><span class="p">:</span> <span class="p">{</span>
</span><span class="line line-15">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-16">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-17">		<span class="nv">src</span> <span class="o">=</span> <span class="sx">./bar</span><span class="p">;</span>
</span><span class="line line-18">		<span class="nv">buildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">foo</span> <span class="p">];</span>
</span><span class="line line-19">		<span class="nv">installTargets</span> <span class="o">=</span> <span class="p">[</span> <span class="s2">"install-lib"</span> <span class="p">];</span>
</span><span class="line line-20">		<span class="nv">passthru</span><span class="o">.</span><span class="nv">dev</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-21">			<span class="kn">inherit</span> <span class="p">(</span><span class="nv">finalAttrs</span><span class="p">)</span> <span class="nv">pname</span> <span class="nv">version</span> <span class="nv">src</span><span class="p">;</span>
</span><span class="line line-22">			<span class="nv">dontBuild</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-23">			<span class="nv">installTargets</span> <span class="o">=</span> <span class="s2">"install-include"</span><span class="p">;</span>
</span><span class="line line-24">		<span class="p">};</span>
</span><span class="line line-25">	<span class="p">});</span>
</span><span class="line line-26">
</span><span class="line line-27">	<span class="nv">bazObj</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-28">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"baz"</span><span class="p">;</span>
</span><span class="line line-29">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-30">		<span class="nv">src</span> <span class="o">=</span> <span class="sx">./baz</span><span class="p">;</span>
</span><span class="line line-31">		<span class="nv">buildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">bar</span><span class="o">.</span><span class="nv">dev</span> <span class="p">];</span>
</span><span class="line line-32">		<span class="nv">buildPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-33"><span class="s2">			runHook preInstall</span>
</span><span class="line line-34"><span class="s2">			make baz.o SHELL="$SHELL"</span>
</span><span class="line line-35"><span class="s2">			runHook postInstall</span>
</span><span class="line line-36"><span class="s2">		''</span><span class="p">;</span>
</span><span class="line line-37">		<span class="nv">installPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-38"><span class="s2">			runHook preInstall</span>
</span><span class="line line-39"><span class="s2">			install -Dm644 baz.o Makefile -t $out</span>
</span><span class="line line-40"><span class="s2">			runHook postInstall</span>
</span><span class="line line-41"><span class="s2">		''</span><span class="p">;</span>
</span><span class="line line-42">	<span class="p">};</span>
</span><span class="line line-43">
</span><span class="line line-44"><span class="kn">in</span>
</span><span class="line line-45"><span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-46">	<span class="kn">inherit</span> <span class="p">(</span><span class="nv">bazObj</span><span class="p">)</span> <span class="nv">pname</span> <span class="nv">version</span><span class="p">;</span>
</span><span class="line line-47">	<span class="nv">src</span> <span class="o">=</span> <span class="nv">bazObj</span><span class="p">;</span>
</span><span class="line line-48">	<span class="nv">buildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">bar</span><span class="o">.</span><span class="nv">out</span> <span class="p">];</span>
</span><span class="line line-49">	<span class="nv">meta</span> <span class="o">=</span> <span class="nv">bazObj</span><span class="o">.</span><span class="nv">meta</span> <span class="o">//</span> <span class="p">{</span> <span class="nv">mainProgram</span> <span class="o">=</span> <span class="s2">"baz"</span><span class="p">;</span> <span class="p">};</span>
</span><span class="line line-50"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<p>Notice that you have to use <code>bar.out</code> instead of just <code>bar</code> in <code>buildInputs</code> of <code>baz</code> because <code>stdenv.mkDerivation</code> “cleverly” selects <code>bar.dev</code> when it sees <code>bar</code> in <code>buildInputs</code>.</p>
<p>Again, this packaging needs some further polishing, but it explains the idea of separating compiling and linking. You may try switching from <code>foo = foo_1</code> to <code>foo = foo_2</code>, and <code>baz</code> will only be compiled once.</p>
</details>
<p>This looks good, but here is the bad news: none of GNU Autotools, pkg-config, or CMake is designed with the idea that compiling and linking may happen in different environments. The configure script typically tries to compile and link small programs to test whether the build environment has all the required header files and library files. If compiling and linking are in separate environments, we really need two different configure scripts, one for checking compilers and header files and the other for checking linkers and library files. The problem about pkg-config is that the <code>.pc</code> files contain information about both the header files and the library files. Then, since <code>libbar.pc</code> has to live in <code>bar.dev</code>, this means that <code>bar.dev</code> has to reference <code>bar.out</code> and ultimately references <code>foo</code>. As for CMake, it is possible to patch CMake to ask it to always look for <code>INTERFACE</code> libraries whenever the CMake script uses <code>add_library</code> and have the properties <code>INTERFACE_INCLUDE_DIRECTORIES</code> or <code>IMPORTED_LOCATION</code> defined according to whether it is in the compiling builder or the linking builder. However, this is still a mess and requires workarounds on a case-by-case basis.</p>
<p>The only way to solve this problem is again using stubs. This time, the stub derivations are much more complicated than the ones for simple store path replacements. This time, the stub derivations have to have libraries that actually contains the symbols against which the linker can link the object files. If there were a tool that can generate stub libraries from header files, a generally useful definition of such stub derivations could in principle be implemented. However, considering the diversity of header files in C/C++ header files, such a tool is very hard to implement. If we do not restrict ourselves to keeping Nix unchanged, however, there is a way out of this: making Nix store paths content-addressed instead of input-addressed. Generating stubs from header files is difficult, but generating stubs from library files is much easier. Although the library files change when some dependency updates, the stubs generated from the library files will not change. If Nix store paths were content-addressed, this would be an ideal way of generating and using stub libraries.</p>
<h2 data-label="0.4" id="ditching-check-phases">Ditching check phases</h2>
<p>At first glance, it seems that it cannot be helped if a depended software actually runs in the dependent builder. However, a lot of such dependencies that cause mass rebuilds are actually only for tests, used in the check phase, especially things like <code>gtest</code>. Changes in such depended packages usually do not change the output of the dependent derivation. Conceptually, if a tool used for testing gets an update, we do not have to rebuild a software that uses it for tests but only have to test the built software again with the new test tools.</p>
<p>Take a simple example here again. Let us say <code>foo</code> is a test helper that compares the standard output of an executable with an expected value, and <code>bar</code> is a very simple program that outputs <code>hello</code> to the standard output. In the install check phase of <code>bar</code>, we use <code>foo</code> to test that the output of the executable is indeed <code>hello</code>. Typically for this case, in Nixpkgs, <code>foo</code> enters the <code>nativeInstallCheckInputs</code> of <code>bar</code>, so <code>bar</code> needs a rebuild when <code>foo</code> updates.</p>
<details>
<summary>
Supposed packaging in Nixpkgs
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-nix"><pre><code><span class="line line-1"><span class="c"># bar.nix</span>
</span><span class="line line-2"><span class="p">{</span>
</span><span class="line line-3">	<span class="nv">stdenv</span><span class="p">,</span>
</span><span class="line line-4">	<span class="nv">writeShellScriptBin</span><span class="p">,</span>
</span><span class="line line-5">	<span class="nv">runtimeShell</span><span class="p">,</span>
</span><span class="line line-6"><span class="p">}:</span>
</span><span class="line line-7">
</span><span class="line line-8"><span class="kd">let</span>
</span><span class="line line-9">	<span class="nv">foo_1</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"[ `$1` = $2 ]"</span><span class="p">;</span>
</span><span class="line line-10">	<span class="nv">foo_2</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"[[ `$1` == $2 ]]"</span><span class="p">;</span>
</span><span class="line line-11">	<span class="nv">foo</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="p">;</span>
</span><span class="line line-12"><span class="kn">in</span>
</span><span class="line line-13"><span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-14">	<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-15">	<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-16">	<span class="nv">dontUnpack</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-17">
</span><span class="line line-18">	<span class="nv">buildPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-19"><span class="s2">		runHook preBuild</span>
</span><span class="line line-20"><span class="s2">		sleep 5 # simulate time-consuming building process</span>
</span><span class="line line-21"><span class="s2">		runHook postBuild</span>
</span><span class="line line-22"><span class="s2">	''</span><span class="p">;</span>
</span><span class="line line-23">
</span><span class="line line-24">	<span class="nv">installPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-25"><span class="s2">		runHook preInstall</span>
</span><span class="line line-26"><span class="s2">		mkdir -p $out/bin</span>
</span><span class="line line-27"><span class="s2">		echo '#!</span><span class="si">${</span><span class="nv">runtimeShell</span><span class="si">}</span><span class="s2">' &gt; $out/bin/bar</span>
</span><span class="line line-28"><span class="s2">		echo 'echo hello' &gt;&gt; $out/bin/bar</span>
</span><span class="line line-29"><span class="s2">		chmod +x $out/bin/bar</span>
</span><span class="line line-30"><span class="s2">		runHook postInstall</span>
</span><span class="line line-31"><span class="s2">	''</span><span class="p">;</span>
</span><span class="line line-32">
</span><span class="line line-33">	<span class="nv">doInstallCheck</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-34">	<span class="nv">nativeInstallCheckInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">foo</span> <span class="p">];</span>
</span><span class="line line-35">	<span class="nv">installCheckPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-36"><span class="s2">		runHook preInstallCheck</span>
</span><span class="line line-37"><span class="s2">		foo $out/bin/bar hello</span>
</span><span class="line line-38"><span class="s2">		runHook postInstallCheck</span>
</span><span class="line line-39"><span class="s2">	''</span><span class="p">;</span>
</span><span class="line line-40"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
To build it, run
</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-bash"><pre><code><span class="line line-1">nix-build <span class="nt">-E</span> <span class="s1">'(import &lt;nixpkgs&gt; {}).callPackage ./bar.nix {}'</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
After that, you can run <code>bar</code> by running <code>result/bin/bar</code>. Observe that <code>bar</code> needs rebuilding when you switch from <code>foo = foo_1</code> to <code>foo = foo_2</code>.
</p>
</details>
<p>For this example, preventing rebuilding is very simple: simply remove the install check phase. However, tests are still important, so we still need to include them somewhere. Fortunately, people conventionally put such tests in <code>passthru.tests</code> for this very purpose. Therefore, all we have to do is to put the tests in <code>passthru.tests</code> instead.</p>
<details>
<summary>
Implementation
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-nix"><pre><code><span class="line line-1"><span class="c"># bar.nix</span>
</span><span class="line line-2"><span class="p">{</span>
</span><span class="line line-3">	<span class="nv">stdenv</span><span class="p">,</span>
</span><span class="line line-4">	<span class="nv">writeShellScriptBin</span><span class="p">,</span>
</span><span class="line line-5">	<span class="nv">runtimeShell</span><span class="p">,</span>
</span><span class="line line-6">	<span class="nv">runCommand</span><span class="p">,</span>
</span><span class="line line-7"><span class="p">}:</span>
</span><span class="line line-8">
</span><span class="line line-9"><span class="kd">let</span>
</span><span class="line line-10">	<span class="nv">foo_1</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"[ `$1` = $2 ]"</span><span class="p">;</span>
</span><span class="line line-11">	<span class="nv">foo_2</span> <span class="o">=</span> <span class="nv">writeShellScriptBin</span> <span class="s2">"foo"</span> <span class="s2">"[[ `$1` == $2 ]]"</span><span class="p">;</span>
</span><span class="line line-12">	<span class="nv">foo</span> <span class="o">=</span> <span class="nv">foo_1</span><span class="p">;</span>
</span><span class="line line-13">
</span><span class="line line-14">	<span class="nv">bar</span> <span class="o">=</span> <span class="nv">stdenv</span><span class="o">.</span><span class="nv">mkDerivation</span> <span class="p">{</span>
</span><span class="line line-15">		<span class="nv">pname</span> <span class="o">=</span> <span class="s2">"bar"</span><span class="p">;</span>
</span><span class="line line-16">		<span class="nv">version</span> <span class="o">=</span> <span class="s2">"1.0.0"</span><span class="p">;</span>
</span><span class="line line-17">		<span class="nv">dontUnpack</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
</span><span class="line line-18">
</span><span class="line line-19">		<span class="nv">buildPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-20"><span class="s2">			runHook preBuild</span>
</span><span class="line line-21"><span class="s2">			sleep 5 # simulate time-consuming building process</span>
</span><span class="line line-22"><span class="s2">			runHook postBuild</span>
</span><span class="line line-23"><span class="s2">		''</span><span class="p">;</span>
</span><span class="line line-24">
</span><span class="line line-25">		<span class="nv">installPhase</span> <span class="o">=</span> <span class="s2">''</span>
</span><span class="line line-26"><span class="s2">			runHook preInstall</span>
</span><span class="line line-27"><span class="s2">			mkdir -p $out/bin</span>
</span><span class="line line-28"><span class="s2">			echo '#!</span><span class="si">${</span><span class="nv">runtimeShell</span><span class="si">}</span><span class="s2">' &gt; $out/bin/bar</span>
</span><span class="line line-29"><span class="s2">			echo 'echo hello' &gt;&gt; $out/bin/bar</span>
</span><span class="line line-30"><span class="s2">			chmod +x $out/bin/bar</span>
</span><span class="line line-31"><span class="s2">			runHook postInstall</span>
</span><span class="line line-32"><span class="s2">		''</span><span class="p">;</span>
</span><span class="line line-33">
</span><span class="line line-34">		<span class="nv">passthru</span><span class="o">.</span><span class="nv">tests</span><span class="o">.</span><span class="nv">installCheck</span> <span class="o">=</span> <span class="nv">runCommand</span> <span class="s2">"bar-installCheck"</span> <span class="p">{</span>
</span><span class="line line-35">			<span class="nv">nativeBuildInputs</span> <span class="o">=</span> <span class="p">[</span> <span class="nv">foo</span> <span class="nv">bar</span> <span class="p">];</span>
</span><span class="line line-36">		<span class="p">}</span> <span class="s2">"foo bar hello &amp;&amp; touch $out"</span><span class="p">;</span>
</span><span class="line line-37">	<span class="p">};</span>
</span><span class="line line-38"><span class="kn">in</span> <span class="nv">bar</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
To run the test, run
</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-bash"><pre><code><span class="line line-1">nix-build <span class="nt">-E</span> <span class="s1">'((import &lt;nixpkgs&gt; {}).callPackage ./bar.nix {}).tests.installCheck'</span>
</span></code></pre></td></tr></tbody></table>
<p>Now, <code>bar</code> does not need rebuilding when <code>foo</code> updates, but only <code>bar.tests.installCheck</code> needs rebuilding.</p>
</details>
<p>Moving the check phase to <code>passthru.tests</code>, however, is more difficult. The reason is that the configure script will disable the tests in <code>Makefile</code> if it cannot find the test dependencies. This, again, can be solved by using stub libraries for the test dependencies, but there is an easier solution. First, copy everything (configure script, source code, and built binaries) to the environment with test dependencies. Then, run the configure script again to generate a new <code>Makefile</code>. Then we can run the check phase. Hopefully, nowhere in the source code does it use test-related macros.</p>
<p>If we ditch the check phases and the install check phases and move all of them to <code>passthru.tests</code> like this, a lot of rebuilds can be avoided.</p>
<p>Notice that avoiding rebuilds due to test depenencies is also related to content-addressed derivations. In a content-addressed model, if <code>foo</code> is a test dependency of <code>bar</code>, and <code>bar</code> is a build dependency of <code>baz</code>, then <code>baz</code> does not need rebuilding if <code>foo</code> gets an update because it does not change the output of <code>bar</code>. However, <code>bar</code> still needs a rebuild, which is unnecessary if it does not use check phases and install check phases but use <code>passthru.tests</code>.</p>
<h2 data-label="0.5" id="conclusion">Conclusion</h2>
<p>I proposed some ways to reduce mass rebuilds without changing Nix. However, each of them has some downsides and requires major refactoring of Nixpkgs.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="programming" /><category term="nix" /><summary type="html"><![CDATA[One serious problem with Nix is the amount of mass rebuilds happening in Nixpkgs every time some package with many dependents gets an update. I thought about three ideas to reduce mass rebuilds: store path replacements, separating compiling and linking, and ditching check phases. Each of them has some degree of impracticality.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2026-04-16-reduce-nix-rebuild.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2026-04-16-reduce-nix-rebuild.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Determining the stabilizability of the abelian sandpile model]]></title><link href="https://ulysseszh.github.io/math/2026/01/03/sandpile-stabilizable.html" rel="alternate" type="text/html" title="Determining the stabilizability of the abelian sandpile model" /><published>2026-01-03T14:56:49-08:00</published><updated>2026-01-03T14:56:49-08:00</updated><id>https://ulysseszh.github.io/math/2026/01/03/sandpile-stabilizable</id><content type="html" xml:base="https://ulysseszh.github.io/math/2026/01/03/sandpile-stabilizable.html"><![CDATA[<h2 data-label="0.1" id="introduction">Introduction</h2>
<p>Suppose that we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> sandpiles denoted as a set <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span>. Each sandpile <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x\in V</annotation></semantics></math></span></span> has a <dfn>toppling threshold</dfn> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>∈</mo><msub><mi mathvariant="double-struck">R</mi><mrow><mo>&gt;</mo><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">\fc\tht x\in\bR_{&gt;0}</annotation></semantics></math></span></span>, and each ordered pair of sandpiles <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x,x'\in V</annotation></semantics></math></span></span> has a <dfn>toppling transfer amount</dfn> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>∈</mo><msub><mi mathvariant="double-struck">R</mi><mrow><mo>≥</mo><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">\fc\alp{x,x'}\in\bR_{\ge0}</annotation></semantics></math></span></span>. The tuple <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>V</mi><mo separator="true">,</mo><mi>θ</mi><mo separator="true">,</mo><mi>α</mi><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{V,\tht,\alp}</annotation></semantics></math></span></span> is called an <dfn>abelian sandpile model</dfn>.</p>
<p>A <dfn>configuration</dfn> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>:</mo><mi>x</mi><mo>→</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">\eta:x\to\bR</annotation></semantics></math></span></span> is to assign an amount of sand <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\eta x</annotation></semantics></math></span></span> to each sandpile <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x\in V</annotation></semantics></math></span></span>, and it is <dfn>legal</dfn> if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\eta x\ge0</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x\in V</annotation></semantics></math></span></span> (or conveniently denoted as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\eta\ge0</annotation></semantics></math></span></span>). For any configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>, any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">y\in V</annotation></semantics></math></span></span> can <dfn>topple</dfn>, which is a transition to a new configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span> defined as
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mo>+</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{\eta'}x\ceq\fc\eta x-\fc\tht y\dlt_{xy}+\fc\alp{y,x}.</annotation></semantics></math></span></span></span> The toppling is <dfn>legal</dfn> if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\eta y\ge\fc\tht y</annotation></semantics></math></span></span>, in which case we call <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> an <dfn>unstable</dfn> site of the configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>. Notice that a legal configuration undergoing a legal toppling must become a legal configuration. A sequence of topplings where each toppling uses the resultant configuration of the previous toppling as the initial configuration is called a <dfn>toppling procedure</dfn>.</p>
<p>In its historically original form (<a href="https://doi.org/10.1103/PhysRevLett.64.1613" target="_blank" rel="external">Dhar, 1990</a>), <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> is the lattice sites on a 2D rectangular grid, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">\fc\tht x=4</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x\in V</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp{x,x'}</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">x'</annotation></semantics></math></span></span> are nearest neighbors or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> otherwise. It is then generalized to an arbitrary directed multigraph (<a href="https://doi.org/10.1007/978-3-7643-8786-0_17" target="_blank" rel="external">Holroyd et al., 2008</a>), where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> is its vertices, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht x</annotation></semantics></math></span></span> is the out-degree of vertex <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp{x,x'}</annotation></semantics></math></span></span> is the number of edges from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> to
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">x'</annotation></semantics></math></span></span>.</p>
<p>A configuration where none of the sandpiles can legally topple is called a <dfn>stable</dfn> configuration. In other words, configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> is stable if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\eta x&lt;\fc\tht x</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x\in V</annotation></semantics></math></span></span>, or denoted as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta&lt;\tht</annotation></semantics></math></span></span> in abbreviation. A toppling procedure that makes a configuration stable is called a <dfn>stabilizing</dfn> toppling procedure that stabilizes the configuration. A legal configuration is <dfn>stabilizable</dfn> if it has a finite legal stabilizing toppling procedure. Otherwise, the configuration is <dfn>exploding</dfn>. A natural question to ask then is how to determine whether a configuration is stabilizable or exploding.</p>
<h2 data-label="0.2" id="abelian-property">Abelian property</h2>
<p>One important fact to notice is that the abelian sandpile model has the so-called <dfn>abelian property</dfn>: if a configuration is stabilizable, then every legal toppling procedure of it is finite, and the stabilizing legal toppling procedure is unique up to the order of topplings. In other words, if we define the <dfn>toppling counting function</dfn> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">N</mi></mrow><annotation encoding="application/x-tex">u:V\to\bN</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc ux</annotation></semantics></math></span></span> is the number of times that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">x\in V</annotation></semantics></math></span></span> topples throughout the toppling procedure, then every legal stabilizing toppling procedure of a stabilizable configuration has the same toppling counting function, which is called the <dfn>odometer</dfn> of the configuration. We will leave the proof of the abelian property to a later part in this section.</p>
<p>In order to better describe the model, we can define a function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mo>:</mo><mi>V</mi><mo>×</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">\Dlt:V\times V\to\bR</annotation></semantics></math></span></span> (the notation comes from the notation of the Laplacian operator in vector analysis due to its direct analogy in the case of the abelian sandpile model on a grid, in which case it is called a Laplacian matrix in the language of graph theory) as follows: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mo>−</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc\Dlt{x,y}=\fc\tht x\dlt_{xy}-\fc\alp{x,y}.</annotation></semantics></math></span></span></span> It encodes information from both <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> and provides everything we need to know to find the resultant configuration given any initial configuration and the toppling counting function. Explicitly, configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> undergoing a toppling procedure with the toppling counting function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> becomes
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mi>y</mi></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{\eta'}x=\fc\eta x-\sum_y\fc\Dlt{x,y}\fc uy.</annotation></semantics></math></span></span></span> For abbreviation, we denote <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>↦</mo><msub><mo>∑</mo><mi>y</mi></msub><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">x\mapsto\sum_y\fc\Dlt{x,y}\fc uy</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi></mrow><annotation encoding="application/x-tex">\Dlt u</annotation></semantics></math></span></span> so that
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mo>∑</mo><mi>y</mi></msub><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Dlt u}x=\sum_y\fc\Dlt{x,y}\fc uy</annotation></semantics></math></span></span>. Therefore, the resultant configuration of a toppling procedure can be denoted as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi></mrow><annotation encoding="application/x-tex">\eta'=\eta-\Dlt u</annotation></semantics></math></span></span>. This notation is natural if we think of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> as an <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>-dimensional matrix and think of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>-dimensional column vectors. This equation tells us that the resultant configuration of two toppling procedures is the same as long as they have the same toppling counting function.</p>
<p>A toppling procedure can then be expressed as a sequence of toppling counting functions where the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span>th toppling counting function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>t</mi></msub></mrow><annotation encoding="application/x-tex">u_t</annotation></semantics></math></span></span> is that of the toppling procedure derived by truncating the full toppling procedure up to the first <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span> topplings. If the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span>th toppling happens at site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>, then <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>u</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>u</mi><mrow><mi>t</mi><mo>−</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{u_t}x-\fc{u_{t-1}}x=\dlt_{xy}.</annotation></semantics></math></span></span></span> We stipulate that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">u_0</annotation></semantics></math></span></span> is the zero function. From now on, we call a sequence <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mrow><mo fence="true">{</mo><msub><mi>u</mi><mi>t</mi></msub><mo fence="true">}</mo></mrow><mrow><mi>t</mi><mo>=</mo><mn>0</mn></mrow><mi>T</mi></msubsup></mrow><annotation encoding="application/x-tex">\B{u_t}_{t=0}^T</annotation></semantics></math></span></span> (where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> is either a natural number or infinity) as a toppling procedure as long as the following conditions are satisfied: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mn>0</mn></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">u_0=0</annotation></semantics></math></span></span>, and for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn><mo>≤</mo><mi>t</mi><mo>&lt;</mo><mi>T</mi></mrow><annotation encoding="application/x-tex">0\le t&lt;T</annotation></semantics></math></span></span>, there exists <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">y\in V</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mrow><mi>t</mi><mo>+</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>u</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>+</mo><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\fc{u_{t+1}}x=\fc{u_t}x+\dlt_{xy}</annotation></semantics></math></span></span>. It is obvious to see that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>x</mi></msub><msub><mi>u</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>t</mi></mrow><annotation encoding="application/x-tex">\sum_x\fc{u_t}x=t</annotation></semantics></math></span></span> for all
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span>. Therefore, the length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> of a toppling procedure is the same as the sum <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>x</mi></msub><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_x\fc ux</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u\ceq u_T</annotation></semantics></math></span></span> is the final toppling counting function of the toppling procedure. The definition of the legality of a toppling procedure is also naturally extended to this formulation.</p>
<p>Because the resultant configuration of a toppling procedure is independent of the order of the topplings, for two different sites <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span>, toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> and then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is equivalent to toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> and then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>. Both toppling procedures have the same toppling counting function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mo>+</mo><msub><mi>δ</mi><mrow><mi>x</mi><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow></msub></mrow><annotation encoding="application/x-tex">\dlt_{xy}+\dlt_{xy'}</annotation></semantics></math></span></span>. If both sites are unstable sites of the initial configuration, then both toppling procedures are legal. To see this, suppose that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> are two different unstable sites of the configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>. Then, the configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span> after
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> topples is given by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mo>+</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\eta'}x=\fc\eta x-\fc\tht y\dlt_{xy}+\fc\alp{y,x}</annotation></semantics></math></span></span>. Its value at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>=</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>+</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo separator="true">,</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\eta'}{y'}=\fc\eta{y'}+\fc\alp{y,y'}</annotation></semantics></math></span></span> (notice that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>δ</mi><mrow><mi>y</mi><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\dlt_{yy'}=0</annotation></semantics></math></span></span> because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo mathvariant="normal">≠</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y\ne y'</annotation></semantics></math></span></span>). The first term is at least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht{y'}</annotation></semantics></math></span></span> because
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is an unstable site of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>. The second term is nonnegative by definition. We then have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>≥</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\eta'}{y'}\ge\fc\tht{y'}</annotation></semantics></math></span></span>, which means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is also an unstable site of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span>, so toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> and then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is legal. By the same logic, toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> and then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> is legal.</p>
<p>Now, we proceed to prove the abelian property: a stabilizable configuration has a unique odometer. To prove this, it is sufficient to prove that, if a configuration is stabilizable, then you can always construct a legal stabilizing toppling procedure by choosing an arbitrary unstable site to topple at each step until the configuration becomes stable, which is guaranteed to happen in finite steps, and the resultant toppling counting function is independent of the choices of unstable sites to topple at each step.</p>
<p>We prove this by induction on the length of an arbitrary legal stabilizing toppling procedure. We will prove case by case for length being <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> as base cases, and then prove the inductive step for length being <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">T+1</annotation></semantics></math></span></span> assuming the case for length being <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>≥</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">T\ge1</annotation></semantics></math></span></span>.</p>
<p>The base case with zero length is trivial. For the base case with length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>, suppose that the configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> has a legal stabilizing toppling procedure of length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>. We need to prove that any choice of unstable site to topple leads to a stable configuration, and the odometer is uniquely determined. Becasue the constraint on the length of the toppling procedure, we need to prove that the unstable site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> in the initial configuration that topples in the legal stabilizing toppling procedure is the only unstable site in the initial configuration (so that the odometer can only be <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\fc ux=\dlt_{xy}</annotation></semantics></math></span></span>). This is obvious because we have already proven that, if there is another unstable site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span>, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is also an unstable site of the configuration after <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> topples, which contradicts the assumption that toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> is stabilizing.</p>
<p>Then proceed with the inductive part of the proof. Suppose that, for any configuration with a legal stabilizing toppling procedure of length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>≥</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">T\ge1</annotation></semantics></math></span></span>, arbitrarily choosing an unstable site to topple at each step will always stabilize after exactly <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> steps, and the toppling counting function of the resultant toppling procedure is unique. Then, we need to prove the same thing for length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">T+1</annotation></semantics></math></span></span>. Suppose that configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> has a legal stabilizing toppling procedure of length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">T+1</annotation></semantics></math></span></span> and that its toppling counting function is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span>. Denote <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> as the first toppling site in this toppling procedure. Then, the configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span> after the first toppling is given by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mo>+</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\eta'}x=\fc\eta x-\fc\tht y\dlt_{xy}+\fc\alp{y,x}</annotation></semantics></math></span></span>, and it has a legal stabilizing toppling procedure of length
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> whose toppling counting function is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\fc{u'}x=\fc ux-\dlt_{xy}</annotation></semantics></math></span></span>. By the induction assumption, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span> stabilizes after <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> arbitrary legal topplings, and the toppling counting function must be <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">u'</annotation></semantics></math></span></span>. Now, arbitrarily choose an unstable site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>. If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi>y</mi></mrow><annotation encoding="application/x-tex">y'=y</annotation></semantics></math></span></span>, then toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> gives
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span>, which stabilizes after <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> arbitrary legal topplings. If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo mathvariant="normal">≠</mo><mi>y</mi></mrow><annotation encoding="application/x-tex">y'\ne y</annotation></semantics></math></span></span>, then the fact that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is an unstable site of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> implies that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> is an unstable site of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span>, so we can construct a legal stabilizing toppling procedure of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span> such that the first toppling site is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span>. We then get a legal stabilizing toppling procedure of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> whose toppling counting function is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> such that the first two toppling sites are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> and
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span>. Because both <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> are unstable sites of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>, we can simply swap the first two toppling sites to get a toppling procedure of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> such that the first two toppling sites are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>. This means that toppling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> makes <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> become a configuration with a legal stabilizing toppling procedure of length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> with toppling counting function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>δ</mi><mrow><mi>x</mi><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow></msub></mrow><annotation encoding="application/x-tex">\fc ux-\dlt_{xy'}</annotation></semantics></math></span></span>. By the induction assumption, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> stabilizes after
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> topples followed by another <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> arbitrary topplings. Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">y'</annotation></semantics></math></span></span> itself is an arbitrary choice of an unstable site, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> stabilizes after <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">T+1</annotation></semantics></math></span></span> arbitrary topplings, and the toppling counting function is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span>. This finishes the induction step of the proof.</p>
<h2 data-label="0.3" id="least-action-principle">Least action principle</h2>
<p>Another property of the abelian sandpile model is the <dfn>least action principle</dfn> <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>: assuming that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> is the odometer of a stabilizable configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>, then for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">N</mi></mrow><annotation encoding="application/x-tex">u':V\to\bN</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta-\Dlt u'&lt;\tht</annotation></semantics></math></span></span>, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>≥</mo><mi>u</mi></mrow><annotation encoding="application/x-tex">u'\ge u</annotation></semantics></math></span></span>.</p>
<p>Here I present a proof inspired by <a href="https://doi.org/10.1007/s10955-009-9899-6" target="_blank" rel="external">Fey et al. (2009)</a>. Construct a legal toppling procedure starting from the configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> as follows. At each step where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mrow><mi>t</mi><mo>+</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>u</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>+</mo><msub><mi>δ</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\fc{u_{t+1}}x=\fc{u_t}x+\dlt_{xy}</annotation></semantics></math></span></span>, the toppling site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> satisfies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi mathvariant="normal">Δ</mi><msub><mi>u</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\eta y-\fc{\Dlt u_t}y\ge\fc\tht y</annotation></semantics></math></span></span> and
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{u_t}y&lt;\fc{u'}y</annotation></semantics></math></span></span>. When there are multiple sites satisfying the conditions, arbitrarily choose one. Continue until none of the sites satisfy the conditions, which always happen after finite steps because any toppling procedure of a stabilizable configuration is finite. This is a legal toppling procedure whose toppling counting function never exceeds <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">u'</annotation></semantics></math></span></span>. Suppose that the length of the toppling procedure is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span>. We then prove by contradiction that this toppling procedure is stabilizing. Suppose that the final configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">\eta'=\eta-\Dlt u_T</annotation></semantics></math></span></span> of this toppling procedure has an unstable site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>. Because the final configuration is unstable, the only reason that the toppling procedure stops is that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{u_T}y=\fc{u'}y</annotation></semantics></math></span></span>. Define
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>−</mo><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u''\ceq u'-u_T</annotation></semantics></math></span></span>, so <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{u''}y=0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">u''\ge0</annotation></semantics></math></span></span>. We have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>+</mo><munder><mo>∑</mo><mi>x</mi></munder><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc\eta y-\fc{\Dlt u'}y
&amp;=\fc{\eta'}y-\fc{\Dlt u''}y\\
&amp;=\fc{\eta'}y-\fc\tht y\fc{u''}y+\sum_x\fc\alp{y,x}\fc{u''}x\\
&amp;\ge\fc{\eta'}y\ge\fc\tht y,
\end{align*}</annotation></semantics></math></span></span></span>
which contradicts the assumption that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> is an unstable site of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span>.</p>
<p>What the least action principle tells us is that, the odemeter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> of a stabilizable configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> is the unique minimum natural number solution to the system of linear inequalities <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta-\Dlt u&lt;\tht</annotation></semantics></math></span></span>. The toppling procedure defined above also provides a constructive way to find the odometer once we have any natural number solution to the system of linear inequalities.</p>
<p>Notice that we cannot relax <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">u'</annotation></semantics></math></span></span> to be a more general real-valued function. If so, in the proof above, the condition <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{u''}y=0</annotation></semantics></math></span></span> becomes <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\fc{u''}y&lt;1</annotation></semantics></math></span></span>. In fact, we can easily find counterexamples where, there exists a real-valued solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">u'</annotation></semantics></math></span></span> to the system of linear inequalities, but the configuration is exploding. This is sad news because it means that determining the stabilizability of a configuration cannot be done by linear programming.</p>
<p>A corollary of the least action principle is that, if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta-\Dlt u&lt;\tht</annotation></semantics></math></span></span> has a natural number solution, then there exists a unique minimum solution, whose value at each site is the minimum among all natural number solutions at that site.</p>
<p>A related property is that, if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>=</mo><msub><mi>u</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">u=u_1</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>=</mo><msub><mi>u</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">u=u_2</annotation></semantics></math></span></span> both satisfies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta-\Dlt u&lt;\tht</annotation></semantics></math></span></span>, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>=</mo><mi mathvariant="normal">min</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>u</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>u</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">u=\opc{min}{u_1,u_2}</annotation></semantics></math></span></span> also satisfies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta-\Dlt u&lt;\tht</annotation></semantics></math></span></span>, where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">min</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>u</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>u</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi mathvariant="normal">min</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo><msub><mi>u</mi><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\opc{min}{u_1,u_2}}x\ceq\opc{min}{\fc{u_1}x,\fc{u_2}x}</annotation></semantics></math></span></span> denotes the pointwise minimum. This property also applies to general real-valued solutions instead of just natural number solutions. To prove this, assuming <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≤</mo><msub><mi>u</mi><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{u_1}x\le\fc{u_2}x</annotation></semantics></math></span></span> without loss of generality, notice that
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">Δ</mi><mi mathvariant="normal">min</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>u</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>u</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mi>y</mi></munder><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">min</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo><msub><mi>u</mi><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mi>y</mi></munder><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi mathvariant="normal">Δ</mi><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{\Dlt\opc{min}{u_1,u_2}}x
&amp;=\fc\tht x\fc{u_1}x-\sum_y\fc\alp{x,y}\opc{min}{\fc{u_1}y,\fc{u_2}y}\\
&amp;\ge\fc\tht x\fc{u_1}x-\sum_y\fc\alp{x,y}\fc{u_1}y\\
&amp;=\fc{\Dlt u_1}x.
\end{align*}</annotation></semantics></math></span></span></span>
By this property, under the binary operator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">min</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>⋅</mo><mo separator="true">,</mo><mo>⋅</mo><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\opc{min}{\cdot,\cdot}</annotation></semantics></math></span></span>, the set <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>P</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>u</mi><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">R</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi><mo separator="true">,</mo><mi>u</mi><mo>≥</mo><mn>0</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">P\ceq\set{u:V\to\bR}{\eta-\Dlt u&lt;\tht,u\ge0}</annotation></semantics></math></span></span></span> forms an idempotent commutative semigroup if not empty. Its closure <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mover accent="true"><mi>P</mi><mo stretchy="true">‾</mo></mover><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>u</mi><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">R</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≤</mo><mi>θ</mi><mo separator="true">,</mo><mi>u</mi><mo>≥</mo><mn>0</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\overline P\ceq\set{u:V\to\bR}{\eta-\Dlt u\le\tht,u\ge0}</annotation></semantics></math></span></span></span> is an idempotent commutative monoid if not empty, whose identity element is the unique minimum element of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>P</mi><mo stretchy="true">‾</mo></mover></mrow><annotation encoding="application/x-tex">\overline P</annotation></semantics></math></span></span>, which obviously exists. The set
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>P</mi><mi mathvariant="double-struck">N</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>u</mi><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">N</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">P_\bN\ceq\set{u:V\to\bN}{\eta-\Dlt u&lt;\tht}</annotation></semantics></math></span></span></span> is a subsemigroup of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi></mrow><annotation encoding="application/x-tex">P</annotation></semantics></math></span></span> and also a monoid if not empty. However, notice that the identity element of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi mathvariant="double-struck">N</mi></msub></mrow><annotation encoding="application/x-tex">P_\bN</annotation></semantics></math></span></span> is always different from that of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>P</mi><mo stretchy="true">‾</mo></mover></mrow><annotation encoding="application/x-tex">\overline P</annotation></semantics></math></span></span>.</p>
<h2 data-label="0.4" id="integer-linear-programming">Integer linear programming</h2>
<p>As we have seen, determining the stabilizability of a configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> is equivalent to determining whether there exists a natural number solution to the system of linear inequalities <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&lt;</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta-\Dlt u&lt;\tht</annotation></semantics></math></span></span>. Such problems are called <dfn>integer linear programming (ILP)</dfn> problems.</p>
<p>The most general form of an ILP problem is, given a matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span> and vectors <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span></span>, to find natural number vector <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> that minimizes <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mi mathvariant="normal">T</mi></msup><mi>x</mi></mrow><annotation encoding="application/x-tex">c^\mrm Tx</annotation></semantics></math></span></span> subject to the constraint <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mi>x</mi><mo>≤</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">Ax\le b</annotation></semantics></math></span></span>. There is also the feasibility version of ILP problems, which only asks whether there exists a natural number vector <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> satisfying the constraint <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mi>x</mi><mo>≤</mo><mi>b</mi></mrow><annotation encoding="application/x-tex">Ax\le b</annotation></semantics></math></span></span> without the objective of optimizing some objective.</p>
<p>Now come back to the problem of determining the stabilizability of a configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>. From a computational point of view, because we cannot really store arbitrary real numbers in a computer, we are only going to consider the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> are both rational-valued functions. Then, without loss of generality, when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> is finite, we can multiply both functions by a common multiple of denominators to make them both integer-valued functions <a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>. The problem of determining the stabilizability of a configuration then becomes a special case of the feasibility version of ILP problems, which is to determine whether there exists a natural number solution to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ψ</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>η</mi><mo>−</mo><mi>θ</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\psi\ceq\eta-\tht+1</annotation></semantics></math></span></span>. It is only a special case because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> by the definition of the abelian sandpile model can only be a Z-matrix, which is defined as a square matrix whose off-diagonal entries are all nonpositive. Because of this restriction, it may not be as hard as the general ILP problems, which are known to be NP-complete. However, Z-matrix ILP problems are in fact also NP-complete.</p>
<details>
<summary>
Proving NP-completeness of Z-matrix ILP problems
</summary>
<p>To prove that the Z-matrix ILP problem is NP-complete, we reduce the good simultaneous approximation problem, which is known to be NP-complete (<a href="https://doi.org/10.1137/0214016" target="_blank" rel="external">Lagarias, 1985</a>), to the Z-matrix ILP problem.</p>
<p>The good simultaneous approximation problem states as follows: given rational numbers <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">r_i</annotation></semantics></math></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi>n</mi><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">i=0,\ldots,n-1</annotation></semantics></math></span></span>), a positive rational number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ε</mi></mrow><annotation encoding="application/x-tex">\veps</annotation></semantics></math></span></span>, and a positive integer <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>, determine whether there exists a positive integer <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo>≤</mo><mi>N</mi></mrow><annotation encoding="application/x-tex">Q\le N</annotation></semantics></math></span></span> such that <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munder><mrow><mi>max</mi><mo>⁡</mo></mrow><mi>i</mi></munder><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mi>Q</mi><mo>−</mo><mrow><mo fence="true">⌊</mo><msub><mi>r</mi><mi>i</mi></msub><mi>Q</mi><mo fence="true">⌉</mo></mrow><mo fence="true">∣</mo></mrow><mo>≤</mo><mi>ε</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\max_i\v{r_iQ-\round{r_iQ}}\le\veps.</annotation></semantics></math></span></span></span></p>
<p>This problem can be reduced to the following Z-matrix ILP problem. Denote <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mo fence="true">{</mo><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo fence="true">}</mo></mrow><mrow><mi>x</mi><mo>∈</mo><mi>V</mi></mrow></msub><mo>=</mo><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>p</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>r</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\B{\fc ux}_{x\in V}=\p{\B{p_i},\B{q_i},r}</annotation></semantics></math></span></span> (so it is a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mn>2</mn><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{2n+1}</annotation></semantics></math></span></span>-dimensional vector), and construct <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\psi</annotation></semantics></math></span></span> so that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span> is equivalent to the system of the following linear inequalities: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>p</mi><mi>i</mi></msub><mo>−</mo><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mo fence="true">∣</mo></mrow><msub><mi>q</mi><mi>i</mi></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mo>−</mo><mi>ε</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mn>3</mn><mi>ε</mi><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>i</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>p</mi><mi>i</mi></msub><mo>+</mo><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mo fence="true">∣</mo></mrow><msub><mi>q</mi><mi>i</mi></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mo>−</mo><mi>ε</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo>−</mo><msub><mi>q</mi><mn>0</mn></msub><mo>−</mo><mi>r</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mo>−</mo><mi>N</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	p_i-\v{r_i}q_i&amp;\ge-\veps,\\
	3\veps\p{q_i-q_{i+1}}-p_i+\v{r_i}q_i&amp;\ge-\veps,\\
	-q_0-r&amp;\ge-N,
\end{align*}</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>q</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">q_n\ceq q_0</annotation></semantics></math></span></span>.</p>
<p>Now, we prove that this Z-matrix ILP problem is equivalent to the initial good simultaneous approximation problem. The equivalence is two-way: for any solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> to the Z-matrix ILP problem, there exists a solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi></mrow><annotation encoding="application/x-tex">Q</annotation></semantics></math></span></span> to the good simultaneous approximation problem, and vice versa.</p>
<p>Given a solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi></mrow><annotation encoding="application/x-tex">Q</annotation></semantics></math></span></span> to the good simultaneous approximation problem, we can construct a solution to the Z-matrix ILP problem as follows: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>q</mi><mi>i</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>Q</mi><mo separator="true">,</mo><mspace width="2em"/><msub><mi>p</mi><mi>i</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌊</mo><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mo fence="true">∣</mo></mrow><mi>Q</mi><mo fence="true">⌉</mo></mrow><mo separator="true">,</mo><mspace width="2em"/><mi>r</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">q_i\ceq Q,\qquad p_i\ceq\round{\v{r_i}Q},\qquad r\ceq0.</annotation></semantics></math></span></span></span> It is trivial to verify that all the linear inequalities are satisfied.</p>
<p>Given a solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>p</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>r</mi><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{\B{p_i},\B{q_i},r}</annotation></semantics></math></span></span> to the Z-matrix ILP problem, I will prove that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>q</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">Q\ceq q_0</annotation></semantics></math></span></span> is a solution to the good simultaneous approximation problem. First, I prove by contradition that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>i</mi></msub><mo>≥</mo><msub><mi>q</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow><annotation encoding="application/x-tex">q_i\ge q_{i+1}</annotation></semantics></math></span></span>. Suppose that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>i</mi></msub><mo>&lt;</mo><msub><mi>q</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow><annotation encoding="application/x-tex">q_i&lt;q_{i+1}</annotation></semantics></math></span></span>. Then, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mn>3</mn><mi>ε</mi><mtext> </mtext><munder><munder><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>i</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mo stretchy="true">⏟</mo></munder><mrow><mo>≤</mo><mo>−</mo><mn>1</mn></mrow></munder><mo>−</mo><munder><munder><mrow><mo fence="true">(</mo><msub><mi>p</mi><mi>i</mi></msub><mo>−</mo><msub><mi>r</mi><mi>i</mi></msub><msub><mi>q</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo stretchy="true">⏟</mo></munder><mrow><mo>≥</mo><mo>−</mo><mi>ε</mi></mrow></munder><mo>≤</mo><mo>−</mo><mn>3</mn><mi>ε</mi><mo>+</mo><mi>ε</mi><mo>&lt;</mo><mo>−</mo><mi>ε</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">3\veps\,\underbrace{\p{q_i-q_{i+1}}}_{\le-1}
-\underbrace{\p{p_i-r_iq_i}}_{\ge-\veps}
\le-3\veps+\veps&lt;-\veps.</annotation></semantics></math></span></span></span> This contradicts with the second inequality in the Z-matrix ILP problem. Therefore, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>i</mi></msub><mo>≥</mo><msub><mi>q</mi><mrow><mi>i</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow><annotation encoding="application/x-tex">q_i\ge q_{i+1}</annotation></semantics></math></span></span>, and furthermore <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mn>0</mn></msub><mo>≥</mo><msub><mi>q</mi><mn>1</mn></msub><mo>≥</mo><mo>⋯</mo><mo>≥</mo><msub><mi>q</mi><mi>n</mi></msub><mo>≥</mo><msub><mi>q</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">q_0\ge q_1\ge\cdots\ge q_n\ge q_0</annotation></semantics></math></span></span>. The only way this can be satisfied is that all
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">q_i</annotation></semantics></math></span></span> are equal to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi></mrow><annotation encoding="application/x-tex">Q</annotation></semantics></math></span></span>. The first inequality and the second inequality then become <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>ε</mi><mo>≤</mo><mo>−</mo><msub><mi>p</mi><mi>i</mi></msub><mo>+</mo><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mo fence="true">∣</mo></mrow><mi>Q</mi><mo>≤</mo><mi>ε</mi></mrow><annotation encoding="application/x-tex">-\veps\le-p_i+\v{r_i}Q\le\veps</annotation></semantics></math></span></span>. Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mi>Q</mi><mo>−</mo><mrow><mo fence="true">⌊</mo><msub><mi>r</mi><mi>i</mi></msub><mi>Q</mi><mo fence="true">⌉</mo></mrow><mo fence="true">∣</mo></mrow><mo>≤</mo><mrow><mo fence="true">∣</mo><mrow><mo fence="true">∣</mo><msub><mi>r</mi><mi>i</mi></msub><mo fence="true">∣</mo></mrow><mi>Q</mi><mo>−</mo><msub><mi>p</mi><mi>i</mi></msub><mo fence="true">∣</mo></mrow><mo>≤</mo><mi>ε</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\v{r_iQ-\round{r_iQ}}\le\v{\v{r_i}Q-p_i}\le\veps.</annotation></semantics></math></span></span></span> The constraint <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo>≤</mo><mi>N</mi></mrow><annotation encoding="application/x-tex">Q\le N</annotation></semantics></math></span></span> is implied by the third inequality. The proof is complete.</p>
</details>
<p>We can design this algorithm inspired by <a href="https://doi.org/10.1137/S0097539793251876" target="_blank" rel="external">Hochbaum et al. (1994)</a> to solve the Z-matrix ILP problem. To find a natural number solution to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span> for some given Z-matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> and vector <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\psi</annotation></semantics></math></span></span>, first solve the linear programming relaxation of the problem to find a real-valued minimum solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">u^*</annotation></semantics></math></span></span> or exit and report nonexistence of solutions if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">u^*</annotation></semantics></math></span></span> does not exist, and then iteratively calculate a sequence <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{u^{\p k}}</annotation></semantics></math></span></span> starting from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mn>0</mn><mo fence="true">)</mo></mrow></msup><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌈</mo><msup><mi>u</mi><mo>∗</mo></msup><mo fence="true">⌉</mo></mrow></mrow><annotation encoding="application/x-tex">u^{\p0}\ceq\ceil{u^*}</annotation></semantics></math></span></span> (where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⌈</mo><mo>⋅</mo><mo fence="true">⌉</mo></mrow><annotation encoding="application/x-tex">\ceil{\cdot}</annotation></semantics></math></span></span> is the componentwise ceiling function) by this procedure: for each row <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span>, if the inequality
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>y</mi></msub><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_y\fc\Dlt{x,y}\fc{u^{\p k}}y\ge\fc\psi x</annotation></semantics></math></span></span> is violated, then exit and report nonexistence of solutions if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≤</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\Dlt{x,x}\le0</annotation></semantics></math></span></span>, or update <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌈</mo><mfrac><mn>1</mn><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mrow><mo fence="true">(</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mrow><mi>y</mi><mo mathvariant="normal">≠</mo><mi>x</mi></mrow></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">⌉</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo mathvariant="normal">≠</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{u^{\p{k+1}}}x&amp;\ceq\ceil{\fr1{\fc\Dlt{x,x}}\p{\fc\psi x-\sum_{y\ne x}\fc\Dlt{x,y}\fc{u^{\p k}}y}},\\
\fc{u^{\p{k+1}}}{y\ne x}&amp;\ceq\fc{u^{\p k}}y
\end{align*}</annotation></semantics></math></span></span></span> and start the next iteration; repeat the iteration until either all inequalities are satisfied (solution found) or any component of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">u^{\p k}</annotation></semantics></math></span></span> exceed a predetermined upper bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span>.</p>
<p>Before we address this dubious upper bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span>, let us first prove that this algorithm finds the minimum solution if a solution exists and is within the bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span>. There are three ways in which the program ends: exceeding the bound, satisfying all inequalities, or having <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≤</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\Dlt{x,x}\le0</annotation></semantics></math></span></span> for an unsatisfied inequality.</p>
<p>For the case when the program ends due to exceeding the bound, we need to prove that no solution exists within the bound. It is equivalent to proving that, if a solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub><mo>≤</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">u_T\le B</annotation></semantics></math></span></span> exists within the bound, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">u^{\p k}</annotation></semantics></math></span></span> can never exceed the bound. Sufficiently, I will prove by induction that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mo>≤</mo><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u^{\p k}\le u_T</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span>. The base case <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">k=0</annotation></semantics></math></span></span> is obvious because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">u^*</annotation></semantics></math></span></span> as the minimum real solution must satisfy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo>∗</mo></msup><mo>≤</mo><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u^*\le u_T</annotation></semantics></math></span></span>. For the inductive step, suppose that
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mo>≤</mo><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u^{\p k}\le u_T</annotation></semantics></math></span></span> for some <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">k\ge0</annotation></semantics></math></span></span>. Then, if row <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> of the inequalities is violated (in other words, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>y</mi></msub><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≤</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_y\fc\Dlt{x,y}\fc{u^{\p k}}y\le\fc\psi x</annotation></semantics></math></span></span>), we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mrow><mo fence="true">⌈</mo><mfrac><mn>1</mn><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mrow><mo fence="true">(</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mrow><mi>y</mi><mo mathvariant="normal">≠</mo><mi>x</mi></mrow></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">⌉</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≤</mo><mrow><mo fence="true">⌈</mo><mfrac><mn>1</mn><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mrow><mo fence="true">(</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mrow><mi>y</mi><mo mathvariant="normal">≠</mo><mi>x</mi></mrow></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">⌉</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≤</mo><mrow><mo fence="true">⌈</mo><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo fence="true">⌉</mo></mrow><mo>=</mo><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{u^{\p{k+1}}}x&amp;=\ceil{\fr1{\fc\Dlt{x,x}}\p{\fc\psi x-\sum_{y\ne x}\fc\Dlt{x,y}\fc{u^{\p k}}y}}\\
&amp;\le\ceil{\fr1{\fc\Dlt{x,x}}\p{\fc\psi x-\sum_{y\ne x}\fc\Dlt{x,y}\fc{u_T}y}}\\
&amp;\le\ceil{\fc{u_T}x}=\fc{u_T}x,
\end{align*}</annotation></semantics></math></span></span></span> where the first inequality is due to the induction assumption and the Z-matrix property and the second inequality is due to the assumption that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u_T</annotation></semantics></math></span></span> is a solution of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span>.</p>
<p>For the case when the program ends due to satisfying all inequalities, we have found a solution.</p>
<p>For the case when the program ends due to having <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≤</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\Dlt{x,x}\le0</annotation></semantics></math></span></span> for an unsatisfied inequality, I will prove by contradiction that no solution exists in this case. Suppose that there exists a solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u_T</annotation></semantics></math></span></span>, then we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mo>≤</mo><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u^{\p k}\le u_T</annotation></semantics></math></span></span>. We then have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>&gt;</mo><munder><mo>∑</mo><mi>y</mi></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≥</mo><munder><mo>∑</mo><mi>y</mi></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc\psi x&gt;\sum_y\fc\Dlt{x,y}\fc{u^{\p k}}y
\ge\sum_y\fc\Dlt{x,y}\fc{u_T}y
\ge\fc\psi x,</annotation></semantics></math></span></span></span> where the first inequality is because of the violated inequality, and the second inequality is because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≤</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\Dlt{x,x}\le0</annotation></semantics></math></span></span> and the Z-matrix property, and the third inequality is because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">u_T</annotation></semantics></math></span></span> is a solution of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span>. This is a contradiction.</p>
<p>Finally, we address the dubious upper bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span>. In order for the algorithm to work, we need to determine a finite upper bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span> under which a solution is guaranteed to exist if any solution exists. A safe choice is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><msup><mi>u</mi><mo>∗</mo></msup><mo>+</mo><mi>n</mi><mi>D</mi></mrow><annotation encoding="application/x-tex">B=u^*+nD</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span></span> is maximum of the absolute values of subdeterminants <a href="#fn3" class="footnote-ref" id="fnref3" role="doc-noteref"><sup>3</sup></a> of the matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span>. I follow <a href="https://doi.org/10.1007/BF01582230" target="_blank" rel="external">Cook et al. (1986)</a> to give a proof.</p>
<p>Suppose that there exists a natural number solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">u_T'</annotation></semantics></math></span></span>. Partition elements in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> into two disjoint subsets <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mo>&gt;</mo></msub></mrow><annotation encoding="application/x-tex">V_&gt;</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mo>&lt;</mo></msub></mrow><annotation encoding="application/x-tex">V_&lt;</annotation></semantics></math></span></span> defined as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>V</mi><mo>&gt;</mo></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>x</mi><mo>∈</mo><mi>V</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><mi mathvariant="normal">Δ</mi><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo fence="true">}</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>V</mi><mo>&lt;</mo></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>x</mi><mo>∈</mo><mi>V</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><mi mathvariant="normal">Δ</mi><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo fence="true">}</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
V_&gt;&amp;\ceq\set{x\in V}{\fc{\Dlt u_T'}x\ge\fc{\Dlt u^*}x},\\
V_&lt;&amp;\ceq\set{x\in V}{\fc{\Dlt u_T'}x&lt;\fc{\Dlt u^*}x}.
\end{align*}</annotation></semantics></math></span></span></span> The set <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mo>&lt;</mo></msub></mrow><annotation encoding="application/x-tex">V_&lt;</annotation></semantics></math></span></span> corresponds to the rows of inequalities that are slack. To see this, notice that for
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&lt;</mo></msub></mrow><annotation encoding="application/x-tex">x\in V_&lt;</annotation></semantics></math></span></span>, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>&gt;</mo><mi mathvariant="normal">Δ</mi><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Dlt u^*}x&gt;\fc{\Dlt u_T'}x\ge\fc\psi x</annotation></semantics></math></span></span>. This motivates us to use complementary slackness to get more information about <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span>. Notice that, for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">z\in V</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">u^*</annotation></semantics></math></span></span> is an optimal solution to the linear program of minimizing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc uz</annotation></semantics></math></span></span> subject to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span>. Its dual linear program is to maximize
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>x</mi></msub><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi>v</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_x\fc\psi x\fc vx</annotation></semantics></math></span></span> subject to the constraint <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>x</mi></msub><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mi>v</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≤</mo><msub><mi>δ</mi><mrow><mi>y</mi><mi>z</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\sum_x\fc\Dlt{x,y}\fc vx\le\dlt_{yz}</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>∈</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">y\in V</annotation></semantics></math></span></span>. By complementary slackness, the optimal solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>v</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">v^*</annotation></semantics></math></span></span> exists and satisfies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>v</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{v^*}y=0</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>∈</mo><msub><mi>V</mi><mo>&lt;</mo></msub></mrow><annotation encoding="application/x-tex">y\in V_&lt;</annotation></semantics></math></span></span>. Therefore, for any
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{\Dlt u}x\ge0</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&gt;</mo></msub></mrow><annotation encoding="application/x-tex">x\in V_&gt;</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><munder><mo>∑</mo><mi>y</mi></munder><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><msub><mi>δ</mi><mrow><mi>y</mi><mi>z</mi></mrow></msub></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><munder><mo>∑</mo><mi>y</mi></munder><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>y</mi><mo fence="true">)</mo></mrow><munder><mo>∑</mo><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&gt;</mo></msub></mrow></munder><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><msup><mi>v</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munder><mo>∑</mo><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&gt;</mo></msub></mrow></munder><msup><mi>v</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc uz=\sum_y\fc uy\dlt_{yz}
&amp;\ge\sum_y\fc uy\sum_{x\in V_&gt;}\fc\Dlt{x,y}\fc{v^*}x\\
&amp;=\sum_{x\in V_&gt;}\fc{v^*}x\fc{\Dlt u}x\ge0.
\end{align*}</annotation></semantics></math></span></span></span>
Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> is arbitrary, this means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{\Dlt u}x\ge0</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&gt;</mo></msub></mrow><annotation encoding="application/x-tex">x\in V_&gt;</annotation></semantics></math></span></span> implies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">u\ge0</annotation></semantics></math></span></span>.</p>
<p>We can define a polyhedral cone <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>u</mi><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">R</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><msup><mi mathvariant="normal">Δ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>u</mi><mo>≥</mo><mn>0</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">C\ceq\set{u:V\to\bR}{\Dlt'u\ge0}</annotation></semantics></math></span></span>, where <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi mathvariant="normal">Δ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&gt;</mo></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&lt;</mo></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">\fc{\Dlt'}{x,y}\ceq\begin{cases}
\fc\Dlt{x,y},&amp;x\in V_&gt;,\\
-\fc\Dlt{x,y},&amp;x\in V_&lt;.
\end{cases}</annotation></semantics></math></span></span></span> We then have that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>∈</mo><mi>C</mi></mrow><annotation encoding="application/x-tex">u\in C</annotation></semantics></math></span></span> implies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">u\ge0</annotation></semantics></math></span></span>. We can choose a finite set <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mo>⊆</mo><mi>C</mi></mrow><annotation encoding="application/x-tex">G\subseteq C</annotation></semantics></math></span></span> that generates <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span> (in other words, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span> is the nonnegative linear combination of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span>) such that, for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>∈</mo><mi>G</mi></mrow><annotation encoding="application/x-tex">g\in G</annotation></semantics></math></span></span>,
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span> is integral and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn><mo>≤</mo><mi>g</mi><mo>≤</mo><mi>D</mi></mrow><annotation encoding="application/x-tex">0\le g\le D</annotation></semantics></math></span></span>. To see that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>≤</mo><mi>D</mi></mrow><annotation encoding="application/x-tex">g\le D</annotation></semantics></math></span></span> is always possible, notice that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span> is in the null space of some submatrix of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Δ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\Dlt'</annotation></semantics></math></span></span>, which is spanned by vectors whose components are subdeterminants of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Δ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\Dlt'</annotation></semantics></math></span></span>, which are all bounded by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span></span> in absolute value by definition. By definition of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mo>&gt;</mo></msub></mrow><annotation encoding="application/x-tex">V_&gt;</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mo>&lt;</mo></msub></mrow><annotation encoding="application/x-tex">V_&lt;</annotation></semantics></math></span></span>, we obviously have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo>−</mo><msup><mi>u</mi><mo>∗</mo></msup><mo>∈</mo><mi>C</mi></mrow><annotation encoding="application/x-tex">u_T'-u^*\in C</annotation></semantics></math></span></span>. Therefore, by Carathéodory’s theorem, there exists <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span></span> (the dimension of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span>) vectors <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>g</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{g_i}</annotation></semantics></math></span></span> in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span></span> nonnegative real numbers <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{\lmd_i}</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo>−</mo><msup><mi>u</mi><mo>∗</mo></msup><mo>=</mo><msub><mo>∑</mo><mi>i</mi></msub><msub><mi>λ</mi><mi>i</mi></msub><msub><mi>g</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">u_T'-u^*=\sum_i\lmd_ig_i</annotation></semantics></math></span></span>. Construct <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo>−</mo><munder><mo>∑</mo><mi>i</mi></munder><mrow><mo fence="true">⌊</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">⌋</mo></mrow><msub><mi>g</mi><mi>i</mi></msub><mo>=</mo><msup><mi>u</mi><mo>∗</mo></msup><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><mrow><mo fence="true">(</mo><msub><mi>λ</mi><mi>i</mi></msub><mo>−</mo><mrow><mo fence="true">⌊</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">⌋</mo></mrow><mo fence="true">)</mo></mrow><msub><mi>g</mi><mi>i</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">u_T\ceq u_T'-\sum_i\floor{\lmd_i}g_i
=u^*+\sum_i\p{\lmd_i-\floor{\lmd_i}}g_i.</annotation></semantics></math></span></span></span> It is obviously integral and satisfies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub><mo>≤</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">u_T\le B</annotation></semantics></math></span></span>. We can verify that it is a solution of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>≥</mo><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\Dlt u\ge\psi</annotation></semantics></math></span></span>. For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&lt;</mo></msub></mrow><annotation encoding="application/x-tex">x\in V_&lt;</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">Δ</mi><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi mathvariant="normal">Δ</mi><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>−</mo><munder><mo>∑</mo><mi>i</mi></munder><mrow><mo fence="true">⌊</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">⌋</mo></mrow><mi mathvariant="normal">Δ</mi><msub><mi>g</mi><mi>i</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi mathvariant="normal">Δ</mi><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><mrow><mo fence="true">⌊</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">⌋</mo></mrow><msup><mi mathvariant="normal">Δ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msub><mi>g</mi><mi>i</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mi mathvariant="normal">Δ</mi><msubsup><mi>u</mi><mi>T</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{\Dlt u_T}x
&amp;=\fc{\Dlt u_T'}x-\sum_i\floor{\lmd_i}\fc{\Dlt g_i}x\\
&amp;=\fc{\Dlt u_T'}x+\sum_i\floor{\lmd_i}\fc{\Dlt'g_i}x\\
&amp;\ge\fc{\Dlt u_T'}x\ge\fc\psi x.
\end{align*}</annotation></semantics></math></span></span></span>
For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><msub><mi>V</mi><mo>&gt;</mo></msub></mrow><annotation encoding="application/x-tex">x\in V_&gt;</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi mathvariant="normal">Δ</mi><msub><mi>u</mi><mi>T</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><mrow><mo fence="true">(</mo><msub><mi>λ</mi><mi>i</mi></msub><mo>−</mo><mrow><mo fence="true">⌊</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">⌋</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">Δ</mi><msub><mi>g</mi><mi>i</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><mrow><mo fence="true">(</mo><msub><mi>λ</mi><mi>i</mi></msub><mo>−</mo><mrow><mo fence="true">⌊</mo><msub><mi>λ</mi><mi>i</mi></msub><mo fence="true">⌋</mo></mrow><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">Δ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msub><mi>g</mi><mi>i</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mi mathvariant="normal">Δ</mi><msup><mi>u</mi><mo>∗</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>≥</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{\Dlt u_T}x
&amp;=\fc{\Dlt u^*}x+\sum_i\p{\lmd_i-\floor{\lmd_i}}\fc{\Dlt g_i}x\\
&amp;=\fc{\Dlt u^*}x+\sum_i\p{\lmd_i-\floor{\lmd_i}}\fc{\Dlt'g_i}x\\
&amp;\ge\fc{\Dlt u^*}x\ge\fc\psi x.
\end{align*}</annotation></semantics></math></span></span></span>
We thus have found a solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mi>T</mi></msub><mo>≤</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">u_T\le B</annotation></semantics></math></span></span>.</p>
<p>Therefore, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><msup><mi>u</mi><mo>∗</mo></msup><mo>+</mo><mi>n</mi><mi>D</mi></mrow><annotation encoding="application/x-tex">B=u^*+nD</annotation></semantics></math></span></span> is a valid upper bound. However, it is often hard to compute <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span></span> in practice, so we may use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><msup><mi>u</mi><mo>∗</mo></msup><mo>+</mo><mi>n</mi><msup><mi>D</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">B=u^*+nD'</annotation></semantics></math></span></span> for some <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>D</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>≥</mo><mi>D</mi></mrow><annotation encoding="application/x-tex">D'\ge D</annotation></semantics></math></span></span> that is easier to compute. Obviously a choice is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>D</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi>n</mi><mo stretchy="false">!</mo><msubsup><mrow><mo fence="true">∥</mo><mi mathvariant="normal">Δ</mi><mo fence="true">∥</mo></mrow><mi mathvariant="normal">∞</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">D'=n!\V{\Dlt}_\infty^n</annotation></semantics></math></span></span>, where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mo fence="true">∥</mo><mi mathvariant="normal">Δ</mi><mo fence="true">∥</mo></mrow><mi mathvariant="normal">∞</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msub><mrow><mi>max</mi><mo>⁡</mo></mrow><mrow><mi>x</mi><mo separator="true">,</mo><mi>y</mi></mrow></msub><mrow><mo fence="true">∣</mo><mi mathvariant="normal">Δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\V{\Dlt}_\infty\ceq\max_{x,y}\v{\fc\Dlt{x,y}}</annotation></semantics></math></span></span>.</p>
<p>Now that we have proven the correctness of the algorithm, we can analyze its time complexity. Because every iteration increases at least one component of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">u^{\p k}</annotation></semantics></math></span></span> by at least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>, the total number of iterations is at most <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mo fence="true">∥</mo><mi>B</mi><mo>−</mo><msup><mi>u</mi><mo>∗</mo></msup><mo fence="true">∥</mo></mrow><mn>1</mn></msub><mo>=</mo><msup><mi>n</mi><mn>2</mn></msup><mi>n</mi><mo stretchy="false">!</mo><msubsup><mrow><mo fence="true">∥</mo><mi mathvariant="normal">Δ</mi><mo fence="true">∥</mo></mrow><mi mathvariant="normal">∞</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\V{B-u^*}_1=n^2n!\V{\Dlt}_\infty^n</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mo fence="true">∥</mo><mo>⋅</mo><mo fence="true">∥</mo></mrow><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\V{\cdot}_1</annotation></semantics></math></span></span> is the sum of absolute values of components. Each iteration takes <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>n</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\order{n^2}</annotation></semantics></math></span></span> time to check all inequalities. Therefore, the total time complexity is
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>n</mi><mn>4</mn></msup><mi>n</mi><mo stretchy="false">!</mo><msubsup><mrow><mo fence="true">∥</mo><mi mathvariant="normal">Δ</mi><mo fence="true">∥</mo></mrow><mi mathvariant="normal">∞</mi><mi>n</mi></msubsup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\order{n^4n!\V{\Dlt}_\infty^n}</annotation></semantics></math></span></span>. It is a pseudopolynomial time algorithm for fixed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>, but grows superexponentially by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> for fixed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mo fence="true">∥</mo><mi mathvariant="normal">Δ</mi><mo fence="true">∥</mo></mrow><mi mathvariant="normal">∞</mi></msub></mrow><annotation encoding="application/x-tex">\V{\Dlt}_\infty</annotation></semantics></math></span></span>.</p>
<p>Also, notice that, in each iteration, we can update any components of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>u</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">u^{\p k}</annotation></semantics></math></span></span> whose corresponding inequalities are violated in parallel instead of only updating one component at each iteration. The proof of correctness still holds.</p>
<h2 data-label="0.5" id="guaranteed-stabilizability">Guaranteed stabilizability</h2>
<p>One interesting question to ask is how to determine whether an abelian sandpile model guarantees the stabilizability of all legal configurations. If determining this is easier than solving ILP problems, then it is even useful for determining the stabilizability of particular configurations.</p>
<p>The answer to this question is that an abelian sandpile model guarantees the stabilizability of all legal configurations if and only if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> is a nonsingular M-matrix (an M-matrix is defined as a matrix that can be written in the form <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mi>I</mi><mo>−</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">sI-B</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span> is the identity matrix, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span> is a nonnegative matrix, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span></span> is at least as large as the spectral radius of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span>; it is nonsingular when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span></span> is strictly larger than the spectral radius of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span>), which is also equivalent to saying that there exists <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">u\ge0</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\Dlt u&gt;0</annotation></semantics></math></span></span> (<a href="https://doi.org/10.1016/0024-3795(77)90073-8" target="_blank" rel="external">Plemmons, 1977</a>). The necessity of this condition is easy to see because it is implied by the stabilizibility of any configuration <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>≥</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\eta\ge\tht</annotation></semantics></math></span></span>. To see the sufficiency, suppose that there exists <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>≥</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">u\ge0</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>u</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\Dlt u&gt;0</annotation></semantics></math></span></span>. Without loss of generality, we can assume that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> is rational-valued because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> as a linear transformation on a finite-dimensional vector space must be continuous. We can then further assume that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> is integer-valued by multiplying it by a common multiple of denominators. Now, for any configuration
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span>, we can always choose a sufficiently large constant <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mrow><mo fence="true">(</mo><mi>c</mi><mi>u</mi><mo fence="true">)</mo></mrow><mo>&gt;</mo><mi>η</mi><mo>−</mo><mi>θ</mi></mrow><annotation encoding="application/x-tex">\Dlt\p{cu}&gt;\eta-\tht</annotation></semantics></math></span></span>. By the least action principle, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> is stabilizable.</p>
<p>In this case, we can define an abelian group called the <dfn>sandpile group</dfn>. The elements are equivalent classes of configurations, where two configurations <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\eta'</annotation></semantics></math></span></span> are equivalent if there exists some <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo>:</mo><mi>V</mi><mo>→</mo><mi mathvariant="double-struck">Z</mi></mrow><annotation encoding="application/x-tex">u:V\to\bZ</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi><mo>−</mo><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mi mathvariant="normal">Δ</mi><mi>u</mi></mrow><annotation encoding="application/x-tex">\eta-\eta'=\Dlt u</annotation></semantics></math></span></span>. The group operation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo></mrow><annotation encoding="application/x-tex">+</annotation></semantics></math></span></span> is defined such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">[</mo><mi>η</mi><mo fence="true">]</mo></mrow><mo>+</mo><mrow><mo fence="true">[</mo><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">]</mo></mrow><mo>=</mo><mrow><mo fence="true">[</mo><mi>η</mi><mo>+</mo><msup><mi>η</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">\b{\eta}+\b{\eta'}=\b{\eta+\eta'}</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">[</mo><mo>⋅</mo><mo fence="true">]</mo></mrow><annotation encoding="application/x-tex">\b{\cdot}</annotation></semantics></math></span></span> denotes the equivalence class represented by a configuration. Only if all configurations are stabilizable can any equivalence class be represented by a stable legal configuration. This group has many interesting properties (<a href="https://doi.org/10.1007/978-3-7643-8786-0_17" target="_blank" rel="external">Holroyd et al., 2008</a>), but they are outside of the scope of this article.</p>
<p>To determine whether a Z-matrix is a nonsingular M-matrix, we can perform an LU decomposition on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> and check whether all diagonal entries of the two triangular matrices are positive. If they are, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi></mrow><annotation encoding="application/x-tex">\Dlt</annotation></semantics></math></span></span> is a nonsingular M-matrix. For fixed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mo fence="true">∥</mo><mi mathvariant="normal">Δ</mi><mo fence="true">∥</mo></mrow><mi mathvariant="normal">∞</mi></msub></mrow><annotation encoding="application/x-tex">\V{\Dlt}_\infty</annotation></semantics></math></span></span>, this can be done in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>n</mi><mn>3</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\order{n^3}</annotation></semantics></math></span></span> time using Gaussian elimination.</p>
<h2 data-label="0.6" id="implementation">Implementation</h2>
<p>Ask LLM to code for you.</p>
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
<hr/>
<ol>
<li id="fn1"><p>I was puzzled by why people made the theorem have the same name as the more famous principle in the field of classical mechanics also known as Hamilton’s principle. Apparently, people who coined the name are also phycists, who must have known Hamilton’s principle, so I think there must be a relation between those two seemingly unrelated propositions, but I cannot devise such a relation.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>This “without loss of generality” is actually not very obvious. Mathematically speaking, we can always reduce the rational-valued case to the integer-valued case. However, computationally speaking, we need to prove that the input size of the reduced problem is bounded by a polynomial of the input size of the original problem. Fortunately, it is easy to prove for this case if the input size of a rational number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mi mathvariant="normal">/</mi><mi>q</mi></mrow><annotation encoding="application/x-tex">p/q</annotation></semantics></math></span></span> is defined as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>+</mo><mrow><mo fence="true">⌈</mo><msub><mrow><mi>log</mi><mo>⁡</mo></mrow><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">∣</mo><mi>p</mi><mo fence="true">∣</mo></mrow><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo fence="true">⌉</mo></mrow><mo>+</mo><mrow><mo fence="true">⌈</mo><msub><mrow><mi>log</mi><mo>⁡</mo></mrow><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">∣</mo><mi>q</mi><mo fence="true">∣</mo></mrow><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo fence="true">⌉</mo></mrow></mrow><annotation encoding="application/x-tex">1+\ceil{\fc{\log_2}{\v p+1}}+\ceil{\fc{\log_2}{\v q+1}}</annotation></semantics></math></span></span>.<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn3"><p>I was confused by the word “subdeterminant” as I found it in the literature because I never heard of it when I learned linear algebra. I then searched it up on Wikipedia and found that it is the title of a Czech Wikipedia article whose English version is titled “minor”. I then realized that a subdeterminant just means a minor, which is the determinant of a matrix after removing some rows and/or columns. I then think the word “subdeterminant” actually makes more sense than “minor” because the latter is overused for too many concepts.<a href="#fnref3" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="math" /><category term="graph theory" /><category term="linear programming" /><category term="long paper" /><summary type="html"><![CDATA[The abelian sandpile model is a cellular automaton where each cell is a sandpile that can topple to put grains on neighboring cells when having enough grains. It is stable if none of the sandpiles can topple. A natural question to ask is whether it can become stable eventually. In this article, I will show that one can determine the stabilizibility usiung integer linear programming for the abelian sandpile model on an arbitrary finite graph.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2026-01-03-sandpile-stabilizable.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2026-01-03-sandpile-stabilizable.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[From Picard iteration to Feynman path integral]]></title><link href="https://ulysseszh.github.io/physics/2025/11/13/picard-path-integral.html" rel="alternate" type="text/html" title="From Picard iteration to Feynman path integral" /><published>2025-11-13T17:31:24-08:00</published><updated>2025-11-13T17:31:24-08:00</updated><id>https://ulysseszh.github.io/physics/2025/11/13/picard-path-integral</id><content type="html" xml:base="https://ulysseszh.github.io/physics/2025/11/13/picard-path-integral.html"><![CDATA[<h2 data-label="0.1" id="discrete-path-integral">Discrete path integral</h2>
<p>As we all know, the Schrödinger equation is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><mi mathvariant="normal">i</mi><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr\d{\d t}\ket{\fc\psi t}=-\i\fc Ht\ket{\fc\psi t},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi>ψ</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\ket\psi</annotation></semantics></math></span></span> is the state vector and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi></mrow><annotation encoding="application/x-tex">H</annotation></semantics></math></span></span> is the Hamiltonian operator (may be time-dependent). This is an ordinary differential equation (ODE), so we can express its solution as a sum <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mrow><mo fence="true">∣</mo><msup><mi>ψ</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\ket{\fc\psi t}=\sum_{n=0}^\infty\ket{\fc{\psi^{\p n}}t},</annotation></semantics></math></span></span></span> where each term in the sum is defined iteratively by (see also <a href="/math/2022/11/15/ode-recursive.html">my past article</a>) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">∣</mo><msup><mi>ψ</mi><mrow><mo fence="true">(</mo><mn>0</mn><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>0</mn><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mrow><mo fence="true">∣</mo><msup><mi>ψ</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mi mathvariant="normal">i</mi><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><msup><mi>ψ</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\ket{\fc{\psi^{\p0}}t}\ceq\ket{\fc\psi0},\quad
\ket{\fc{\psi^{\p{n+1}}}t}\ceq-\i\int_0^t\d t'\,\fc H{t'}\ket{\fc{\psi^{\p n}}{t'}}.</annotation></semantics></math></span></span></span> This iteration is called the Picard iteration, which is most known as a method to prove the Picard–Lindelöf theorem.</p>
<p>Let us actually write out the general term in this sum as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">∣</mo><msup><mi>ψ</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo>=</mo><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>0</mn><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\ket{\fc{\psi^{\p n}}t}=\fc{K^{\p n}}t\ket{\fc\psi0},</annotation></semantics></math></span></span></span> where
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msub><mi>t</mi><mi>n</mi></msub><mtext> </mtext><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mi>n</mi></msub><mo fence="true">)</mo></mrow><msubsup><mo>∫</mo><mn>0</mn><msub><mi>t</mi><mi>n</mi></msub></msubsup><mi mathvariant="normal">d</mi><msub><mi>t</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><mtext> </mtext><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mo>⋯</mo><msubsup><mo>∫</mo><mn>0</mn><msub><mi>t</mi><mn>2</mn></msub></msubsup><mi mathvariant="normal">d</mi><msub><mi>t</mi><mn>1</mn></msub><mtext> </mtext><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mn>1</mn></msub><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{K^{\p n}}t=\p{-\i}^n\int_0^t\d t_n\,\fc H{t_n}\int_0^{t_n}\d t_{n-1}\,\fc H{t_{n-1}}\cdots\int_0^{t_2}\d t_1\,\fc H{t_1}.</annotation></semantics></math></span></span></span>
Now with the trick of time-ordering, we can rewrite this as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msub><mi>t</mi><mi>n</mi></msub><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msub><mi>t</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>⋯</mo><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msub><mi>t</mi><mn>1</mn></msub><mtext> </mtext><mi mathvariant="script">T</mi><mtext> ⁣</mtext><mrow><mo fence="true">[</mo><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mi>n</mi></msub><mo fence="true">)</mo></mrow><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mo>⋯</mo><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mn>1</mn></msub><mo fence="true">)</mo></mrow><mo fence="true">]</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><mi mathvariant="script">T</mi><msup><mrow><mo fence="true">(</mo><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi>n</mi></msup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{K^{\p n}}t&amp;=\fr{\p{-\i}^n}{n!}\int_0^t\d t_n\int_0^t\d t_{n-1}\cdots\int_0^t\d t_1\,\bfc{\mcal T}{\fc H{t_n}\fc H{t_{n-1}}\cdots\fc H{t_1}}\\
&amp;=\fr{\p{-\i}^n}{n!}\mcal T\p{\int_0^t\d t'\,\fc H{t'}}^n,
\end{align*}</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">T</mi><mtext> ⁣</mtext><mrow><mo fence="true">[</mo><mo>⋯</mo><mtext> </mtext><mo fence="true">]</mo></mrow></mrow><annotation encoding="application/x-tex">\bfc{\mcal T}\cdots</annotation></semantics></math></span></span> means to order the operators inside according to their time arguments. The factor of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">1/n!</annotation></semantics></math></span></span> appears because there are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">n!</annotation></semantics></math></span></span> ways to order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> time variables, but another way to see this is to note that the domain of integration is an <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>-simplex, whose volume is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">1/n!</annotation></semantics></math></span></span> of the corresponding <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>-parallelotope. When we then sum over all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>, we get the time-ordered exponential <span id="eq:time-ordered-exp" data-label="(1)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo>=</mo><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>0</mn><mo fence="true">)</mo></mrow><mo fence="true">⟩</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><munder><mo>∑</mo><mi>n</mi></munder><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi mathvariant="script">T</mi><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\ket{\fc\psi t}=\fc Kt\ket{\fc\psi0},\quad
\fc Kt=\sum_n\fc{K^{\p n}}t=\mcal T\fc\exp{-\i\int_0^t\d t'\,\fc H{t'}}.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1)</annotation></semantics></math></span></span></span></span> </span></span> The operator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc Kt</annotation></semantics></math></span></span> has a bunch of equivalent names, such as the time evolution operator, the propagator, the Green’s function, the Dyson operator, and the S-matrix (well, they are not entirely equivalent because they are used under different contexts).</p>
<p>The interesting part comes when we consider the matrix elements of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc Kt</annotation></semantics></math></span></span> and how they relate to the matrix elements of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc Ht</annotation></semantics></math></span></span>. We choose an orthonormal basis <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{\ket x}</annotation></semantics></math></span></span>, and then insert a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>x</mi></msub><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mrow><mo fence="true">⟨</mo><mi>x</mi><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_x\ket x\bra x</annotation></semantics></math></span></span> between each pair of Hamiltonian operators in the expression of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{K^{\p n}}t</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><msub><mi>x</mi><mi>n</mi></msub><mo fence="true">∣</mo></mrow><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><msub><mi>x</mi><mn>0</mn></msub><mo fence="true">⟩</mo></mrow><mo>=</mo><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><msup><mi mathvariant="normal">d</mi><mi>n</mi></msup><mi>t</mi><munder><mo>∑</mo><mrow><msub><mi>x</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></munder><msub><mi>h</mi><mrow><msub><mi>x</mi><mi>n</mi></msub><msub><mi>x</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mi>n</mi></msub><mo fence="true">)</mo></mrow><msub><mi>h</mi><mrow><msub><mi>x</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><msub><mi>x</mi><mrow><mi>n</mi><mo>−</mo><mn>2</mn></mrow></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mrow><mi>n</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mo>⋯</mo><msub><mi>h</mi><mrow><msub><mi>x</mi><mn>1</mn></msub><msub><mi>x</mi><mn>0</mn></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mn>1</mn></msub><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\bra{x_n}\fc{K^{\p n}}t\ket{x_0}
=\fr{\p{-\i}^n}{n!}\int_0^t\d^nt\sum_{x_1,\ldots,x_{n-1}}
\fc{h_{x_nx_{n-1}}}{t_n}\fc{h_{x_{n-1}x_{n-2}}}{t_{n-1}}\cdots\fc{h_{x_1x_0}}{t_1},</annotation></semantics></math></span></span></span>
where we have abbreviated <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>h</mi><mrow><mi>x</mi><mi>y</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⟨</mo><mi>x</mi><mo fence="true">∣</mo></mrow><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>y</mi><mo fence="true">⟩</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{h_{xy}}t\ceq\bra x\fc Ht\ket y</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mn>1</mn></msub><mo>≤</mo><mo>⋯</mo><mo>≤</mo><msub><mi>t</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">t_1\le\cdots\le t_n</annotation></semantics></math></span></span> are a specific ordering of the integrated time variables. We can pull out the sum over intermediate basis states and call the summand a contribution from a walk <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a> from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">x_0</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">x_n</annotation></semantics></math></span></span>. In other words, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><msup><mi>K</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mi>n</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></munderover><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\bra y\fc{K^{\p n}}t\ket x
=\sum_{\B{x_i}}^{\substack{x_n=y\\x_0=x}}\fc K{\B{x_i},t},</annotation></semantics></math></span></span></span> where the sum is over all walks of length <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>, and <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><msup><mi mathvariant="normal">d</mi><mi>n</mi></msup><mi>t</mi><mtext> </mtext><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><msub><mi>h</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>t</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc K{\B{x_i},t}\ceq\fr{\p{-\i}^n}{n!}\int_0^t\d^nt\,
\prod_{i=1}^n\fc{h_{x_ix_{i-1}}}{t_i}.</annotation></semantics></math></span></span></span> Now, the matrix elements of the full propagator is then the sum over contributions from all walks:
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><munder><mo>∑</mo><mrow><mtext>walks </mtext><mi>x</mi><mo>→</mo><mi>y</mi></mrow></munder><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mtext>walk</mtext><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x=\sum_{\text{walks }x\to y}\fc K{\text{walk},t}.</annotation></semantics></math></span></span></span> We can imagine a “Hamiltonian graph” formed by taking the basis states as vertices and the Hamiltonian matrix elements as edge weights (the weight of the directed edge from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi mathvariant="normal">i</mi><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>H</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow></mrow><annotation encoding="application/x-tex">-\i\bra y\fc Ht\ket x</annotation></semantics></math></span></span>). Note that an edge can be a self-loop. Then, the propagator contribution from a walk is given by integrating the product of all the edge weights along the walk (for a trivial walk, which has zero length, the contribution is simply <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>). This formulation may be called the discrete path integral. There is a <a href="https://arxiv.org/abs/2407.11231" target="_blank" rel="external">paper</a> on arXiv that delivers the idea of the Hamiltonian graph. Its difference from the current article is that it only focuses on time-independent Hamiltonians and that it treats self-loops separately instead of just like normal edges. The following two sections (excluding self-loops and the Feynman path integral) largely follow from the ideas from this paper.</p>
<h2 data-label="0.2" id="excluding-self-loops">Excluding self-loops</h2>
<p>In some cases, it may be hard to consider self-loops on the Hamiltonian graph. We may then benefit from counting only walks without self-loops. However, the contributions from each walk will now be different because we have to account for the same walk with self-loops inserted at various positions. In other words, for a walk <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{x_i}</annotation></semantics></math></span></span> without self-loops, instead of contributing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc K{\B{x_i},t}</annotation></semantics></math></span></span>, we now want to find the contribution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc L{\B{x_i},t}</annotation></semantics></math></span></span> that sums over all ways to insert self-loops into <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{x_i}</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><msub><mi>m</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>m</mi><mi>n</mi></msub><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msubsup><mi>x</mi><mi>i</mi><msub><mi>m</mi><mi>i</mi></msub></msubsup><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc L{\B{x_i},t}=\sum_{m_0,\ldots,m_n=0}^\infty
\fc K{\B{x_i^{m_i}},t},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">m_i</annotation></semantics></math></span></span> is the number of self-loops inserted at the vertex <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">x_i</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msubsup><mi>x</mi><mi>i</mi><msub><mi>m</mi><mi>i</mi></msub></msubsup><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{x_i^{m_i}}</annotation></semantics></math></span></span> is an abbreviation of this walk:
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munder><munder><mrow><msub><mi>x</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>x</mi><mn>0</mn></msub></mrow><mo stretchy="true">⏟</mo></munder><msub><mi>m</mi><mn>0</mn></msub></munder><mo separator="true">,</mo><munder><munder><mrow><msub><mi>x</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>x</mi><mn>1</mn></msub></mrow><mo stretchy="true">⏟</mo></munder><msub><mi>m</mi><mn>1</mn></msub></munder><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><munder><munder><mrow><msub><mi>x</mi><mi>n</mi></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>x</mi><mi>n</mi></msub></mrow><mo stretchy="true">⏟</mo></munder><msub><mi>m</mi><mi>n</mi></msub></munder><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\underbrace{x_0,\ldots,x_0}_{m_0},
\underbrace{x_1,\ldots,x_1}_{m_1},\ldots,
\underbrace{x_n,\ldots,x_n}_{m_n}.</annotation></semantics></math></span></span></span></p>
<p>I will show that we can find an expression for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc L{\B{x_i},t}</annotation></semantics></math></span></span> for the case when the Hamiltonians at different times commute with each other. In this case, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><mi>t</mi><mtext> </mtext><msub><mi>h</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc K{\B{x_i},t}=\fr{1}{n!}\prod_{i=1}^n
\p{-\i\int_0^t\d t\,\fc{h_{x_ix_{i-1}}}t}.</annotation></semantics></math></span></span></span> Therefore, by the definition of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc L{\B{x_i},t}</annotation></semantics></math></span></span>, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><munder><mo>∑</mo><mrow><msub><mi>m</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>m</mi><mi>n</mi></msub></mrow></munder><mfrac><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow><mrow><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>m</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo></mrow></mfrac><munder><mo>∏</mo><mi>i</mi></munder><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">i</mi><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><mi>t</mi><mtext> </mtext><msub><mi>h</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><msub><mi>x</mi><mi>i</mi></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><msub><mi>m</mi><mi>i</mi></msub></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc L{\B{x_i},t}=\fc K{\B{x_i},t}\sum_{m_0,\ldots,m_n}
\fr{n!}{\p{n+\sum_i m_i}!}
\prod_i\p{-\i\int_0^t\d t\,\fc{h_{x_ix_i}}t}^{m_i}.</annotation></semantics></math></span></span></span>
For abbreviation, for the rest of this section, we denote <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>S</mi><mi>i</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mi mathvariant="normal">i</mi><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><mi>t</mi><mtext> </mtext><msub><mi>h</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><msub><mi>x</mi><mi>i</mi></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">S_i\ceq-\i\int_0^t\d t\,\fc{h_{x_ix_i}}t</annotation></semantics></math></span></span>.</p>
<p>Now, we use a trick to replace the factorial in the denominator with an contour integral: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mrow><mi>N</mi><mo stretchy="false">!</mo></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">i</mi></mrow></mfrac><mo>∮</mo><mi mathvariant="normal">d</mi><mi>z</mi><mfrac><msup><mi mathvariant="normal">e</mi><mi>z</mi></msup><msup><mi>z</mi><mrow><mi>N</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr1{N!}=\fr1{2\pi\i}\oint\d z\fr{\e^z}{z^{N+1}},</annotation></semantics></math></span></span></span> where the contour is a counterclockwise simple closed curve around the origin in the complex plane. We then have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>n</mi><mo stretchy="false">!</mo><mtext> </mtext><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">i</mi></mrow></mfrac><munder><mo>∑</mo><mrow><msub><mi>m</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>m</mi><mi>n</mi></msub></mrow></munder><mo>∮</mo><mi mathvariant="normal">d</mi><mi>z</mi><mfrac><msup><mi mathvariant="normal">e</mi><mi>z</mi></msup><msup><mi>z</mi><mrow><mi>n</mi><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>m</mi><mi>i</mi></msub><mo>+</mo><mn>1</mn></mrow></msup></mfrac><munder><mo>∏</mo><mi>i</mi></munder><msubsup><mi>S</mi><mi>i</mi><msub><mi>m</mi><mi>i</mi></msub></msubsup><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">i</mi></mrow></mfrac><mo>∮</mo><mi mathvariant="normal">d</mi><mi>z</mi><mfrac><msup><mi mathvariant="normal">e</mi><mi>z</mi></msup><msup><mi>z</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><munder><mo>∏</mo><mi>i</mi></munder><munder><mo>∑</mo><msub><mi>m</mi><mi>i</mi></msub></munder><mfrac><msubsup><mi>S</mi><mi>i</mi><msub><mi>m</mi><mi>i</mi></msub></msubsup><msup><mi>z</mi><msub><mi>m</mi><mi>i</mi></msub></msup></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr{\fc L{\B{x_i},t}}{n!\,\fc K{\B{x_i},t}}
=\fr1{2\pi\i}\sum_{m_0,\ldots,m_n}
\oint\d z\fr{\e^z}{z^{n+\sum_im_i+1}}
\prod_i S_i^{m_i}
=\fr1{2\pi\i}\oint\d z\fr{\e^z}{z^{n+1}}
\prod_i\sum_{m_i}\fr{S_i^{m_i}}{z^{m_i}}.</annotation></semantics></math></span></span></span>
We have thus separated the sums over different <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">m_i</annotation></semantics></math></span></span>. Each sum is a geometric series that converges when we choose the contour large enough, so <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>n</mi><mo stretchy="false">!</mo><mtext> </mtext><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">i</mi></mrow></mfrac><mo>∮</mo><mi mathvariant="normal">d</mi><mi>z</mi><mfrac><msup><mi mathvariant="normal">e</mi><mi>z</mi></msup><msup><mi>z</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><munder><mo>∏</mo><mi>i</mi></munder><mfrac><mn>1</mn><mrow><mn>1</mn><mo>−</mo><msub><mi>S</mi><mi>i</mi></msub><mi mathvariant="normal">/</mi><mi>z</mi></mrow></mfrac><mo>=</mo><munder><mo>∑</mo><mi>i</mi></munder><mfrac><msup><mi mathvariant="normal">e</mi><msub><mi>S</mi><mi>i</mi></msub></msup><mrow><munder><mo>∏</mo><mrow><mi>j</mi><mo mathvariant="normal">≠</mo><mi>i</mi></mrow></munder><mrow><mo fence="true">(</mo><msub><mi>S</mi><mi>i</mi></msub><mo>−</mo><msub><mi>S</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow></mrow></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr{\fc L{\B{x_i},t}}{n!\,\fc K{\B{x_i},t}}
=\fr1{2\pi\i}\oint\d z\fr{\e^z}{z^{n+1}}
\prod_i\fr1{1-S_i/z}
=\sum_i\fr{\e^{S_i}}{\prod_{j\ne i}\p{S_i-S_j}},</annotation></semantics></math></span></span></span>
where the last step used the residue theorem for each pole at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>=</mo><msub><mi>S</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">z=S_i</annotation></semantics></math></span></span>. This expression is exactly the expanded form of the <a href="https://en.wikipedia.org/wiki/Divided_differences#Expanded_form" target="_blank" rel="external">divided difference</a> of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msup><mi mathvariant="normal">e</mi><msub><mi>S</mi><mi>i</mi></msub></msup><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{\e^{S_i}}</annotation></semantics></math></span></span>, often denoted <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\e^{\b{S_0,\ldots,S_n}}</annotation></semantics></math></span></span>. Therefore, <span id="eq:no-self-loops" data-label="(2)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>n</mi><mo stretchy="false">!</mo><mtext> </mtext><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc L{\B{x_i},t}=n!\,\fc K{\B{x_i},t}\e^{\b{S_0,\ldots,S_n}}.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>2</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(2)</annotation></semantics></math></span></span></span></span> </span></span></p>
<p>The discrete path integral can then be rewritten in a form that only involves collecting contributions from walks without self-loops: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mtext>walks </mtext><mi>x</mi><mo>→</mo><mi>y</mi></mrow><mtext>no self-loops</mtext></munderover><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mtext>walk</mtext><mo separator="true">,</mo><mi>t</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x=\sum_{\text{walks }x\to y}^{\text{no self-loops}}\fc L{\text{walk},t}.</annotation></semantics></math></span></span></span></p>
<h2 data-label="0.3" id="feynman-path-integral">Feynman path integral</h2>
<p>This discrete path integral formulation of the propagator already looks similar to the Feynman path integral, but we have to go a step further to take the continuum limit to actually get there. For simplicity, I will only consider a particle with unvarying mass <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> moving in a time-independent potential in one dimension. Its Hamiltonian is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi><mo>=</mo><msup><mi>p</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn><mi>m</mi><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">H=p^2/2m+\fc Vx</annotation></semantics></math></span></span>, and the orthonormal basis is chosen to be the position basis, also denoted as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{\ket x}</annotation></semantics></math></span></span>.</p>
<p>The more standard way to derive the Feynman path integral is to slice the time integral in Equation <a href="#eq:time-ordered-exp">1</a>, to express the total exponentiation as a product as many small exponentiations, and then to insert <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∫</mo><mi mathvariant="normal">d</mi><mi>x</mi><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mrow><mo fence="true">⟨</mo><mi>x</mi><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\int\d x\ket x\bra x</annotation></semantics></math></span></span> between each pair of exponentiations (see, e.g., chapter 6 of <cite>Quantum Field Theory</cite> by Mark Srednicki). However, this approach does not make its connection to the discrete path integral clear. Instead, we will discretize the position space into a lattice with spacing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span>, use the discrete path integral formulation on this lattice, and then take the continuum limit <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>→</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">a\to0</annotation></semantics></math></span></span> at the end. Now, instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">x\in\bR</annotation></semantics></math></span></span>, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>∈</mo><mi>a</mi><mi mathvariant="double-struck">Z</mi></mrow><annotation encoding="application/x-tex">x\in a\bZ</annotation></semantics></math></span></span>. Each basis vector <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\ket x</annotation></semantics></math></span></span> now has two nearest neighbors <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi>x</mi><mo>−</mo><mi>a</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\ket{x-a}</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi>x</mi><mo>+</mo><mi>a</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\ket{x+a}</annotation></semantics></math></span></span>.</p>
<p>In the position basis, the kinetic part of the Hamiltonian <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>p</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn><mi>m</mi></mrow><annotation encoding="application/x-tex">p^2/2m</annotation></semantics></math></span></span> is a second derivative operator. From <a href="https://en.wikipedia.org/wiki/Numerical_differentiation#Higher_derivatives" target="_blank" rel="external">numerical differentiation</a>, we can approximate it on the lattice as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><msup><mi>p</mi><mn>2</mn></msup><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mrow><mo fence="true">(</mo><mn>2</mn><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>−</mo><mrow><mo fence="true">∣</mo><mi>x</mi><mo>+</mo><mi>a</mi><mo fence="true">⟩</mo></mrow><mo>−</mo><mrow><mo fence="true">∣</mo><mi>x</mi><mo>−</mo><mi>a</mi><mo fence="true">⟩</mo></mrow><mo fence="true">)</mo></mrow><mrow><mo fence="true">⟨</mo><mi>x</mi><mo fence="true">∣</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr{p^2}{2m}=\fr1{2ma^2}\p{2\ket x-\ket{x+a}-\ket{x-a}}\bra x.</annotation></semantics></math></span></span></span> Therefore, the discretized Hamiltonian is
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>H</mi><mo>=</mo><munder><mo>∑</mo><mi>x</mi></munder><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mrow><mo fence="true">(</mo><mn>2</mn><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>−</mo><mrow><mo fence="true">∣</mo><mi>x</mi><mo>+</mo><mi>a</mi><mo fence="true">⟩</mo></mrow><mo>−</mo><mrow><mo fence="true">∣</mo><mi>x</mi><mo>−</mo><mi>a</mi><mo fence="true">⟩</mo></mrow><mo fence="true">)</mo></mrow><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo fence="true">)</mo></mrow><mrow><mo fence="true">⟨</mo><mi>x</mi><mo fence="true">∣</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">H=\sum_x\p{\fr1{2ma^2}\p{2\ket x-\ket{x+a}-\ket{x-a}}+\fc Vx\ket x}\bra x.</annotation></semantics></math></span></span></span> Its matrix elements are then
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>h</mi><mrow><mi>y</mi><mi>x</mi></mrow></msub><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mrow><mo fence="true">(</mo><mn>2</mn><msub><mi>δ</mi><mrow><mi>y</mi><mo separator="true">,</mo><mi>x</mi></mrow></msub><mo>−</mo><msub><mi>δ</mi><mrow><mi>y</mi><mo separator="true">,</mo><mi>x</mi><mo>+</mo><mi>a</mi></mrow></msub><mo>−</mo><msub><mi>δ</mi><mrow><mi>y</mi><mo separator="true">,</mo><mi>x</mi><mo>−</mo><mi>a</mi></mrow></msub><mo fence="true">)</mo></mrow><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><msub><mi>δ</mi><mrow><mi>y</mi><mo separator="true">,</mo><mi>x</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">h_{yx}=\fr1{2ma^2}\p{2\dlt_{y,x}-\dlt_{y,x+a}-\dlt_{y,x-a}}+\fc Vx\dlt_{y,x}.</annotation></semantics></math></span></span></span> Conceptually, it consists of on-site energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">1/ma^2+\fc Vx</annotation></semantics></math></span></span> and nearest-neighbor hops. The on-site energy looks bothersome, but we can remove it if we only consider walks without self-loops. Equation <a href="#eq:no-self-loops">2</a> becomes <span id="eq:discrete-particle" data-label="(3)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mrow><mo fence="true">(</mo><mfrac><mi>β</mi><mrow><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mi>n</mi></msup><munderover><mo>∑</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mi>n</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></munderover><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>+</mo><mi>a</mi></mrow></msub><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>−</mo><mi>a</mi></mrow></msub><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x
=\sum_{n=0}^\infty\p{\fr\beta{ma^2}}^n
\sum_{\B{x_i}}^{\substack{x_n=y\\x_0=x}}\e^{\b{S_0,\ldots,S_n}}
\prod_{i=1}^n\p{\fr12\dlt_{x_i,x_{i-1}+a}+\fr12\dlt_{x_i,x_{i-1}-a}},</annotation></semantics></math></span></span></span></span>
<span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(3)</annotation></semantics></math></span></span></span></span> </span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mi mathvariant="normal">i</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\beta=\i t</annotation></semantics></math></span></span> is the imaginary time, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>S</mi><mi>i</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mi>β</mi><mrow><mo fence="true">(</mo><mn>1</mn><mi mathvariant="normal">/</mi><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">S_i\ceq-\beta\p{1/ma^2+\fc V{x_i}}</annotation></semantics></math></span></span> is defined for the same abbreviation reason as the previous section. The terms proportional to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow></msub></mrow><annotation encoding="application/x-tex">\dlt_{x_i,x_{i-1}}</annotation></semantics></math></span></span> in the multiplicant are omitted because we only consider walks without self-loops. The rest of this section is done under a Wick rotation so that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> is assumed to be a positive real parameter.</p>
<p>First, let us tackle the divided difference <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\e^{\b{S_0,\ldots,S_n}}</annotation></semantics></math></span></span>. Define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><msub><mi>S</mi><mi>i</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>S</mi><mi>i</mi></msub><mo>−</mo><mover accent="true"><mi>S</mi><mo>ˉ</mo></mover></mrow><annotation encoding="application/x-tex">\Dlt S_i\ceq S_i-\bar S</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>S</mi><mo>ˉ</mo></mover><mo><mi mathvariant="normal">≔</mi></mo><msub><mo>∑</mo><mi>i</mi></msub><mi>S</mi><mi mathvariant="normal">/</mi><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\bar S\ceq\sum_i S/\p{n+1}</annotation></semantics></math></span></span> is the mean of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>S</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{S_i}</annotation></semantics></math></span></span>. Then,
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><msub><mi>S</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\Dlt S_i</annotation></semantics></math></span></span> is of order unity (while <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>S</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">S_i</annotation></semantics></math></span></span> is of order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\beta/ma^2</annotation></semantics></math></span></span>, which is much larger than unity for small <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span>). Then, from the expanded form of the divided difference, we can easily get <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup><mo>=</mo><msup><mi mathvariant="normal">e</mi><mover accent="true"><mi>S</mi><mo>ˉ</mo></mover></msup><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><mi mathvariant="normal">Δ</mi><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi mathvariant="normal">Δ</mi><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\e^{\b{S_0,\ldots,S_n}}=\e^{\bar S}\e^{\b{\Dlt S_0,\ldots,\Dlt S_n}}.</annotation></semantics></math></span></span></span> Recalling how we initially derived the divided difference, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><mi mathvariant="normal">Δ</mi><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi mathvariant="normal">Δ</mi><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup><mo>=</mo><munder><mo>∑</mo><mrow><msub><mi>m</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>m</mi><mi>n</mi></msub></mrow></munder><mfrac><mn>1</mn><mrow><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>m</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo></mrow></mfrac><munder><mo>∏</mo><mi>i</mi></munder><mi mathvariant="normal">Δ</mi><msubsup><mi>S</mi><mi>i</mi><msub><mi>m</mi><mi>i</mi></msub></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\e^{\b{\Dlt S_0,\ldots,\Dlt S_n}}=\sum_{m_0,\ldots,m_n}\fr1{\p{n+\sum_im_i}!}\prod_i\Dlt S_i^{m_i}.</annotation></semantics></math></span></span></span> When
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> is large (the reason of which will be explained in a minute), we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo stretchy="false">!</mo><mo>≪</mo><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo><mo>≪</mo><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">n!\ll\p{n+1}!\ll\p{n+2}!</annotation></semantics></math></span></span> etc., while <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>Q</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">Q_i</annotation></semantics></math></span></span> is of the order of unity, so we only need to consider the terms with the lowest <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>i</mi></msub><msub><mi>m</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">\sum_im_i</annotation></semantics></math></span></span>. The leading term is the term with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>i</mi></msub><msub><mi>m</mi><mi>i</mi></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\sum_im_i=0</annotation></semantics></math></span></span>, which is trivially <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">1/n!</annotation></semantics></math></span></span>, so we have <span id="eq:observation-3" data-label="(4)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo fence="true">[</mo><msub><mi>S</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>S</mi><mi>n</mi></msub><mo fence="true">]</mo></mrow></msup><mo>=</mo><mfrac><mn>1</mn><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mover accent="true"><mi>S</mi><mo>ˉ</mo></mover></mrow></msup><mo>=</mo><mfrac><mn>1</mn><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mi>β</mi><mrow><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mo>−</mo><mfrac><mi>β</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac><munder><mo>∑</mo><mi>i</mi></munder><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\e^{\b{S_0,\ldots,S_n}}=\fr1{n!}\e^{\i\bar S}
=\fr1{n!}\fc\exp{-\fr{\beta}{ma^2}-\fr{\beta}{n+1}\sum_i\fc V{x_i}}.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>4</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(4)</annotation></semantics></math></span></span></span></span> </span></span> This contributes to the potential part of the action.</p>
<p>Substitute Equation <a href="#eq:observation-3">4</a> into Equation <a href="#eq:discrete-particle">3</a>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi></mrow></msup><msup><mi>λ</mi><mi>n</mi></msup></mrow><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><munderover><mo>∑</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mi>n</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></munderover><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mi>β</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac><munder><mo>∑</mo><mi>i</mi></munder><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>n</mi></munderover><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi>δ</mi><mo>⋯</mo></msub><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi>δ</mi><mo>⋯</mo></msub><mtext> </mtext><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x
=\sum_{n=0}^\infty\fr{\e^{-\lmd}\lmd^n}{n!}
\sum_{\B{x_i}}^{\substack{x_n=y\\x_0=x}}
\fc\exp{-\fr{\beta}{n+1}\sum_i\fc V{x_i}}\prod_{i=1}^n\p{\fr12\dlt_\cdots+\fr12\dlt_\cdots},</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>β</mi><mi mathvariant="normal">/</mi><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\lmd\ceq\beta/ma^2</annotation></semantics></math></span></span> is a large positive number when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span> is small. Observe that the factor <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi></mrow></msup><msup><mi>λ</mi><mi>n</mi></msup><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">\e^{-\lmd}\lmd^n/n!</annotation></semantics></math></span></span> is the probability mass function of the Poisson distribution with mean <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> evaluated at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>. When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> is very large, the Poisson distribution can be approximated by a delta distribution because the standard deviation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mi>λ</mi></msqrt></mrow><annotation encoding="application/x-tex">\sqrt\lmd</annotation></semantics></math></span></span> is much smaller than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span>. In other words, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi></mrow></msup><msup><mi>λ</mi><mi>n</mi></msup><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo><mo>≈</mo><msub><mi>δ</mi><mrow><mi>n</mi><mo separator="true">,</mo><mi>λ</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\e^{-\lmd}\lmd^n/n!\approx\dlt_{n,\lmd}</annotation></semantics></math></span></span>. Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mi>λ</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>x</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></munderover><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mi>β</mi><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac><munder><mo>∑</mo><mi>i</mi></munder><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>λ</mi></munderover><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>+</mo><mi>a</mi></mrow></msub><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>−</mo><mi>a</mi></mrow></msub><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x
=\sum_{\B{x_i}}^{\substack{x_\lmd=y\\x_0=x}}
\fc\exp{-\fr{\beta}{n+1}\sum_i\fc V{x_i}}
\prod_{i=1}^\lmd\p{\fr12\dlt_{x_i,x_{i-1}+a}+\fr12\dlt_{x_i,x_{i-1}-a}}.</annotation></semantics></math></span></span></span></p>
<details>
<summary>
Imaginary parameter Poisson distribution
</summary>
<p>It was this point that got me thinking the most when I originally tried to derive the Feynman path integral without the Wick rotation. While the approximation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi></mrow></msup><msup><mi>λ</mi><mi>n</mi></msup><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo><mo>≈</mo><msub><mi>δ</mi><mrow><mi>n</mi><mo separator="true">,</mo><mi>λ</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\e^{-\lmd}\lmd^n/n!\approx\dlt_{n,\lmd}</annotation></semantics></math></span></span> is valid, the problem is whether we can likewise say <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi mathvariant="normal">i</mi><mi>λ</mi></mrow></msup><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">i</mi><mi>λ</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><mi mathvariant="normal">/</mi><mi>n</mi><mo stretchy="false">!</mo><mo>≈</mo><msub><mi>δ</mi><mrow><mi>n</mi><mo separator="true">,</mo><mi>λ</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\e^{-\i\lmd}\p{\i\lmd}^n/n!\approx\dlt_{n,\lmd}</annotation></semantics></math></span></span> (or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>δ</mi><mrow><mi>n</mi><mo separator="true">,</mo><mi mathvariant="normal">i</mi><mi>λ</mi></mrow></msub></mrow><annotation encoding="application/x-tex">\dlt_{n,\i\lmd}</annotation></semantics></math></span></span>). While it is true that the left-hand side has a very large magnitude when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mi>λ</mi></mrow><annotation encoding="application/x-tex">n=\lmd</annotation></semantics></math></span></span> so that it dominates the sum, it does not actually approximate the right-hand side because the right-hand side is of order unity and is real. In fact, the summand is rapidly oscillating when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> is near <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span>, so the numbers of different phases actually cancel each other out and give a number with small magnitude in the end.</p>
<p>If you actually try to walk through the calculation without the Wick rotation, you will find that what you need to justify in the end is something like this (there are some other factors dependent on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> in the summand, but we can remove them by some techniques, so let us ignore them for simplicity): <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi mathvariant="normal">i</mi><mi>λ</mi></mrow></msup><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">i</mi><mi>λ</mi><mo fence="true">)</mo></mrow><mi>n</mi></msup><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow></mfrac><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>M</mi><mi mathvariant="normal">/</mi><mi>n</mi></mrow></msup><mo>≈</mo><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>M</mi><mi mathvariant="normal">/</mi><mi>λ</mi></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\e^{-\i\lmd}\sum_{n=0}^\infty\fr{\p{\i\lmd}^n}{n!}\e^{-M/n}\approx \e^{\i M/\lmd},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> are both large positive numbers. This is unfortunately false, neither in magnitude nor in phase, and not even up to an overall factor.</p>
<p>While it is true that a lot of things can be carried over by analytic continuation, which is the reason why the Wick rotation can give the correct result in many cases, you can do the analytic continuation only if every step you take is actually analytic. Having an approximation based on the magnitude of each summand is not analytic because a fast oscillation can change the result drastically. Therefore, I am not satisfied with this derivation with the Wick rotation, but I have not found a better way to do it yet.</p>
</details>
<p>If the factor involving <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> were not there in the summand, the sum of products is exactly the probability that a random walk starting at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> ends at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> after <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> steps, where at each step the walk moves to the left or right nearest neighbor with equal probability <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">1/2</annotation></semantics></math></span></span>. Instead of considering one random walk with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> steps, we can consider <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> random walks with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>λ</mi><mi mathvariant="normal">/</mi><mi>N</mi></mrow><annotation encoding="application/x-tex">l\ceq\lmd/N</annotation></semantics></math></span></span> steps each, where both <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> are large. Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span></span> is large, we can approximate the distribution of the position at the end of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation></semantics></math></span></span>th random walk as a normally distributed random variable <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>j</mi></msub></mrow><annotation encoding="application/x-tex">q_j</annotation></semantics></math></span></span> with variance <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">la^2</annotation></semantics></math></span></span>. Note that even though <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span></span> is large, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">la^2</annotation></semantics></math></span></span> is still very small, so the majority of contribution in the sum only comes from those paths where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">x_i</annotation></semantics></math></span></span> does not differ too much from the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>q</mi><mi>j</mi></msub></mrow><annotation encoding="application/x-tex">q_j</annotation></semantics></math></span></span> of its corresponding part of random walk. Therefore, if we fix a set of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{q_j}</annotation></semantics></math></span></span>, the factor involving <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> in the summand can be approximated by replacing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc V{x_i}</annotation></semantics></math></span></span> with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc V{q_j}</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>x</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">x_i</annotation></semantics></math></span></span> in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>j</mi></mrow><annotation encoding="application/x-tex">j</annotation></semantics></math></span></span>th random walk segment. We can then pull this factor out of the sum over <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{x_i}</annotation></semantics></math></span></span> (but still inside the integral over
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{q_j}</annotation></semantics></math></span></span>). Therefore, we get <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msubsup><mo>∫</mo><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>q</mi><mi>N</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>q</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></msubsup><mi mathvariant="normal">d</mi><msub><mi>q</mi><mn>1</mn></msub><mo>⋯</mo><mi mathvariant="normal">d</mi><msub><mi>q</mi><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow></msub><munderover><mo>∑</mo><mrow><mo fence="true">{</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><mrow><msub><mi>x</mi><mrow><mi>j</mi><mi>l</mi></mrow></msub><mo>=</mo><msub><mi>q</mi><mi>j</mi></msub></mrow></munderover><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mstyle displaystyle="false" scriptlevel="0"><mfrac><mrow><mo>−</mo><mi>β</mi></mrow><mrow><mi>n</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mstyle><munder><mo>∑</mo><mi>i</mi></munder><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><munderover><mo>∏</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mi>λ</mi></munderover><mrow><mo fence="true">(</mo><mstyle displaystyle="false" scriptlevel="0"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>+</mo><mi>a</mi></mrow></msub><mo>+</mo><mstyle displaystyle="false" scriptlevel="0"><mfrac><mn>1</mn><mn>2</mn></mfrac></mstyle><msub><mi>δ</mi><mrow><msub><mi>x</mi><mi>i</mi></msub><mo separator="true">,</mo><msub><mi>x</mi><mrow><mi>i</mi><mo>−</mo><mn>1</mn></mrow></msub><mo>−</mo><mi>a</mi></mrow></msub><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msubsup><mo>∫</mo><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>q</mi><mi>N</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>q</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></msubsup><mi mathvariant="normal">d</mi><msub><mi>q</mi><mn>1</mn></msub><mo>⋯</mo><mi mathvariant="normal">d</mi><msub><mi>q</mi><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow></msub><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mstyle displaystyle="false" scriptlevel="0"><mfrac><mrow><mo>−</mo><mi>β</mi></mrow><mrow><mi>N</mi><mo>+</mo><mn>1</mn></mrow></mfrac></mstyle><munder><mo>∑</mo><mi>j</mi></munder><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><munderover><mo>∏</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><mrow><mo fence="true">(</mo><mi>a</mi><mstyle displaystyle="false" scriptlevel="0"><mfrac><mn>1</mn><msqrt><mrow><mn>2</mn><mi>π</mi><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></msqrt></mfrac></mstyle><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mstyle displaystyle="false" scriptlevel="0"><mfrac><msup><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>j</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mn>2</mn></msup><mrow><mn>2</mn><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac></mstyle><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\bra y\fc Kt\ket x
&amp;=\int_{\B{q_j}}^{\substack{q_N=y\\q_0=x}}\d q_1\cdots\d q_{N-1}
\sum_{\B{x_i}}^{x_{jl}=q_j}\fc\exp{\tfr{-\beta}{n+1}\sum_i\fc V{x_i}}
\prod_{i=1}^\lmd\p{\tfr12\dlt_{x_i,x_{i-1}+a}+\tfr12\dlt_{x_i,x_{i-1}-a}}\\
&amp;=\int_{\B{q_j}}^{\substack{q_N=y\\q_0=x}}\d q_1\cdots\d q_{N-1}
\fc\exp{\tfr{-\beta}{N+1}\sum_j\fc V{q_j}}
\prod_{j=1}^N\p{a\tfr1{\sqrt{2\pi la^2}}\fc\exp{-\tfr{\p{q_j-q_{j-1}}^2}{2la^2}}},
\end{align*}</annotation></semantics></math></span></span></span> where the extra factor of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span> in the multiplicant comes from converting a probability density to a probability (since the probability that the position ends up at the lattice site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span> times the probability density at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>).</p>
<p>Combining the product of exponentiations into the exponentiation of a sum, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∏</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><mrow><mo fence="true">(</mo><mi>a</mi><mfrac><mn>1</mn><msqrt><mrow><mn>2</mn><mi>π</mi><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></msqrt></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><msup><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>j</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mn>2</mn></msup><mrow><mn>2</mn><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><msup><msqrt><mrow><mn>2</mn><mi>π</mi><mi>l</mi></mrow></msqrt><mi>N</mi></msup></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>j</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mn>2</mn></msup><mrow><mn>2</mn><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\prod_{j=1}^N\p{a\fr1{\sqrt{2\pi la^2}}\fc\exp{-\fr{\p{q_j-q_{j-1}}^2}{2la^2}}}
=\fr1{\sqrt{2\pi l}^N}
\fc\exp{-\sum_{j=1}^N\fr{\p{q_j-q_{j-1}}^2}{2la^2}}.</annotation></semantics></math></span></span></span> If we introduce the time step <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>t</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>β</mi><mi mathvariant="normal">/</mi><mi>N</mi><mo>=</mo><mi>m</mi><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\Dlt t\ceq\beta/N=mla^2</annotation></semantics></math></span></span>, for large <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>j</mi><mo>−</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow><mn>2</mn></msup><mrow><mn>2</mn><mi>l</mi><msup><mi>a</mi><mn>2</mn></msup></mrow></mfrac><mo>=</mo><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><mi mathvariant="normal">Δ</mi><mi>t</mi><mtext> </mtext><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msub><mi>q</mi><mi>j</mi></msub><mo>−</mo><msub><mi>q</mi><mrow><mi>j</mi><mo>−</mo><mn>1</mn></mrow></msub></mrow><mrow><mi mathvariant="normal">Δ</mi><mi>t</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><msubsup><mo>∫</mo><mn>0</mn><mi>β</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\sum_{j=1}^N\fr{\p{q_j-q_{j-1}}^2}{2la^2}
=\sum_{j=1}^N\Dlt t\,\fr12m\p{\fr{q_j-q_{j-1}}{\Dlt t}}^2
=\int_0^\beta\d t'\,\fr12m\fc{\dot q}{t'}^2.</annotation></semantics></math></span></span></span>
Similarly, for the potential part we introduce the time step <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Δ</mi><mi>t</mi><mo>=</mo><mi>β</mi><mi mathvariant="normal">/</mi><mrow><mo fence="true">(</mo><mi>N</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\Dlt t=\beta/\p{N+1}</annotation></semantics></math></span></span> <a href="#fn2" class="footnote-ref" id="fnref2" role="doc-noteref"><sup>2</sup></a>, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mi>β</mi><mrow><mi>N</mi><mo>+</mo><mn>1</mn></mrow></mfrac><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>N</mi></munderover><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>j</mi><mo>=</mo><mn>0</mn></mrow><mi>N</mi></munderover><mi mathvariant="normal">Δ</mi><mi>t</mi><mtext> </mtext><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow><mo>=</mo><msubsup><mo>∫</mo><mn>0</mn><mi>β</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr\beta{N+1}\sum_{j=0}^N\fc V{q_j}
=\sum_{j=0}^N\Dlt t\,\fc V{q_j}
=\int_0^\beta\d t'\,\fc V{\fc q{t'}}.</annotation></semantics></math></span></span></span> Here, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc q{t'}</annotation></semantics></math></span></span> and
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\dot q}{t'}</annotation></semantics></math></span></span> are the position and its time at time <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">t'</annotation></semantics></math></span></span> for a particle undergoing these random walks. Therefore, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><msup><msqrt><mfrac><mrow><mi>m</mi><msup><mi>a</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">Δ</mi><mi>t</mi></mrow></mfrac></msqrt><mi>N</mi></msup><msubsup><mo>∫</mo><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">}</mo></mrow><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>q</mi><mi>N</mi></msub><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><msub><mi>q</mi><mn>0</mn></msub><mo>=</mo><mi>x</mi></mrow></mstyle></mtd></mtr></mtable></mstyle></msubsup><mi mathvariant="normal">d</mi><msub><mi>q</mi><mn>1</mn></msub><mo>⋯</mo><mi mathvariant="normal">d</mi><msub><mi>q</mi><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow></msub><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><msubsup><mo>∫</mo><mn>0</mn><mi>β</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x
=\sqrt{\fr{ma^2}{2\pi\Dlt t}}^N
\int_{\B{q_j}}^{\substack{q_N=y\\q_0=x}}\d q_1\cdots\d q_{N-1}
\fc\exp{-\int_0^\beta\d t'\p{\fr12m\fc{\dot q}{t'}^2+\fc V{\fc q{t'}}}}.</annotation></semantics></math></span></span></span></p>
<p>Finally, simply revert the Wick rotation by substituting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mi mathvariant="normal">i</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\beta=\i t</annotation></semantics></math></span></span> and rewrite the integral over <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>q</mi><mi>j</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{q_j}</annotation></semantics></math></span></span> as a path integral over all paths <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc q{t'}</annotation></semantics></math></span></span>. Then, we get the Feynman path integral expression of the propagator: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">∣</mo></mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">∣</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><msup><mo>∫</mo><mstyle scriptlevel="1"><mtable rowspacing="0.1em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><mi>q</mi><mrow/><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>y</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="1" displaystyle="false"><mrow><mi>q</mi><mrow/><mrow><mo fence="true">(</mo><mn>0</mn><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow></mstyle></mtd></mtr></mtable></mstyle></msup><mi mathvariant="script">D</mi><mi>q</mi><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi mathvariant="normal">i</mi><msubsup><mo>∫</mo><mn>0</mn><mi>t</mi></msubsup><mi mathvariant="normal">d</mi><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>−</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>t</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\bra y\fc Kt\ket x
=\int^{\substack{\fc qt=y\\\fc q0=0}}
\mcal Dq\fc\exp{\i\int_0^t\d t'\p{\fr12m\fc{\dot q}{t'}^2-\fc V{\fc q{t'}}}}.</annotation></semantics></math></span></span></span> This completes the derivation.</p>
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
<hr/>
<ol>
<li id="fn1"><p>You may wonder why I use the word “walk” while the resultant thing is called a “path” integral. This is just because “walk” is the correct term in graph theory that describes the object we use here, and the sum over all the walks is called a “path” integral because it is what physicists call. In graph theory, however, a path is a walk in which all vertices are distinct.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
<li id="fn2"><p>Do not ask my why it is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">N+1</annotation></semantics></math></span></span>. It is not important.<a href="#fnref2" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="physics" /><category term="ode" /><category term="quantum mechanics" /><category term="graph theory" /><category term="stochastic process" /><category term="long paper" /><summary type="html"><![CDATA[The Schrödinger equation is an ODE, so we can approach its solution through Picard iteration. This approach leads to a sum over walks on the graph formed by an orthonormal basis as vertices and the Hamiltonian matrix elements as edge weights. This sum is exactly the Feynman path integral if we choose the position basis and take the continuum limit.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-11-13-picard-path-integral.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-11-13-picard-path-integral.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Imperative programming in Nix language]]></title><link href="https://ulysseszh.github.io/programming/2025/11/06/nix-imperative.html" rel="alternate" type="text/html" title="Imperative programming in Nix language" /><published>2025-11-06T23:47:51-08:00</published><updated>2025-11-06T23:47:51-08:00</updated><id>https://ulysseszh.github.io/programming/2025/11/06/nix-imperative</id><content type="html" xml:base="https://ulysseszh.github.io/programming/2025/11/06/nix-imperative.html"><![CDATA[<p>Nix, a purely functional language best known for describing reproducible systems, seems to have just enough power to <em>model</em> imperative behavior. This article walks through a small experiment: an embedded DSL in Nix that lets you write programs with imperative features, such as mutable variables, loops, exceptions, functions, and I/O.</p>
<p>This article is an expansion of my earlier <a href="https://discourse.nixos.org/t/interactive-program-written-in-nix-lang/71536" target="_blank" rel="external">forum post</a> about writing an interactive program in Nix.</p>
<h2 data-label="0.1" id="assign-and-print">Assign and print</h2>
<p>Monads are the standard abstraction for mutation of states. A monad wraps values with extra information (such as side effects). A monadic operation can be seen as a function from some <em>state</em> to a new <em>state</em>, possibly with side effects encoded as data rather than real I/O.</p>
<p>This DSL adopts that idea. Each statement is a function of a state that returns an instruction of how to mutate the state. Consider this <code>do</code> function that “executes” a statement:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="nv">do</span> <span class="o">=</span> <span class="nv">statement</span><span class="p">:</span> <span class="nv">state</span><span class="p">:</span> <span class="nv">state</span> <span class="o">//</span> <span class="nv">statement</span> <span class="nv">state</span> <span class="nv">state</span><span class="p">;</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
Each statement receives the current state and returns a function that mutates the current state into an updated one. It is equivalent to a monadic bind, but the monads are very trivial here because the unit operation is just the identity function.
</p>
<p>Let us define some simple statements such as assignment and printing to the console:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c">#!/usr/bin/env nix-build</span>
</span>
            <span class="line line-2">
</span>
            <span class="line line-3"><span class="kd">let</span>
</span>
            <span class="line line-4">	<span class="nv">do</span> <span class="o">=</span> <span class="nv">statement</span><span class="p">:</span> <span class="nv">state</span><span class="p">:</span> <span class="nv">state</span> <span class="o">//</span> <span class="nv">statement</span> <span class="nv">state</span> <span class="nv">state</span><span class="p">;</span>
</span>
            <span class="line line-5">	<span class="nv">assign</span> <span class="o">=</span> <span class="nv">variables</span><span class="p">:</span> <span class="nv">state</span><span class="p">:</span> <span class="nv">state</span> <span class="o">//</span> <span class="nv">variables</span><span class="p">;</span>
</span>
            <span class="line line-6">	<span class="nv">print</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">trace</span><span class="p">;</span>
</span>
            <span class="line line-7">
</span>
            <span class="line line-8">	<span class="nv">state0</span> <span class="o">=</span> <span class="p">{</span> <span class="p">};</span>
</span>
            <span class="line line-9">	<span class="nv">state1</span> <span class="o">=</span> <span class="nv">do</span> <span class="p">(</span><span class="nv">state</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span> <span class="nv">state0</span><span class="p">;</span>
</span>
            <span class="line line-10">	<span class="nv">state2</span> <span class="o">=</span> <span class="nv">do</span> <span class="p">(</span><span class="nv">state</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Current value: </span><span class="si">${</span><span class="kr">toString</span> <span class="nv">state</span><span class="o">.</span><span class="nv">i</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> <span class="nv">state1</span><span class="p">;</span>
</span>
            <span class="line line-11">	<span class="nv">state3</span> <span class="o">=</span> <span class="nv">do</span> <span class="p">(</span><span class="nv">state</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="nv">state</span><span class="o">.</span><span class="nv">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span> <span class="nv">state2</span><span class="p">;</span>
</span>
            <span class="line line-12">	<span class="nv">state4</span> <span class="o">=</span> <span class="nv">do</span> <span class="p">(</span><span class="nv">state</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Current value: </span><span class="si">${</span><span class="kr">toString</span> <span class="nv">state</span><span class="o">.</span><span class="nv">i</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span> <span class="nv">state3</span><span class="p">;</span>
</span>
            <span class="line line-13">
</span>
            <span class="line line-14"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="nv">state4</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
The final <code>builtins.seq</code> call forces the final state to be evaluated so that all the statements will be executed. There is no need for a <code>builtins.deepSeq</code> because any data that we wish to see via <code>print</code> will be force evaluated. The output:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">trace: Current value: 1
</span>
            <span class="line line-2">trace: Current value: 2
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
This is nice! We can slightly modify <code>do</code> to make it handle a list of statements instead so that we do not have to call <code>do</code> for each statement. We can also rename <code>state</code> to just <code>_</code> so that the code does not look too verbose.
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c">#!/usr/bin/env nix-build</span>
</span>
            <span class="line line-2">
</span>
            <span class="line line-3"><span class="kd">let</span>
</span>
            <span class="line line-4">	<span class="nv">do</span> <span class="o">=</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span>
</span>
            <span class="line line-5">		<span class="k">if</span> <span class="nv">statements</span> <span class="o">==</span> <span class="p">[</span> <span class="p">]</span> <span class="k">then</span> <span class="nv">_</span>
</span>
            <span class="line line-6">		<span class="k">else</span> <span class="nv">do</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">tail</span> <span class="nv">statements</span><span class="p">)</span> <span class="p">(</span><span class="nv">_</span> <span class="o">//</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">head</span> <span class="nv">statements</span> <span class="nv">_</span> <span class="nv">_</span><span class="p">);</span>
</span>
            <span class="line line-7">	<span class="nv">assign</span> <span class="o">=</span> <span class="nv">variables</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span> <span class="nv">_</span> <span class="o">//</span> <span class="nv">variables</span><span class="p">;</span>
</span>
            <span class="line line-8">	<span class="nv">print</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">trace</span><span class="p">;</span>
</span>
            <span class="line line-9">
</span>
            <span class="line line-10"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-11">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-12">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Current value: </span><span class="si">${</span><span class="kr">toString</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-13">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-14">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Current value: </span><span class="si">${</span><span class="kr">toString</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-15"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
This gives the same output as before. I used a recursion to iterate over the list of statements instead of just using <code>builtins.foldl'</code> because this form is easier to be modified later to incorporate exception handling.
</p>
<h2 data-label="0.2" id="exception-handling">Exception handling</h2>
<p>Next, we add exception handling to the DSL. I introduce it before control flow because I will make loops rely on exceptions to implement <code>break</code> and <code>continue</code>.</p>
<p>For simplicity, I will make throwing an exception just setting a special variable <code>_thrown_</code> in the state:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kr">throw</span> <span class="o">=</span> <span class="nv">thrown</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">_thrown_</span> <span class="o">=</span> <span class="nv">thrown</span><span class="p">;</span> <span class="p">};</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
(Notice that this shadows the built-in <code>throw</code> function, so we will refer to the built-in one as <code>builtins.throw</code> if needed.) In <code>do</code>, we need to check whether an exception has been thrown after each statement. If so, we stop executing further statements.
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="nv">do</span> <span class="o">=</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span>
</span>
            <span class="line line-2">	<span class="k">if</span> <span class="nv">statements</span> <span class="o">==</span> <span class="p">[</span> <span class="p">]</span> <span class="k">then</span> <span class="nv">_</span>
</span>
            <span class="line line-3">	<span class="k">else</span> <span class="kd">let</span> <span class="nv">result</span> <span class="o">=</span> <span class="nv">_</span> <span class="o">//</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">head</span> <span class="nv">statements</span> <span class="nv">_</span> <span class="nv">_</span><span class="p">;</span> <span class="kn">in</span>
</span>
            <span class="line line-4">		<span class="k">if</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">hasAttr</span> <span class="s2">"_thrown_"</span> <span class="nv">result</span> <span class="k">then</span> <span class="nv">result</span>
</span>
            <span class="line line-5">		<span class="k">else</span> <span class="nv">do</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">tail</span> <span class="nv">statements</span><span class="p">)</span> <span class="nv">result</span><span class="p">;</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
Then, in the <code>try</code> statement, we check for <code>_thrown_</code> after executing the <code>try</code> block. If an exception was thrown, we execute the <code>catch</code> block with the exception value passed to it (after unsetting the <code>_thrown_</code> variable).
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="nv">try</span> <span class="o">=</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">catch</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span> <span class="kd">let</span> <span class="nv">result</span> <span class="o">=</span> <span class="nv">do</span> <span class="nv">statements</span> <span class="nv">_</span><span class="p">;</span> <span class="kn">in</span>
</span>
            <span class="line line-2">	<span class="k">if</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">hasAttr</span> <span class="s2">"_thrown_"</span> <span class="nv">result</span> <span class="k">then</span>
</span>
            <span class="line line-3">		<span class="nv">do</span> <span class="p">(</span><span class="nv">catch</span> <span class="nv">result</span><span class="o">.</span><span class="nv">_thrown_</span><span class="p">)</span> <span class="p">(</span><span class="kr">removeAttrs</span> <span class="nv">result</span> <span class="p">[</span> <span class="s2">"_thrown_"</span> <span class="p">])</span>
</span>
            <span class="line line-4">	<span class="k">else</span> <span class="nv">result</span><span class="p">;</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
With these definitions, we can now write code that throws and catches exceptions:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-2"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">try</span> <span class="p">[</span>
</span>
            <span class="line line-4">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="kr">throw</span> <span class="s2">"Some error message."</span><span class="p">)</span>
</span>
            <span class="line line-5">	<span class="p">]</span> <span class="p">(</span><span class="nv">exception</span><span class="p">:</span> <span class="p">[</span>
</span>
            <span class="line line-6">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Caught exception: </span><span class="si">${</span><span class="nv">exception</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-7">	<span class="p">]))</span>
</span>
            <span class="line line-8"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<h2 data-label="0.3" id="control-flow">Control flow</h2>
<p>The control flow statements include <code>if</code> and <code>while</code>, and the latter is accompanied by <code>break</code> and <code>continue</code>. Both of them needs a condition expression that evaluates to a boolean value. The <code>while</code> condition will be evaluated multiple times for different states, so it at least needs to be a function that maps the state to a boolean instead of just a boolean. While the <code>if</code> condition can be a simple boolean expression, I will make it a function as well for consistency.</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="k">if</span><span class="err">'</span> <span class="o">=</span> <span class="nv">condition</span><span class="p">:</span> <span class="kc">true</span><span class="nv">Statements</span><span class="p">:</span> <span class="kc">false</span><span class="nv">Statements</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span>
</span>
            <span class="line line-2">	<span class="nv">do</span> <span class="p">(</span><span class="k">if</span> <span class="nv">condition</span> <span class="nv">_</span> <span class="k">then</span> <span class="kc">true</span><span class="nv">Statements</span> <span class="k">else</span> <span class="kc">false</span><span class="nv">Statements</span><span class="p">)</span> <span class="nv">_</span><span class="p">;</span>
</span>
            <span class="line line-3"><span class="nv">whileWithoutJump</span> <span class="o">=</span> <span class="nv">condition</span><span class="p">:</span> <span class="nv">body</span><span class="p">:</span>
</span>
            <span class="line line-4">	<span class="k">if</span><span class="err">'</span> <span class="nv">condition</span> <span class="p">[</span> <span class="nv">body</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">whileWithoutJump</span> <span class="nv">condition</span> <span class="nv">body</span><span class="p">)</span> <span class="p">]</span> <span class="p">[</span> <span class="p">];</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
Now, to implement <code>break</code> and <code>continue</code>, we can use exception handling. Define them as throwing special exception values:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="nv">break</span> <span class="o">=</span> <span class="kr">throw</span> <span class="s2">"_break_"</span><span class="p">;</span>
</span>
            <span class="line line-2"><span class="nv">continue</span> <span class="o">=</span> <span class="kr">throw</span> <span class="s2">"_continue_"</span><span class="p">;</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
Then, define <code>while</code> to use <code>try</code> to catch these exceptions. The <code>"_continue_"</code> exception is caught inside the loop body, and the <code>"_break_"</code> exception is caught outside the loop to terminate the loop.
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="nv">catchOnly</span> <span class="o">=</span> <span class="nv">handled</span><span class="p">:</span> <span class="nv">thrown</span><span class="p">:</span> <span class="k">if</span> <span class="nv">thrown</span> <span class="o">==</span> <span class="nv">handled</span> <span class="k">then</span> <span class="p">[</span> <span class="p">]</span> <span class="k">else</span> <span class="p">[</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="kr">throw</span> <span class="nv">thrown</span><span class="p">)</span> <span class="p">];</span>
</span>
            <span class="line line-2"><span class="nv">while</span> <span class="o">=</span> <span class="nv">condition</span><span class="p">:</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">try</span> <span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">whileWithoutJump</span> <span class="nv">condition</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">try</span> <span class="nv">statements</span> <span class="p">(</span><span class="nv">catchOnly</span> <span class="s2">"_continue_"</span><span class="p">)))</span>
</span>
            <span class="line line-4"><span class="p">]</span> <span class="p">(</span><span class="nv">catchOnly</span> <span class="s2">"_break_"</span><span class="p">);</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>We can now write some loops.</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-2"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-4">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">while</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">&lt;</span> <span class="mi">5</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-5">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="k">if</span><span class="err">'</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">==</span> <span class="mi">4</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-6">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">break</span><span class="p">)</span>
</span>
            <span class="line line-7">		<span class="p">]</span> <span class="p">[</span> <span class="p">])</span>
</span>
            <span class="line line-8">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="k">if</span><span class="err">'</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-9">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-10">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">continue</span><span class="p">)</span>
</span>
            <span class="line line-11">		<span class="p">]</span> <span class="p">[</span> <span class="p">])</span>
</span>
            <span class="line line-12">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Current i: </span><span class="si">${</span><span class="kr">toString</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-13">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-14">	<span class="p">])</span>
</span>
            <span class="line line-15"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
This prints:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">trace: Current i: 0
</span>
            <span class="line line-2">trace: Current i: 1
</span>
            <span class="line line-3">trace: Current i: 3
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<h2 data-label="0.4" id="functions">Functions</h2>
<p>Defining functions is already possible without any special constructs, but only <code>assign</code> and <code>do</code> is needed:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-2"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">hello</span> <span class="o">=</span> <span class="nv">name</span><span class="p">:</span> <span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-4">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Hello, </span><span class="si">${</span><span class="nv">name</span><span class="si">}</span><span class="s2">!"</span><span class="p">)</span>
</span>
            <span class="line line-5">	<span class="p">];</span> <span class="p">})</span>
</span>
            <span class="line line-6">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="s2">"world"</span><span class="p">)</span>
</span>
            <span class="line line-7"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
We can make it nicer by having it support <code>return</code> to exit early from the function. Similar to <code>break</code> and <code>continue</code>, we can implement <code>return</code> using exceptions.
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="nv">return</span> <span class="o">=</span> <span class="kr">throw</span> <span class="s2">"_return_"</span><span class="p">;</span>
</span>
            <span class="line line-2"><span class="nv">function</span> <span class="o">=</span> <span class="nv">functions</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">mapAttrs</span> <span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="nv">fun</span><span class="p">:</span> <span class="nv">arg</span><span class="p">:</span> <span class="nv">try</span> <span class="p">(</span><span class="nv">fun</span> <span class="nv">arg</span><span class="p">)</span> <span class="p">(</span><span class="nv">catchOnly</span> <span class="s2">"_return_"</span><span class="p">))</span> <span class="nv">functions</span><span class="p">);</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Then, we can define functions with <code>return</code> support:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-2"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">function</span> <span class="p">{</span> <span class="nv">hello</span> <span class="o">=</span> <span class="nv">arg</span><span class="p">:</span> <span class="p">[</span>
</span>
            <span class="line line-4">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="k">if</span><span class="err">'</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">arg</span> <span class="o">==</span> <span class="s2">""</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-5">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"What's your name?"</span><span class="p">)</span>
</span>
            <span class="line line-6">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">return</span><span class="p">)</span>
</span>
            <span class="line line-7">		<span class="p">]</span> <span class="p">[</span> <span class="p">])</span>
</span>
            <span class="line line-8">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"Hello, </span><span class="si">${</span><span class="nv">arg</span><span class="si">}</span><span class="s2">!"</span><span class="p">)</span>
</span>
            <span class="line line-9">	<span class="p">];</span> <span class="p">})</span>
</span>
            <span class="line line-10">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="s2">""</span><span class="p">)</span>
</span>
            <span class="line line-11">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="s2">"world"</span><span class="p">)</span>
</span>
            <span class="line line-12"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
This prints:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">trace: What's your name?
</span>
            <span class="line line-2">trace: Hello, world!
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<h2 data-label="0.5" id="input">Input</h2>
<p>We can use <code>builtins.readFile</code> to read input from files. To read from stdin, we need to use Lix to do that because the vanilla implementation of Nix <a href="https://github.com/NixOS/nix/issues/9330" target="_blank" rel="external">does not</a> support <code>builtins.readFile /dev/stdin</code>.</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-2">	<span class="nv">read</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">readFile</span><span class="p">;</span>
</span>
            <span class="line line-3"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-4">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">input</span> <span class="o">=</span> <span class="nv">read</span> <span class="sx">/dev/stdin</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-5">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">print</span> <span class="s2">"You entered: </span><span class="si">${</span><span class="nv">_</span><span class="o">.</span><span class="nv">input</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-6"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Because <code>builtins.readFile</code> reads the entire file until EOF, when you finish input, you need to send an EOF signal, typically by pressing <kbd>Ctrl</kbd>+<kbd>D</kbd> on an empty line. Notice that you need to press this combination on a empty line, so the input you get in Nix probably ends with a newline character that you want to trim.</p>
<p>If you want to read from stdin multiple times, to ensure that the Nix interpreter tries to reopen <code>/dev/stdin</code> each time, you must not write <code>input = builtins.readFile /dev/stdin;</code> in the first <code>let</code> block and refer to <code>input</code> every time you want to read from stdin. Instead, you should use <code>read /dev/stdin</code> every time, or wrap it in a function and call the function every time.</p>
<h2 data-label="0.6" id="other-minor-improvements">Other minor improvements</h2>
<p>We may want to separate all those things in the first <code>let</code> block into a separate file, which let us call <code>imperative.nix</code>, so that we do not need to write out all those things like <code>assign</code>, <code>print</code> every time we write an imperative program. However, this would still mean that we have to pass a bunch of variables like this:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kd">let</span>
</span>
            <span class="line line-2">	<span class="kn">inherit</span> <span class="p">(</span><span class="kr">import</span> <span class="sx">./imperative.nix</span><span class="p">)</span> <span class="nv">do</span> <span class="nv">assign</span> <span class="nv">print</span> <span class="kr">throw</span><span class="p">;</span>
</span>
            <span class="line line-3">	<span class="c"># ...</span>
</span>
            <span class="line line-4"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span><span class="nv">do</span> <span class="p">[</span>
</span>
            <span class="line line-5">	<span class="c"># ...</span>
</span>
            <span class="line line-6"><span class="p">]</span> <span class="p">{</span> <span class="p">})</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
One way to avoid this is to use <code>builtins.scopedImport</code> in <code>imperative.nix</code>, but in my opinion, a better approach is to simply put all those things in the initial state <code>_</code>. Now, the actually executable Nix file just contain the list of statements, and <code>imperative.nix</code> will import it to run it. All the keywords like <code>while</code> and <code>assign</code> become variables in <code>_</code>, so nothing needs to be imported or scoped in the executable Nix file. However, this would also mean that we need to <code>import</code> the program in <code>imperative.nix</code> instead of the other way around. To make <code>imperative.nix</code> know which file to import, we can provide it with an argument, so it looks like this:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="p">{</span> <span class="nv">input</span> <span class="p">}:</span> <span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-2"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span>
</span>
            <span class="line line-3">	<span class="nv">do</span>
</span>
            <span class="line line-4">	<span class="p">(</span><span class="kr">import</span> <span class="p">(</span><span class="k">if</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">match</span> <span class="nv">input</span> <span class="s2">"^/"</span> <span class="o">!=</span> <span class="kc">null</span> <span class="k">then</span> <span class="nv">input</span> <span class="k">else</span> <span class="s2">"</span><span class="si">${</span><span class="kr">toString</span> <span class="sx">./.</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">input</span><span class="si">}</span><span class="s2">"</span><span class="p">))</span>
</span>
            <span class="line line-5">	<span class="p">{</span> <span class="kn">inherit</span> <span class="nv">assign</span> <span class="k">if</span><span class="err">'</span> <span class="nv">while</span> <span class="nv">print</span> <span class="kr">throw</span> <span class="nv">break</span> <span class="nv">continue</span> <span class="nv">return</span> <span class="nv">function</span> <span class="nv">read</span> <span class="nv">try</span><span class="p">;</span> <span class="p">}</span>
</span>
            <span class="line line-6"><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
To run a program in <code>program.nix</code>, you need to run <code>nix-build imperative.nix --argstr input program.nix</code>. You may encapsulate it in a shebang in <code>imperative.nix</code>:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c">#!/usr/bin/env nix-shell</span>
</span>
            <span class="line line-2"><span class="c">#!nix-shell --pure -i "nix-build --no-out-link" -p lix</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
If you now make <code>imperative.nix</code> executable, you can run a program using <code>imperative.nix --argstr input program.nix</code>.
</p>
<p>This now enables us to implement an <code>import</code> function that runs programs from other files:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="kr">import</span> <span class="o">=</span> <span class="nv">file</span><span class="p">:</span> <span class="nv">do</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="kr">import</span> <span class="nv">file</span><span class="p">);</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
(This shadows the built-in <code>import</code> function, so we will refer to the built-in one as <code>builtins.import</code> if needed.) You can now do something like this:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c"># program.nix</span>
</span>
            <span class="line line-2"><span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="kr">import</span> <span class="sx">./other-program.nix</span><span class="p">)</span>
</span>
            <span class="line line-4"><span class="p">]</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c"># other-program.nix</span>
</span>
            <span class="line line-2"><span class="p">[</span>
</span>
            <span class="line line-3">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">print</span> <span class="s2">"Hello from other program!"</span><span class="p">)</span>
</span>
            <span class="line line-4"><span class="p">]</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
When you run <code>imperative.nix --argstr input program.nix</code>, it will print:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">trace: Hello from other program!
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>We may improve it further by removing the need of <code>--argstr input</code> and also adding support for passing command line arguments to the program, at the cost of having to write a little bit of shell script and jq in the shebang (so really we cannot call it a “purely Nix” implementation now, but the nix-shell shebang is simply too powerful):</p>
<!-- markdownlint-disable line-length -->
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c">#!/usr/bin/env nix-shell</span>
</span>
            <span class="line line-2"><span class="c">#!nix-shell --pure -i "sh -c '_1=\$1; _2=\$2; shift 2; exec nix-build --no-out-link \"\$_1\" --argstr input \"\$_2\" --argstr argvJSON \"\$(printf \"%s\\\\0\" \"\$@\" | jq -Rsc \"split(\\\"\\\\u0000\\\")[:-1]\")\"' --" -p lix jq</span>
</span>
            <span class="line line-3">
</span>
            <span class="line line-4"><span class="p">{</span> <span class="nv">input</span><span class="p">,</span> <span class="nv">argvJSON</span> <span class="p">}:</span> <span class="kd">let</span> <span class="c"># ...</span>
</span>
            <span class="line line-5">	<span class="nv">argv</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">fromJSON</span> <span class="nv">argvJSON</span><span class="p">;</span>
</span>
            <span class="line line-6"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="c"># ...</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<!-- markdownlint-enable line-length -->
<p class="no-indent">
The mechanism is that the shell script in the shebang extracts the first two command line arguments as the Nix file to run and the input file, and the rest of the command line arguments are concatenated with null characters and converted to a JSON array using <code>jq</code>. In <code>imperative.nix</code>, we parse the JSON array back to a Nix list and provide it as the variable <code>argv</code> in the initial state <code>_</code>. You can now simply use a shebang <code>#!/usr/bin/env imperative.nix</code> in <code>program.nix</code>, and then you can run it with <code>./program.nix arg1 arg2</code> if you make it executable, and the command line arguments will be available in the list <code>_.argv</code>.
</p>
<p>Finally, we can use <code>try</code> instead of <code>do</code> in the ultimate <code>builtins.seq</code> call to catch any uncaught exceptions in the program. Here is the final version of <code>imperative.nix</code> and an example <code>program.nix</code> that uses most of the features we introduced:</p>
<!-- markdownlint-disable line-length -->
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c">#!/usr/bin/env nix-shell</span>
</span>
            <span class="line line-2"><span class="c">#!nix-shell --pure -i "sh -c '_1=\$1; _2=\$2; shift 2; exec nix-build --no-out-link \"\$_1\" --argstr input \"\$_2\" --argstr argvJSON \"\$(printf \"%s\\\\0\" \"\$@\" | jq -Rsc \"split(\\\"\\\\u0000\\\")[:-1]\")\"' --" -p lix jq</span>
</span>
            <span class="line line-3">
</span>
            <span class="line line-4"><span class="p">{</span> <span class="nv">input</span><span class="p">,</span> <span class="nv">argvJSON</span> <span class="p">}:</span> <span class="kd">let</span>
</span>
            <span class="line line-5">	<span class="nv">do</span> <span class="o">=</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span>
</span>
            <span class="line line-6">		<span class="k">if</span> <span class="nv">statements</span> <span class="o">==</span> <span class="p">[</span> <span class="p">]</span> <span class="k">then</span> <span class="nv">_</span>
</span>
            <span class="line line-7">		<span class="k">else</span> <span class="kd">let</span> <span class="nv">result</span> <span class="o">=</span> <span class="nv">_</span> <span class="o">//</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">head</span> <span class="nv">statements</span> <span class="nv">_</span> <span class="nv">_</span><span class="p">;</span> <span class="kn">in</span>
</span>
            <span class="line line-8">			<span class="k">if</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">hasAttr</span> <span class="s2">"_thrown_"</span> <span class="nv">result</span> <span class="k">then</span> <span class="nv">result</span>
</span>
            <span class="line line-9">			<span class="k">else</span> <span class="nv">do</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">tail</span> <span class="nv">statements</span><span class="p">)</span> <span class="nv">result</span><span class="p">;</span>
</span>
            <span class="line line-10">	<span class="nv">assign</span> <span class="o">=</span> <span class="nv">variables</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span> <span class="nv">_</span> <span class="o">//</span> <span class="nv">variables</span><span class="p">;</span>
</span>
            <span class="line line-11">	<span class="nv">read</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">readFile</span><span class="p">;</span>
</span>
            <span class="line line-12">	<span class="nv">print</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">trace</span><span class="p">;</span>
</span>
            <span class="line line-13">	<span class="k">if</span><span class="err">'</span> <span class="o">=</span> <span class="nv">condition</span><span class="p">:</span> <span class="kc">true</span><span class="nv">Statements</span><span class="p">:</span> <span class="kc">false</span><span class="nv">Statements</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span>
</span>
            <span class="line line-14">		<span class="nv">do</span> <span class="p">(</span><span class="k">if</span> <span class="nv">condition</span> <span class="nv">_</span> <span class="k">then</span> <span class="kc">true</span><span class="nv">Statements</span> <span class="k">else</span> <span class="kc">false</span><span class="nv">Statements</span><span class="p">)</span> <span class="nv">_</span><span class="p">;</span>
</span>
            <span class="line line-15">	<span class="nv">whileWithoutJump</span> <span class="o">=</span> <span class="nv">condition</span><span class="p">:</span> <span class="nv">body</span><span class="p">:</span>
</span>
            <span class="line line-16">		<span class="k">if</span><span class="err">'</span> <span class="nv">condition</span> <span class="p">[</span> <span class="nv">body</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">whileWithoutJump</span> <span class="nv">condition</span> <span class="nv">body</span><span class="p">)</span> <span class="p">]</span> <span class="p">[</span> <span class="p">];</span>
</span>
            <span class="line line-17">	<span class="nv">catchOnly</span> <span class="o">=</span> <span class="nv">handled</span><span class="p">:</span> <span class="nv">thrown</span><span class="p">:</span> <span class="k">if</span> <span class="nv">thrown</span> <span class="o">==</span> <span class="nv">handled</span> <span class="k">then</span> <span class="p">[</span> <span class="p">]</span> <span class="k">else</span> <span class="p">[</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="kr">throw</span> <span class="nv">thrown</span><span class="p">)</span> <span class="p">];</span>
</span>
            <span class="line line-18">	<span class="nv">while</span> <span class="o">=</span> <span class="nv">condition</span><span class="p">:</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">try</span> <span class="p">[</span>
</span>
            <span class="line line-19">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">whileWithoutJump</span> <span class="nv">condition</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">try</span> <span class="nv">statements</span> <span class="p">(</span><span class="nv">catchOnly</span> <span class="s2">"_continue_"</span><span class="p">)))</span>
</span>
            <span class="line line-20">	<span class="p">]</span> <span class="p">(</span><span class="nv">catchOnly</span> <span class="s2">"_break_"</span><span class="p">);</span>
</span>
            <span class="line line-21">	<span class="kr">throw</span> <span class="o">=</span> <span class="nv">thrown</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">{</span> <span class="nv">_thrown_</span> <span class="o">=</span> <span class="nv">thrown</span><span class="p">;</span> <span class="p">};</span>
</span>
            <span class="line line-22">	<span class="nv">break</span> <span class="o">=</span> <span class="kr">throw</span> <span class="s2">"_break_"</span><span class="p">;</span>
</span>
            <span class="line line-23">	<span class="nv">continue</span> <span class="o">=</span> <span class="kr">throw</span> <span class="s2">"_continue_"</span><span class="p">;</span>
</span>
            <span class="line line-24">	<span class="nv">return</span> <span class="o">=</span> <span class="kr">throw</span> <span class="s2">"_return_"</span><span class="p">;</span>
</span>
            <span class="line line-25">	<span class="nv">try</span> <span class="o">=</span> <span class="nv">statements</span><span class="p">:</span> <span class="nv">catch</span><span class="p">:</span> <span class="nv">_</span><span class="p">:</span> <span class="kd">let</span> <span class="nv">result</span> <span class="o">=</span> <span class="nv">do</span> <span class="nv">statements</span> <span class="nv">_</span><span class="p">;</span> <span class="kn">in</span>
</span>
            <span class="line line-26">		<span class="k">if</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">hasAttr</span> <span class="s2">"_thrown_"</span> <span class="nv">result</span> <span class="k">then</span>
</span>
            <span class="line line-27">			<span class="nv">do</span> <span class="p">(</span><span class="nv">catch</span> <span class="nv">result</span><span class="o">.</span><span class="nv">_thrown_</span><span class="p">)</span> <span class="p">(</span><span class="kr">removeAttrs</span> <span class="nv">result</span> <span class="p">[</span> <span class="s2">"_thrown_"</span> <span class="p">])</span>
</span>
            <span class="line line-28">		<span class="k">else</span> <span class="nv">result</span><span class="p">;</span>
</span>
            <span class="line line-29">	<span class="nv">function</span> <span class="o">=</span> <span class="nv">functions</span><span class="p">:</span> <span class="nv">assign</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">mapAttrs</span> <span class="p">(</span><span class="nv">name</span><span class="p">:</span> <span class="nv">fun</span><span class="p">:</span> <span class="nv">arg</span><span class="p">:</span> <span class="nv">try</span> <span class="p">(</span><span class="nv">fun</span> <span class="nv">arg</span><span class="p">)</span> <span class="p">(</span><span class="nv">catchOnly</span> <span class="s2">"_return_"</span><span class="p">))</span> <span class="nv">functions</span><span class="p">);</span>
</span>
            <span class="line line-30">	<span class="kr">import</span> <span class="o">=</span> <span class="nv">file</span><span class="p">:</span> <span class="nv">do</span> <span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="kr">import</span> <span class="nv">file</span><span class="p">);</span>
</span>
            <span class="line line-31">	<span class="nv">argv</span> <span class="o">=</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">fromJSON</span> <span class="nv">argvJSON</span><span class="p">;</span>
</span>
            <span class="line line-32"><span class="kn">in</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">seq</span> <span class="p">(</span>
</span>
            <span class="line line-33">	<span class="nv">try</span>
</span>
            <span class="line line-34">	<span class="p">(</span><span class="kr">builtins</span><span class="o">.</span><span class="kr">import</span> <span class="p">(</span><span class="k">if</span> <span class="kr">builtins</span><span class="o">.</span><span class="nv">match</span> <span class="nv">input</span> <span class="s2">"^/"</span> <span class="o">!=</span> <span class="kc">null</span> <span class="k">then</span> <span class="nv">input</span> <span class="k">else</span> <span class="s2">"</span><span class="si">${</span><span class="kr">toString</span> <span class="sx">./.</span><span class="si">}</span><span class="s2">/</span><span class="si">${</span><span class="nv">input</span><span class="si">}</span><span class="s2">"</span><span class="p">))</span>
</span>
            <span class="line line-35">	<span class="kr">builtins</span><span class="o">.</span><span class="kr">throw</span>
</span>
            <span class="line line-36">	<span class="p">{</span> <span class="kn">inherit</span> <span class="nv">assign</span> <span class="k">if</span><span class="err">'</span> <span class="nv">while</span> <span class="nv">print</span> <span class="kr">throw</span> <span class="nv">break</span> <span class="nv">continue</span> <span class="nv">return</span> <span class="nv">function</span> <span class="nv">read</span> <span class="nv">try</span> <span class="kr">import</span> <span class="kr">builtins</span> <span class="nv">argv</span><span class="p">;</span> <span class="p">}</span>
</span>
            <span class="line line-37"><span class="p">)</span> <span class="p">{</span> <span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<!-- markdownlint-enable line-length -->
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-nix">
        <pre>
          <code>
            <span class="line line-1"><span class="c">#!/usr/bin/env imperative.nix</span>
</span>
            <span class="line line-2">
</span>
            <span class="line line-3"><span class="p">[</span>
</span>
            <span class="line line-4">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="kr">import</span> <span class="p">(</span><span class="nv">_</span><span class="o">.</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">toFile</span> <span class="s2">"other-input.nix"</span> <span class="s2">"[ (_: _.print </span><span class="se">\"</span><span class="s2">Hello from other file!</span><span class="se">\"</span><span class="s2">) ]"</span><span class="p">))</span>
</span>
            <span class="line line-5">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">function</span> <span class="p">{</span> <span class="nv">hello</span> <span class="o">=</span> <span class="nv">arg</span><span class="p">:</span> <span class="p">[</span>
</span>
            <span class="line line-6">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="k">if</span><span class="err">'</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">arg</span> <span class="o">==</span> <span class="s2">""</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-7">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">print</span> <span class="s2">"What's your name?"</span><span class="p">)</span>
</span>
            <span class="line line-8">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">return</span><span class="p">)</span>
</span>
            <span class="line line-9">		<span class="p">]</span> <span class="p">[</span> <span class="p">])</span>
</span>
            <span class="line line-10">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">print</span> <span class="s2">"Hello, </span><span class="si">${</span><span class="nv">arg</span><span class="si">}</span><span class="s2">!"</span><span class="p">)</span>
</span>
            <span class="line line-11">	<span class="p">];</span> <span class="p">})</span>
</span>
            <span class="line line-12">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="s2">""</span><span class="p">)</span>
</span>
            <span class="line line-13">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="s2">"World"</span><span class="p">)</span>
</span>
            <span class="line line-14">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">while</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">argv</span> <span class="o">!=</span> <span class="p">[</span> <span class="p">])</span> <span class="p">[</span>
</span>
            <span class="line line-15">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="p">(</span><span class="nv">_</span><span class="o">.</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">head</span> <span class="nv">_</span><span class="o">.</span><span class="nv">argv</span><span class="p">))</span>
</span>
            <span class="line line-16">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">assign</span> <span class="p">{</span> <span class="nv">argv</span> <span class="o">=</span> <span class="nv">_</span><span class="o">.</span><span class="kr">builtins</span><span class="o">.</span><span class="nv">tail</span> <span class="nv">_</span><span class="o">.</span><span class="nv">argv</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-17">	<span class="p">])</span>
</span>
            <span class="line line-18">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-19">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">while</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">&lt;</span> <span class="mi">5</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-20">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="k">if</span><span class="err">'</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">==</span> <span class="mi">4</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-21">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">break</span><span class="p">)</span>
</span>
            <span class="line line-22">		<span class="p">]</span> <span class="p">[</span> <span class="p">])</span>
</span>
            <span class="line line-23">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="k">if</span><span class="err">'</span> <span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">==</span> <span class="mi">2</span><span class="p">)</span> <span class="p">[</span>
</span>
            <span class="line line-24">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-25">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">continue</span><span class="p">)</span>
</span>
            <span class="line line-26">		<span class="p">]</span> <span class="p">[</span>
</span>
            <span class="line line-27">			<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">hello</span> <span class="s2">"</span><span class="si">${</span><span class="nv">_</span><span class="o">.</span><span class="kr">builtins</span><span class="o">.</span><span class="kr">toString</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-28">		<span class="p">])</span>
</span>
            <span class="line line-29">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">assign</span> <span class="p">{</span> <span class="nv">i</span> <span class="o">=</span> <span class="nv">_</span><span class="o">.</span><span class="nv">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span> <span class="p">})</span>
</span>
            <span class="line line-30">	<span class="p">])</span>
</span>
            <span class="line line-31">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">try</span> <span class="p">[</span>
</span>
            <span class="line line-32">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="kr">throw</span> <span class="s2">"Some error message."</span><span class="p">)</span>
</span>
            <span class="line line-33">	<span class="p">]</span> <span class="p">(</span><span class="nv">exception</span><span class="p">:</span> <span class="p">[</span>
</span>
            <span class="line line-34">		<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">print</span> <span class="s2">"Caught exception: </span><span class="si">${</span><span class="nv">exception</span><span class="si">}</span><span class="s2">"</span><span class="p">)</span>
</span>
            <span class="line line-35">	<span class="p">]))</span>
</span>
            <span class="line line-36">	<span class="p">(</span><span class="nv">_</span><span class="p">:</span> <span class="nv">_</span><span class="o">.</span><span class="nv">print</span> <span class="s2">"Goodbye!"</span><span class="p">)</span>
</span>
            <span class="line line-37"><span class="p">]</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
When you run <code>./program.nix Kat "Ulysses Zhan"</code>, it will print:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">trace: Hello from other file!
</span>
            <span class="line line-2">trace: What's your name?
</span>
            <span class="line line-3">trace: Hello, World!
</span>
            <span class="line line-4">trace: Hello, Kat!
</span>
            <span class="line line-5">trace: Hello, Ulysses Zhan!
</span>
            <span class="line line-6">trace: Hello, 0!
</span>
            <span class="line line-7">trace: Hello, 1!
</span>
            <span class="line line-8">trace: Hello, 3!
</span>
            <span class="line line-9">trace: Caught exception: Some error message.
</span>
            <span class="line line-10">trace: Goodbye!
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<h2 data-label="0.7" id="possible-improvements">Possible improvements</h2>
<p>Maybe I can improve it further by adding support for local variables. It would also be nice if functions with side effects can also have return values, but this would be tricky to implement.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="programming" /><category term="nix" /><category term="functional programming" /><summary type="html"><![CDATA[Nix is a functional programming language primarily used for package management and system configuration. However, it may be interesting to emulate imperative programming constructs within Nix. This post explores how to achieve imperative-style programming in Nix, ipmlementing control flow, exception handling, and interactive IO.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-11-06-nix-imperative.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-11-06-nix-imperative.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Multi-pass Gaussian blur filter]]></title><link href="https://ulysseszh.github.io/programming/2025/07/17/blur-filter.html" rel="alternate" type="text/html" title="Multi-pass Gaussian blur filter" /><published>2025-07-17T01:06:08-07:00</published><updated>2025-07-17T01:06:08-07:00</updated><id>https://ulysseszh.github.io/programming/2025/07/17/blur-filter</id><content type="html" xml:base="https://ulysseszh.github.io/programming/2025/07/17/blur-filter.html"><![CDATA[<p>In image processing, a Gaussian blur filter is the transformation of an image that blurs it by a Gaussian function. Mathematically, a Gaussian blur filter is a linear transformation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> on a measurable function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>:</mo><msup><mi mathvariant="double-struck">R</mi><mi>d</mi></msup><mo>→</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">f:\bR^d\to\bR</annotation></semantics></math></span></span> that does not grow too fast at infinity (or more generally, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>:</mo><msup><mi mathvariant="double-struck">R</mi><mi>d</mi></msup><mo>→</mo><mi>V</mi></mrow><annotation encoding="application/x-tex">f:\bR^d\to V</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> is a locally convex topological vector space) which results in a function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mi>f</mi><mo>:</mo><msup><mi mathvariant="double-struck">R</mi><mi>d</mi></msup><mo>→</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">Gf:\bR^d\to\bR</annotation></semantics></math></span></span> defined by the integral <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>G</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mo>∫</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mi>d</mi></msup><mi>y</mi></mrow><msqrt><mrow><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>π</mi><mo fence="true">)</mo></mrow><mi>d</mi></msup><mi>det</mi><mo>⁡</mo><mi>A</mi></mrow></msqrt></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msub><mrow><mo fence="true">(</mo><msup><mi>A</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo fence="true">)</mo></mrow><mrow><mi>j</mi><mi>k</mi></mrow></msub><msub><mi>y</mi><mi>j</mi></msub><msub><mi>y</mi><mi>k</mi></msub><mo fence="true">)</mo></mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{Gf}x\ceq\int\frac{\d^dy}{\sqrt{\p{2\pi}^d\det A}}\fc\exp{-\fr12\p{A^{-1}}_{jk}y_jy_k}\fc f{x+y},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span> is a symmetric positive definite matrix called the covariance matrix of the Gaussian kernel.</p>
<p>By looking at this formula, we can see that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{Gf}x</annotation></semantics></math></span></span> is exactly the expectation value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mi>Y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc f{x+Y}</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Y</mi></mrow><annotation encoding="application/x-tex">Y</annotation></semantics></math></span></span> is a random vector distributed according to the multivariate normal distribution with mean <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> and covariance matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span>. Let’s say, however, that instead of a multivariate normal distribution, we have a discrete distribution on a finite set of points <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>a</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{a_i}</annotation></semantics></math></span></span>, each with probability <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>w</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">w_i</annotation></semantics></math></span></span>, satisfying
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><mo>=</mo><mn>1</mn><mo separator="true">,</mo><mspace width="1em"/><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><msub><mi>a</mi><mi>i</mi></msub><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\sum_i w_i=1,\quad\sum_i w_ia_i=0.</annotation></semantics></math></span></span></span> Then, for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Y</mi></mrow><annotation encoding="application/x-tex">Y</annotation></semantics></math></span></span> distributed according to this discrete distribution, the expectation value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mi>Y</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc f{x+Y}</annotation></semantics></math></span></span> is
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">E</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">[</mo><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mi>Y</mi><mo fence="true">)</mo></mrow><mo fence="true">]</mo></mrow><mo>=</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><msub><mi>a</mi><mi>i</mi></msub><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\bopc E{\fc f{x+Y}}=\sum_i w_i\fc f{x+a_i}.</annotation></semantics></math></span></span></span> This distribution has the covariance matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>A</mi><mrow><mi>j</mi><mi>k</mi></mrow></msub><mo>=</mo><msub><mo>∑</mo><mi>i</mi></msub><msub><mi>w</mi><mi>i</mi></msub><msub><mi>a</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>a</mi><mrow><mi>i</mi><mi>k</mi></mrow></msub></mrow><annotation encoding="application/x-tex">A_{jk}=\sum_i w_ia_{ij}a_{ik}</annotation></semantics></math></span></span>, but this expectation value is not the same as the result <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{Gf}x</annotation></semantics></math></span></span> of the Gaussian blur filter. In order to approach the Gaussian distribution, we need to sum <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> independent samples
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>Y</mi><mi>α</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{Y_\alpha}</annotation></semantics></math></span></span>, each distributed according the same discrete distribution with covariance matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mi mathvariant="normal">/</mi><mi>N</mi></mrow><annotation encoding="application/x-tex">A/N</annotation></semantics></math></span></span>. Without changing the relation between <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>a</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{a_i}</annotation></semantics></math></span></span>, we can achieve this by taking the distribution to be among the points <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>a</mi><mi>i</mi></msub><mi mathvariant="normal">/</mi><msqrt><mi>N</mi></msqrt><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{a_i/\sqrt N}</annotation></semantics></math></span></span>, with the same probabilities <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>w</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">w_i</annotation></semantics></math></span></span>. Then, according to the central limit theorem, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>G</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>N</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow></munder><mi mathvariant="normal">E</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">[</mo><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><munder><mo>∑</mo><mi>α</mi></munder><msub><mi>Y</mi><mi>α</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">]</mo></mrow><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>N</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow></munder><munder><mo>∑</mo><mrow><mo fence="true">{</mo><msub><mi>i</mi><mi>α</mi></msub><mo fence="true">}</mo></mrow></munder><mrow><mo fence="true">(</mo><munder><mo>∏</mo><mi>α</mi></munder><msub><mi>w</mi><msub><mi>i</mi><mi>α</mi></msub></msub><mo fence="true">)</mo></mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mfrac><mn>1</mn><msqrt><mi>N</mi></msqrt></mfrac><munder><mo>∑</mo><mi>α</mi></munder><msub><mi>a</mi><msub><mi>i</mi><mi>α</mi></msub></msub><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{Gf}x=\lim_{N\to\infty}\bopc E{\fc f{x+\sum_\alpha Y_\alpha}}
=\lim_{N\to\infty}\sum_{\B{i_\alpha}}\p{\prod_\alpha w_{i_\alpha}}\fc f{x+\fr{1}{\sqrt N}\sum_\alpha a_{i_\alpha}}.</annotation></semantics></math></span></span></span> By staring at this formula, one may notice that it is actually the result of the same linear transformation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">P_N</annotation></semantics></math></span></span> applied <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> times to the function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi></mrow><annotation encoding="application/x-tex">f</annotation></semantics></math></span></span>, where <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mfrac><msub><mi>a</mi><mi>i</mi></msub><msqrt><mi>N</mi></msqrt></mfrac><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{P_Nf}x\ceq\sum_iw_i\fc f{x+\fr{a_i}{\sqrt N}}.</annotation></semantics></math></span></span></span> Thus, we can write <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>G</mi><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>N</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow></munder><msubsup><mi>P</mi><mi>N</mi><mi>N</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">G=\lim_{N\to\infty}P_N^N.</annotation></semantics></math></span></span></span></p>
<p>We can now see why we can implement a Gaussian blur filter as a multi-pass filter: each pass of the filter is equivalent to applying the linear transformation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">P_N</annotation></semantics></math></span></span> once, and the Gaussian blur filter is the limit of applying this transformation infinitely many times. After choosing the points <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>a</mi><mi>i</mi></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{a_i}</annotation></semantics></math></span></span> and the weights <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>w</mi><mi>i</mi></msub></mrow><annotation encoding="application/x-tex">w_i</annotation></semantics></math></span></span>, we can easily implement the filter in a fragment shader. After implementing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">P_N</annotation></semantics></math></span></span>, one can implement the multi-pass filter by flip-flopping between two textures <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> times. Here is an example implementation of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">P_N</annotation></semantics></math></span></span> for a 2D (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">d=2</annotation></semantics></math></span></span>) texture, with <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>a</mi><mn>0</mn></msub><mo>=</mo><mrow><mo fence="true">(</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mi>σ</mi></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr></mtable><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msub><mi>a</mi><mn>1</mn></msub><mo>=</mo><mrow><mo fence="true">(</mo><mtable rowspacing="0.16em" columnalign="center" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo>−</mo><mi>σ</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>0</mn></mstyle></mtd></mtr></mtable><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msub><mi>w</mi><mn>0</mn></msub><mo>=</mo><msub><mi>w</mi><mn>1</mn></msub><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">a_0=\begin{pmatrix}\sgm\\0\end{pmatrix},\quad
a_1=\begin{pmatrix}-\sgm\\0\end{pmatrix},\quad
w_0=w_1=\fr12,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>σ</mi></mrow><annotation encoding="application/x-tex">\sgm</annotation></semantics></math></span></span> would be the standard deviation of the resulting Gaussian blur filter:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-glsl">
        <pre>
          <code>
            <span class="line line-1"><span class="k">varying</span> <span class="kt">vec2</span> <span class="n">vTextureCoord</span><span class="p">;</span>
</span>
            <span class="line line-2">
</span>
            <span class="line line-3"><span class="k">uniform</span> <span class="kt">sampler2D</span> <span class="n">uTexture</span><span class="p">;</span>
</span>
            <span class="line line-4"><span class="k">uniform</span> <span class="kt">float</span> <span class="n">uStrength</span><span class="p">;</span> <span class="c1">// sigma / sqrt(N)</span>
</span>
            <span class="line line-5">
</span>
            <span class="line line-6"><span class="kt">void</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span>
</span>
            <span class="line line-7">	<span class="nb">gl_FragColor</span>  <span class="o">=</span> <span class="n">texture2D</span><span class="p">(</span><span class="n">uTexture</span><span class="p">,</span> <span class="n">vTextureCoord</span> <span class="o">+</span> <span class="kt">vec2</span><span class="p">(</span> <span class="n">uStrength</span><span class="p">,</span> <span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">))</span> <span class="o">*</span> <span class="mi">0</span><span class="p">.</span><span class="mi">5</span><span class="p">;</span>
</span>
            <span class="line line-8">	<span class="nb">gl_FragColor</span> <span class="o">+=</span> <span class="n">texture2D</span><span class="p">(</span><span class="n">uTexture</span><span class="p">,</span> <span class="n">vTextureCoord</span> <span class="o">+</span> <span class="kt">vec2</span><span class="p">(</span><span class="o">-</span><span class="n">uStrength</span><span class="p">,</span> <span class="mi">0</span><span class="p">.</span><span class="mi">0</span><span class="p">))</span> <span class="o">*</span> <span class="mi">0</span><span class="p">.</span><span class="mi">5</span><span class="p">;</span>
</span>
            <span class="line line-9"><span class="p">}</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
When using the shader, the texture is input as the uniform <code>uTexture</code>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>σ</mi><mi mathvariant="normal">/</mi><msqrt><mi>N</mi></msqrt></mrow><annotation encoding="application/x-tex">\sgm/\sqrt N</annotation></semantics></math></span></span> is input as the uniform <code>uStrength</code>. This example is then called the 2-tap horizontal Gaussian blur filter (because to find <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fx</annotation></semantics></math></span></span> for some <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> one needs to evaluate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi></mrow><annotation encoding="application/x-tex">f</annotation></semantics></math></span></span> twice).
</p>
<p>To get a good Gaussian blur effect, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> should be large enough, which can quickly become computationally expensive. We can reduce the number of passes by rewriting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>P</mi><mi>N</mi><mi>N</mi></msubsup><mo>=</mo><msup><mrow><mo fence="true">(</mo><msubsup><mi>P</mi><mi>N</mi><mi>n</mi></msubsup><mo fence="true">)</mo></mrow><mrow><mi>N</mi><mi mathvariant="normal">/</mi><mi>n</mi></mrow></msup></mrow><annotation encoding="application/x-tex">P_N^N=\p{P_N^n}^{N/n}</annotation></semantics></math></span></span> so that the number of passes is now reduced from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mi mathvariant="normal">/</mi><mi>n</mi></mrow><annotation encoding="application/x-tex">N/n</annotation></semantics></math></span></span> without changing the result, but the cost is to implement <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>P</mi><mi>N</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">P_N^n</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">P_N</annotation></semantics></math></span></span> in the shader. With the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>P</mi><mi>N</mi></msub></mrow><annotation encoding="application/x-tex">P_N</annotation></semantics></math></span></span> example above, the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>P</mi><mi>N</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">P_N^n</annotation></semantics></math></span></span> filter is then a
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{n+1}</annotation></semantics></math></span></span>-tap horizontal Gaussian blur filter. The total number of times to fetch the texture is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>N</mi><mi mathvariant="normal">/</mi><mi>n</mi></mrow><annotation encoding="application/x-tex">\p{n+1}N/n</annotation></semantics></math></span></span> to render the whole blurred texture, which decreases as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> increases.</p>
<p>By utilizing the linear sampling feature of the GPU, this number can be further reduced (by half) if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>σ</mi><mi mathvariant="normal">/</mi><msqrt><mi>N</mi></msqrt><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\sgm/\sqrt N=1</annotation></semantics></math></span></span>. One can read further about this in <a href="https://www.rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/" target="_blank" rel="external">this article</a>.</p>
<hr/>
<p>Let us now move on to an interesting relation to the heat equation. The heat equation is a partial differential equation that reads <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">∂</mi><mi>t</mi></msub><msub><mi>f</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><munder><mo>∑</mo><mi>j</mi></munder><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi>f</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\partial_t\fc{f_t}x=\sum_j\partial_j\partial_j\fc{f_t}x.</annotation></semantics></math></span></span></span> The physical meaning of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{f_t}x</annotation></semantics></math></span></span> is the temperature at position <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> at time <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span>, and the solution to this equation gives the time evolution of the temperature distribution in a medium with unit thermal diffusivity. More generally, we can have some other thermal diffusivities, which may even be anisotropic, in which case the equation reads
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">∂</mi><mi>t</mi></msub><msub><mi>f</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><munder><mo>∑</mo><mrow><mi>j</mi><mi>k</mi></mrow></munder><msub><mi>A</mi><mrow><mi>j</mi><mi>k</mi></mrow></msub><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>k</mi></msub><msub><mi>f</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\partial_t\fc{f_t}x=\fr12\sum_{jk}A_{jk}\partial_j\partial_k\fc{f_t}x,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span> is a symmetric positive definite matrix. Such an equation can always be reduced to the form with unit thermal diffusivity by a linear transformation of the coordinates <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo>↦</mo><mi>L</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">x\mapsto Lx</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi></mrow><annotation encoding="application/x-tex">L</annotation></semantics></math></span></span> satisfies
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo>=</mo><msup><mi>L</mi><mi mathvariant="normal">T</mi></msup><mi>L</mi></mrow><annotation encoding="application/x-tex">A/2=L^\mrm TL</annotation></semantics></math></span></span> (the Cholesky decomposition of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">A/2</annotation></semantics></math></span></span>). By using operator exponentiation, we can write the solution to the heat equation as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi>G</mi><mi>t</mi></msup><msub><mi>f</mi><mn>0</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{f_t}x=G^t\fc{f_0}x</annotation></semantics></math></span></span>, where <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>G</mi><mi>t</mi></msup><mo><mi mathvariant="normal">≔</mi></mo><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mi>t</mi><mn>2</mn></mfrac><munder><mo>∑</mo><mrow><mi>j</mi><mi>k</mi></mrow></munder><msub><mi>A</mi><mrow><mi>j</mi><mi>k</mi></mrow></msub><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>k</mi></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">G^t\ceq\fc\exp{\fr t2\sum_{jk}A_{jk}\partial_j\partial_k}</annotation></semantics></math></span></span></span> is called the time evolution operator (which is not generally defined for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">t&lt;0</annotation></semantics></math></span></span>, which means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msup><mi>G</mi><mi>t</mi></msup><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\B{G^t}</annotation></semantics></math></span></span> cannot form a group but only a monoid).</p>
<p>The reason that I denote it as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>G</mi><mi>t</mi></msup></mrow><annotation encoding="application/x-tex">G^t</annotation></semantics></math></span></span> is that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>G</mi><mn>1</mn></msup></mrow><annotation encoding="application/x-tex">G^1</annotation></semantics></math></span></span> gives exactly the Gaussian blur filter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> (when acting on real analytic functions). This is not immediately obvious, and I will justify its correctness by starting from the multi-pass expression of the Gaussian blur filter. For analytic functions, we can get the translation operator by exponentiating the derivative operator, so <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mfrac><msub><mi>a</mi><mi>i</mi></msub><msqrt><mi>N</mi></msqrt></mfrac><mo fence="true">)</mo></mrow><mo>=</mo><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><munder><mo>∑</mo><mi>j</mi></munder><mfrac><msub><mi>a</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msqrt><mi>N</mi></msqrt></mfrac><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc f{x+\fr{a_i}{\sqrt N}}=\fc\exp{\sum_j\fr{a_{ij}}{\sqrt N}\partial_j}\fc fx.</annotation></semantics></math></span></span></span> Therefore, we can write <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msub><mi>P</mi><mi>N</mi></msub></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><munder><mo>∑</mo><mi>j</mi></munder><mfrac><msub><mi>a</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msqrt><mi>N</mi></msqrt></mfrac><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munder><munder><mrow><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub></mrow><mo stretchy="true">⏟</mo></munder><mn>1</mn></munder><mo>+</mo><mfrac><mn>1</mn><msqrt><mi>N</mi></msqrt></mfrac><munder><mo>∑</mo><mi>j</mi></munder><munder><munder><mrow><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><msub><mi>a</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub></mrow><mo stretchy="true">⏟</mo></munder><mn>0</mn></munder><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><mo>+</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>N</mi></mrow></mfrac><munder><mo>∑</mo><mrow><mi>j</mi><mi>k</mi></mrow></munder><munder><munder><mrow><munder><mo>∑</mo><mi>i</mi></munder><msub><mi>w</mi><mi>i</mi></msub><msub><mi>a</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>a</mi><mrow><mi>i</mi><mi>k</mi></mrow></msub></mrow><mo stretchy="true">⏟</mo></munder><msub><mi>A</mi><mrow><mi>j</mi><mi>k</mi></mrow></msub></munder><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>k</mi></msub><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>N</mi><mrow><mo>−</mo><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
P_N&amp;=\sum_iw_i\fc\exp{\sum_j\fr{a_{ij}}{\sqrt N}\partial_j}\\
&amp;=\underbrace{\sum_iw_i}_1
+\fr1{\sqrt N}\sum_j\underbrace{\sum_iw_ia_{ij}}_0\partial_j
+\fr1{2N}\sum_{jk}\underbrace{\sum_iw_ia_{ij}a_{ik}}_{A_{jk}}\partial_j\partial_k
+\order{N^{-3/2}}.
\end{align*}</annotation></semantics></math></span></span></span> Now, in the limit of infinite <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>G</mi><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>N</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow></munder><msubsup><mi>P</mi><mi>N</mi><mi>N</mi></msubsup><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>N</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow></munder><msup><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>N</mi></mrow></mfrac><munder><mo>∑</mo><mrow><mi>j</mi><mi>k</mi></mrow></munder><msub><mi>A</mi><mrow><mi>j</mi><mi>k</mi></mrow></msub><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>k</mi></msub><mo fence="true">)</mo></mrow><mi>N</mi></msup><mo>=</mo><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><munder><mo>∑</mo><mrow><mi>j</mi><mi>k</mi></mrow></munder><msub><mi>A</mi><mrow><mi>j</mi><mi>k</mi></mrow></msub><msub><mi mathvariant="normal">∂</mi><mi>j</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>k</mi></msub><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi>G</mi><mn>1</mn></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">G=\lim_{N\to\infty}P_N^N
=\lim_{N\to\infty}\p{1+\fr1{2N}\sum_{jk}A_{jk}\partial_j\partial_k}^N
=\fc\exp{\fr12\sum_{jk}A_{jk}\partial_j\partial_k}=G^1.</annotation></semantics></math></span></span></span> This means that applying the Gaussian blur filter is equivalent to evolving one unit of time according to the heat equation. Therefore, the equation in the beginning of this article, the definition of the Gaussian blur filter, can then be used to express the unit time evolution under the heat equation in the form of a integral transformation. To get the general <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>G</mi><mi>t</mi></msup></mrow><annotation encoding="application/x-tex">G^t</annotation></semantics></math></span></span>, we can just replace <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span> with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi><mi>A</mi></mrow><annotation encoding="application/x-tex">tA</annotation></semantics></math></span></span>.</p>
<p>As a byproduct, we can then show that the heat kernel is a Gaussian kernel. The heat kernel <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>K</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{K_t}{x,x'}</annotation></semantics></math></span></span> is defined as the solution to the heat equation with initial condition <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>K</mi><mn>0</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>=</mo><mi>δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{K_0}{x,x'}=\fc\dlt{x-x'}</annotation></semantics></math></span></span>. Directly applying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>G</mi><mi>t</mi></msup></mrow><annotation encoding="application/x-tex">G^t</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\dlt{x-x'}</annotation></semantics></math></span></span> gives
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi>K</mi><mi>t</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msup><mi>G</mi><mi>t</mi></msup><mi>δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>∫</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mi>d</mi></msup><mi>y</mi></mrow><msqrt><mrow><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>π</mi><mi>t</mi><mo fence="true">)</mo></mrow><mi>d</mi></msup><mi>det</mi><mo>⁡</mo><mi>A</mi></mrow></msqrt></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>t</mi></mrow></mfrac><msub><mrow><mo fence="true">(</mo><msup><mi>A</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo fence="true">)</mo></mrow><mrow><mi>j</mi><mi>k</mi></mrow></msub><msub><mi>y</mi><mi>j</mi></msub><msub><mi>y</mi><mi>k</mi></msub><mo fence="true">)</mo></mrow><mi>δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><mi>y</mi><mo>−</mo><msup><mi>x</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><msqrt><mrow><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>π</mi><mi>t</mi><mo fence="true">)</mo></mrow><mi>d</mi></msup><mi>det</mi><mo>⁡</mo><mi>A</mi></mrow></msqrt></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>t</mi></mrow></mfrac><msub><mrow><mo fence="true">(</mo><msup><mi>A</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo fence="true">)</mo></mrow><mrow><mi>j</mi><mi>k</mi></mrow></msub><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>j</mi></msub><mo>−</mo><msubsup><mi>x</mi><mi>j</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><msub><mi>x</mi><mi>k</mi></msub><mo>−</mo><msubsup><mi>x</mi><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{K_t}{x,x'}&amp;=G^t\fc\dlt{x-x'}\\
&amp;=\int\fr{\d^dy}{\sqrt{\p{2\pi t}^d\det A}}\fc\exp{-\fr1{2t}\p{A^{-1}}_{jk}y_jy_k}\fc\dlt{x+y-x'}\\
&amp;=\fr{1}{\sqrt{\p{2\pi t}^d\det A}}\fc\exp{-\fr1{2t}\p{A^{-1}}_{jk}\p{x_j-x'_j}\p{x_k-x'_k}},
\end{align*}</annotation></semantics></math></span></span></span> which is the form that you would find in textbooks.</p>
<hr/>
<p>The reason that I decided to study the Gaussian blur filter is that I spotted a flaw in the implementation of the blur filter in <a href="https://pixijs.com" target="_blank" rel="external">PixiJS</a>, where the uniform <code>uStrength</code> in the example shader above is scaled by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>N</mi></mrow><annotation encoding="application/x-tex">1/N</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msqrt><mi>N</mi></msqrt></mrow><annotation encoding="application/x-tex">1/\sqrt N</annotation></semantics></math></span></span>. I was very happy to find the bug because this is the first time that I found a bug without actually producing an unexpected phenomenon first but by just staring at the source codes and deducing the mathematical formulas by hand. I opened an <a href="https://github.com/pixijs/pixijs/issues/11554" target="_blank" rel="external">issue</a> for my findings.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="programming" /><category term="algorithm" /><category term="shader" /><category term="probability" /><category term="pde" /><summary type="html"><![CDATA[According to the central limit theorem, the sum of some i.i.d. samples is normally distributed in the limit of large sample size. This fact can be used to implement a multi-pass Gaussian blur filter, where the total number of passes is equal to the number of samples used in the averaging. Through this, we can also see a nice relation to the heat equation, which is not surprising since the heat kernel is a Gaussian function.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-07-17-blur-filter.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-07-17-blur-filter.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[The buildup kickroll in <cite>Time to beat the odds</cite>]]></title><link href="https://ulysseszh.github.io/music/2025/06/22/beat-the-odds-kickroll.html" rel="alternate" type="text/html" title="The buildup kickroll in Time to beat the odds" /><published>2025-06-22T00:31:43-07:00</published><updated>2025-06-22T00:31:43-07:00</updated><id>https://ulysseszh.github.io/music/2025/06/22/beat-the-odds-kickroll</id><content type="html" xml:base="https://ulysseszh.github.io/music/2025/06/22/beat-the-odds-kickroll.html"><![CDATA[<details>
<summary>
Python preamble
</summary>
<p>Packages to install from PyPI: <code>numpy</code>, <code>scipy</code>, <code>matplotlib</code>, <code>soundfile</code>.</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-python"><pre><code><span class="line line-1"><span class="kn">import</span> <span class="n">numpy</span> <span class="k">as</span> <span class="n">np</span>
</span><span class="line line-2"><span class="kn">from</span> <span class="n">scipy.signal</span> <span class="kn">import</span> <span class="n">ShortTimeFFT</span><span class="p">,</span> <span class="n">find_peaks</span>
</span><span class="line line-3"><span class="kn">from</span> <span class="n">scipy.signal.windows</span> <span class="kn">import</span> <span class="n">hann</span>
</span><span class="line line-4"><span class="kn">from</span> <span class="n">scipy.optimize</span> <span class="kn">import</span> <span class="n">fsolve</span>
</span><span class="line line-5"><span class="kn">from</span> <span class="n">scipy.stats</span> <span class="kn">import</span> <span class="n">linregress</span>
</span><span class="line line-6"><span class="kn">import</span> <span class="n">matplotlib.pyplot</span> <span class="k">as</span> <span class="n">plt</span>
</span><span class="line line-7"><span class="kn">from</span> <span class="n">matplotlib.colors</span> <span class="kn">import</span> <span class="n">LogNorm</span>
</span><span class="line line-8"><span class="kn">import</span> <span class="n">soundfile</span>
</span></code></pre></td></tr></tbody></table>
</details>
<p>There is a nice song by 影虎。called <cite>Time to beat the odds</cite>:</p>
<div class="embed-container">
<iframe src="https://www.youtube.com/embed/C-XxL_LUB18" frameborder="0" allowfullscreen="">
</iframe>
</div>
<p>At 1:18, there is an interesting buildup kickroll. This effect is created by mixing a steady 32nd note kickroll with a gradually-accelerating buildup kickroll. The gradually-accelerating part is not quantized to dyadic note values, so it is pretty hard to analyze by ear.</p>
<p>One can obtain a clearer sample of this kickroll by consulting the file <code>Dr_KICKroll00.ogg</code> from the <a href="https://bmssearch.net/bmses/Lay7qGChaJUgrs" target="_blank" rel="external">BMS</a>. The waveform of the sample looks like this:</p>
<details>
<summary>
Python code
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-python"><pre><code><span class="line line-1"><span class="n">samples</span><span class="p">,</span> <span class="n">fs</span> <span class="o">=</span> <span class="n">soundfile</span><span class="p">.</span><span class="nf">read</span><span class="p">(</span><span class="sh">"</span><span class="s">Kagetora_Time-to-beat-the-odds_bofet/Dr_KICKroll00.ogg</span><span class="sh">"</span><span class="p">)</span>
</span><span class="line line-2"><span class="n">fs</span> <span class="o">/=</span> <span class="mi">1000</span> <span class="c1"># Use ms and kHz</span>
</span><span class="line line-3"><span class="k">if</span> <span class="n">samples</span><span class="p">.</span><span class="n">ndim</span> <span class="o">==</span> <span class="mi">2</span><span class="p">:</span>
</span><span class="line line-4">	<span class="n">samples</span> <span class="o">=</span> <span class="n">samples</span><span class="p">.</span><span class="nf">mean</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
</span><span class="line line-5"><span class="n">N</span> <span class="o">=</span> <span class="nf">len</span><span class="p">(</span><span class="n">samples</span><span class="p">)</span>
</span><span class="line line-6">
</span><span class="line line-7"><span class="n">plt</span><span class="p">.</span><span class="nf">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">6</span><span class="p">))</span>
</span><span class="line line-8"><span class="n">plt</span><span class="p">.</span><span class="nf">plot</span><span class="p">(</span><span class="n">np</span><span class="p">.</span><span class="nf">arange</span><span class="p">(</span><span class="n">N</span><span class="p">)</span> <span class="o">/</span> <span class="n">fs</span><span class="p">,</span> <span class="n">samples</span><span class="p">,</span> <span class="n">linewidth</span><span class="o">=</span><span class="mf">0.5</span><span class="p">)</span>
</span><span class="line line-9"><span class="n">plt</span><span class="p">.</span><span class="nf">xlabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Time (ms)</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-10"><span class="n">plt</span><span class="p">.</span><span class="nf">ylabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Amplitude</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-11"><span class="n">plt</span><span class="p">.</span><span class="nf">xlim</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">N</span><span class="o">/</span><span class="n">fs</span><span class="p">)</span>
</span><span class="line line-12"><span class="n">plt</span><span class="p">.</span><span class="nf">ylim</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
</span></code></pre></td></tr></tbody></table>
</details>
<figure>
<img src="/assets/images/figures/2025-06-22-beat-the-odds-kickroll/samples.svg" class="dark-adaptive" alt="Waveform plot."/>

</figure>
<p>There is clearly a repeating pattern that is occurring at an gradually-increasing frequency. Each occurrence of the pattern is a kick. The task is to find the regularity of the kicks.</p>
<p>We can see that, at the start of each kick, the waveform is oscillating more rapidly than in later times of the kick. Therefore, a natural idea is to capture this high-frequency oscillation feature using the short-time Fourier transform (STFT), and we would expect to see some peaks at the high-frequency region of the spectrogram of the waveform at each kick occurrence. SciPy provides a convenient function for STFT, and then we can plot the spectrogram of the waveform:</p>
<details>
<summary>
Python code
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-python"><pre><code><span class="line line-1"><span class="n">hop</span> <span class="o">=</span> <span class="mi">32</span>
</span><span class="line line-2"><span class="n">SFT</span> <span class="o">=</span> <span class="nc">ShortTimeFFT</span><span class="p">(</span><span class="nf">hann</span><span class="p">(</span><span class="n">hop</span><span class="p">),</span> <span class="n">hop</span><span class="p">,</span> <span class="n">fs</span><span class="p">)</span>
</span><span class="line line-3"><span class="n">spectrogram</span> <span class="o">=</span> <span class="n">SFT</span><span class="p">.</span><span class="nf">spectrogram</span><span class="p">(</span><span class="n">samples</span><span class="p">)</span>
</span><span class="line line-4">
</span><span class="line line-5"><span class="n">plt</span><span class="p">.</span><span class="nf">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">6</span><span class="p">))</span>
</span><span class="line line-6"><span class="n">im</span> <span class="o">=</span> <span class="n">plt</span><span class="p">.</span><span class="nf">imshow</span><span class="p">(</span>
</span><span class="line line-7">	<span class="n">spectrogram</span><span class="p">,</span>
</span><span class="line line-8">	<span class="n">aspect</span><span class="o">=</span><span class="sh">'</span><span class="s">auto</span><span class="sh">'</span><span class="p">,</span>
</span><span class="line line-9">	<span class="n">origin</span><span class="o">=</span><span class="sh">'</span><span class="s">lower</span><span class="sh">'</span><span class="p">,</span>
</span><span class="line line-10">	<span class="n">extent</span><span class="o">=</span><span class="n">SFT</span><span class="p">.</span><span class="nf">extent</span><span class="p">(</span><span class="n">N</span><span class="p">),</span>
</span><span class="line line-11">	<span class="n">norm</span><span class="o">=</span><span class="nc">LogNorm</span><span class="p">(</span><span class="n">vmin</span><span class="o">=</span><span class="mf">0.001</span><span class="p">,</span> <span class="n">vmax</span><span class="o">=</span><span class="n">np</span><span class="p">.</span><span class="nf">max</span><span class="p">(</span><span class="n">spectrogram</span><span class="p">)),</span>
</span><span class="line line-12"><span class="p">)</span>
</span><span class="line line-13"><span class="n">plt</span><span class="p">.</span><span class="nf">xlabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Time (ms)</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-14"><span class="n">plt</span><span class="p">.</span><span class="nf">ylabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Frequency (kHz)</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-15"><span class="n">plt</span><span class="p">.</span><span class="nf">colorbar</span><span class="p">(</span><span class="n">im</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="sh">'</span><span class="s">Magnitude</span><span class="sh">'</span><span class="p">)</span>
</span></code></pre></td></tr></tbody></table>
</details>
<figure>
<img src="/assets/images/figures/2025-06-22-beat-the-odds-kickroll/spectrogram.svg" class="dark-adaptive" alt="Spectrogram of the kick roll sample."/>

</figure>
<p>We can see that there are clearly some peaks at the high-frequency region of the spectrogram. Pick out the peaks:</p>
<details>
<summary>
Python code
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-python"><pre><code><span class="line line-1"><span class="n">plt</span><span class="p">.</span><span class="nf">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">6</span><span class="p">))</span>
</span><span class="line line-2"><span class="n">data</span> <span class="o">=</span> <span class="n">spectrogram</span><span class="p">[</span><span class="mi">14</span><span class="p">:,</span> <span class="p">:].</span><span class="nf">mean</span><span class="p">(</span><span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span>
</span><span class="line line-3"><span class="n">peaks</span><span class="p">,</span> <span class="n">peak_properties</span> <span class="o">=</span> <span class="nf">find_peaks</span><span class="p">(</span><span class="n">data</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mf">0.004</span><span class="p">,</span> <span class="n">distance</span><span class="o">=</span><span class="mi">7</span><span class="p">)</span>
</span><span class="line line-4"><span class="n">peaks</span> <span class="o">=</span> <span class="n">peaks</span> <span class="o">*</span> <span class="n">hop</span> <span class="o">/</span> <span class="n">fs</span>
</span><span class="line line-5"><span class="n">plt</span><span class="p">.</span><span class="nf">xlabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Time (ms)</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-6"><span class="n">plt</span><span class="p">.</span><span class="nf">ylabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Average magnitude for high frequencies</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-7"><span class="n">plt</span><span class="p">.</span><span class="nf">plot</span><span class="p">(</span><span class="n">SFT</span><span class="p">.</span><span class="nf">t</span><span class="p">(</span><span class="n">N</span><span class="p">),</span> <span class="n">data</span><span class="p">)</span>
</span><span class="line line-8"><span class="n">plt</span><span class="p">.</span><span class="nf">plot</span><span class="p">(</span><span class="n">peaks</span><span class="p">,</span> <span class="n">peak_properties</span><span class="p">[</span><span class="sh">'</span><span class="s">peak_heights</span><span class="sh">'</span><span class="p">],</span> <span class="sh">"</span><span class="s">o</span><span class="sh">"</span><span class="p">)</span>
</span></code></pre></td></tr></tbody></table>
</details>
<figure>
<img src="/assets/images/figures/2025-06-22-beat-the-odds-kickroll/peaks.svg" class="dark-adaptive" alt="Each peak is approximately at the start of a kick."/>

</figure>
<p>To check that those peaks make sense, we can mark the positions of the peaks on the waveform to see if they are indeed approximately at the start of each kick:</p>
<details>
<summary>
Python code
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-python"><pre><code><span class="line line-1"><span class="n">plt</span><span class="p">.</span><span class="nf">figure</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">6</span><span class="p">))</span>
</span><span class="line line-2"><span class="n">plt</span><span class="p">.</span><span class="nf">plot</span><span class="p">(</span><span class="n">np</span><span class="p">.</span><span class="nf">arange</span><span class="p">(</span><span class="n">N</span><span class="p">)</span> <span class="o">/</span> <span class="n">fs</span><span class="p">,</span> <span class="n">samples</span><span class="p">)</span>
</span><span class="line line-3"><span class="k">for</span> <span class="n">peak</span> <span class="ow">in</span> <span class="n">peaks</span><span class="p">:</span>
</span><span class="line line-4">	<span class="n">plt</span><span class="p">.</span><span class="nf">axvline</span><span class="p">(</span><span class="n">peak</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="sh">'</span><span class="s">red</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-5"><span class="n">plt</span><span class="p">.</span><span class="nf">xlabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Time (ms)</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-6"><span class="n">plt</span><span class="p">.</span><span class="nf">ylabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Amplitude</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-7"><span class="n">plt</span><span class="p">.</span><span class="nf">xlim</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">200</span><span class="p">)</span>
</span><span class="line line-8"><span class="n">plt</span><span class="p">.</span><span class="nf">ylim</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
</span></code></pre></td></tr></tbody></table>
</details>
<figure>
<img src="/assets/images/figures/2025-06-22-beat-the-odds-kickroll/peaks_on_samples.svg" class="dark-adaptive" alt="Waveform with high-frequency spectrogram peaks marked."/>

</figure>
<p>We can see that although they are not perfectly at the start of each kick, the peaks are indeed approximately at the start of each kick. Now, plot the time intervals between each pair of consecutive peaks. If the plot is in log-scale, one can see that they approximately form a straight line, which means that the time intervals decay geometrically. We can use a simple linear regression to fit the data.</p>
<details>
<summary>
Python code
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-python"><pre><code><span class="line line-1"><span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="p">.</span><span class="nf">subplots</span><span class="p">(</span><span class="n">figsize</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span> <span class="mi">6</span><span class="p">))</span>
</span><span class="line line-2"><span class="n">ax</span><span class="p">.</span><span class="nf">set_yscale</span><span class="p">(</span><span class="sh">'</span><span class="s">log</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-3"><span class="n">intervals</span> <span class="o">=</span> <span class="n">np</span><span class="p">.</span><span class="nf">diff</span><span class="p">(</span><span class="n">peaks</span><span class="p">)</span>
</span><span class="line line-4"><span class="n">indices</span> <span class="o">=</span> <span class="n">np</span><span class="p">.</span><span class="nf">arange</span><span class="p">(</span><span class="nf">len</span><span class="p">(</span><span class="n">intervals</span><span class="p">))</span>
</span><span class="line line-5"><span class="n">lin_res</span> <span class="o">=</span> <span class="nf">linregress</span><span class="p">(</span><span class="n">indices</span><span class="p">,</span> <span class="n">np</span><span class="p">.</span><span class="nf">log</span><span class="p">(</span><span class="n">intervals</span><span class="p">))</span>
</span><span class="line line-6"><span class="n">ax</span><span class="p">.</span><span class="nf">plot</span><span class="p">(</span><span class="n">indices</span><span class="p">,</span> <span class="n">intervals</span><span class="p">,</span> <span class="sh">'</span><span class="s">o</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-7"><span class="n">ax</span><span class="p">.</span><span class="nf">plot</span><span class="p">(</span><span class="n">indices</span><span class="p">,</span> <span class="n">np</span><span class="p">.</span><span class="nf">exp</span><span class="p">(</span><span class="n">lin_res</span><span class="p">.</span><span class="n">intercept</span> <span class="o">+</span> <span class="n">lin_res</span><span class="p">.</span><span class="n">slope</span> <span class="o">*</span> <span class="n">indices</span><span class="p">))</span>
</span><span class="line line-8"><span class="n">ax</span><span class="p">.</span><span class="nf">set_xlabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Kick</span><span class="sh">'</span><span class="p">)</span>
</span><span class="line line-9"><span class="n">ax</span><span class="p">.</span><span class="nf">set_ylabel</span><span class="p">(</span><span class="sh">'</span><span class="s">Interval (ms)</span><span class="sh">'</span><span class="p">)</span>
</span></code></pre></td></tr></tbody></table>
</details>
<figure>
<img src="/assets/images/figures/2025-06-22-beat-the-odds-kickroll/intervals.svg" class="dark-adaptive" alt="Intervals between consecutive peaks."/>

</figure>
<p>With the linear regression, we can conclude that the decay ratio is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0.9762</mn></mrow><annotation encoding="application/x-tex">0.9762</annotation></semantics></math></span></span>.</p>
<p>If we had guessed that the time intervals decay geometrically and that the first kick has the length of a 32nd note, we could calculate the decay ratio <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span> by solving the equation <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mn>8</mn></mfrac><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><msup><mi>a</mi><mn>59</mn></msup><mo fence="true">)</mo></mrow><mo>=</mo><mn>4</mn><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>a</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr18\p{1-a^{59}}=4\p{1-a},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>8</mn></mrow><annotation encoding="application/x-tex">1/8</annotation></semantics></math></span></span> is the note value of a 32nd note, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn></mrow><annotation encoding="application/x-tex">4</annotation></semantics></math></span></span> is the total note value of this kickroll (a measure with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn></mrow><annotation encoding="application/x-tex">4</annotation></semantics></math></span></span> quarter notes), and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>59</mn></mrow><annotation encoding="application/x-tex">59</annotation></semantics></math></span></span> is the total number of kicks (obtained by counting the patterns in the waveform). Solving this equation numerically gives us <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>0.9764</mn></mrow><annotation encoding="application/x-tex">a=0.9764</annotation></semantics></math></span></span>, which is pretty close to the value we got before.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="music" /><category term="fourier transform" /><category term="python" /><summary type="html"><![CDATA[There is a gradually-accelerating buildup kickroll at 1:18 in the song <cite>Time to beat the odds</cite> by 影虎。. In order to know the details of this rhythm, I have to analyze the sample using Python. The main method is to do a short-time Fourier transform and to find the peaks in the high-frequency region of the spectrogram. A linear regression shows that the time intervals decay geometrically.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-06-22-beat-the-odds-kickroll.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-06-22-beat-the-odds-kickroll.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Eigenfunctions of the Laplacian on an annulus with homogeneous Neumann boundary condition]]></title><link href="https://ulysseszh.github.io/math/2025/04/11/laplacian-annulus.html" rel="alternate" type="text/html" title="Eigenfunctions of the Laplacian on an annulus with homogeneous Neumann boundary condition" /><published>2025-04-11T00:40:49-07:00</published><updated>2025-04-11T00:40:49-07:00</updated><id>https://ulysseszh.github.io/math/2025/04/11/laplacian-annulus</id><content type="html" xml:base="https://ulysseszh.github.io/math/2025/04/11/laplacian-annulus.html"><![CDATA[<h2 data-label="0.1" id="the-problem-and-the-solution">The problem and the solution</h2>
<p>Suppose there is an annulus defined by the region <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><mrow><mo fence="true">(</mo><mi>ρ</mi><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><msub><mi>R</mi><mrow><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi></mrow></msub><mo>&lt;</mo><mi>ρ</mi><mo>&lt;</mo><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\set{\p{\rho,\vphi}}{R_\mrm{in}&lt;\rho&lt;R_\mrm{out}}</annotation></semantics></math></span></span>. What are the functions <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Φ</mi></mrow><annotation encoding="application/x-tex">\Phi</annotation></semantics></math></span></span> defined on this region that satisfy
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>λ</mi><mi mathvariant="normal">Φ</mi><mo>=</mo><msup><mi mathvariant="normal">∇</mi><mn>2</mn></msup><mi mathvariant="normal">Φ</mi><mo>=</mo><mfrac><mn>1</mn><mi>ρ</mi></mfrac><msub><mi mathvariant="normal">∂</mi><mi>ρ</mi></msub><mrow><mo fence="true">(</mo><mi>ρ</mi><msub><mi mathvariant="normal">∂</mi><mi>ρ</mi></msub><mi mathvariant="normal">Φ</mi><mo fence="true">)</mo></mrow><mo>+</mo><mfrac><mn>1</mn><msup><mi>ρ</mi><mn>2</mn></msup></mfrac><msubsup><mi mathvariant="normal">∂</mi><mi>φ</mi><mn>2</mn></msubsup><mi mathvariant="normal">Φ</mi></mrow><annotation encoding="application/x-tex">\lmd\Phi=\nabla^2\Phi=\fr1\rho\partial_\rho\p{\rho\partial_\rho\Phi}+\fr1{\rho^2}\partial_\vphi^2\Phi</annotation></semantics></math></span></span></span> and the boundary conditions
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">∂</mi><mi>ρ</mi></msub><mi mathvariant="normal">Φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo>=</mo><msub><mi>R</mi><mrow><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi></mrow></msub><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi mathvariant="normal">∂</mi><mi>ρ</mi></msub><mi mathvariant="normal">Φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo>=</mo><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\partial_\rho\fc\Phi{\rho=R_\mrm{in},\vphi}=\partial_\rho\fc\Phi{\rho=R_\mrm{out},\vphi}=0,</annotation></semantics></math></span></span></span> i.e., eigenfunctions of the Laplacian on the annulus with homogeneous Neumann boundary conditions?</p>
<p>For any boundary condition with azimuthal symmetry, an easy separation of variable gives you solutions of the general form <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>J</mi><mo fence="true">)</mo></mrow></msup><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mi>ρ</mi><mi mathvariant="normal">/</mi><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo fence="true">)</mo></mrow><mo>+</mo><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>Y</mi><mo fence="true">)</mo></mrow></msup><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mi>ρ</mi><mi mathvariant="normal">/</mi><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>m</mi><mi>φ</mi></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc\Phi{\rho,\vphi}=\p{\Xi^{\p J}\fc{J_m}{z\rho/R_\mrm{out}}+\Xi^{\p Y}\fc{Y_m}{z\rho/R_\mrm{out}}}\e^{\i m\vphi},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>J</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\Xi^{\p J}</annotation></semantics></math></span></span>,
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>Y</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\Xi^{\p Y}</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> are constants fixed by the boundary conditions, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> is an integer and the azimuthal quantum number. The functions <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>J</mi><mi>m</mi></msub></mrow><annotation encoding="application/x-tex">J_m</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>Y</mi><mi>m</mi></msub></mrow><annotation encoding="application/x-tex">Y_m</annotation></semantics></math></span></span> are Bessel functions of the first and second kind, respectively, which are two linearly independent solutions of the Bessel equation <span id="eq:bessel-equation" data-label="(1)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>z</mi><mn>2</mn></msup><msup><mi>y</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><mi>z</mi><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><mrow><mo fence="true">(</mo><msup><mi>z</mi><mn>2</mn></msup><mo>−</mo><msup><mi>m</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi>y</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">z^2\fc{y''}z+z\fc{y'}z+\p{z^2-m^2}\fc{y}z=0</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1)</annotation></semantics></math></span></span></span></span> </span></span> with some particular normalization. Plugging the general form into the boundary condition, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>J</mi><mo fence="true">)</mo></mrow></msup><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>Y</mi><mo fence="true">)</mo></mrow></msup><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mspace width="1em"/><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>J</mi><mo fence="true">)</mo></mrow></msup><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>Y</mi><mo fence="true">)</mo></mrow></msup><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\Xi^{\p J}\fc{J_m'}{z}+\Xi^{\p Y}\fc{Y_m'}{z}=0,\quad
\Xi^{\p J}\fc{J_m'}{rz}+\Xi^{\p Y}\fc{Y_m'}{rz}=0,</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>R</mi><mrow><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi></mrow></msub><mi mathvariant="normal">/</mi><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub></mrow><annotation encoding="application/x-tex">r\ceq R_\mrm{in}/R_\mrm{out}</annotation></semantics></math></span></span>. This is regarded as a homogeneous linear system of equations for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>J</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\Xi^{\p J}</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ξ</mi><mrow><mo fence="true">(</mo><mi>Y</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\Xi^{\p Y}</annotation></semantics></math></span></span>. In order for it to have nontrivial solutions, the determinant of the coefficient matrix must vanish, which gives <span id="eq:g" data-label="(2)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\fc gz\ceq\fc{J_m'}{rz}\fc{Y_m'}z-\fc{Y_m'}{rz}\fc{J_m'}z=0.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>2</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(2)</annotation></semantics></math></span></span></span></span> </span></span> We can then assign a radial quantum number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> to the eigenfunctions by making the value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>th root of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span>, which we may casually call
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub></mrow><annotation encoding="application/x-tex">z_{mn}</annotation></semantics></math></span></span>.</p>
<p>We then have the final solution (up to normalization) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">Φ</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mo fence="true">)</mo></mrow><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mi>ρ</mi><mi mathvariant="normal">/</mi><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo fence="true">)</mo></mrow><mo>−</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mo fence="true">)</mo></mrow><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mi>ρ</mi><mi mathvariant="normal">/</mi><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>m</mi><mi>φ</mi></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{\Phi_{mn}}{\rho,\vphi}=\p{\fc{Y_m'}{z_{mn}}\fc{J_m}{z_{mn}\rho/R_\mrm{out}}
-\fc{J_m'}{z_{mn}}\fc{Y_m}{z_{mn}\rho/R_\mrm{out}}}\e^{\i m\vphi},</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> is the azimuthal quantum number, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> is the radial quantum number, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub></mrow><annotation encoding="application/x-tex">z_{mn}</annotation></semantics></math></span></span> is defined as the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>th root of the function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span>. The eigenvalue is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>λ</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mo>=</mo><mo>−</mo><msubsup><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow><mn>2</mn></msubsup><mi mathvariant="normal">/</mi><msubsup><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow><mn>2</mn></msubsup></mrow><annotation encoding="application/x-tex">\lmd_{mn}=-z_{mn}^2/R_\mrm{out}^2</annotation></semantics></math></span></span>. In order for the eigenfunctions to be complete, we need to allow <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> to be any integer, but we will restrict ourselves to non-negative <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> in the rest of the article because the negative ones are practically the same as the positive ones.</p>
<h2 data-label="0.2" id="distribution-of-eigenvalues">Distribution of eigenvalues</h2>
<p>From the well-known asymptotic form of the Bessel functions (<a href="https://dlmf.nist.gov/10.7#E8" target="_blank" rel="external">source</a>) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><msqrt><mfrac><mn>2</mn><mrow><mi>π</mi><mi>z</mi></mrow></mfrac></msqrt><mi>cos</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><msqrt><mfrac><mn>2</mn><mrow><mi>π</mi><mi>z</mi></mrow></mfrac></msqrt><mi>sin</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{J_m}{z\to\infty}=\sqrt{\fr2{\pi z}}\fc\cos{z-\fr{m\pi}2-\fr\pi4},\quad
\fc{Y_m}{z\to\infty}=\sqrt{\fr2{\pi z}}\fc\sin{z-\fr{m\pi}2-\fr\pi4},</annotation></semantics></math></span></span></span> we can easily conclude that the asymptotic form of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span> is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mn>2</mn><mi>sin</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>π</mi><msqrt><mi>r</mi></msqrt><mtext> </mtext><mi>z</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc g{z\to\infty}=\fr{2\fc\sin{\p{1-r}z}}{\pi\sqrt r\,z}.</annotation></semantics></math></span></span></span> This inspires us to define a function in companion with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span> as <span id="eq:f" data-label="(3)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc fz\ceq\fc{J_m'}{rz}\fc{J_m'}z+\fc{Y_m'}{rz}\fc{Y_m'}z,</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(3)</annotation></semantics></math></span></span></span></span> </span></span> which will have the asymptotic form <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mn>2</mn><mi>cos</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>π</mi><msqrt><mi>r</mi></msqrt><mtext> </mtext><mi>z</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc f{z\to\infty}=\fr{2\fc\cos{\p{1-r}z}}{\pi\sqrt r\,z}.</annotation></semantics></math></span></span></span> Therefore, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>∼</mo><mi>cos</mi><mo>⁡</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">f\sim\cos\fc\tht z</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>∼</mo><mi>sin</mi><mo>⁡</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">g\sim\sin\fc\tht z</annotation></semantics></math></span></span> are like the cosine and sine pair of oscillatory functions, with a phase angle <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">\fc\tht{z\to\infty}=\p{1-r}z</annotation></semantics></math></span></span> asymptotically directly proportional to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>.</p>
<p>Here is a plot that shows how <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> behaves:</p>
<figure>
<img src="/assets/images/figures/2025-04-11-laplacian-annulus/theta-asymptotic.svg" class="dark-adaptive" alt="Plot of  and  for , "/>

</figure>
<p class="no-indent">
The blue line is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>arctan</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">/</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\arctan{\fc gz/\fc fz}</annotation></semantics></math></span></span>, and the orange line is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>arctan</mi><mo>⁡</mo><mi>tan</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\arctan\fc\tan{\p{1-r}z}</annotation></semantics></math></span></span>. we can see that the two functions are asymptotically equal.
</p>
<p>A good thing about this description is that we can now see that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub></mrow><annotation encoding="application/x-tex">z_{mn}</annotation></semantics></math></span></span> as a root of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span> is just the solution to the equation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>n</mi><mi>π</mi></mrow><annotation encoding="application/x-tex">\fc\tht z=n\pi</annotation></semantics></math></span></span>. In other words, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub></mrow><annotation encoding="application/x-tex">z_{mn}</annotation></semantics></math></span></span> are just the points at which the blue line crosses the horizontal axis in the plot above. Therefore, if we can find the inverse function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc z\tht</annotation></semantics></math></span></span> (maybe in a series expansion), we can directly get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mo>=</mo><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mi>π</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">z_{mn}=\fc z{n\pi}</annotation></semantics></math></span></span>. We can see from the plot that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>θ</mi><mi mathvariant="normal">/</mi><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc z\tht=\tht/\p{1-r}</annotation></semantics></math></span></span> is probably not a good enough approximation. Therefore, we would like to seek higher order terms.</p>
<h3 data-label="0.2.1" id="kummers-equation">Kummer’s equation</h3>
<p>For this part, we employ a method similar to a <a href="https://www.math.toronto.edu/bremer/papers/bessel2.pdf" target="_blank" rel="external">paper</a> by Bremer.</p>
<p>First, for a general homogeneous second-order linear ODE in the form <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo>+</mo><mn>2</mn><mi>χ</mi><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>+</mo><mi>ψ</mi><mi>y</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">y''+2\chi y'+\psi y=0</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi></mrow><annotation encoding="application/x-tex">\chi</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ψ</mi></mrow><annotation encoding="application/x-tex">\psi</annotation></semantics></math></span></span> are known functions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>, we can define <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>y</mi><mi mathvariant="normal">n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>p</mi><mi>y</mi><mo separator="true">,</mo><mspace width="1em"/><mi>p</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>C</mi><mi>exp</mi><mo>⁡</mo><mo>∫</mo><mi>χ</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>z</mi><mo separator="true">,</mo><mspace width="1em"/><mi>q</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>p</mi><mi>ψ</mi><mo>−</mo><msup><mi>p</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">y_\mrm n\ceq py,\quad p\ceq C\exp\int\chi\,\d z,
\quad q\ceq p\psi-p'',</annotation></semantics></math></span></span></span> and the ODE will become a normal form <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>y</mi><mi mathvariant="normal">n</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msubsup><mo>+</mo><mi>q</mi><msub><mi>y</mi><mi mathvariant="normal">n</mi></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">y_\mrm n''+qy_\mrm n=0</annotation></semantics></math></span></span>. Therefore, for any second-order linear ODE, we only need to consider those without the first-derivative term.</p>
<p>Then, one can prove that, for the ODE <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo>+</mo><mi>q</mi><mi>y</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">y''+qy=0</annotation></semantics></math></span></span>, its two linearly independent solutions can be expressed as <span id="eq:kummer-solutions" data-label="(4)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>u</mi><mo>=</mo><mfrac><mrow><mi>cos</mi><mo>⁡</mo><mi>α</mi></mrow><msqrt><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></msqrt></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>v</mi><mo>=</mo><mfrac><mrow><mi>sin</mi><mo>⁡</mo><mi>α</mi></mrow><msqrt><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></msqrt></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">u=\fr{\cos\alp}{\sqrt{\alp'}},\quad v=\fr{\sin\alp}{\sqrt{\alp'}},</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>4</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(4)</annotation></semantics></math></span></span></span></span> </span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> satisfy Kummer’s equation <span id="eq:kummer" data-label="(5)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>α</mi><mrow><mo mathvariant="normal">′</mo><mn>2</mn></mrow></msup><mo>+</mo><mfrac><msup><mi>α</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mrow><mn>2</mn><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow></mfrac><mo>−</mo><mfrac><mrow><mn>3</mn><msup><mi>α</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo><mn>2</mn></mrow></msup></mrow><mrow><mn>4</mn><msup><mi>α</mi><mrow><mo mathvariant="normal">′</mo><mn>2</mn></mrow></msup></mrow></mfrac><mo>=</mo><mi>q</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\alp^{\prime2}+\fr{\alp'''}{2\alp'}-\fr{3\alp^{\prime\prime2}}{4\alp^{\prime2}}=q.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>5</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(5)</annotation></semantics></math></span></span></span></span> </span></span> This may seem like converting a problem to a more complicated one, but the advantage is that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> is not oscillatory while <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation></semantics></math></span></span> are oscillatory, which means that it would be easier to expand
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> as a series for large <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>. Notice that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mn>1</mn><mi mathvariant="normal">/</mi><mrow><mo fence="true">(</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\alp'=1/\p{u^2+v^2}</annotation></semantics></math></span></span>, which provides a means of finding <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> if the solutions of the original ODE are known.</p>
<details>
<summary>
Derivation
</summary>
<p>For the ODE <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo>+</mo><mi>q</mi><mi>y</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">y''+qy=0</annotation></semantics></math></span></span>, substitute the trial solution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi><mo>=</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>α</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>β</mi></mrow></msup></mrow><annotation encoding="application/x-tex">y=\e^{\alp+\i\beta}</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo separator="true">,</mo><mi>β</mi></mrow><annotation encoding="application/x-tex">\alp,\beta</annotation></semantics></math></span></span> are real functions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>. We can derive the following equations: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>α</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo>+</mo><mn>2</mn><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msup><mi>β</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mspace width="1em"/><msup><mi>β</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mo>+</mo><msup><mi>β</mi><mrow><mo mathvariant="normal">′</mo><mn>2</mn></mrow></msup><mo>−</mo><msup><mi>α</mi><mrow><mo mathvariant="normal">′</mo><mn>2</mn></mrow></msup><mo>+</mo><mi>q</mi><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\alp''+2\alp'\beta'=0,\quad
\beta''+\beta^{\prime2}-\alp^{\prime2}+q=0.</annotation></semantics></math></span></span></span> The first equation gives <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mo>−</mo><mi>ln</mi><mo>⁡</mo><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\beta=-\ln\alp'/2</annotation></semantics></math></span></span>, which we can substitute into the second equation to get Equation <a href="#eq:kummer">5</a>. On the other hand, the real and imaginary parts of the trial solution gives us Equation <a href="#eq:kummer-solutions">4</a>. Technically speaking, it can be called the real and imaginary parts only if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\alp'&gt;0</annotation></semantics></math></span></span>, but they are still solutions to the ODE.</p>
<p>Another way to prove Kummer’s equation is just substituting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mn>1</mn><mi mathvariant="normal">/</mi><mrow><mo fence="true">(</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\alp'=1/\p{u^2+v^2}</annotation></semantics></math></span></span> and check that it satisfies Kummer’s equation if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi></mrow><annotation encoding="application/x-tex">u</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>v</mi></mrow><annotation encoding="application/x-tex">v</annotation></semantics></math></span></span> satisfy the ODE and have Wronkskian equal to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>.</p>
</details>
<p>Now, we can try to apply this to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">J_m'</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">Y_m'</annotation></semantics></math></span></span>. First, we need to find the second-order ODE that those two functions satisfy. We already know that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>J</mi><mi>m</mi></msub></mrow><annotation encoding="application/x-tex">J_m</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>Y</mi><mi>m</mi></msub></mrow><annotation encoding="application/x-tex">Y_m</annotation></semantics></math></span></span> are solutions to Equation <a href="#eq:bessel-equation">1</a>, so it would be straightforward to derive that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">J_m'</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">Y_m'</annotation></semantics></math></span></span> satisfy <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>y</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><mfrac><mn>1</mn><mi>z</mi></mfrac><mfrac><mrow><msup><mi>z</mi><mn>2</mn></msup><mo>−</mo><mn>3</mn><msup><mi>m</mi><mn>2</mn></msup></mrow><mrow><msup><mi>z</mi><mn>2</mn></msup><mo>−</mo><msup><mi>m</mi><mn>2</mn></msup></mrow></mfrac><msup><mi>y</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mfrac><mrow><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><mn>1</mn></mrow><msup><mi>z</mi><mn>2</mn></msup></mfrac><mo>−</mo><mfrac><mrow><mn>2</mn><msup><mi>m</mi><mn>2</mn></msup></mrow><mrow><msup><mi>z</mi><mn>2</mn></msup><mo>−</mo><msup><mi>m</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mi>y</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\fc{y''}z+\fr1z\fr{z^2-3m^2}{z^2-m^2}\fc{y'}z
+\p{1-\fr{m^2+1}{z^2}-\fr{2m^2}{z^2-m^2}}\fc yz=0.</annotation></semantics></math></span></span></span>
To reduce this into the normal form without the first-derivative term, define <span id="eq:p-and-q" data-label="(6)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msqrt><mfrac><mi>π</mi><mn>2</mn></mfrac></msqrt><mfrac><msup><mi>z</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><msqrt><mrow><msup><mi>z</mi><mn>2</mn></msup><mo>−</mo><msup><mi>m</mi><mn>2</mn></msup></mrow></msqrt></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><mo>−</mo><mfrac><mrow><mn>4</mn><msup><mi>m</mi><mn>2</mn></msup><mo>−</mo><mn>1</mn></mrow><mrow><mn>4</mn><msup><mi>z</mi><mn>2</mn></msup></mrow></mfrac><mo>−</mo><mfrac><mrow><mn>2</mn><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><msup><mi>z</mi><mn>2</mn></msup></mrow><msup><mrow><mo fence="true">(</mo><msup><mi>m</mi><mn>2</mn></msup><mo>−</mo><msup><mi>z</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc pz\ceq\sqrt{\fr\pi2}\fr{z^{3/2}}{\sqrt{z^2-m^2}},\quad
\fc qz\ceq1-\fr{4m^2-1}{4z^2}-\fr{2m^2+z^2}{\p{m^2-z^2}^2},</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>6</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(6)</annotation></semantics></math></span></span></span></span> </span></span> and we have
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc pz\fc{J_m'}z</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc pz\fc {Y_m'}z</annotation></semantics></math></span></span> satisfy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>y</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mi>y</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{y''}z+\fc qz\fc yz=0</annotation></semantics></math></span></span>. Equation <a href="#eq:kummer-solutions">4</a> then gives <span id="eq:bessel-as-kummer-solutions" data-label="(7)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>cos</mi><mo>⁡</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msqrt><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></msqrt></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><mo>−</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>sin</mi><mo>⁡</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msqrt><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></msqrt></mrow></mfrac></mrow><annotation encoding="application/x-tex">\fc{Y_m'}z=\fr{\cos\fc\alp z}{\fc pz\sqrt{\fc{\alp'}z}},\quad
-\fc{J_m'}z=\fr{\sin\fc\alp z}{\fc pz\sqrt{\fc{\alp'}z}}</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>7</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(7)</annotation></semantics></math></span></span></span></span> </span></span> (the normalization of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span></span> and the initial value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> are chosen to make sure they are correct). You may worry that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>&lt;</mo><mi>m</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc p{z&lt;m}</annotation></semantics></math></span></span> is imaginary, but <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\alp'}z</annotation></semantics></math></span></span> will be negative in that region so that everything works out and is real in the end. Substitute Equation <a href="#eq:bessel-as-kummer-solutions">7</a> into Equation <a href="#eq:f">3</a> and <a href="#eq:g">2</a>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>cos</mi><mo>⁡</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msqrt><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></msqrt></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>sin</mi><mo>⁡</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msqrt><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></msqrt></mrow></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc fz=\fr{\cos\fc\tht z}{\fc p{rz}\fc pz\sqrt{\fc{\alp'}{rz}\fc{\alp'}z}},\quad
\fc gz=\fr{\sin\fc\tht z}{\fc p{rz}\fc pz\sqrt{\fc{\alp'}{rz}\fc{\alp'}z}},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z\ceq\fc\alp z-\fc\alp{rz}</annotation></semantics></math></span></span>. By this, we have a workable expression for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> so that we now just need to turn our attention to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp z</annotation></semantics></math></span></span>.</p>
<p>We can substitute <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc qz</annotation></semantics></math></span></span> in Equation <a href="#eq:p-and-q">6</a> into Equation <a href="#eq:kummer">5</a> and expand on both sides as a series of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> at infinity and solve for the series coefficients to get <span id="eq:alpha-prime-few-terms" data-label="(8)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>1</mn><mo>+</mo><mfrac><mrow><mo>−</mo><mn>4</mn><msup><mi>m</mi><mn>2</mn></msup><mo>−</mo><mn>3</mn></mrow><mrow><mn>8</mn><msup><mi>z</mi><mn>2</mn></msup></mrow></mfrac><mo>+</mo><mfrac><mrow><mo>−</mo><mn>16</mn><msup><mi>m</mi><mn>4</mn></msup><mo>−</mo><mn>184</mn><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><mn>63</mn></mrow><mrow><mn>128</mn><msup><mi>z</mi><mn>4</mn></msup></mrow></mfrac><mo>+</mo><mo>⋯</mo><mtext> </mtext><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{\alp'}z=1+\fr{-4m^2-3}{8z^2}+\fr{-16m^4-184m^2+63}{128z^4}+\cdots,</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>8</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(8)</annotation></semantics></math></span></span></span></span> </span></span> which has a certain convergence radius which is not important at this stage.</p>
<h3 data-label="0.2.2" id="asymptotic-expansion">Asymptotic expansion</h3>
<p>Here we will work out another way of expanding <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp z</annotation></semantics></math></span></span> as a series based on properties of the Bessel functions. From Equation <a href="#eq:bessel-as-kummer-solutions">7</a>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mi>p</mi><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mrow><mo fence="true">(</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr1{\fc{\alp'}z}=\fc pz^2\p{\fc{J_m'}z^2+\fc{Y_m'}z^2}.</annotation></semantics></math></span></span></span> If we were working with
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc{J_m}z^2+\fc{Y_m}z^2</annotation></semantics></math></span></span> instead, we would be able to employ the handy Nicholson’s integral, but the same method cannot be applied here.</p>
<details>
<summary>
Why it does not work
</summary>
<p>Nicholson’s integral is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><mfrac><mn>8</mn><msup><mi>π</mi><mn>2</mn></msup></mfrac><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><mi>cosh</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>m</mi><mi>t</mi><mo fence="true">)</mo></mrow><msub><mi>K</mi><mn>0</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>z</mi><mi>sinh</mi><mo>⁡</mo><mi>t</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>t</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{J_m}z^2+\fc{Y_m}z^2=\fr8{\pi^2}\int_0^\infty\fc\cosh{2mt}\fc{K_0}{2z\sinh t}\d t,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>K</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">K_0</annotation></semantics></math></span></span> is the modified Bessel function. A derivation is given in Section 13.73 of Watson’s <cite>A Treatise on the Theory of Bessel Functions</cite>.</p>
<p>To apply this to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc{J_m'}z^2+\fc{Y_m'}z^2</annotation></semantics></math></span></span>, we need to use (<a href="https://dlmf.nist.gov/10.6#E1" target="_blank" rel="external">source</a>) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mrow><mo fence="true">(</mo><msub><mi>J</mi><mrow><mi>m</mi><mo>−</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>J</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mrow><mo fence="true">(</mo><msub><mi>Y</mi><mrow><mi>m</mi><mo>−</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>Y</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{J_m'}z=\fr12\p{\fc{J_{m-1}}z-\fc{J_{m+1}}z},\quad
\fc{Y_m'}z=\fr12\p{\fc{Y_{m-1}}z-\fc{Y_{m+1}}z}.</annotation></semantics></math></span></span></span> Then, we just need to work out the cross terms
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>J</mi><mrow><mi>m</mi><mo>−</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>J</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><msub><mi>Y</mi><mrow><mi>m</mi><mo>−</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>Y</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{J_{m-1}}z\fc{J_{m+1}}z+\fc{Y_{m-1}}z\fc{Y_{m+1}}z</annotation></semantics></math></span></span>. By the same method of deriving Nicholson’s integral, we can get <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mphantom><mo>=</mo><mrow/></mphantom><msub><mi>J</mi><msub><mi>m</mi><mn>1</mn></msub></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>J</mi><msub><mi>m</mi><mn>2</mn></msub></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><msub><mi>Y</mi><msub><mi>m</mi><mn>1</mn></msub></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>Y</mi><msub><mi>m</mi><mn>2</mn></msub></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>4</mn><msup><mi>π</mi><mn>2</mn></msup></mfrac><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mrow><mo fence="true">(</mo><msub><mi>m</mi><mn>1</mn></msub><mo>+</mo><msub><mi>m</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mi>t</mi></mrow></msup><mi>cos</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">(</mo><msub><mi>m</mi><mn>1</mn></msub><mo>−</mo><msub><mi>m</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mi>π</mi><mo fence="true">)</mo></mrow><mo>+</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mrow><mo fence="true">(</mo><msub><mi>m</mi><mn>1</mn></msub><mo>+</mo><msub><mi>m</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mi>t</mi></mrow></msup><mo fence="true">)</mo></mrow><msub><mi>K</mi><mrow><msub><mi>m</mi><mn>2</mn></msub><mo>−</mo><msub><mi>m</mi><mn>1</mn></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>z</mi><mi>sinh</mi><mo>⁡</mo><mi>t</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>t</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
&amp;\phantom{={}}\fc{J_{m_1}}z\fc{J_{m_2}}z+\fc{Y_{m_1}}z\fc{Y_{m_2}}z\\
&amp;=\fr4{\pi^2}\int_0^\infty\p{\e^{\p{m_1+m_2}t}\fc\cos{\p{m_1-m_2}\pi}
+\e^{-\p{m_1+m_2}t}}\fc{K_{m_2-m_1}}{2z\sinh t}\d t,
\end{align*}</annotation></semantics></math></span></span></span>
which is a more general version of Nicholson’s integral. However, this formula is only valid for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">∣</mo><mi mathvariant="normal">Re</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>m</mi><mn>1</mn></msub><mo>−</mo><msub><mi>m</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo fence="true">∣</mo></mrow><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\v{\fc\Re{m_1-m_2}}&lt;1</annotation></semantics></math></span></span> because otherwise the integral diverges near <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">t=0</annotation></semantics></math></span></span>, while we need <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mn>2</mn></msub><mo>−</mo><msub><mi>m</mi><mn>1</mn></msub><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">m_2-m_1=2</annotation></semantics></math></span></span>.</p>
<p>One can also try to employ the same method of deriving Nicholson’s integral directly on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc{J_m'}z^2+\fc{Y_m'}z^2</annotation></semantics></math></span></span>, but it will turn out to have the same divergence problem. Briefly speaking, there is a term that is an infinitesimal quantity times the integral of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="normal">∂</mi><mi>μ</mi><mn>2</mn></msubsup><msub><mi>K</mi><mi>μ</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>z</mi><mi>sinh</mi><mo>⁡</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\partial_\mu^2\fc{K_\mu}{2z\sinh t}</annotation></semantics></math></span></span>, which can only be thrown away without any problem if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">∣</mo><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>μ</mi><mo fence="true">∣</mo></mrow><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\v{\Re\mu}&lt;1</annotation></semantics></math></span></span>, which is not the case here.</p>
</details>
<p class="no-indent">
We can, however, use the asymptotic expansion of the Bessel functions directly (<a href="https://dlmf.nist.gov/10.17#E9" target="_blank" rel="external">source</a>): <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msqrt><mfrac><mn>2</mn><mrow><mi>π</mi><mi>z</mi></mrow></mfrac></msqrt><mrow><mo fence="true">(</mo><mi>cos</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo fence="true">)</mo></mrow><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mrow><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi></mrow></msub></mrow><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo>−</mo><mi>sin</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo fence="true">)</mo></mrow><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mrow><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo>−</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msqrt><mfrac><mn>2</mn><mrow><mi>π</mi><mi>z</mi></mrow></mfrac></msqrt><mrow><mo fence="true">(</mo><mi>cos</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo fence="true">)</mo></mrow><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mrow><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub></mrow><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo>+</mo><mi>sin</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo fence="true">)</mo></mrow><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mrow><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi></mrow></msub></mrow><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{Y_m'}z&amp;=\sqrt{\fr2{\pi z}}\p{\fc\cos{z-\fr{m\pi}2-\fr\pi4}
\sum_{k=0}^\infty\fr{\p{-1}^kc_{2k}}{z^{2k}}
-\fc\sin{z-\fr{m\pi}2-\fr\pi4}\sum_{k=0}^\infty\fr{\p{-1}^kc_{2k+1}}{z^{2k+1}}},\\
-\fc{J_m'}z&amp;=\sqrt{\fr2{\pi z}}\p{\fc\cos{z-\fr{m\pi}2-\fr\pi4}
\sum_{k=0}^\infty\fr{\p{-1}^kc_{2k+1}}{z^{2k+1}}
+\fc\sin{z-\fr{m\pi}2-\fr\pi4}\sum_{k=0}^\infty\fr{\p{-1}^kc_{2k}}{z^{2k}}},
\end{align*}</annotation></semantics></math></span></span></span>
where <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>c</mi><mi>k</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>a</mi><mi>k</mi></msub><mo>+</mo><mrow><mo fence="true">(</mo><mi>k</mi><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo fence="true">)</mo></mrow><msub><mi>a</mi><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msub><mo separator="true">,</mo><mspace width="1em"/><msub><mi>a</mi><mi>k</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mfrac><mrow><msup><mrow><mo fence="true">(</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn><mo>−</mo><mi>m</mi><mo fence="true">)</mo></mrow><mover accent="true"><mi>k</mi><mo stretchy="true">‾</mo></mover></msup><msup><mrow><mo fence="true">(</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn><mo>+</mo><mi>m</mi><mo fence="true">)</mo></mrow><mover accent="true"><mi>k</mi><mo stretchy="true">‾</mo></mover></msup></mrow><mrow><msup><mn>2</mn><mi>k</mi></msup><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">c_k\ceq a_k+\p{k-\fr12}a_{k-1},\quad
a_k\ceq\p{-1}^k\fr{\p{1/2-m}^{\overline k}\p{1/2+m}^{\overline k}}{2^kk!},</annotation></semantics></math></span></span></span> where the raising factorial notation is used. By combining them, we get
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><mfrac><mn>2</mn><mi>π</mi></mfrac><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msub><mi>r</mi><mi>k</mi></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>r</mi><mi>k</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>0</mn></mrow><mrow><mn>2</mn><mi>k</mi></mrow></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>l</mi></msup><msub><mi>c</mi><mi>l</mi></msub><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mi>l</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{J_m'}z^2+\fc{Y_m'}z^2=\fr2\pi\sum_{k=0}^\infty\fr{r_k}{z^{2k+1}},\quad
r_k\ceq\p{-1}^k\sum_{l=0}^{2k}\p{-1}^lc_lc_{2k-l}.</annotation></semantics></math></span></span></span>
</p>
<details>
<summary>
Derivation
</summary>
<p>First, expand the squares, and the cross terms will cancel, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi>π</mi><mi>z</mi></mrow><mn>2</mn></mfrac><mrow><mo fence="true">(</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow><mo>=</mo><msup><mrow><mo fence="true">(</mo><munder><mo>∑</mo><mi>k</mi></munder><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mfrac><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi></mrow></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msup><mrow><mo fence="true">(</mo><munder><mo>∑</mo><mi>k</mi></munder><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mfrac><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr{\pi z}2\p{\fc{J_m'}z^2+\fc{Y_m'}z^2}=
\p{\sum_k\p{-1}^k\fr{c_{2k}}{z^{2k}}}^2
+\p{\sum_k\p{-1}^k\fr{c_{2k+1}}{z^{2k+1}}}^2.</annotation></semantics></math></span></span></span>
For the first term, combine a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>z</mi><mrow><mn>2</mn><mi>l</mi></mrow></msup></mrow><annotation encoding="application/x-tex">1/z^{2l}</annotation></semantics></math></span></span> and a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>z</mi><mrow><mn>2</mn><mrow><mo fence="true">(</mo><mi>k</mi><mo>−</mo><mi>l</mi><mo fence="true">)</mo></mrow></mrow></msup></mrow><annotation encoding="application/x-tex">1/z^{2\p{k-l}}</annotation></semantics></math></span></span> to get a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mrow><annotation encoding="application/x-tex">1/z^{2k}</annotation></semantics></math></span></span>, so that we can resum it as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mrow><mo fence="true">(</mo><munder><mo>∑</mo><mi>k</mi></munder><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mfrac><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi></mrow></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mn>1</mn><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>l</mi></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>l</mi></mrow></msub><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mi>l</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\p{\sum_k\p{-1}^k\fr{c_{2k}}{z^{2k}}}^2
=\sum_{k=0}^\infty\fr1{z^{2k}}\sum_{l=0}^k\p{-1}^lc_{2l}\p{-1}^{k-l}c_{2k-2l}.</annotation></semantics></math></span></span></span>
Similarly, for the other term, combine a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>z</mi><mrow><mn>2</mn><mi>l</mi><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">1/z^{2l-1}</annotation></semantics></math></span></span> and a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>z</mi><mrow><mn>2</mn><mrow><mo fence="true">(</mo><mi>k</mi><mo>−</mo><mi>l</mi><mo fence="true">)</mo></mrow><mo>+</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">1/z^{2\p{k-l}+1}</annotation></semantics></math></span></span> to get a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mrow><annotation encoding="application/x-tex">1/z^{2k}</annotation></semantics></math></span></span>, so that we can resum it as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mrow><mo fence="true">(</mo><munder><mo>∑</mo><mi>k</mi></munder><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mfrac><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mn>1</mn><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mrow><mi>l</mi><mo>−</mo><mn>1</mn></mrow></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>l</mi><mo>−</mo><mn>1</mn></mrow></msub><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mi>l</mi><mo>+</mo><mn>1</mn></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\p{\sum_k\p{-1}^k\fr{c_{2k+1}}{z^{2k+1}}}^2
=\sum_{k=0}^\infty\fr1{z^{2k}}\sum_{l=1}^k\p{-1}^{l-1}c_{2l-1}\p{-1}^{k-l}c_{2k-2l+1}.</annotation></semantics></math></span></span></span>
Combine to get <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><mi>π</mi><mi>z</mi></mrow><mn>2</mn></mfrac><mrow><mo fence="true">(</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mn>1</mn><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mrow><mo fence="true">(</mo><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>l</mi></mrow></msub><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mi>l</mi></mrow></msub><mo>+</mo><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup><msub><mi>c</mi><mrow><mn>2</mn><mi>l</mi><mo>−</mo><mn>1</mn></mrow></msub><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mi>l</mi><mo>+</mo><mn>1</mn></mrow></msub><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>0</mn></mrow><mrow><mn>2</mn><mi>k</mi></mrow></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>l</mi></msup><msub><mi>c</mi><mi>l</mi></msub><msub><mi>c</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mi>l</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fr{\pi z}2\p{\fc{J_m'}z^2+\fc{Y_m'}z^2}&amp;=
\sum_{k=0}^\infty\fr1{z^{2k}}
\p{\sum_{l=0}^k\p{-1}^kc_{2l}c_{2k-2l}
+\sum_{l=1}^k\p{-1}^{k-1}c_{2l-1}c_{2k-2l+1}}\\
&amp;=\sum_{k=0}^\infty\fr{\p{-1}^k}{z^{2k}}
\sum_{l=0}^{2k}\p{-1}^lc_lc_{2k-l}.
\end{align*}</annotation></semantics></math></span></span></span></p>
</details>
<p>Then, take the reciprocal of the series, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></mfrac><mo>=</mo><mfrac><mi>π</mi><mn>2</mn></mfrac><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msubsup><mi>r</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr1{\fc{J_m'}z^2+\fc{Y_m'}z^2}=\fr\pi2\sum_{k=0}^\infty\fr{r^\mrm r_k}{z^{2k-1}},</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>r</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup></mrow><annotation encoding="application/x-tex">r^\mrm r_k</annotation></semantics></math></span></span> is defined recursively as (noticing that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mn>0</mn></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">r_0=1</annotation></semantics></math></span></span>) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>r</mi><mn>0</mn><mi mathvariant="normal">r</mi></msubsup><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>r</mi><mrow><mi>k</mi><mo>&gt;</mo><mn>0</mn></mrow><mi mathvariant="normal">r</mi></msubsup><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msub><mi>r</mi><mi>l</mi></msub><msubsup><mi>r</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow><mi mathvariant="normal">r</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">r^\mrm r_0\ceq 1,\quad
r^\mrm r_{k&gt;0}\ceq-\sum_{l=1}^kr_lr^\mrm r_{k-l}.</annotation></semantics></math></span></span></span></p>
<details>
<summary>
Series reciprocation
</summary>
<p>For a series <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></msubsup><msub><mi>r</mi><mi>k</mi></msub><msup><mi>z</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\sum_{k=0}^\infty r_kz^k</annotation></semantics></math></span></span>, what is the reciprocal <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mrow><mo fence="true">(</mo><msubsup><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></msubsup><msub><mi>r</mi><mi>k</mi></msub><msup><mi>z</mi><mi>k</mi></msup><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\p{\sum_{k=0}^\infty r_kz^k}^{-1}</annotation></semantics></math></span></span>? Assume that it is another series <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></msubsup><msubsup><mi>r</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><msup><mi>z</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\sum_{k=0}^\infty r^\mrm r_kz^k</annotation></semantics></math></span></span>. Then, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mn>1</mn><mo>=</mo><mrow><mo fence="true">(</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msub><mi>r</mi><mi>k</mi></msub><msup><mi>z</mi><mi>k</mi></msup><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msubsup><mi>r</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><msup><mi>z</mi><mi>k</mi></msup><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>z</mi><mi>k</mi></msup><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msub><mi>r</mi><mi>l</mi></msub><msubsup><mi>r</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow><mi mathvariant="normal">r</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">1=\p{\sum_{k=0}^\infty r_kz^k}\p{\sum_{k=0}^\infty r^\mrm r_kz^k}
=\sum_{k=0}^\infty z^k\sum_{l=0}^k r_l r^\mrm r_{k-l}.</annotation></semantics></math></span></span></span> Compare the coefficients of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>z</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">z^k</annotation></semantics></math></span></span> on both sides, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>δ</mi><mrow><mi>k</mi><mo separator="true">,</mo><mn>0</mn></mrow></msub><mo>=</mo><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>0</mn></mrow><mi>k</mi></munderover><msub><mi>r</mi><mi>l</mi></msub><msubsup><mi>r</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow><mi mathvariant="normal">r</mi></msubsup><mo>=</mo><msub><mi>r</mi><mn>0</mn></msub><msubsup><mi>r</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><mo>+</mo><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msub><mi>r</mi><mi>l</mi></msub><msubsup><mi>r</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow><mi mathvariant="normal">r</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\dlt_{k,0}=\sum_{l=0}^k r_l r^\mrm r_{k-l}
=r_0r^\mrm r_k+\sum_{l=1}^k r_l r^\mrm r_{k-l}.</annotation></semantics></math></span></span></span> Therefore, we get the recursion relation <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>r</mi><mn>0</mn><mi mathvariant="normal">r</mi></msubsup><mo>=</mo><mfrac><mn>1</mn><msub><mi>r</mi><mn>0</mn></msub></mfrac><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>r</mi><mrow><mi>k</mi><mo>&gt;</mo><mn>0</mn></mrow><mi mathvariant="normal">r</mi></msubsup><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><msub><mi>r</mi><mn>0</mn></msub></mfrac><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msub><mi>r</mi><mi>l</mi></msub><msubsup><mi>r</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow><mi mathvariant="normal">r</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">r^\mrm r_0=\fr1{r_0},\quad
r^\mrm r_{k&gt;0}=-\fr1{r_0}\sum_{l=1}^kr_lr^\mrm r_{k-l}.</annotation></semantics></math></span></span></span> I will use the notation of superscript <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">r</mi></mrow><annotation encoding="application/x-tex">\mrm r</annotation></semantics></math></span></span> for series reciprocation in the rest of this article.</p>
<p>There are non-recursive ways of writing those coefficients, but they are either very long or needs notations that require a bit of explanation, so I restrained from that.</p>
</details>
<p class="no-indent">
Therefore, we get the asymptotic expansion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp z</annotation></semantics></math></span></span> as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mo>∫</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi>p</mi><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mrow><mo fence="true">(</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mo>−</mo><mfrac><mrow><mi>m</mi><mi>π</mi></mrow><mn>2</mn></mfrac><mo>−</mo><mfrac><mi>π</mi><mn>4</mn></mfrac><mo>+</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msub><mi>s</mi><mi>k</mi></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>s</mi><mi>k</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mfrac><mrow><msup><mi>m</mi><mn>2</mn></msup><msubsup><mi>r</mi><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow><mi mathvariant="normal">r</mi></msubsup><mo>−</mo><msubsup><mi>r</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup></mrow><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>1</mn></mrow></mfrac></mrow><annotation encoding="application/x-tex">\fc\alp z=\int\fr{\d z}{\fc pz^2\p{\fc{J_m'}z^2+\fc{Y_m'}z^2}}
=-\fr{m\pi}2-\fr\pi4+\sum_{k=0}^\infty\fr{s_k}{z^{2k-1}},\quad
s_k\ceq\fr{m^2r^\mrm r_{k-1}-r^\mrm r_k}{2k-1}</annotation></semantics></math></span></span></span>
(with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>r</mi><mrow><mo>−</mo><mn>1</mn></mrow><mi mathvariant="normal">r</mi></msubsup></mrow><annotation encoding="application/x-tex">r^\mrm r_{-1}</annotation></semantics></math></span></span> understood as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span>; I will be assuming the reference to any expansion coefficients outside their designated range to be interpreted as zero in all occurrences in the rest of this article). The additive constant in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp z</annotation></semantics></math></span></span> is properly chosen so that Equation <a href="#eq:bessel-as-kummer-solutions">7</a> is satisfied without being off by a phase (but it is actually unimportant anyway because it gets canceled in the expression of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span>). One can check that this agrees with Equation <a href="#eq:alpha-prime-few-terms">8</a>.
</p>
<p>We can now find an expansion for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msub><mi>d</mi><mi>k</mi></msub><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>d</mi><mi>k</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mfrac><mn>1</mn><msup><mi>r</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mfrac><msub><mi>s</mi><mi>k</mi></msub><mrow><mn>1</mn><mo>−</mo><mi>r</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc\tht z=\fc\alp z-\fc\alp{rz}=\p{1-r}\sum_{k=0}^\infty\fr{d_k}{z^{2k-1}},\quad
d_k\ceq\p{1-\fr1{r^{2k-1}}}\fr{s_k}{1-r}.</annotation></semantics></math></span></span></span>
Then it is the final step to find an expansion for the inverse function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc z\tht</annotation></semantics></math></span></span>. Take the reciprocal of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo>−</mo><mi>r</mi></mrow></mfrac><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msubsup><mi>d</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><msup><mi>z</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>d</mi><mn>0</mn><mi mathvariant="normal">r</mi></msubsup><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>d</mi><mrow><mi>k</mi><mo>&gt;</mo><mn>0</mn></mrow><mi mathvariant="normal">r</mi></msubsup><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msub><mi>d</mi><mi>l</mi></msub><msubsup><mi>d</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow><mi mathvariant="normal">r</mi></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr1{\fc\tht z}=\fr1{1-r}\sum_{k=0}^\infty\fr{d^\mrm r_k}{z^{2k+1}},\quad
d^\mrm r_0\ceq1,\quad d^\mrm r_{k&gt;0}\ceq-\sum_{l=1}^kd_l d^\mrm r_{k-l}.</annotation></semantics></math></span></span></span>
Then, <a href="https://en.wikipedia.org/wiki/Lagrange_inversion_theorem" target="_blank" rel="external">invert the series</a>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msubsup><mi>b</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><msup><mi>θ</mi><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>b</mi><mi>k</mi><mi mathvariant="normal">r</mi></msubsup><mo><mi mathvariant="normal">≔</mi></mo><mfrac><msup><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mrow><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup><mrow><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo></mrow></mfrac><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mrow><mn>2</mn><mi>k</mi></mrow></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>l</mi></msup><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><mover accent="true"><mi>l</mi><mo stretchy="true">‾</mo></mover></msup><msub><mi>B</mi><mrow><mn>2</mn><mi>k</mi><mo separator="true">,</mo><mi>l</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>0</mn><mo separator="true">,</mo><mn>2</mn><mo stretchy="false">!</mo><msubsup><mi>d</mi><mn>1</mn><mi mathvariant="normal">r</mi></msubsup><mo separator="true">,</mo><mn>0</mn><mo separator="true">,</mo><mn>4</mn><mo stretchy="false">!</mo><msubsup><mi>d</mi><mn>2</mn><mi mathvariant="normal">r</mi></msubsup><mo separator="true">,</mo><mn>0</mn><mo separator="true">,</mo><mo>…</mo><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>k</mi><mo>&gt;</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mn>1</mn><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>k</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">\fr1{\fc z\tht}=\sum_{k=0}^\infty\fr{b^\mrm r_k}{\tht^{2k+1}},\quad
b^\mrm r_k\ceq\fr{\p{1-r}^{2k+1}}{\p{2k+1}!}\begin{dcases}
\sum_{l=1}^{2k}\p{-1}^l\p{2k+1}^{\overline l}
\fc{B_{2k,l}}{0,2!d^\mrm r_1,0,4!d^\mrm r_2,0,\ldots},&amp;k&gt;0,\\
1,&amp;k=0,
\end{dcases}</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>B</mi><mrow><mn>2</mn><mi>k</mi><mo separator="true">,</mo><mi>l</mi></mrow></msub></mrow><annotation encoding="application/x-tex">B_{2k,l}</annotation></semantics></math></span></span> is the <a href="https://en.wikipedia.org/wiki/Bell_polynomials" target="_blank" rel="external">Bell polynomial</a>. Finally, take the reciprocal: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msub><mi>b</mi><mi>k</mi></msub><msup><mi>θ</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>b</mi><mn>0</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo>−</mo><mi>r</mi></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>b</mi><mrow><mi>k</mi><mo>&gt;</mo><mn>0</mn></mrow></msub><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo>−</mo><mi>r</mi></mrow></mfrac><munderover><mo>∑</mo><mrow><mi>l</mi><mo>=</mo><mn>1</mn></mrow><mi>k</mi></munderover><msubsup><mi>b</mi><mi>l</mi><mi mathvariant="normal">r</mi></msubsup><msub><mi>b</mi><mrow><mi>k</mi><mo>−</mo><mi>l</mi></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc z\tht=\sum_{k=0}^\infty\fr{b_k}{\tht^{2k-1}},\quad
b_0\ceq\fr1{1-r},\quad
b_{k&gt;0}\ceq-\fr1{1-r}\sum_{l=1}^kb^\mrm r_lb_{k-l}.</annotation></semantics></math></span></span></span>
The first few terms are <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mi>θ</mi><mrow><mn>1</mn><mo>−</mo><mi>r</mi></mrow></mfrac><mo>+</mo><mfrac><mrow><mrow><mo fence="true">(</mo><mn>4</mn><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><mn>3</mn><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow></mrow><mrow><mn>8</mn><mi>r</mi><mi>θ</mi></mrow></mfrac><mo>+</mo><mo>⋯</mo></mrow><annotation encoding="application/x-tex">\fc z\tht=\fr\tht{1-r}+\fr{\p{4m^2+3}\p{1-r}}{8r\tht}+\cdots</annotation></semantics></math></span></span></span> (I only write two terms here because the next term starts to be very long; it will turn out that only the first two terms are useful anyway).</p>
<details>
<summary>
Wolfram codes for computing the coefficients
</summary>
<table class="rouge-table"><tbody><tr><td class="highlight language-wolfram"><pre><code><span class="line line-1"><span class="nv">a</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="w"> </span><span class="p">(</span><span class="o">-</span><span class="m">1</span><span class="p">)</span><span class="o">^</span><span class="nv">k</span><span class="w"> </span><span class="nb">Pochhammer</span><span class="p">[</span><span class="m">1</span><span class="o">/</span><span class="m">2</span><span class="o">-</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="p">]</span><span class="nb">Pochhammer</span><span class="p">[</span><span class="m">1</span><span class="o">/</span><span class="m">2</span><span class="o">+</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="p">]</span><span class="o">/</span><span class="p">(</span><span class="m">2</span><span class="o">^</span><span class="nv">k</span><span class="w"> </span><span class="nv">k</span><span class="o">!</span><span class="p">)</span>
</span><span class="line line-2"><span class="nv">c</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="nv">a</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="p">]</span><span class="o">+</span><span class="p">(</span><span class="nv">k</span><span class="o">-</span><span class="m">1</span><span class="o">/</span><span class="m">2</span><span class="p">)</span><span class="nv">a</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">-</span><span class="m">1</span><span class="p">]</span>
</span><span class="line line-3"><span class="nv">r</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="p">(</span><span class="o">-</span><span class="m">1</span><span class="p">)</span><span class="o">^</span><span class="nv">k</span><span class="w"> </span><span class="nb">Sum</span><span class="p">[(</span><span class="o">-</span><span class="m">1</span><span class="p">)</span><span class="o">^</span><span class="nv">l</span><span class="w"> </span><span class="nv">c</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">l</span><span class="p">]</span><span class="nv">c</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="m">2</span><span class="nv">k</span><span class="o">-</span><span class="nv">l</span><span class="p">]</span><span class="o">,</span><span class="p">{</span><span class="nv">l</span><span class="o">,</span><span class="m">0</span><span class="o">,</span><span class="m">2</span><span class="nv">k</span><span class="p">}]</span>
</span><span class="line line-4"><span class="nv">rr</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="nv">rr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="p">]</span><span class="o">=</span><span class="nb">If</span><span class="p">[</span><span class="nv">k</span><span class="o">&lt;</span><span class="m">0</span><span class="o">,</span><span class="m">0</span><span class="o">,</span><span class="nb">If</span><span class="p">[</span><span class="nv">k</span><span class="o">==</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">,-</span><span class="nb">Sum</span><span class="p">[</span><span class="nv">r</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">l</span><span class="p">]</span><span class="nv">rr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">-</span><span class="nv">l</span><span class="p">]</span><span class="o">,</span><span class="p">{</span><span class="nv">l</span><span class="o">,</span><span class="m">1</span><span class="o">,</span><span class="nv">k</span><span class="p">}]]]</span>
</span><span class="line line-5"><span class="nv">s</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="p">(</span><span class="nv">m</span><span class="o">^</span><span class="m">2</span><span class="w"> </span><span class="nv">rr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">-</span><span class="m">1</span><span class="p">]</span><span class="o">-</span><span class="nv">rr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="p">])</span><span class="o">/</span><span class="p">(</span><span class="m">2</span><span class="nv">k</span><span class="o">-</span><span class="m">1</span><span class="p">)</span>
</span><span class="line line-6"><span class="nv">d</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_,</span><span class="nv">R</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="p">(</span><span class="m">1</span><span class="o">-</span><span class="m">1</span><span class="o">/</span><span class="nv">R</span><span class="o">^</span><span class="p">(</span><span class="m">2</span><span class="nv">k</span><span class="o">-</span><span class="m">1</span><span class="p">))</span><span class="nv">s</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="p">]</span><span class="o">/</span><span class="p">(</span><span class="m">1</span><span class="o">-</span><span class="nv">R</span><span class="p">)</span>
</span><span class="line line-7"><span class="nv">dr</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_,</span><span class="nv">R</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="nv">dr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="o">=</span><span class="nb">If</span><span class="p">[</span><span class="nv">k</span><span class="o">==</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">,-</span><span class="nb">Sum</span><span class="p">[</span><span class="nv">d</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">l</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="nv">dr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">-</span><span class="nv">l</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="o">,</span><span class="p">{</span><span class="nv">l</span><span class="o">,</span><span class="m">1</span><span class="o">,</span><span class="nv">k</span><span class="p">}]]</span>
</span><span class="line line-8"><span class="nv">br</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_,</span><span class="nv">R</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="p">(</span><span class="m">1</span><span class="o">-</span><span class="nv">R</span><span class="p">)</span><span class="o">^</span><span class="p">(</span><span class="m">2</span><span class="nv">k</span><span class="o">+</span><span class="m">1</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="m">2</span><span class="nv">k</span><span class="o">+</span><span class="m">1</span><span class="p">)</span><span class="o">!</span><span class="nb">If</span><span class="p">[</span><span class="nv">k</span><span class="o">==</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">,</span><span class="nb">Sum</span><span class="p">[(</span><span class="o">-</span><span class="m">1</span><span class="p">)</span><span class="o">^</span><span class="nv">l</span><span class="w"> </span><span class="nb">Pochhammer</span><span class="p">[</span><span class="m">2</span><span class="nv">k</span><span class="o">+</span><span class="m">1</span><span class="o">,</span><span class="nv">l</span><span class="p">]</span><span class="nb">BellY</span><span class="p">[</span><span class="m">2</span><span class="nv">k</span><span class="o">,</span><span class="nv">l</span><span class="o">,</span><span class="nb">Table</span><span class="p">[</span><span class="nb">If</span><span class="p">[</span><span class="nb">EvenQ</span><span class="p">[</span><span class="nv">j</span><span class="p">]</span><span class="o">,</span><span class="nv">dr</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">j</span><span class="o">/</span><span class="m">2</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="nv">j</span><span class="o">!,</span><span class="m">0</span><span class="p">]</span><span class="o">,</span><span class="p">{</span><span class="nv">j</span><span class="o">,</span><span class="m">1</span><span class="o">,</span><span class="m">2</span><span class="nv">k</span><span class="o">-</span><span class="nv">l</span><span class="o">+</span><span class="m">1</span><span class="p">}]]</span><span class="o">,</span><span class="p">{</span><span class="nv">l</span><span class="o">,</span><span class="m">1</span><span class="o">,</span><span class="m">2</span><span class="nv">k</span><span class="p">}]]</span>
</span><span class="line line-9"><span class="nv">b</span><span class="p">[</span><span class="nv">m</span><span class="o">_,</span><span class="nv">k</span><span class="o">_,</span><span class="nv">R</span><span class="o">_</span><span class="p">]</span><span class="o">:=</span><span class="nv">b</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="o">=</span><span class="nb">If</span><span class="p">[</span><span class="nv">k</span><span class="o">==</span><span class="m">0</span><span class="o">,</span><span class="m">1</span><span class="o">/</span><span class="p">(</span><span class="m">1</span><span class="o">-</span><span class="nv">R</span><span class="p">)</span><span class="o">,-</span><span class="m">1</span><span class="o">/</span><span class="p">(</span><span class="m">1</span><span class="o">-</span><span class="nv">R</span><span class="p">)</span><span class="nb">Sum</span><span class="p">[</span><span class="nv">br</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">l</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="nv">b</span><span class="p">[</span><span class="nv">m</span><span class="o">,</span><span class="nv">k</span><span class="o">-</span><span class="nv">l</span><span class="o">,</span><span class="nv">R</span><span class="p">]</span><span class="o">,</span><span class="p">{</span><span class="nv">l</span><span class="o">,</span><span class="m">1</span><span class="o">,</span><span class="nv">k</span><span class="p">}]]</span>
</span></code></pre></td></tr></tbody></table>
<p class="no-indent">
(The capitalized <code>R</code> is the parameter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span></span> in this article; I have so poor choices of variable names…)
</p>
</details>
<p>The result is shown in the plot below.</p>
<figure>
<img src="/assets/images/figures/2025-04-11-laplacian-annulus/theta-expansion.svg" class="dark-adaptive" alt="Plot of  vs.  with different numbers of terms for , "/>

</figure>
<p class="no-indent">
The black line is the exact function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">m=4</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>=</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>3</mn></mrow><annotation encoding="application/x-tex">r=1/3</annotation></semantics></math></span></span>, and the blue, green, orange, and red lines are the truncated asymptotic series of the inverse function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc z\tht</annotation></semantics></math></span></span> with 1, 2, 3, and 4 terms, respectively. The horizontal grid lines are the integer multiples of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>π</mi></mrow><annotation encoding="application/x-tex">\pi</annotation></semantics></math></span></span>, whose intersections with the black line gives the wanted roots <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub></mrow><annotation encoding="application/x-tex">z_{mn}</annotation></semantics></math></span></span>. To be honest, the result is a bit anticlimactic because it turns out that truncating the series to only the first two terms gives the best approximation. This is within expectation, though, because the asymptotic series is never guaranteed to give better approximations with more terms.
</p>
<h3 data-label="0.2.3" id="the-n0-mode">The <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> mode</h3>
<p>For all the previous plots, I have only shown <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">m=4</annotation></semantics></math></span></span>. For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> being other positive integers, they all look similar, but there is a special feature for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>. To see this, first study the limiting form of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fz</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc gz</annotation></semantics></math></span></span> for small <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>. The limiting forms of the Bessel functions are (<a href="https://dlmf.nist.gov/10.7#i" target="_blank" rel="external">source</a>) <span id="eq:bessel-limiting" data-label="(9)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left right left" columnspacing="0em 1em 0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msubsup><mi>J</mi><mn>0</mn><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>−</mo><mfrac><mi>z</mi><mn>2</mn></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msubsup><mi>J</mi><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mrow><msup><mn>2</mn><mi>m</mi></msup><mrow><mo fence="true">(</mo><mi>m</mi><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo></mrow></mfrac><msup><mi>z</mi><mrow><mi>m</mi><mo>−</mo><mn>1</mn></mrow></msup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msubsup><mi>Y</mi><mn>0</mn><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>2</mn><mrow><mi>π</mi><mi>z</mi></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msubsup><mi>Y</mi><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mrow><msup><mn>2</mn><mi>m</mi></msup><mi>m</mi><mo stretchy="false">!</mo></mrow><mi>π</mi></mfrac><mfrac><mn>1</mn><msup><mi>z</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{J_0'}{z\to0}&amp;=-\fr z2,&amp;
\fc{J_{m&gt;0}'}{z\to0}&amp;=\fr{1}{2^m\p{m-1}!}z^{m-1},\\
\fc{Y_0'}{z\to0}&amp;=\fr2{\pi z},&amp;
\fc{Y_{m&gt;0}'}{z\to0}&amp;=\fr{2^mm!}{\pi}\fr1{z^{m+1}}.
\end{align*}</annotation></semantics></math></span></span></span></span>
<span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>9</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(9)</annotation></semantics></math></span></span></span></span> </span></span> We can then get <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mn>4</mn><mrow><msup><mi>π</mi><mn>2</mn></msup><mi>r</mi><msup><mi>z</mi><mn>2</mn></msup></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mn>1</mn><msup><mi>r</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mn>2</mn><mi>m</mi></msup><mi>m</mi><mo stretchy="false">!</mo></mrow><mi>π</mi></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mfrac><mn>1</mn><msup><mi>z</mi><mrow><mn>2</mn><mi>m</mi><mo>+</mo><mn>2</mn></mrow></msup></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><mn>1</mn><mo>−</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><mrow><mi>π</mi><mi>r</mi></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mi>m</mi><mi>π</mi></mfrac><mrow><mo fence="true">(</mo><msup><mi>r</mi><mrow><mi>m</mi><mo>−</mo><mn>1</mn></mrow></msup><mo>−</mo><mfrac><mn>1</mn><msup><mi>r</mi><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mfrac><mn>1</mn><msup><mi>z</mi><mn>2</mn></msup></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>&gt;</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable></mrow></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc f{z\to0}&amp;=\begin{dcases}
\fr4{\pi^2rz^2},&amp;m=0,\\
\fr1{r^{m+1}}\p{\fr{2^mm!}\pi}^2\fr1{z^{2m+2}},&amp;m&gt;0,
\end{dcases}\\
\fc g{z\to0}&amp;=\begin{dcases}
\fr{1-r^2}{\pi r},&amp;m=0,\\
\fr m\pi\p{r^{m-1}-\fr1{r^{m+1}}}\fr1{z^2},&amp;m&gt;0.
\end{dcases}
\end{align*}</annotation></semantics></math></span></span></span>
From this, we can get the limiting form of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><mi>π</mi><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><msup><mi>r</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><mn>4</mn></mfrac><msup><mi>z</mi><mn>2</mn></msup><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo>−</mo><mfrac><mrow><mi>π</mi><mi>m</mi><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><msup><mi>r</mi><mrow><mn>2</mn><mi>m</mi></mrow></msup><mo fence="true">)</mo></mrow></mrow><msup><mrow><mo fence="true">(</mo><mi>m</mi><mo stretchy="false">!</mo><msup><mn>2</mn><mi>m</mi></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mfrac><msup><mi>z</mi><mrow><mn>2</mn><mi>m</mi></mrow></msup><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>&gt;</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">\fc\tht{z\to0}=\begin{dcases}
\fr{\pi\p{1-r^2}}4z^2,&amp;m=0,\\
-\fr{\pi m\p{1-r^{2m}}}{\p{m!2^m}^2}z^{2m},&amp;m&gt;0.
\end{dcases}</annotation></semantics></math></span></span></span> The particularly interesting thing to note is the negative sign for the case of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m&gt;0</annotation></semantics></math></span></span>. Remember that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">\fc\tht{z\to\infty}=\p{1-r}z</annotation></semantics></math></span></span>, which is a positive thing, we would conclude that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> would become zero for some positive <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m&gt;0</annotation></semantics></math></span></span>, while that may not be the case for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>. Indeed, there is no positive <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\tht z=0</annotation></semantics></math></span></span> if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>, as we can see from the plot below.</p>
<figure>
<img src="/assets/images/figures/2025-04-11-laplacian-annulus/n-zero-mode-existence.svg" class="dark-adaptive" alt="Plot of  for  and ."/>

</figure>
<p class="no-indent">
The red line is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">m=1</annotation></semantics></math></span></span>, which we can see that crosses the horizontal axis, while the blue line is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>, which does not cross the horizontal axis. The more lightly colored lines are the limiting forms of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> for small <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>.
</p>
<p>The implication is that the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> mode would not exist for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span> but exist for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m&gt;0</annotation></semantics></math></span></span>. However, traditionally, when people talk about eigenmodes of the Laplacian, the quantum number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> refers to the 1-based numbering of the roots of the Bessel functions (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi></mrow><annotation encoding="application/x-tex">g</annotation></semantics></math></span></span> in our case). This would mean that what is referred to as the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>m</mi><mo>&gt;</mo><mn>0</mn><mo separator="true">,</mo><mi>n</mi><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{m&gt;0,n}</annotation></semantics></math></span></span> mode in this article would be traditionally called the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>m</mi><mo>&gt;</mo><mn>0</mn><mo separator="true">,</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{m&gt;0,n+1}</annotation></semantics></math></span></span> mode, while the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mi>n</mi><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{m=0,n}</annotation></semantics></math></span></span> mode in this article is the same as what is traditionally called. In other words, the traditional names of the modes for different values of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo separator="true">,</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">m,n</annotation></semantics></math></span></span> are
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.16em" columnalign="right center center center center" columnlines="solid none none none" columnspacing="1em" rowlines="solid none none none"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>2</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mo lspace="0em" rspace="0em">⋯</mo></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo fence="true">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>0</mn><mo separator="true">,</mo><mn>2</mn><mo fence="true">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>1</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>1</mn><mo separator="true">,</mo><mn>1</mn><mo fence="true">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo fence="true">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>1</mn><mo separator="true">,</mo><mn>3</mn><mo fence="true">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mn>2</mn></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>2</mn><mo separator="true">,</mo><mn>1</mn><mo fence="true">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>2</mn><mo separator="true">,</mo><mn>2</mn><mo fence="true">)</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mo fence="true">(</mo><mn>2</mn><mo separator="true">,</mo><mn>3</mn><mo fence="true">)</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mi><mi mathvariant="normal">⋮</mi><mpadded height="0em" voffset="0em"><mspace mathbackground="black" width="0em" height="1.5em"/></mpadded></mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="false"><mo lspace="0em" rspace="0em">⋱</mo></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{array}{r|cccc}
&amp;n=0&amp;1&amp;2&amp;\cdots\\
\hline
m=0&amp;&amp;\p{0,1}&amp;\p{0,2}\\
1&amp;\p{1,1}&amp;\p{1,2}&amp;\p{1,3}\\
2&amp;\p{2,1}&amp;\p{2,2}&amp;\p{2,3}\\
\vdots&amp;&amp;&amp;&amp;\ddots
\end{array}</annotation></semantics></math></span></span></span></p>
<p>Another way to see this is that, according to Equation <a href="#eq:bessel-as-kummer-solutions">7</a>, in order for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{J_m'}z</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{Y_m'}z</annotation></semantics></math></span></span> to be real-valued, whenever <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{\alp'}z&lt;0</annotation></semantics></math></span></span>, we would need <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc pz</annotation></semantics></math></span></span> to be purely imaginary, and vice versa. From Equation <a href="#eq:p-and-q">6</a>, we can see that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc pz</annotation></semantics></math></span></span> is real when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>≥</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z\ge m</annotation></semantics></math></span></span>, and it is purely imaginary when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>&lt;</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z&lt;m</annotation></semantics></math></span></span>. Therefore, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>α</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\alp'}z</annotation></semantics></math></span></span> goes from negative to positive when
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> crosses <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>. This means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp z</annotation></semantics></math></span></span> is monotonically decreasing when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>&lt;</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z&lt;m</annotation></semantics></math></span></span> but monotonically increasing when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>&gt;</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z&gt;m</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>=</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z=m</annotation></semantics></math></span></span> is the minimum. This means that <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>r</mi><mi>z</mi><mo>&lt;</mo><mi>z</mi><mo>&lt;</mo><mi>m</mi><mtext>  </mtext><mo>⟹</mo><mtext>  </mtext><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>&gt;</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">rz&lt;z&lt;m\implies\fc\alp{rz}&gt;\fc\alp z,</annotation></semantics></math></span></span></span> which means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>&lt;</mo><mi>m</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\tht{z&lt;m}&lt;0</annotation></semantics></math></span></span>. This means that when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m&gt;0</annotation></semantics></math></span></span>, the root
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">z_{m0}</annotation></semantics></math></span></span> must exist, and we also get a lower bound <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub><mo>&gt;</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z_{m0}&gt;m</annotation></semantics></math></span></span>. However, when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\alp z</annotation></semantics></math></span></span> would be monotonically increasing for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>, and thus <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z</annotation></semantics></math></span></span> would be positive for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>, which means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mn>00</mn></msub></mrow><annotation encoding="application/x-tex">z_{00}</annotation></semantics></math></span></span> does not exist. By a similar method, we can also derive an upper bound for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">z_{m0}</annotation></semantics></math></span></span>. We have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>m</mi><mo>&lt;</mo><mi>r</mi><mi>z</mi><mo>&lt;</mo><mi>z</mi><mtext>  </mtext><mo>⟹</mo><mtext>  </mtext><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>&lt;</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">m&lt;rz&lt;z\implies\fc\alp{rz}&lt;\fc\alp z,</annotation></semantics></math></span></span></span> which means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>&gt;</mo><mi>m</mi><mi mathvariant="normal">/</mi><mi>r</mi><mo fence="true">)</mo></mrow><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\tht{z&gt;m/r}&gt;0</annotation></semantics></math></span></span>. This means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub><mo>&lt;</mo><mi>m</mi><mi mathvariant="normal">/</mi><mi>r</mi></mrow><annotation encoding="application/x-tex">z_{m0}&lt;m/r</annotation></semantics></math></span></span>. This also implies the nonexistence of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mn>00</mn></msub></mrow><annotation encoding="application/x-tex">z_{00}</annotation></semantics></math></span></span>.</p>
<p>Maybe we can still formally define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mn>00</mn></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">z_{00}=0</annotation></semantics></math></span></span>, and the eigenfunction would be the trivial <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Φ</mi><mn>00</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">t</mi></mrow></mrow><annotation encoding="application/x-tex">\fc{\Phi_{00}}{\rho,\vphi}=\mrm{const}</annotation></semantics></math></span></span> with a zero eigenvalue.</p>
<h3 data-label="0.2.4" id="numerical-root-finding">Numerical root-finding</h3>
<p>A key thing to note about the asymptotic series truncated to the first two terms is that it is impossible to get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> values smaller than a certain bound: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>z</mi><mrow><mi mathvariant="normal">t</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">c</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>θ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mi>θ</mi><mrow><mn>1</mn><mo>−</mo><mi>r</mi></mrow></mfrac><mo>+</mo><mfrac><mrow><mrow><mo fence="true">(</mo><mn>4</mn><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><mn>3</mn><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow></mrow><mrow><mn>8</mn><mi>r</mi><mi>θ</mi></mrow></mfrac><mo>≥</mo><msup><mi>z</mi><mo>∗</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><msqrt><mfrac><mrow><mn>4</mn><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><mn>3</mn></mrow><mrow><mn>2</mn><mi>r</mi></mrow></mfrac></msqrt><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{z_\mrm{trunc}}\tht=\fr{\tht}{1-r}+\fr{\p{4m^2+3}\p{1-r}}{8r\tht}
\ge z^*\ceq\sqrt{\fr{4m^2+3}{2r}},</annotation></semantics></math></span></span></span> where the equality holds when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mo>=</mo><msup><mi>θ</mi><mo>∗</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><msqrt><mrow><mrow><mo fence="true">(</mo><mn>4</mn><msup><mi>m</mi><mn>2</mn></msup><mo>+</mo><mn>3</mn><mo fence="true">)</mo></mrow><mi mathvariant="normal">/</mi><mn>8</mn><mi>r</mi></mrow></msqrt></mrow><annotation encoding="application/x-tex">\tht=\tht^*\ceq\p{1-r}\sqrt{\p{4m^2+3}/8r}</annotation></semantics></math></span></span>. This means that if we use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow></msub><mo>≈</mo><msub><mi>z</mi><mrow><mi mathvariant="normal">t</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">c</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mi>π</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">z_{mn}\approx\fc{z_\mrm{trunc}}{n\pi}</annotation></semantics></math></span></span> to approximate the roots, we will miss all the roots with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>&lt;</mo><msup><mi>z</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">z&lt;z^*</annotation></semantics></math></span></span>. The number of missed roots is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>n</mi><mo>∗</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌈</mo><msup><mi>θ</mi><mo>∗</mo></msup><mi mathvariant="normal">/</mi><mi>π</mi><mo fence="true">⌉</mo></mrow></mrow><annotation encoding="application/x-tex">n^*\ceq\ceil{\tht^*/\pi}</annotation></semantics></math></span></span> (this includes the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> mode, so for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>, the number of missed roots is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>n</mi><mo>∗</mo></msup><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">n^*-1</annotation></semantics></math></span></span>). According to the bound on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">z_{m0}</annotation></semantics></math></span></span> we derived in the previous section, all the missing roots are in the interval
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><msup><mi>z</mi><mo>∗</mo></msup><mo separator="true">,</mo><mi>m</mi><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{z^*,m}</annotation></semantics></math></span></span>. In order to numerically find those roots, we can equispacedly sample more than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>n</mi><mo>∗</mo></msup></mrow><annotation encoding="application/x-tex">n^*</annotation></semantics></math></span></span> points (maybe <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3</mn><mrow><mo fence="true">(</mo><msup><mi>n</mi><mo>∗</mo></msup><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">3\p{n^*+1}</annotation></semantics></math></span></span> points to be safe) in the interval as initial guesses and use usual root-finding methods such as Newton’s method to find the roots.</p>
<h2 data-label="0.3" id="limiting-cases">Limiting cases</h2>
<h3 data-label="0.3.1" id="the-disk-limit">The disk limit</h3>
<p>When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>→</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">r\to0</annotation></semantics></math></span></span>, the annulus becomes a disk. We will see how the eigenmodes tend to the eigenmodes on a disk, which are given by <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi mathvariant="normal">Φ</mi><mrow><mi>m</mi><mi>n</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">k</mi></mrow></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msubsup><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">k</mi></mrow></msubsup><mi>ρ</mi><mi mathvariant="normal">/</mi><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>m</mi><mi>φ</mi></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{\Phi_{mn}^{\mrm{disk}}}{\rho,\vphi}
=\fc{J_m}{z_{mn}^\mrm{disk}\rho/R_\mrm{out}}\e^{\i m\vphi},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>z</mi><mrow><mi>m</mi><mi>n</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">z_{mn}^\mrm{disk}</annotation></semantics></math></span></span> are the roots of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">J_m'</annotation></semantics></math></span></span>.</p>
<p>In this case, we can regard <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mi>z</mi></mrow><annotation encoding="application/x-tex">rz</annotation></semantics></math></span></span> as small, so using Equation <a href="#eq:bessel-limiting">9</a> gives <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mn>2</mn><mrow><mi>π</mi><mi>r</mi><mi>z</mi></mrow></mfrac><msubsup><mi>Y</mi><mn>0</mn><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><msup><mn>2</mn><mi>m</mi></msup><mi>m</mi><mo stretchy="false">!</mo></mrow><mrow><mi>π</mi><msup><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msup></mrow></mfrac><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable></mrow><mspace width="1em"/><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo>−</mo><mfrac><mn>2</mn><mrow><mi>π</mi><mi>r</mi><mi>z</mi></mrow></mfrac><msubsup><mi>J</mi><mn>0</mn><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo>−</mo><mfrac><mrow><msup><mn>2</mn><mi>m</mi></msup><mi>m</mi><mo stretchy="false">!</mo></mrow><mrow><mi>π</mi><msup><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mrow><mi>m</mi><mo>+</mo><mn>1</mn></mrow></msup></mrow></mfrac><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>&gt;</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">\fc fz=\begin{dcases}
\fr2{\pi rz}\fc{Y_0'}z,&amp;m=0,\\
\fr{2^mm!}{\pi\p{rz}^{m+1}}\fc{Y_m'}z,&amp;m&gt;0,
\end{dcases}\quad
\fc gz=\begin{dcases}
-\fr2{\pi rz}\fc{J_0'}z,&amp;m=0,\\
-\fr{2^mm!}{\pi\p{rz}^{m+1}}\fc{J_m'}z,&amp;m&gt;0.
\end{dcases}</annotation></semantics></math></span></span></span>
This means that <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>tan</mi><mo>⁡</mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mfrac><mrow><mo>−</mo><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><mrow><msubsup><mi>Y</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mi>tan</mi><mo>⁡</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\tan\fc\tht z=\fr{\fc gz}{\fc fz}=\fr{-\fc{J_m'}z}{\fc{Y_m'}z}=\tan\fc\alp z,</annotation></semantics></math></span></span></span> or just <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z=\fc\alp z</annotation></semantics></math></span></span>. We can also see this by noting that
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\alp{rz}=0</annotation></semantics></math></span></span> when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">r=0</annotation></semantics></math></span></span>, so <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\tht z=\fc\alp z-\fc\alp{rz}=\fc\alp z</annotation></semantics></math></span></span>. Therefore, the solutions to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>n</mi><mi>π</mi></mrow><annotation encoding="application/x-tex">\fc\tht z=n\pi</annotation></semantics></math></span></span> would just be the solutions to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>n</mi><mi>π</mi></mrow><annotation encoding="application/x-tex">\fc\alp z=n\pi</annotation></semantics></math></span></span>, which are just roots of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>J</mi><mi>m</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">J_m'</annotation></semantics></math></span></span>. This hence recovers the eigenmodes on a disk.</p>
<h3 data-label="0.3.2" id="the-circle-limit">The circle limit</h3>
<p>When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>→</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">r\to1</annotation></semantics></math></span></span>, the annulus becomes a circle. In this case, we can suppress the radial dimension to make the problem one-dimensional. The eigenmodes would be <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi mathvariant="normal">Φ</mi><mi>m</mi><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">c</mi><mi mathvariant="normal">l</mi><mi mathvariant="normal">e</mi></mrow></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>m</mi><mi>φ</mi></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{\Phi_m^\mrm{circle}}{\vphi}=\e^{\i m\vphi},</annotation></semantics></math></span></span></span> and the eigenvalues are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>λ</mi><mi>m</mi><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">c</mi><mi mathvariant="normal">l</mi><mi mathvariant="normal">e</mi></mrow></msubsup><mo>=</mo><mo>−</mo><msup><mi>m</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><msup><mi>R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\lmd^\mrm{circle}_m=-m^2/R^2</annotation></semantics></math></span></span> (no need to distinguish between <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mrow><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi></mrow></msub></mrow><annotation encoding="application/x-tex">R_\mrm{in}</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub></mrow><annotation encoding="application/x-tex">R_\mrm{out}</annotation></semantics></math></span></span> here).</p>
<p>This case is interesting in that the radial dimension would become “invisible” from the physics of the system. Note that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>r</mi><mo fence="true">)</mo></mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">\fc\tht{z\to\infty}=\p{1-r}z</annotation></semantics></math></span></span> would be a very flat line, which means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> would need to increase by a very large amount in order to get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> to increase by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>π</mi></mrow><annotation encoding="application/x-tex">\pi</annotation></semantics></math></span></span>. Therefore, the radial quantum number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> would be very hard to increase. Formally, the eigenvalues of the modes with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n&gt;0</annotation></semantics></math></span></span> will become infinite, so we then practically only need to consider <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> for the “low-energy description” of the system.</p>
<p>We have previously derived the lower bound and upper bound for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">z_{m0}</annotation></semantics></math></span></span>, which gives <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub><mo>∈</mo><mrow><mo fence="true">(</mo><mi>m</mi><mo separator="true">,</mo><mi>m</mi><mi mathvariant="normal">/</mi><mi>r</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">z_{m0}\in\p{m,m/r}</annotation></semantics></math></span></span>. When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>→</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">r\to1</annotation></semantics></math></span></span>, we then get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub><mo>=</mo><mi>m</mi></mrow><annotation encoding="application/x-tex">z_{m0}=m</annotation></semantics></math></span></span> by the squeeze theorem. The eigenvalue of the Laplacian is then
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>λ</mi><mrow><mi>m</mi><mn>0</mn></mrow></msub><mo>=</mo><mo>−</mo><msubsup><mi>z</mi><mrow><mi>m</mi><mn>0</mn></mrow><mn>2</mn></msubsup><mi mathvariant="normal">/</mi><msup><mi>R</mi><mn>2</mn></msup><mo>=</mo><mo>−</mo><msup><mi>m</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><msup><mi>R</mi><mn>2</mn></msup><mo>=</mo><msubsup><mi>λ</mi><mi>m</mi><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">r</mi><mi mathvariant="normal">c</mi><mi mathvariant="normal">l</mi><mi mathvariant="normal">e</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\lmd_{m0}=-z_{m0}^2/R^2=-m^2/R^2=\lmd^\mrm{circle}_m</annotation></semantics></math></span></span>.</p>
<p>For the case of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span>, there are two ways to look at it. If we do not regard the trivial mode <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Φ</mi><mn>0</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">t</mi></mrow></mrow><annotation encoding="application/x-tex">\fc{\Phi_0}{\vphi}=\mrm{const}</annotation></semantics></math></span></span> as a mode, then we can say that the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span> mode does not exist on a circle, which fits nicely with the fact that the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> mode does not exist for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span> in the annulus. With the other way, if we regard the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> mode on the annulus as the trivial mode <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Φ</mi><mn>00</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">t</mi></mrow></mrow><annotation encoding="application/x-tex">\fc{\Phi_{00}}{\rho,\vphi}=\mrm{const}</annotation></semantics></math></span></span>, then it also nicely tends to the trivial mode <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m=0</annotation></semantics></math></span></span> on the circle in the limit <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>→</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">r\to1</annotation></semantics></math></span></span>.</p>
<h3 data-label="0.3.3" id="the-homogeneous-dirichlet-boundary-condition">The homogeneous Dirichlet boundary condition</h3>
<p>So far I only talked about the homogeneous Neumann boundary condition. In the case of homogeneous Dirichlet boundary condition <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo>=</mo><msub><mi>R</mi><mrow><mi mathvariant="normal">i</mi><mi mathvariant="normal">n</mi></mrow></msub><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi mathvariant="normal">Φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ρ</mi><mo>=</mo><msub><mi>R</mi><mrow><mi mathvariant="normal">o</mi><mi mathvariant="normal">u</mi><mi mathvariant="normal">t</mi></mrow></msub><mo separator="true">,</mo><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc\Phi{\rho=R_\mrm{in},\vphi}=\fc\Phi{\rho=R_\mrm{out},\vphi}=0,</annotation></semantics></math></span></span></span> most of the derivation is the same, but with <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>+</mo><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mi>g</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>−</mo><msub><mi>Y</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>r</mi><mi>z</mi><mo fence="true">)</mo></mrow><msub><mi>J</mi><mi>m</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc fz\ceq\fc{J_m}{rz}\fc{Y_m}z+\fc{Y_m}{rz}\fc{J_m}z,\quad
\fc gz\ceq\fc{J_m}{rz}\fc{Y_m}z-\fc{Y_m}{rz}\fc{J_m}z.</annotation></semantics></math></span></span></span></p>
<p>There is a qualitative difference from the Neumann case, though, which comes from the limiting behavior of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc \tht{z\to0}</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo>→</mo><mn>0</mn><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><mi>π</mi><mi>ln</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>1</mn><mi mathvariant="normal">/</mi><mi>r</mi><mo fence="true">)</mo></mrow></mrow><mrow><mn>2</mn><mi>ln</mi><mo>⁡</mo><mi>r</mi><mi>z</mi><mi>ln</mi><mo>⁡</mo><mi>z</mi></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><mi>π</mi><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><msup><mi>r</mi><mrow><mn>2</mn><mi>m</mi></mrow></msup><mo fence="true">)</mo></mrow></mrow><mrow><msup><mn>4</mn><mi>m</mi></msup><mi>m</mi><mo stretchy="false">!</mo><mrow><mo fence="true">(</mo><mi>m</mi><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo stretchy="false">!</mo></mrow></mfrac><msup><mi>z</mi><mrow><mn>2</mn><mi>m</mi></mrow></msup><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mo>&gt;</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">\fc\tht{z\to0}=\begin{dcases}
\fr{\pi\fc\ln{1/r}}{2\ln rz\ln z},&amp;m=0,\\
\fr{\pi\p{1-r^{2m}}}{4^mm!\p{m-1}!}z^{2m},&amp;m&gt;0.
\end{dcases}</annotation></semantics></math></span></span></span> We can see that they are positive in both cases, which means that
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc\tht z=0</annotation></semantics></math></span></span> does not have a positive solution in both cases. Therefore, the radial modes start at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">n=1</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span> (in contrast to the Neumann case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> mode exists for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">m&gt;0</annotation></semantics></math></span></span>). The traditional naming of the eigenmodes then agrees with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>m</mi><mo separator="true">,</mo><mi>n</mi><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{m,n}</annotation></semantics></math></span></span>.</p>
<p>An implication of the difference is that there is no longer a non-trivial circle limit. This is because the eigenvalue of any mode with positive <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> would tend to infinity as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi><mo>→</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">r\to1</annotation></semantics></math></span></span>.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="math" /><category term="mathematical physics" /><category term="pde" /><category term="ode" /><category term="long paper" /><summary type="html"><![CDATA[Several features of the eigenfunctions of the Laplacian on an annulus with homogeneous Neumann boundary condition are discussed. The distribution of the eigenvalues is discussed in detail, making use of a phase angle function called <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span>. The limiting cases of a disk and a circle are discussed.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-04-11-laplacian-annulus.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-04-11-laplacian-annulus.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[The role of particle indistinguishability in statistical mechanics]]></title><link href="https://ulysseszh.github.io/physics/2025/03/03/indistinguishability.html" rel="alternate" type="text/html" title="The role of particle indistinguishability in statistical mechanics" /><published>2025-03-03T22:53:47-08:00</published><updated>2025-03-03T22:53:47-08:00</updated><id>https://ulysseszh.github.io/physics/2025/03/03/indistinguishability</id><content type="html" xml:base="https://ulysseszh.github.io/physics/2025/03/03/indistinguishability.html"><![CDATA[<h2 data-label="0.1" id="classical-vs.-quantum-statistical-mechanics">Classical vs. quantum statistical mechanics</h2>
<p>Previously, I have written two blog articles (<a href="/physics/2023/03/30/measure-ensemble.html">part 1</a> about thermal ensembles and <a href="/physics/2023/05/01/measure-ensemble-2.html">part 2</a> about non-thermal ensembles) about a formalism of statistical ensembles. I will be using it as the formalism of classical statistical mechanics in this article.</p>
<p>In that formalism, the space of microstates of a system is a measure space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span>, and the physical meaning of the measure is the number of microstates. A macrostate is described by the extensive quantities, which are a function of the microstate, so designating a macrostate restricts the microstates that can realize it to a subset of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span>.</p>
<p>A state of the system is a probability density function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span>, whose physical meaning is an ensemble of microstates. The macroscopically measured extensive quantities of the system are defined to be the ensemble average, i.e., the measured value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>:</mo><mi mathvariant="script">M</mi><mo>→</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">A:\mcal M\to\bR</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∫</mo><mi mathvariant="script">M</mi></msub><mi>p</mi><mi>A</mi></mrow><annotation encoding="application/x-tex">\int_{\mcal M}pA</annotation></semantics></math></span></span>. Generally, any probability density function is a perfectly valid state, but the most important ones are those that are thermal equilibrium states, including the microcanonical ensembles, the thermal ensembles, and the non-thermal ensembles. The term about an ensemble being thermal or non-thermal is made up by me, but for most practical reasons, we only need to focus on thermal ensembles (because both canonical ensembles and grand canonical ensembles are thermal ensembles).</p>
<p>To avoid subtleties about measure theory and topology, in this article, we will only use counting measure and discrete spaces for the space of microstates and the space of extensive quantities.</p>
<details>
<summary>
Possible confusion of macrostate vs. state and an example
</summary>
<p>In this article, a <dfn>macrostate</dfn> is a tuple of extensive quantities (usually the energy, the volume, and the number of particles) that constrain the microstates. In classical statistical mechanics, every microstate has a definite macrostate. Technically, any function on the microstates may be defined as the macrostates of the system (as long as it meets some measure-theoretic requirements).</p>
<p>On the other hand, a <dfn>state</dfn> is an ensemble of microstates. In classical statistical mechanics, it is a probability distribution on the microstates. Any probability density function on the microstates is a state state of the system.</p>
<p>These two concepts are clearly distinct in the context of this article, but they are often confused in the literature.</p>
<p>For example, consider the system <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi><mo>=</mo><mrow><mo fence="true">{</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo separator="true">,</mo><mn>3</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\mcal M=\B{0,1,2,3}</annotation></semantics></math></span></span>, and it has three different macrostates <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi><mo>=</mo><mrow><mo fence="true">{</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">E=\B{0,1,2}</annotation></semantics></math></span></span>. Then, we can define the set of microstates that realize the macrostate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> to be <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mn>0</mn></msub><mo>=</mo><mrow><mo fence="true">{</mo><mn>0</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">M_0=\B{0}</annotation></semantics></math></span></span>, and similarly we can define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mn>1</mn></msub><mo>=</mo><mrow><mo fence="true">{</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">M_1=\B{1,2}</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mn>2</mn></msub><mo>=</mo><mrow><mo fence="true">{</mo><mn>3</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">M_2=\B{3}</annotation></semantics></math></span></span>. We then finished defining the macrostates of the system.</p>
<p>Now, let’s see what states we can define. Despite that the system has only <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn></mrow><annotation encoding="application/x-tex">4</annotation></semantics></math></span></span> different microstates, it has infinitely many states because any probability distribution on the microstates is a state, which may be specified by the probabilities <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub><mo separator="true">,</mo><msub><mi>p</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>p</mi><mn>2</mn></msub><mo separator="true">,</mo><msub><mi>p</mi><mn>3</mn></msub></mrow><annotation encoding="application/x-tex">p_0,p_1,p_2,p_3</annotation></semantics></math></span></span> that sum to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>, each representing the probability of the corresponding microstate. For example, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mn>1</mn></msub><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><msub><mi>p</mi><mn>3</mn></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">p_0=\fr12,\quad p_1=\fr12,\quad p_2=p_3=0</annotation></semantics></math></span></span></span> is a perfectly valid state of the system. However, to find the
thermal equilibrium state for a certain macrostate, we can use the equal <em>a priori</em> probability principle to find the microcanonical ensemble. For example, the microcanonical ensemble for the macrostate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub><mo>=</mo><mn>1</mn><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mn>1</mn></msub><mo>=</mo><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><msub><mi>p</mi><mn>3</mn></msub><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">p_0=1,\quad p_1=p_2=p_3=0,</annotation></semantics></math></span></span></span> and the microcanonical ensemble for the macrostate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>p</mi><mn>1</mn></msub><mo>=</mo><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mn>0</mn></msub><mo>=</mo><msub><mi>p</mi><mn>3</mn></msub><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">p_1=p_2=\fr12,\quad p_0=p_3=0.</annotation></semantics></math></span></span></span></p>
<p>Now let’s consider <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> as a subset of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">\bR</annotation></semantics></math></span></span> so that we can do arithmetics on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> (of course it is called extensive quantities for a reason). We can then define a thermal ensemble given the intensive variables, say, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>p</mi><mn>0</mn></msub><mo>=</mo><mfrac><mn>1</mn><mi>Z</mi></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mn>1</mn></msub><mo>=</mo><msub><mi>p</mi><mn>2</mn></msub><mo>=</mo><mfrac><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mi>Z</mi></mfrac><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mn>3</mn></msub><mo>=</mo><mfrac><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>2</mn></mrow></msup><mi>Z</mi></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">p_0=\fr{1}{Z},\quad p_1=p_2=\fr{\e^{-1}}{Z},\quad p_3=\fr{\e^{-2}}{Z},</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo>=</mo><mn>1</mn><mo>+</mo><mn>2</mn><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mo>+</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">Z=1+2\e^{-1}+\e^{-2}</annotation></semantics></math></span></span> is the partition function.</p>
I would like to give an example of a non-thermal ensemble, but it is only non-trivially defined if the space of extensive quantities is at least two-dimensional (i.e. if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> lives on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\bR^2</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">\bR</annotation></semantics></math></span></span>), so I will omit it here.
</details>
<p>However, in quantum mechanics, things get different because of the introduction of superpositions of states. For the superpositions to make sense, the space of microstates must be endowed with a vector space structure. By principles in quantum mechanics, it is the projective space of a separable Hilbert space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span>. A state of the system is then a density operator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span>, which can be any positive semi-definite self-adjoint operator with trace <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>. This is quite different from a state in the classical case because we cannot simply interpret a density operator as an ensemble of microstates. Generally, we can have different ensembles that realize the same density operator. All those different ensembles are just equally physically valid (without further contexts) due to the <a href="https://en.wikipedia.org/wiki/Schr%C3%B6dinger%E2%80%93HJW_theorem" target="_blank" rel="external">Schrödinger–HJW theorem</a>.</p>
<p>Extensive quantities are self-adjoint operators on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span>. This leads to a key difference between classical and quantum statistical mechanics: in quantum statistical mechanics, a microstate generally does not have a definite macrostate, except for the case when it is an eigenstate of all the extensive quantities. However, we can still define macroscopically measured extensive quantities for any state of the system, being <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Tr</mi><mo>⁡</mo><mi>ρ</mi><mi>A</mi></mrow><annotation encoding="application/x-tex">\Tr\rho A</annotation></semantics></math></span></span> for any self-adjoint operator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span>.</p>
<p>The fact that only the states in the eigenspace of all the extensive quantities have a definite macrostate imposes a challenge on defining the microcanonical ensemble (to clarify, I am referring to the density operator, which does not define a particular ensemble, but I am still using “microcanonical ensemble” to refer to that state). It may not be possible to define a microcanonical ensemble for every possible combinations of values of the extensive quantities (in their spectra). In practice, one would restrict to only consider mutually commuting operators as the extensive quantities. Then, the microcanonical ensemble density operator is the projection operator onto the common eigenspace (properly normalized to have trace <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>). The statistical mechanics is then actually equivalent to the classical statistical mechanics (namely taking the eigenbasis of the extensive quantities as the classical space of microstates)! Unfortunately, this is not the way typically used in practice because it is not always practical to find the eigenbasis.</p>
<p>To avoid mathematical subtleties, we will mostly only consider finite-dimensional Hilbert spaces.</p>
<p>Here is a summary table:</p>
<table>
<thead>
<tr>
<th/>
<th>Classical</th>
<th>Quantum</th>
</tr>
</thead>
<tbody>
<tr>
<td>Space of microstates</td>
<td>Measure space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span></td>
<td>Projective space of a separable Hilbert space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span></td>
</tr>
<tr>
<td>State</td>
<td>Probability density function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi></mrow><annotation encoding="application/x-tex">p</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span></td>
<td>Density operator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span></td>
</tr>
<tr>
<td>Extensive quantities</td>
<td>Functions on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span></td>
<td>Self-adjoint operators on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span></td>
</tr>
<tr>
<td>Measured value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span></td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∫</mo><mi mathvariant="script">M</mi></msub><mi>p</mi><mi>A</mi></mrow><annotation encoding="application/x-tex">\int_{\mcal M}pA</annotation></semantics></math></span></span></td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Tr</mi><mo>⁡</mo><mi>ρ</mi><mi>A</mi></mrow><annotation encoding="application/x-tex">\Tr\rho A</annotation></semantics></math></span></span></td>
</tr>
</tbody>
</table>
<h2 data-label="0.2" id="many-body-systems">Many-body systems</h2>
<p>We then want to ask: if the space of microstates for one particle is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span> (or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span>), what is the space of microstates for many particles? The answer depends on whether the particles are distinguishable particles, indistinguishable fermions, or indistinguishable bosons.</p>
<p>There are two aspects in which fermions and bosons contrasts with each other. One is their symmetry properties: fermions are antisymmetric under exchange of particles, and bosons are symmetric. The other is their statistical properties: fermions obey the Pauli exclusion principle, and the bosons do not. The second property naturally leads us to work with Fock states, which can be derived from the first property after second quantization. In this article, a third kind of particles, distinguishable particles, will also be considered. They are neither symmetric nor antisymmetric under exchange of particles, but exchanging particles actually gives a new state.</p>
<p>The whole idea of these different kinds of particles is very easy to describe in quantum mechanics. If the microstates of each particle live on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi></mrow><annotation encoding="application/x-tex">\mcal H</annotation></semantics></math></span></span>, then the microstates of many distinguishable particles live on the <a href="https://en.wikipedia.org/wiki/Tensor_algebra" target="_blank" rel="external">tensor algebra</a> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi mathvariant="script">H</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc T{\mcal H}</annotation></semantics></math></span></span>; those of many bosons live on the <a href="https://en.wikipedia.org/wiki/Symmetric_algebra" target="_blank" rel="external">symmetric algebra</a> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi mathvariant="script">H</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc S{\mcal H}</annotation></semantics></math></span></span>; and those of many fermions live on the <a href="https://en.wikipedia.org/wiki/Exterior_algebra" target="_blank" rel="external">exterior algebra</a> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>⋀</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi mathvariant="script">H</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\bigwedge{\mcal H}</annotation></semantics></math></span></span>. Those spaces are called Fock spaces. They are naturally <a href="https://en.wikipedia.org/wiki/Graded_ring#Graded_algebra" target="_blank" rel="external">graded</a>, so the particle number operator can be defined by defining the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>-grade subspace of the Fock space to be the eigenspace associated with the eigenvalue <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>.</p>
<p>Taking ideas from the Fock basis in quantum mechanics, we can similarly discuss those different kinds of particles in classical statistical mechanics. If the microstates of each particle are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span>, then the microstates of many distinguishable particles are tuples <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>⋃</mo><mrow><mi>N</mi><mo>∈</mo><mi mathvariant="double-struck">N</mi></mrow></msub><msup><mi mathvariant="script">M</mi><mi>N</mi></msup></mrow><annotation encoding="application/x-tex">\bigcup_{N\in\bN}\mcal M^N</annotation></semantics></math></span></span>; those of many bosons are finite <a href="https://en.wikipedia.org/wiki/Multiset#Basic_properties_and_operations" target="_blank" rel="external">multisets</a> in the universe <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span>, i.e., <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><mi>m</mi><mo>:</mo><mi mathvariant="script">M</mi><mo>→</mo><mi mathvariant="double-struck">N</mi><mtext>  </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext>  </mtext><mo>∑</mo><mi>m</mi><mo>&lt;</mo><mi mathvariant="normal">∞</mi><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\set{m:\mcal M\to\bN}{\sum m&lt;\infty}</annotation></semantics></math></span></span>; and those of many fermions are finite subsets of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span>, i.e., <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="script">P</mi><mrow><mo>&lt;</mo><msub><mi mathvariant="normal">ℵ</mi><mn>0</mn></msub></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi mathvariant="script">M</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\mcal P_{&lt;\aleph_0}}{\mcal M}</annotation></semantics></math></span></span>. Those concepts, namely tuple, multiset, and set, are actually common mathematical constructs used in combinatorics. They all have a natural notion of size, which we define the number of particles to be.</p>
<p>I previously stated that there is an equivalence between quantum and classical statistical mechanics. Here, necessarily for the equivalence to hold, the dimension of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>-particle subspace in the Fock space (when it is finite) must be the same as the cardinality of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>-particle microstates in the classical case, and this is indeed the case. Assume that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>dim</mi><mo>⁡</mo><mi mathvariant="script">H</mi><mo>=</mo><mi mathvariant="normal">card</mi><mo>⁡</mo><mi mathvariant="script">M</mi><mo>=</mo><mi>M</mi></mrow><annotation encoding="application/x-tex">\dim\mcal H=\card\mcal M=M</annotation></semantics></math></span></span>, then both the dimension of the subspace of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> distinguishable particles and the number of classical microstates of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> distinguishable particles are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mi>N</mi></msup></mrow><annotation encoding="application/x-tex">M^N</annotation></semantics></math></span></span>. This number for bosons is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mover accent="true"><mi>N</mi><mo stretchy="true">‾</mo></mover></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">M^{\overline N}/N!</annotation></semantics></math></span></span>, and that for fermions is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">M^{\underline N}/N!</annotation></semantics></math></span></span>, where <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>M</mi><mover accent="true"><mi>N</mi><mo stretchy="true">‾</mo></mover></msup><mo><mi mathvariant="normal">≔</mi></mo><munder><mo>∏</mo><mrow><mi>M</mi><mo>≤</mo><mi>k</mi><mo>&lt;</mo><mi>M</mi><mo>+</mo><mi>N</mi></mrow></munder><mi>k</mi><mo separator="true">,</mo><mspace width="1em"/><msup><mi>M</mi><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder></msup><mo><mi mathvariant="normal">≔</mi></mo><munder><mo>∏</mo><mrow><mi>M</mi><mo>−</mo><mi>N</mi><mo>&lt;</mo><mi>k</mi><mo>≤</mo><mi>M</mi></mrow></munder><mi>k</mi></mrow><annotation encoding="application/x-tex">M^{\overline N}\ceq\prod_{M\le k&lt;M+N}k,\quad
M^{\underline N}\ceq\prod_{M-N&lt;k\le M}k</annotation></semantics></math></span></span></span> are called the rising factorial power and the falling factorial power respectively. These are the number of ways to put <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> balls into <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> boxes under three different rules.</p>
<p>Here is a summary table:</p>
<table>
<thead>
<tr>
<th/>
<th>Distinguishable</th>
<th>Bosons</th>
<th>Fermions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Quantum</td>
<td>Tensor algebra</td>
<td>Symmetric algebra</td>
<td>Exterior algebra</td>
</tr>
<tr>
<td>Classical</td>
<td>Tuple</td>
<td>Multiset</td>
<td>Set</td>
</tr>
<tr>
<td>Number</td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mi>N</mi></msup></mrow><annotation encoding="application/x-tex">M^N</annotation></semantics></math></span></span></td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mover accent="true"><mi>N</mi><mo stretchy="true">‾</mo></mover></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">M^{\overline N}/N!</annotation></semantics></math></span></span></td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">M^{\underline N}/N!</annotation></semantics></math></span></span></td>
</tr>
</tbody>
</table>
<details>
<summary>
Labels on distinguishable particles
</summary>
<p>To explain this, I may actually need to explain the mathematical definition of a tuple. My personal favorite definition of a tuple is nested ordered pairs, with <a href="https://en.wikipedia.org/wiki/Ordered_pair#Kuratowski's_definition" target="_blank" rel="external">Kuratowski’s definition</a> of an ordered pair. However, for the purpose of this illustration, I will use another definition, which defines a tuple as a function from a finite <a href="https://en.wikipedia.org/wiki/Ordinal_number#Von_Neumann_definition_of_ordinals" target="_blank" rel="external">von Neumann ordinal</a> to the set of elements (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span> in this case), and a function is defined using its <a href="https://en.wikipedia.org/wiki/Graph_of_a_function" target="_blank" rel="external">graph</a>. There is a notational advantage of this definition in that, if we also define natural numbers as von Neumann ordinals (which is a common practice in set theory), it unifies the notation of the Cartesian power and the set of functions (in other words, we can identify <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="script">M</mi><mi>N</mi></msup></mrow><annotation encoding="application/x-tex">\mcal M^N</annotation></semantics></math></span></span> with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mo>→</mo><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">N\to\mcal M</annotation></semantics></math></span></span>).</p>
<p>With this definition, we can see that a microstate of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> distinguishable particles is a function from their labels to the single-particle microstates, and the labels are always the first <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> natural numbers. The point is that, if a particle is removed or added, the labels will be rearranged so that the labels are always the first <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> natural numbers.</p>
<p>This should concern you in that the operation of rearranging labels makes each label no longer unique to each particle. For example, say, initially, the system has two particles with labels <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>, and they are in single-particle microstates <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">m_0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">m_1</annotation></semantics></math></span></span> respectively. It is then allowed to exchange particles with a bath. If particle <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> moves from the system to the bath while another particle from the bath moves to the system, then the two particles in the system after the exchange will still have labels <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>, but they are not the same particles as before. Namely, particle <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> is not the same particle <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> as before. If the two new partcicles are in single-particle microstates <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">m_0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">m_1</annotation></semantics></math></span></span> respectively just as before, then this new state will be regarded as the same state as the initial state, which should not be true because the particles are different from before.</p>
<p>Therefore, to avoid the subtlety of the labels, maybe it is better to consider microstates of many distinguishable particles directly as functions from the set of particles to the single-particle microstates, without attaching labels to the particles. However, this means that as long as the system is allowed to exchange particles with a bath, which, by definition, has a large number of particles compared to the system, the number of microstates in the system will be drastically increased. It would then be impossible to use the grand canonical ensemble to describe the system because you will find that the average number of particles in the system would depend on the number of particles in the bath, which is very absurd.</p>
<p>From this, we can see that the idea that every particle is distinguishable is inherently flawed, i.e., it can only be self-consistent with the unphysical operation of rearranging labels. This hints that, either the <em>a priori</em> probability principle is not applicable in this case, or there are only a few distinguishable types of particles in any practical cases.</p>
</details>
<h2 data-label="0.3" id="gibbs-factor-and-entropy">Gibbs factor and entropy</h2>
<p>Gibbs put the famous factor of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">1/N!</annotation></semantics></math></span></span> in front of the phase space integral of the ideal gas to make the entropy asymptotically linear in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>. People often interpret this as accounting for the indistinguishability of particles so that the result of classical treatment can match with the quantum treatment.</p>
<p>Actually, the effect of the Gibbs factor may not be as important as you imagined. In the microcanonical and the canonical ensemble, the Gibbs factor is just an overall factor for the partition function. The only effect is that the chemical potential would not be intensive and that the entropy would not be extensive without it, but there is no actual physical consequence of this because we cannot measure the entropy and the chemical potential in experiments anyway. In the grand canonical ensemble, the distribution of the number of particles is expected to be different with or without the Gibbs factor. However, at least for the ideal gas example (or more generally, for models with a quadratic Hamiltonian), the equipartition theorem and the ideal gas law would still hold without the Gibbs factor. Consider the grand canonical partition function of the ideal gas, whether we include the Gibbs factor or not: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">Ξ</mi><mn>1</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><munder><mo>∑</mo><mi>N</mi></munder><mfrac><mn>1</mn><mrow><mi>N</mi><mo stretchy="false">!</mo></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi>μ</mi></mrow></msup><mi>V</mi></mrow><msup><mi>λ</mi><mi>d</mi></msup></mfrac><mo fence="true">)</mo></mrow><mi>N</mi></msup><mo separator="true">,</mo><mspace width="1em"/><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><munder><mo>∑</mo><mi>N</mi></munder><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi>μ</mi></mrow></msup><mi>V</mi></mrow><msup><mi>λ</mi><mi>d</mi></msup></mfrac><mo fence="true">)</mo></mrow><mi>N</mi></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\Xi_1\ceq\sum_N\fr1{N!}\p{\fr{\e^{\beta\mu}V}{\lmd^d}}^N,\quad
\Xi_2\ceq\sum_N\p{\fr{\e^{\beta\mu}V}{\lmd^d}}^N,</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo><mi mathvariant="normal">≔</mi></mo><msqrt><mrow><mi>β</mi><msup><mi>h</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn><mi>π</mi><mi>m</mi></mrow></msqrt></mrow><annotation encoding="application/x-tex">\lmd\ceq\sqrt{\beta h^2/2\pi m}</annotation></semantics></math></span></span>. If you spend the time to actually do the calculation, you can get the desired <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>p</mi><mi>V</mi><mo>=</mo><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">/</mi><mi>β</mi></mrow><annotation encoding="application/x-tex">pV=\a N/\beta</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mi>d</mi><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">/</mi><mn>2</mn><mi>β</mi></mrow><annotation encoding="application/x-tex">\a E=d\a N/2\beta</annotation></semantics></math></span></span>, whether you include the Gibbs factor or not. The entropy and the chemical potential would indeed change drastically with the introduction of the Gibbs factor, but they are not actually measurable quantities in experiments.</p>
<details>
<summary>
In case you feel this too magical
</summary>
<p>Let’s do this calculation. The calculation with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ξ</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\Xi_1</annotation></semantics></math></span></span> is standard on textbooks, so I will skip it. For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\Xi_2</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mo>=</mo><mfrac><mn>1</mn><mrow><mn>1</mn><mo>−</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\Xi_2=\fr1{1-\e^{-\alp}V/\lmd^d},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mi>β</mi><mi>μ</mi></mrow><annotation encoding="application/x-tex">\alp\ceq-\beta\mu</annotation></semantics></math></span></span>. Notice that there is a condition for this convergence, but it does not matter because we only need to consider those <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> values that make it converge. Then, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>α</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mo>=</mo><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow><mrow><mn>1</mn><mo>−</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\a N=-\fr{\partial}{\partial\alp}\ln\Xi_2
=\fr{\e^{-\alp}V/\lmd^d}{1-\e^{-\alp}V/\lmd^d},</annotation></semantics></math></span></span></span> <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>β</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mo>=</mo><mfrac><mi>d</mi><mrow><mn>2</mn><mi>β</mi></mrow></mfrac><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow><mrow><mn>1</mn><mo>−</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow></mfrac><mo>=</mo><mfrac><mi>d</mi><mrow><mn>2</mn><mi>β</mi></mrow></mfrac><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\a E=-\fr{\partial}{\partial\beta}\ln\Xi_2
=\fr d{2\beta}\fr{\e^{-\alp}V/\lmd^d}{1-\e^{-\alp}V/\lmd^d}
=\fr d{2\beta}\a N.</annotation></semantics></math></span></span></span> Therefore, it works out. You may have noticed that the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a N</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> do not seem to be proportional to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span>, but it is fine because
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alp</annotation></semantics></math></span></span> is not intensive. Now, for the ideal gas law, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>p</mi><mo>=</mo><mfrac><mn>1</mn><mi>β</mi></mfrac><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>V</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mo>=</mo><mfrac><mn>1</mn><mi>β</mi></mfrac><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow><mrow><mn>1</mn><mo>−</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow></mfrac><mo>=</mo><mfrac><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mrow><mi>β</mi><mi>V</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">p=\fr1\beta\fr{\partial}{\partial V}\ln\Xi_2
=\fr1\beta\fr{\e^{-\alp}/\lmd^d}{1-\e^{-\alp}V/\lmd^d}
=\fr{\a N}{\beta V}.</annotation></semantics></math></span></span></span> Therefore, it works out.</p>
<p>In fact, you can multiply the summand by any (sensible) function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> without spoiling these state equations, but it is specific to the ideal gas. The reason behind this is because of the strict extensivity of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>.</p>
<p>Let’s just consider the general case for now. Assume that the canonical partition function is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>N</mi><mo fence="true">)</mo></mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fN\fc Z{\beta,N,V}</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fN</annotation></semantics></math></span></span> is the Gibbs factor, which can actually be any non-trivial function you like. Then, the average energy in the canonical ensemble is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mi>Z</mi></msub><mo>=</mo><mo>−</mo><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>β</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>N</mi><mo fence="true">)</mo></mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>β</mi></mrow></mfrac><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mi mathvariant="normal">/</mi><mi>V</mi><mo fence="true">)</mo></mrow><mi>N</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\a E_Z=-\fr{\partial}{\partial\beta}\fc\ln{\fc fN\fc Z{\beta,N,V}}
=-\fr1{\fc Z{\beta,N,V}}\fr{\partial}{\partial\beta}\fc Z{\beta,N,V}
=\fc u{\beta,N/V}N,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mi mathvariant="normal">/</mi><mi>V</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc u{\beta,N/V}</annotation></semantics></math></span></span> cannot depend on any extensive quantities (here, the only things that it can depend on are the temperature <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> and the particle number density
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mi mathvariant="normal">/</mi><mi>V</mi></mrow><annotation encoding="application/x-tex">N/V</annotation></semantics></math></span></span>). The last step is because both <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> are extensive quantities (so they must be proportional to each other). Notice that this requires the thermodynamic limit unless we are considering the ideal gas, where the extensivity is exact. Therefore, <span id="eq:partial-z" data-label="(1)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>β</mi></mrow></mfrac><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mi mathvariant="normal">/</mi><mi>V</mi><mo fence="true">)</mo></mrow><mi>N</mi><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr{\partial}{\partial\beta}\fc Z{\beta,N,V}=-\fc u{\beta,N/V}N\fc Z{\beta,N,V}.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1)</annotation></semantics></math></span></span></span></span> </span></span></p>
<p>Particularly, for ideal gases, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mi mathvariant="normal">/</mi><mi>V</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc u{\beta,N/V}</annotation></semantics></math></span></span> only depends on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span>, with no <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi><mi mathvariant="normal">/</mi><mi>V</mi></mrow><annotation encoding="application/x-tex">N/V</annotation></semantics></math></span></span> dependence. For more general cases, it is reasonable to assume that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc u{\beta,n}</annotation></semantics></math></span></span> can be expanded in a power series of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msub><mi>u</mi><mi>k</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo fence="true">)</mo></mrow><msup><mi>n</mi><mi>k</mi></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc u{\beta,n}=\sum_{k=0}^\infty\fc{u_k}\beta n^k.</annotation></semantics></math></span></span></span></p>
<p>Then, let’s define the grand canonical partition function to be <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Ξ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>α</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><munder><mo>∑</mo><mi>N</mi></munder><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>N</mi><mo fence="true">)</mo></mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi><mi>N</mi></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc\Xi{\beta,\alp,V}\ceq\sum_N\fc fN\fc Z{\beta,N,V}\e^{-\alp N}.</annotation></semantics></math></span></span></span> Then, the average energy in the grand canonical ensemble is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><mo>=</mo><mo>−</mo><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>β</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><mi mathvariant="normal">Ξ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>α</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><mrow><mi mathvariant="normal">Ξ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>α</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow></mrow></mfrac><munder><mo>∑</mo><mi>N</mi></munder><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>N</mi><mo fence="true">)</mo></mrow><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>N</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow></mrow><mrow><mi mathvariant="normal">∂</mi><mi>β</mi></mrow></mfrac><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi><mi>N</mi></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\a E_\Xi=-\fr{\partial}{\partial\beta}\ln\fc\Xi{\beta,\alp,V}
=-\fr1{\fc\Xi{\beta,\alp,V}}\sum_N\fc fN\fr{\partial\fc Z{\beta,N,V}}{\partial\beta}\e^{-\alp N}.</annotation></semantics></math></span></span></span> Substitute Equation <a href="#eq:partial-z">1</a>, and then we get
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><mo>=</mo><munder><mo>∑</mo><mi>k</mi></munder><mfrac><mrow><msub><mi>u</mi><mi>k</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo fence="true">)</mo></mrow></mrow><msup><mi>V</mi><mi>k</mi></msup></mfrac><msub><mrow><mo fence="true">⟨</mo><msup><mi>N</mi><mrow><mi>k</mi><mo>+</mo><mn>1</mn></mrow></msup><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\a E_\Xi=\sum_k\fr{\fc{u_k}\beta}{V^k}\a{N^{k+1}}_\Xi.</annotation></semantics></math></span></span></span> For ideal gas, only the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">k=0</annotation></semantics></math></span></span> term is nonzero, so we recover <span id="eq:grand-canonical-energy" data-label="(2)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><mo>=</mo><mi>u</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><msub><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><mi mathvariant="normal">/</mi><mi>V</mi><mo fence="true">)</mo></mrow><msub><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\a E_\Xi=\fc u{\beta,\a N_\Xi/V}\a N_\Xi.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>2</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(2)</annotation></semantics></math></span></span></span></span> </span></span> For more general case, for this to be true, we need to require that <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><msub><mrow><mo fence="true">⟨</mo><msup><mi>N</mi><mi>k</mi></msup><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi></msub><msubsup><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">Ξ</mi><mi>k</mi></msubsup></mfrac><mo>→</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\fr{\a{N^k}_\Xi}{\a{N}^k_\Xi}\to1</annotation></semantics></math></span></span></span> in the thermodynamic limit. However, this is not true for a general <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fN</annotation></semantics></math></span></span>. In fact, it is not true already for the
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\Xi_2</annotation></semantics></math></span></span> example above, which can be easily shown for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">k=2</annotation></semantics></math></span></span>. Notice that <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><msub><mrow><mo fence="true">⟨</mo><msup><mi>N</mi><mn>2</mn></msup><mo fence="true">⟩</mo></mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub></msub><mo>−</mo><msubsup><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mn>2</mn></msubsup></mrow><msubsup><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mn>2</mn></msubsup></mfrac><mo>=</mo><mfrac><mrow><mfrac><msup><mi mathvariant="normal">∂</mi><mn>2</mn></msup><mrow><mi mathvariant="normal">∂</mi><msup><mi>α</mi><mn>2</mn></msup></mrow></mfrac><mi>ln</mi><mo>⁡</mo><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>α</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow></mrow><msup><mrow><mo fence="true">(</mo><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>α</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo separator="true">,</mo><mi>α</mi><mo separator="true">,</mo><mi>V</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mn>2</mn></msup></mfrac><mo>=</mo><mfrac><mn>1</mn><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>α</mi></mrow></msup><mi>V</mi><mi mathvariant="normal">/</mi><msup><mi>λ</mi><mi>d</mi></msup></mrow></mfrac><mo>=</mo><mn>1</mn><mo>+</mo><mfrac><mn>1</mn><msub><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub></msub></mfrac><mo>→</mo><mn>1.</mn></mrow><annotation encoding="application/x-tex">\fr{\a{N^2}_{\Xi_2}-\a N_{\Xi_2}^2}{\a N_{\Xi_2}^2}
=\fr{\fr{\partial^2}{\partial\alp^2}\ln\fc{\Xi_2}{\beta,\alp,V}}{\p{\fr{\partial}{\partial\alp}\ln\fc{\Xi_2}{\beta,\alp,V}}^2}
=\fr1{\e^{-\alp}V/\lmd^d}=1+\fr1{\a N_{\Xi_2}}\to1.</annotation></semantics></math></span></span></span>
Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><msub><mrow><mo fence="true">⟨</mo><msup><mi>N</mi><mn>2</mn></msup><mo fence="true">⟩</mo></mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub></msub><msubsup><mrow><mo fence="true">⟨</mo><mi>N</mi><mo fence="true">⟩</mo></mrow><msub><mi mathvariant="normal">Ξ</mi><mn>2</mn></msub><mn>2</mn></msubsup></mfrac><mo>→</mo><mn>2.</mn></mrow><annotation encoding="application/x-tex">\fr{\a{N^2}_{\Xi_2}}{\a N_{\Xi_2}^2}\to2.</annotation></semantics></math></span></span></span> This makes <a href="#eq:grand-canonical-energy">2</a> not true if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>u</mi><mn>1</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{u_1}\beta</annotation></semantics></math></span></span> is non-trivial. The deeper reason behind this disagreement is that the extensivity of the characteristic functions (in this case, the Helmholtz energy and the grand potential) is required for the thermodynamic equivalence between different ensembles (in this case, the canonical ensemble and the grand canonical ensemble). I will cover this in more detail later in this article.</p>
</details>
<p>This then raises questions. Does the entropy have to be linear in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>? In other words, does the entropy need to meet the traditional sense of extensivity? Does physics actually care about our definition of the entropy? The answer to these questions is actually no. The entropy is not something that we can directly measure in experiments, and there are some freedom in the definition of the entropy that does not affect any physical outcomes.</p>
<p>Now, recall that the Gibbs factor accounts for the indistinguishability of particles. This would mean that whether the particles are actually distinguishable or not does not matter the actual physics. Gas particles in real life may well be distinguishable. For example, chlorine has two stable isotopes that naturally occur with considerable abundance, and that does not make it substantially different from, say, fluorine, which has only one stable isotope. Maybe people will also find observable features in fluorine molecules that would make them distinguishable, who knows? That would not deny any of the experimentally tested thermodynamic theories that can be applied to fluorine today.</p>
<p>Therefore, the Gibbs factor should not be introduced in the sole purpose of accounting for the indistinguishability of particles. It is introduced to make the entropy traditionally extensive. However, as I already stated, it is not necessary for the actual physics, so why is it important to make the entropy extensive? The answer is that, otherwise, the free energy (be it the Helmholtz energy or the Gibbs energy) would not be extensive. The free energy measures the work that can be extracted from the system, and by this nature it must be extensive because energy is additive. Therefore, only when we define the entropy in a way such that it is extensive, can it possibly make the derived free energy be able to measure the extractable work.</p>
<p>Having the idea that the free energy measures the amount of work that can be extracted from the system, we would then think we are able to extract some work out of the process of mixing two distinguishable gases. This is because distinguishability gives rise to a mixing entropy, which is the whole reason why it makes the entropy fail to be traditionally extensive. On the other hand, as I stated, whether we regard the two gases distinguishable or not in theory, it does not matter the actual physics. However, the amount of work that can be extracted from the process of mixing two gases is very physical by any means. To resolve this, the take is that, if it is possible to extract work from mixing them in one’s theory, then it should also be possible to distinguish the gases in their theory. On the other hand, if the two gases are indistinguishable in one’s theory, then it is impossible to extract work from mixing them in their theory. Therefore, it actually does not matter whether the gases are “in reality” distinguishable or not, the theory would be able to make itself consistent. The texts about the <a href="https://en.wikipedia.org/wiki/Gibbs_paradox#Mixing_paradox" target="_blank" rel="external">mixing paradox</a> on Wikipedia explain this idea, which is a gist of the <a href="https://doi.org/10.1007/978-94-017-2219-3_1" target="_blank" rel="external">paper</a> (which unfortunately did not talk about the grand canonical ensemble in detail).</p>
<p>Another importance for the entropy to be extensive is that only then can different ensembles be thermodynamically equivalent. The thermodynamical equivalence is the property that the thermodynamic properties determined from the characteristic functions (e.g., entropy, Helmholtz energy, and grand potential) of different statistical ensembles are the same in the thermodynamic limit. This is not a sufficient condition, though, because we also need to require that the entropy is a concave function of the extensive quantities. There is a good <a href="https://doi.org/10.1007/s10955-015-1212-2" target="_blank" rel="external">paper</a> that explains the equivalence and nonequivalence of ensembles in detail, assuming the characteristic functions are always extensive. The main idea is that, for any statistical ensemble, the probability measure on the space of macrostates, parametrized by the particle number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>, satisfies the large deviation principle with the <a href="https://en.wikipedia.org/wiki/Rate_function" target="_blank" rel="external">rate function</a> being the characteristic function. With the concavity condition, using a generalization of <a href="https://en.wikipedia.org/wiki/Laplace%27s_method" target="_blank" rel="external">Laplace’s method</a>, it can then be proven that the characteristic functions of different ensembles are related as being the Legendre transform of each other.</p>
<details>
<summary>
Simplified sketch
</summary>
<p>I am writing this because before I read the paper, I independently came up with the same idea of using Laplace’s method to prove the equivalence of ensembles. I wrote it on <a href="https://www.zhihu.com/question/35706570/answer/3505430771" target="_blank" rel="external">Zhihu</a>, and here is a translation of it.</p>
<p>Assume that the extensive quantity of the system is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> and that the corresponding intensive quantity is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span>. Suppose that the partition function of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span>-ensemble is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Ω</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\Omg E</annotation></semantics></math></span></span>, and then the characteristic function of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span>-ensemble would be <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>ln</mi><mo>⁡</mo><mi mathvariant="normal">Ω</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc SE\ceq\ln\fc\Omg E</annotation></semantics></math></span></span>, and we would have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi><mo>=</mo><msup><mi>S</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">I=\fc{S'}E</annotation></semantics></math></span></span> (the prime denotes the derivative) in the thermal equilibrium state with fixed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span>.</p>
<p>On the other hand, the partition function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc ZI</annotation></semantics></math></span></span> of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span>-ensemble is the Laplace transform of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Ω</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\Omg E</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo>=</mo><mo>∫</mo><mi mathvariant="normal">Ω</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>I</mi><mi>E</mi></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>E</mi><mo>=</mo><mo>∫</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>I</mi><mi>E</mi></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>E</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc ZI=\int\fc\Omg E\e^{-IE}\,\d E
=\int\e^{\fc SE-IE}\,\d E.</annotation></semantics></math></span></span></span> We have the characteristic function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>F</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc FI\ceq-\ln\fc ZI</annotation></semantics></math></span></span> of the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span>-ensemble, and we would have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi><mo>=</mo><msup><mi>F</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">E=\fc{F'}I</annotation></semantics></math></span></span> in the thermal equilibrium state with fixed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span>.</p>
<p>The question now is whether <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi><mo>=</mo><msup><mi>S</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">I=\fc{S'}E</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi><mo>=</mo><msup><mi>F</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">E=\fc{F'}I</annotation></semantics></math></span></span> are actually the same equation. In other words, are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>S</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">S'</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>F</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">F'</annotation></semantics></math></span></span> inverse functions of each other? If they are, then we get the same results from the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span>-ensemble and the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span>-ensemble. Nevertheless, generally they are not. We just need one counterexample to show that: for system with a quadratic Hamiltonian, let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> be the energy, and then its corresponding intensive quantity <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span> is the inverse temperature (in this case, the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span>-ensemble is the microcanonical ensemble, and the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi></mrow><annotation encoding="application/x-tex">I</annotation></semantics></math></span></span>-ensemble is the canonical ensemble), and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Ω</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo>∝</mo><msup><mi>E</mi><mrow><mi>n</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mo separator="true">,</mo><mspace width="1em"/><msup><mi>S</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mi>n</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow><mi>E</mi></mfrac><mo separator="true">,</mo><mspace width="1em"/><msup><mi>F</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mrow><mn>1</mn><mo>+</mo><mi>n</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow><mi>I</mi></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc\Omg E\propto E^{n/2},\quad
\fc{S'}E=\fr{n/2}E,\quad
\fc{F'}I=\fr{1+n/2}I,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> is the number of quadratic terms in the Hamiltonian (e.g., <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>3</mn><mi>N</mi></mrow><annotation encoding="application/x-tex">n=3N</annotation></semantics></math></span></span> for classical monatomic ideal gas).</p>
<p>However, we can see that, for the thermodynamic limit <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">n\to\infty</annotation></semantics></math></span></span>, we indeed have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>S</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">S'</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>F</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">F'</annotation></semantics></math></span></span> being the inverse functions of each other. We can then conjecture that, under the thermodynamic limit, different ensembles will get the same result. Now, what is the thermodynamic limit? We may think that multiplying extensive quantities by a zooming factor <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> and letting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\lmd\to\infty</annotation></semantics></math></span></span> is the thermodynamic limit. A good characteristic function should also be extensive in the thermodynamic limit, so <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>E</mi><mo fence="true">)</mo></mrow><mo>≈</mo><mi>λ</mi><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc S{\lmd E}\approx\lmd\fc SE</annotation></semantics></math></span></span>. Therefore, we define <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>S</mi><mi>λ</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>E</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msub><mi>Z</mi><mi>λ</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mo>∫</mo><msup><mi mathvariant="normal">e</mi><mrow><msub><mi>S</mi><mi>λ</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>I</mi><mi>λ</mi><mi>E</mi></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>E</mi><mo>≈</mo><mo>∫</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>λ</mi><mrow><mo fence="true">(</mo><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>I</mi><mi>E</mi><mo fence="true">)</mo></mrow></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>E</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{S_\lmd}E\ceq\fc S{\lmd E},\quad
\fc{Z_\lmd}I\ceq\int\e^{\fc{S_\lmd}E-I\lmd E}\,\d E
\approx\int\e^{\lmd\p{\fc SE-IE}}\,\d E.</annotation></semantics></math></span></span></span> When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\lmd\to\infty</annotation></semantics></math></span></span>, use Laplace’s method to get (assuming that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi></mrow><annotation encoding="application/x-tex">S</annotation></semantics></math></span></span> is a concave function) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo>≈</mo><msqrt><mfrac><mrow><mn>2</mn><mi>π</mi></mrow><mrow><mi>λ</mi><mrow><mo fence="true">∣</mo><msup><mi>S</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>S</mi><mrow><mo mathvariant="normal">′</mo><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">∣</mo></mrow></mrow></mfrac></msqrt><msup><mi mathvariant="normal">e</mi><mrow><mi>λ</mi><mrow><mo fence="true">(</mo><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>S</mi><mrow><mo mathvariant="normal">′</mo><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>−</mo><mi>I</mi><msup><mi>S</mi><mrow><mo mathvariant="normal">′</mo><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{Z_\lmd}I\approx\sqrt{\fr{2\pi}{\lmd\v{\fc{S''}{\fc{S^{\prime-1}}{I}}}}}
\e^{\lmd\p{\fc S{\fc{S^{\prime-1}}{I}}-I\fc{S^{\prime-1}}{I}}},</annotation></semantics></math></span></span></span> and thus (only keeping the highest order term in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span>) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>F</mi><mi>λ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mo>−</mo><mfrac><mi mathvariant="normal">∂</mi><mrow><mi mathvariant="normal">∂</mi><mi>I</mi></mrow></mfrac><mi>ln</mi><mo>⁡</mo><msub><mi>Z</mi><mi>λ</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo>≈</mo><mi>λ</mi><msup><mi>S</mi><mrow><mo mathvariant="normal">′</mo><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo>≈</mo><msubsup><mi>S</mi><mi>λ</mi><mrow><mo mathvariant="normal">′</mo><mo>−</mo><mn>1</mn></mrow></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>I</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{F'_\lmd}I\ceq-\fr\partial{\partial I}\ln\fc{Z_\lmd}I
\approx\lmd\fc{S^{\prime-1}}{I}\approx\fc{S^{\prime-1}_\lmd}I,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>S</mi><mi>λ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>E</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi mathvariant="normal">d</mi><mi>S</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>E</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>E</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi>S</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>E</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{S'_\lmd}E\ceq\d\fc S{\lmd E}/\d\!\p{\lmd E}
=\fc{S'}{\lmd E}</annotation></semantics></math></span></span> (instead of simply the derivative of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>S</mi><mi>λ</mi></msub></mrow><annotation encoding="application/x-tex">S_\lmd</annotation></semantics></math></span></span>). This is indeed our expected result: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>S</mi><mi>λ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">S'_\lmd</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>F</mi><mi>λ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup></mrow><annotation encoding="application/x-tex">F'_\lmd</annotation></semantics></math></span></span> are inverse functions of each other.</p>
</details>
<h2 data-label="0.4" id="gibbs-factor-and-indistinguishability">Gibbs factor and indistinguishability</h2>
<p>Why can the introductiong of the Gibbs factor account for the indistinguishability?</p>
<p>Define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mn>0</mn></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>M</mi><mi>N</mi></msup></mrow><annotation encoding="application/x-tex">\fc{\Omg^0}{M,N}\ceq M^N</annotation></semantics></math></span></span> to be the number of microstates of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> distinguishable particles with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> single-particle microstates. Then, define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mn>0</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">Ω</mi><mn>0</mn></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">\fc{\Omg_0}{M,N}\ceq\fc{\Omg^0}{M,N}/N!</annotation></semantics></math></span></span> to be the version with the Gibbs factor. Also, define
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>M</mi><mover accent="true"><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder><mo stretchy="true">‾</mo></mover></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">\fc{\Omg_\pm}{M,N}\ceq M^{\overline{\underline N}}/N!</annotation></semantics></math></span></span> for bosons and fermions, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mover accent="true"><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder><mo stretchy="true">‾</mo></mover></msup></mrow><annotation encoding="application/x-tex">M^{\overline{\underline N}}</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mover accent="true"><mi>N</mi><mo stretchy="true">‾</mo></mover></msup></mrow><annotation encoding="application/x-tex">M^{\overline N}</annotation></semantics></math></span></span> or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder></msup></mrow><annotation encoding="application/x-tex">M^{\underline N}</annotation></semantics></math></span></span> corresponding to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>+</mo></mrow><annotation encoding="application/x-tex">+</annotation></semantics></math></span></span> or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo></mrow><annotation encoding="application/x-tex">-</annotation></semantics></math></span></span> in the notation
“<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>±</mo></mrow><annotation encoding="application/x-tex">\pm</annotation></semantics></math></span></span>” respectively.</p>
<p>If we make the distinguishable particles indistinguishable, we have to characterize them as either bosons or fermions. However, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\Omg_0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub></mrow><annotation encoding="application/x-tex">\Omg_\pm</annotation></semantics></math></span></span> are not exactly the same, This discrepancy can be resolved in the large <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> limit. We have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mrow><mi>N</mi><mo stretchy="false">!</mo></mrow></mfrac><munderover><mo>∏</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow></munderover><mrow><mo fence="true">(</mo><mi>M</mi><mo>±</mo><mi>k</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><msup><mi>M</mi><mi>N</mi></msup><mrow><mi>N</mi><mo stretchy="false">!</mo></mrow></mfrac><munderover><mo>∏</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mrow><mi>N</mi><mo>−</mo><mn>1</mn></mrow></munderover><mrow><mo fence="true">(</mo><mn>1</mn><mo>±</mo><mfrac><mi>k</mi><mi>M</mi></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msub><mi mathvariant="normal">Ω</mi><mn>0</mn></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mn>1</mn><mo>±</mo><mfrac><mrow><mi>N</mi><mrow><mo fence="true">(</mo><mi>N</mi><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow></mrow><mrow><mn>2</mn><mi>M</mi></mrow></mfrac><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>M</mi><mrow><mo>−</mo><mn>2</mn></mrow></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fc{\Omg_\pm}{M,N}&amp;=\fr1{N!}\prod_{k=0}^{N-1}\p{M\pm k}
=\fr{M^N}{N!}\prod_{k=0}^{N-1}\p{1\pm\fr kM}\\
&amp;=\fc{\Omg_0}{M,N}\p{1\pm\fr{N\p{N-1}}{2M}+\order{M^{-2}}},
\end{align*}</annotation></semantics></math></span></span></span>
where the big-O notation is understood as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> fixed and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">M\to\infty</annotation></semantics></math></span></span>. Therefore, to have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mn>0</mn></msub><mo>≈</mo><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub></mrow><annotation encoding="application/x-tex">\Omg_0\approx\Omg_\pm</annotation></semantics></math></span></span>, loosely speaking, we need <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi><mo>≫</mo><msup><mi>N</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">M\gg N^2</annotation></semantics></math></span></span>. In this limit, there is no difference between boson statistics and fermion statistics, and both of them are the same as distinguishable particles with the Gibbs factor.</p>
<p>Intuitively, if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> is very large, then in most of the microstates, each single-particle microstate is occupied by at most one particle, which renders boson statistics and fermion statistics the same. Particularly, if there are infinitely many single-particle microstates, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> is effectively infinite, so <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mn>0</mn></msub><mo>=</mo><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub></mrow><annotation encoding="application/x-tex">\Omg_0=\Omg_\pm</annotation></semantics></math></span></span> is strictly true for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> in this case. This is why the result for classical ideal gas is exact: there are so many single-particle microstates that the probability for two particles to occupy the same microstate is exactly zero, i.e., such microstates have zero measure.</p>
<details>
<summary>
Classical Fermi gas
</summary>
<p>I previously said that, to make things simple, the measure on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">M</mi></mrow><annotation encoding="application/x-tex">\mcal M</annotation></semantics></math></span></span> would be the counting measure. One big reason behind that is the difficulty of a purely classical description of the Fermi gas.</p>
<p>In the classical description of a gas, the microstates of each particle are points in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mi>d</mi></mrow><annotation encoding="application/x-tex">2d</annotation></semantics></math></span></span>-dimensional phase space, which is a region in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mrow><mn>2</mn><mi>d</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\bR^{2d}</annotation></semantics></math></span></span>, and the measure is just the usual Lebesgue measure (or any other practically equivalent measure, for math nerds). Therefore, naturally, the microstates of many particles with particle number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> would be a region in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mrow><mn>2</mn><mi>d</mi><mi>N</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\bR^{2dN}</annotation></semantics></math></span></span>, also equipped with the usual Lebesgue measure.</p>
<p>If the gas consists of fermions, then in any microstate, two particles cannot be in the same single-particle microstate. However, the set of all microstates that have two such particles has zero measure in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mi>d</mi><mi>N</mi></mrow><annotation encoding="application/x-tex">2dN</annotation></semantics></math></span></span>-dimensional phase space. Therefore, it just would not matter at all whether the particles are fermions or not in the classical description.</p>
<p>However, we know that is not the actual case. In practice, we divide the single-particle phase space into cells of size <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>h</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">h^{d}</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi></mrow><annotation encoding="application/x-tex">h</annotation></semantics></math></span></span> is the Planck constant, which we put here by hand. No two particles can reside in the same cell. Therefore, any “bulky” region in the single-particle phase space with volume <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Ω</mi></mrow><annotation encoding="application/x-tex">\Omg</annotation></semantics></math></span></span> cannot contain more than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Ω</mi><mi mathvariant="normal">/</mi><msup><mi>h</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">\Omg/h^{d}</annotation></semantics></math></span></span> particles.</p>
<p>This all sounds fine, except that we did not define what a “bulky” region is. Of course, the Fermi sea is a bulky region, but what about a tube that is long enough to connect any specified discrete points in the single-particle phase space but is thin enough to have volume even smaller than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>h</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">h^{d}</annotation></semantics></math></span></span>? In fact, by constructing regions with not-so-exotic shapes, we can make any distributino of particles in the single-particle phase space seem like it is violating the Pauli exclusion principle or not arbitrarily. Just shown in the figure below, particles that reasonably distribute in different cells may be regarded as being in one cell, while particles that reasonably occupy the same cell may be regarded as being in different cells.</p>
<figure>
<img src="/assets/images/figures/2025-03-03-indistinguishability/phase-space-cells.svg" class="dark-adaptive" alt="Regular phase space cells and exotic ones"/>

</figure>
<p>There are some possible ways to resolve this issue. One naive way is to stipulate that the cell arranges in some lattice structure such as the simple cube lattice. However, this will break the rotational symmetry in the phase space so that the Fermi sea will not be strictly isotropic anymore. Also, the introduction of the lattice structure changes the physics of the system if it is far from the thermodynamic limit. Only in the thermodynamic limit will the particular choice of lattice structure be irrelevant to the physics.</p>
<p>Another way is to consider a phase space <a href="https://en.wikipedia.org/wiki/Density_functional_theory" target="_blank" rel="external">density functional theory</a>, where a function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span></span> is defined on the single-particle phase space, representing the number of particles in unit volume in the phase space. The measure of the number of microstates for the many-body system is then the functional integral of this density function. The Pauli exclusion principle can then be translated into the constraint that the value of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ρ</mi></mrow><annotation encoding="application/x-tex">\rho</annotation></semantics></math></span></span> must not exceed <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><msup><mi>h</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">1/h^{d}</annotation></semantics></math></span></span> anywhere, which prevents the number of particles in any region of size <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>h</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">h^{d}</annotation></semantics></math></span></span> from exceeding <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span>. It can also describe bosons by removing this constraint. I have not explored this approach myself, but I doubt it would be a good idea because it seems like an overkill to the problem and will introduce even more mathematical subtleties with the functional integral. Also, more careful analysis must be done to devise the proper measure on the functional space to match the usual sense of number of microstates. Another issue is that it defies the classical notion of particles as clear points but instead treats them as cloudy distributions just like quantum mechanics, and by this very reason it is not capable of being generalized to describe distinguishable particles.</p>
</details>
<p>When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> is not very large, using the Gibbs factor is then not a correct way to account for indistinguishability. However, it can be corrected, as long as we use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>±</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>M</mi><mover accent="true"><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder><mo stretchy="true">‾</mo></mover></msup></mrow><annotation encoding="application/x-tex">\fc{\Omg^\pm}{M,N}\ceq M^{\overline{\underline N}}</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mn>0</mn></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Omg^0}{M,N}</annotation></semantics></math></span></span>. Then, we would have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>±</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo><mo>=</mo><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Omg^\pm}{M,N}/N!=\fc{\Omg_\pm}{M,N}</annotation></semantics></math></span></span> exactly, corresponding to boson statistics and fermion statistics. There are indeed combanitorics problems of putting distinguishable balls into boxes that results in
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>±</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Omg^\pm}{M,N}</annotation></semantics></math></span></span>. Actually, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>+</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Omg^+}{M,N}</annotation></semantics></math></span></span> is the number of ways to put <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> distinguishable balls into <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> boxes with the balls in each box being ordered; <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>−</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>M</mi><mo separator="true">,</mo><mi>N</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Omg^-}{M,N}</annotation></semantics></math></span></span> is the number of ways to put <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> distinguishable balls into <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> exclusive boxes (“exclusive” means that each box cannot contain more than one ball).</p>
<p>Now, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>±</mo></msup></mrow><annotation encoding="application/x-tex">\Omg^\pm</annotation></semantics></math></span></span> represents two more different rules under which we put balls into boxes. Together with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\Omg_0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mo>±</mo></msub></mrow><annotation encoding="application/x-tex">\Omg_\pm</annotation></semantics></math></span></span>, there are five different rules in total. We can summarize them into a table:</p>
<table>
<thead>
<tr>
<th><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span> balls</th>
<th><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> boxes</th>
<th>Number of ways</th>
<th>Particles</th>
</tr>
</thead>
<tbody>
<tr>
<td>Distinguishable</td>
<td>Unordered</td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mn>0</mn></msup><mo>=</mo><msup><mi>M</mi><mi>N</mi></msup></mrow><annotation encoding="application/x-tex">\Omg^0=M^N</annotation></semantics></math></span></span></td>
<td>Distinguishable particles</td>
</tr>
<tr>
<td>Distinguishable</td>
<td>Ordered</td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>+</mo></msup><mo>=</mo><msup><mi>M</mi><mover accent="true"><mi>N</mi><mo stretchy="true">‾</mo></mover></msup></mrow><annotation encoding="application/x-tex">\Omg^+=M^{\overline N}</annotation></semantics></math></span></span></td>
<td>Bosons (without Gibbs factor)</td>
</tr>
<tr>
<td>Distinguishable</td>
<td>Exclusive</td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Ω</mi><mo>−</mo></msup><mo>=</mo><msup><mi>M</mi><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder></msup></mrow><annotation encoding="application/x-tex">\Omg^-=M^{\underline N}</annotation></semantics></math></span></span></td>
<td>Fermions (without Gibbs factor)</td>
</tr>
<tr>
<td>Indistinguishable</td>
<td>Unordered</td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mo>+</mo></msub><mo>=</mo><msup><mi>M</mi><mover accent="true"><mi>N</mi><mo stretchy="true">‾</mo></mover></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">\Omg_+=M^{\overline N}/N!</annotation></semantics></math></span></span></td>
<td>Bosons</td>
</tr>
<tr>
<td>Indistinguishable</td>
<td>Exclusive</td>
<td><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="normal">Ω</mi><mo>−</mo></msub><mo>=</mo><msup><mi>M</mi><munder accentunder="true"><mi>N</mi><mo stretchy="true">‾</mo></munder></msup><mi mathvariant="normal">/</mi><mi>N</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">\Omg_-=M^{\underline N}/N!</annotation></semantics></math></span></span></td>
<td>Fermions</td>
</tr>
</tbody>
</table>
<p class="no-indent">
These are all common enumerative problems of putting balls into boxes in combinatorics. One can extend this table by including more different enumerative problems. There is such a table called the <a href="https://en.wikipedia.org/wiki/Twelvefold_way#The_twentyfold_way" target="_blank" rel="external">twentyfold way</a> that lists 20 different enumerative problems.
</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="physics" /><category term="mathematical physics" /><category term="statistical mechanics" /><category term="probability" /><category term="long paper" /><category term="combinatorics" /><category term="quantum mechanics" /><summary type="html"><![CDATA[Indistinguishability plays an important role in enumerative problems in combinatorics. This article explains the concept and significance of particle indistinguishability in statistical mechanics.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-03-03-indistinguishability.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-03-03-indistinguishability.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Why it is a bad idea to use GitHub for submiting school homework]]></title><link href="https://ulysseszh.github.io/misc/2025/01/09/github-homework.html" rel="alternate" type="text/html" title="Why it is a bad idea to use GitHub for submiting school homework" /><published>2025-01-09T23:51:35-08:00</published><updated>2025-01-09T23:51:35-08:00</updated><id>https://ulysseszh.github.io/misc/2025/01/09/github-homework</id><content type="html" xml:base="https://ulysseszh.github.io/misc/2025/01/09/github-homework.html"><![CDATA[<p>
  <em>Do not take this artical as legal advice because I am not a lawyer.</em>
</p>
<hr/>
<p>It is common for school courses to require students to submit their homework using GitHub, especially in college-level courses offered in universities, but this may not be the best idea.</p>
<p>The first reason why GitHub is not suitable for that is that it is not controlled by the school. GitHub has its own terms of service (TOS), which students must agree to. This may not sound bad because it is not hard for students to do so, but the course instructors may be <strong>forcing students to violate the TOS</strong> by “threatening” that they will get a bad grade otherwise. There are different possible reasons why the instructors may be doing this. Maybe they are not familiar with the TOS enough; maybe they are just not familar enough with GitHub to come up with an actually good way of managing homework; or maybe they are aware of that but do not care.</p>
<p>What is the big deal? Why is it bad to violate the TOS? Well, the GitHub account of a student may be really important to him: he may be contributing to dozens of open-source projects, or he may be presenting his GitHub username in his resume. This account is not only important for the owner himself, it is also important for the community: some of the repositories that the account owns may be very popular projects; there may be hundreds of people following the account because they are interested in the work of its owner; important webpages (hosted on GitHub Pages) or important package registries (hosted on GitHub Packages) may be associated with the account; and many pages on the internet may be linking to contents of the account. Now, if the account violates the TOS, it may be subject to being suspended, losing privileges, or getting hidden from the public, any of which may cause a lot of harm to the owner and the community. Because of violation of TOS, the account owner may face trouble when reaching GitHub support because it tends to refuse to help users who violate the TOS.</p>
<p>What about creating a new account just for the course? Yes, it sounds like a effective and simple solution, only if it is allowed by the TOS. Actually, the TOS explicitly prohibits one person to own multiple non-bot accounts:</p>
<blockquote>
<p class="no-indent">
One person or legal entity may maintain no more than one free Account (if you choose to control a machine account as well, that’s fine, but it can only be used for running a machine).
</p>
</blockquote>
<p class="no-indent">
Therefore, it is still a violation of TOS to create a new account just for the course. People may argue that GitHub will not know whether different accounts are owned by the same person, but the answer is it will know if it really wants to know. Also, even if it does not ban the account for this reason, it is still possible for GitHub support to ignore the tickets filed by the account owner because his violation of the TOS. There are actually multiple real-life cases of this.
</p>
<p>What is worse is that the students do not have a proper way to defend against this. The most likely case that will happen is that all the students are not familiar enough with the TOS to discover that the instructors are forcing them to violate the TOS. The consequences of the violation may only appear long after they are out of the course or even long after they graduate. There is no way they can trace back to the instructors and ask them to take responsibility for the harm they have caused. Even if there is a student that discovers the potential problem in violating the TOS and sends an email to the instructors to ask for a change in the policy of the course, it is still up to the instructors to decide whether they are actually going to do that. If they are, it is good, but if they are not, there is no place for the student to appeal to. GitHub will not care about this because the account owner takes all the responsibility in the issues related to his account. The school will not care about this because the course is still “fair” for the students. Other students will not care about this because most of them are not going to heavily use their GitHub accounts after the course or after they graduate.</p>
<p>After saying so much about the consequences of the instructors forcing students to violate the TOS, what are the TOS that may be violated? The first one is the one mentioned above: multiple accounts. Instructors may tell students to create a new account just for the course, or they may tell students to do so if they do not feel comfortable using their existing personal account for the course, due to ignoring or not knowing that this is a violation of the TOS.</p>
<p>Another TOS that may be violated is the one that enforces the right for GitHub users to fork public repositories. The instructors may tell students to comply with academic integrity codes by stating that the work done in the repo must not be “plagiarized”. However, not only is this not enforceable, but it also violates the TOS of GitHub because any public repository grants the right for other GitHub users to freely use and create their own copies:</p>
<blockquote>
<p class="no-indent">
If you set your pages and repositories to be viewed publicly, you grant each User of GitHub a nonexclusive, worldwide license to use, display, and perform Your Content through the GitHub Service and to reproduce Your Content solely on GitHub as permitted through GitHub’s functionality (for example, through forking).
</p>
</blockquote>
<p class="no-indent">
While this can be circumvented by making the repositories private, many instructors do not allow using private repositories for homework for some reasons. Maybe they do not want to bother managing the access permissions to many students’ private repositories, or maybe they are only coping with the academic integrity codes without actually enforcing it.
</p>
<hr/>
<p>Besides violation of the TOS, the instructors may also be <strong>forcing students to do harm to their own</strong>. One example is that some instructors force the names of the repositories that students create for homework, and the repositories must be under the account of the student (so no designated GitHub organization for that). However, the names of the repositories under the same account must be unique, which means that students may have to delete or rename their old repositories. This definitely is doing harm to the account as well as the community because it breaks the links to the old repositories, and students have to do this because their grades are at stake.</p>
<p>Another harm that using GitHub for schoolwork can cause is the privacy issue. If the repositories are public, people can see the work of the students and infer school information from them. If the repositories are private, people can still see when the repositories are created and updated, which may be enough to infer school information. Because the GitHub account is also used by the student to communicate with other people in the open-source community on the internet, the partial disclosure of these information may cause harm to the student by enabling others to identify his real-life identity.</p>
<p>Another harm is that the school activities may be “polluting” the GitHub account activities and thus affecting the students’ reputation in the community. Some people may be following the account because they are interested in the work of the student, but if the student starts using the account for schoolwork, the account activities will be filled with schoolwork activities for some time, which may not be the things that the student may want to show to the followers. This may cause the followers to unfollow the account. It is similar to the situation where the instructors ask students to upload public videos using their personal YouTube accounts for schoolwork, which can do harm to the students if they are already popular YouTubers. However, YouTube actually allows one account to have multiple channels, so that does not have negative effects like GitHub.</p>
<hr/>
<p>The third reason why GitHub is not suitable for submitting school homework is that the school has no control over the service. GitHub is also probably not receiving any money from the school to take the responsibility of providing the service for schoolwork purposes. Apparently, <strong>GitHub can refuse its service for any or no reason</strong>:</p>
<blockquote>
<p class="no-indent">
GitHub has the right to suspend or terminate your access to all or any part of the Website at any time, with or without cause, with or without notice, effective immediately. GitHub reserves the right to refuse service to anyone for any reason at any time.
</p>
</blockquote>
<p class="no-indent">
This means that students have to “pray” that GitHub will continue be reliable for them to keep using it for schoolwork. If GitHub decides to stop providing services for some students, their grades may get penalized because they cannot submit their homework, and this situation is definitely possible considering that the students may actually be violating the TOS of GitHub whether for the course or not. GitHub will not care about this because the account owner takes all the responsibility. The instructor or the school may not care about this because they may deem the students’ own fault to be the cause of the suspension of the service. There is simply no way for students to tackle this situation.
</p>
<p>This situation is very different from other third-party services, such as Google Workspace, Zoom Workplace, or Microsoft 365, because the school is actually paying for the service so that the providers are liable to provide the service.</p>
<p>There is indeed paid services provided by GitHub, though, such as GitHub Enterprise, which may actually be suitable for school contexts. However, the school is not motivated to pay for the service because the free services provided by GitHub are already enough for educational purposes.</p>
<hr/>
<p>The fourth reason of not using GitHub for schoolwork is that Git and GitHub are just too difficult to use while being designed to be user-friendly. This causes an awkward situation: it does not worth a full course designated to teach Git and GitHub, but it would also have to take up a considerable part of a course to teach all the relevant best practices of Git and GitHub to students. This leads to the problem of <strong>students actually misusing Git and GitHub when learning it in school</strong> because instructors may not bother to spend time to teach them Git instead of teaching the actually relevant course materials. Not to mention that the instructors may intentionally tell students to follow bad practices because GitHub is missing on LMS (learning management system) features to conveniently suit schoolwork needs or because the instructors are simply not aware of better practices. It is also possible that the instructor just does not want to bother teaching those practicies because most students are not going to use Git and GitHub after the course or after they graduate.</p>
<p>One common bad practice that especially happens in school contexts is to use Git to manage frequently-updated binary files. While it is arguable whether Git should be used to manage binary files at all, it definitely causes resource waste to use Git to manage frequently-updated binary files because diffs on them can only be resolved if the old version mathces exactly. Also, in most cases, it is impossible to efficiently store the history version of binary files by storing deltas between versions. Another common bad practice is to include running results of the code in the repository. Instead, they should be produced by CI systems (e.g. GitHub Actions) and stored in the artifacts of the CI systems (e.g. GitHub releases or GitHub Packages). A worse common bad practice is that some instructors are just using GitHub as a file hosting service instead of a version control system. They may tell students to upload their homework as a zip file or tarball on GitHub, which is really confusing because you can actually download the tarball of a repository directly on GitHub. The list of bad practices can go on.</p>
<p>Some may argue that the problem of teaching bad practices can happen in any course besides those use GitHub for homework submission. Some incapable instructors may even teach false information in the course, which is just inevitable. However, the problem especially with GitHub is that GitHub is also the place where worldwide developers form the community, and a concensus on good practices is important for a community. Having students employ bad practices on GitHub may affect the atmosphere of the community and can also cause resource wasting from the perspective of GitHub the platform. This is different from usual academic situations because, in most academic situations, misusage can only propagate through paper publications and academic conferences, which are much more formal and have a much higher barrier of entry than GitHub.</p>
<hr/>
<p>The final reason of not using GitHub for schoolwork is that <strong>GitHub is not a learning management system (LMS)</strong>. It lacks essential features that are needed for schoolwork.</p>
<p>There are existing LMS softwares that are designed to be used in school contexts, suited for material distribution, homework submission and collection, grading, communication, and so on, designed with the consideration of being used by the instructors, graders, students, and possibly other roles. There are even open-source ones that can actually be self-hosted by the school such as Canvas (I am a big fan of Canvas).</p>
<p>What is more devious is that, in order to use the workflow of the existing LMS, some instructors ask students to submit their homework in the LMS after they finish it on GitHub. Sometimes instructors ask students to submit a GitHub link in the LMS. While this may seem like a good idea, some instructors may ask students to submit wierd things such as a PDF consisting of screenshots of webpages on GitHub so that graders can annotate using the features shipped with the LMS. These are just inefficient ways of working around the limitations of the LMS and GitHub.</p>
<p>If the course needs to use GitHub for source version control, CI/CD, or other software development-related purposes, besides normal LMS features such as homework submission and grading, there is a LMS provided GitHub dedicated for that purpose called GitHub Classroom. Though it looks very promising, it seems rare for schools to actually use it, so I have never used it myself.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="misc" /><category term="github" /><category term="school" /><summary type="html"><![CDATA[It is common for school courses to require students to submit their homework using GitHub. However, this is usually a bad idea for several reasons, potentially including TOS violation, community degradation, and reliability.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2025-01-09-github-homework.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2025-01-09-github-homework.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[How to use JavaScript in GitHub Actions without committing <code>node_modules</code>]]></title><link href="https://ulysseszh.github.io/guide/2024/11/15/gh-action-modules.html" rel="alternate" type="text/html" title="How to use JavaScript in GitHub Actions without committing node_modules" /><published>2024-11-15T16:34:55-08:00</published><updated>2024-11-15T16:34:55-08:00</updated><id>https://ulysseszh.github.io/guide/2024/11/15/gh-action-modules</id><content type="html" xml:base="https://ulysseszh.github.io/guide/2024/11/15/gh-action-modules.html"><![CDATA[<p>I was creating my first GitHub Action (it is now working, which you can check out <a href="https://github.com/UlyssesZh/grs-action" target="_blank" rel="external">here</a>). I am familiar with JavaScript, so I chose to create a JavaScript action. According to the <a href="https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github" target="_blank" rel="external">official documentation</a>, I need to do one of the following to make my JavaScript code correctly import 3rd-party modules:</p>
<ul>
<li>commit the <code>node_modules</code> to the repo, or</li>
<li>use <a href="https://github.com/vercel/ncc" target="_blank" rel="external">@vercel/ncc</a> to bundle everything into a single script.</li>
</ul>
<p class="no-indent">
I think both of these methods are not good practices. Especially, for my case, the way with @vercel/ncc is not feasible because some package uses <code>require</code>.
</p>
<p>The best way to handle this is to make GitHub cache and install all the dependencies for the user every time the action is run. This can be made possible by <a href="https://docs.github.com/en/actions/sharing-automations/creating-actions/creating-a-composite-action" target="_blank" rel="external">creating a composite action</a>. Here is a snippet in <code>action.yml</code>:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-yaml">
        <pre>
          <code>
            <span class="line line-1"><span class="na">runs</span><span class="pi">:</span>
</span>
            <span class="line line-2">  <span class="na">using</span><span class="pi">:</span> <span class="s">composite</span>
</span>
            <span class="line line-3">  <span class="na">steps</span><span class="pi">:</span>
</span>
            <span class="line line-4">    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">Setup Node.js</span>
</span>
            <span class="line line-5">      <span class="na">uses</span><span class="pi">:</span> <span class="s">actions/setup-node@v4</span>
</span>
            <span class="line line-6">      <span class="na">with</span><span class="pi">:</span>
</span>
            <span class="line line-7">        <span class="na">node-version</span><span class="pi">:</span> <span class="s1">'</span><span class="s">20'</span>
</span>
            <span class="line line-8">
</span>
            <span class="line line-9">    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">Get cache key and path</span>
</span>
            <span class="line line-10">      <span class="na">id</span><span class="pi">:</span> <span class="s">lock</span>
</span>
            <span class="line line-11">      <span class="na">run</span><span class="pi">:</span> <span class="pi">|</span>
</span>
            <span class="line line-12">        <span class="s">cd $GITHUB_ACTION_PATH</span>
</span>
            <span class="line line-13">        <span class="s">node &lt;&lt;'JAVASCRIPT'</span>
</span>
            <span class="line line-14">          <span class="s">const fs = require('fs');</span>
</span>
            <span class="line line-15">          <span class="s">const os = require('os');</span>
</span>
            <span class="line line-16">          <span class="s">const sha256 = require('crypto').createHash('sha256');</span>
</span>
            <span class="line line-17">          <span class="s">const hash = sha256.update(fs.readFileSync('package-lock.json')).digest('hex');</span>
</span>
            <span class="line line-18">          <span class="s">fs.appendFileSync(process.env.GITHUB_OUTPUT, `key=${os.platform()}-${os.arch()}-grs-modules-${hash}\n`);</span>
</span>
            <span class="line line-19">        <span class="s">JAVASCRIPT</span>
</span>
            <span class="line line-20">        <span class="s">modules=$(pwd)/node_modules</span>
</span>
            <span class="line line-21">        <span class="s">command -v cygpath &amp;&gt; /dev/null &amp;&amp; modules=$(cygpath -w $modules)</span>
</span>
            <span class="line line-22">        <span class="s">echo "modules=$modules" &gt;&gt; $GITHUB_OUTPUT</span>
</span>
            <span class="line line-23">        <span class="s">cat $GITHUB_OUTPUT</span>
</span>
            <span class="line line-24">        <span class="s">cd $GITHUB_WORKSPACE</span>
</span>
            <span class="line line-25">      <span class="na">shell</span><span class="pi">:</span> <span class="s">bash</span>
</span>
            <span class="line line-26">
</span>
            <span class="line line-27">    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">Restore cache</span>
</span>
            <span class="line line-28">      <span class="na">uses</span><span class="pi">:</span> <span class="s">actions/cache/restore@v4</span>
</span>
            <span class="line line-29">      <span class="na">id</span><span class="pi">:</span> <span class="s">cache-restore</span>
</span>
            <span class="line line-30">      <span class="na">with</span><span class="pi">:</span>
</span>
            <span class="line line-31">        <span class="na">path</span><span class="pi">:</span> <span class="s">${{ steps.lock.outputs.modules }}</span>
</span>
            <span class="line line-32">        <span class="na">key</span><span class="pi">:</span> <span class="s">${{ steps.lock.outputs.key }}</span>
</span>
            <span class="line line-33">
</span>
            <span class="line line-34">    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">CI</span>
</span>
            <span class="line line-35">      <span class="na">if</span><span class="pi">:</span> <span class="s">steps.cache-restore.outputs.cache-hit != 'true'</span>
</span>
            <span class="line line-36">      <span class="na">run</span><span class="pi">:</span> <span class="pi">|</span>
</span>
            <span class="line line-37">        <span class="s">cd $GITHUB_ACTION_PATH</span>
</span>
            <span class="line line-38">        <span class="s">npm ci</span>
</span>
            <span class="line line-39">        <span class="s">cd $GITHUB_WORKSPACE</span>
</span>
            <span class="line line-40">      <span class="na">shell</span><span class="pi">:</span> <span class="s">bash</span>
</span>
            <span class="line line-41">
</span>
            <span class="line line-42">    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">Save cache</span>
</span>
            <span class="line line-43">      <span class="na">if</span><span class="pi">:</span> <span class="s">steps.cache-restore.outputs.cache-hit != 'true'</span>
</span>
            <span class="line line-44">      <span class="na">uses</span><span class="pi">:</span> <span class="s">actions/cache/save@v4</span>
</span>
            <span class="line line-45">      <span class="na">with</span><span class="pi">:</span>
</span>
            <span class="line line-46">        <span class="na">path</span><span class="pi">:</span> <span class="s">${{ steps.lock.outputs.modules }}</span>
</span>
            <span class="line line-47">        <span class="na">key</span><span class="pi">:</span> <span class="s">${{ steps.lock.outputs.key }}</span>
</span>
            <span class="line line-48">
</span>
            <span class="line line-49">    <span class="pi">-</span> <span class="na">name</span><span class="pi">:</span> <span class="s">Run</span>
</span>
            <span class="line line-50">      <span class="na">run</span><span class="pi">:</span> <span class="s">node $GITHUB_ACTION_PATH/index.js</span>
</span>
            <span class="line line-51">      <span class="na">shell</span><span class="pi">:</span> <span class="s">bash</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>I manually use <code>actions/cache</code> to cache the <code>node_modules</code> directory although <code>actions/setup-node</code> has caching functionality. This is because it <a href="https://github.com/actions/setup-node/issues/819" target="_blank" rel="external">is not good yet</a>. Also, because <code>github.action_path</code> ends with <code>/./</code>, it can cause some problem due to the relative pathing. My workflow here works around those problems.</p>
<p>The hash in the cache key is calculated using JavaScript because there is no <code>sha256sum</code> command on macOS and Ubuntu runners.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="guide" /><category term="javascript" /><category term="github" /><summary type="html"><![CDATA[I was creating my first GitHub Action. According to the official documentation, I should commit the <code>node_modules</code> to the repo or generate a script that bundles the whole <code>node_modules</code> if I want to create a JavaScript action. I think this is not good practice, so I try to find another way: manually managing the caches for the dependencies in <code>node_modules</code>.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-11-15-gh-action-modules.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-11-15-gh-action-modules.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Some understanding of Grassmann numbers out of intuition]]></title><link href="https://ulysseszh.github.io/math/2024/10/10/grassmann-num.html" rel="alternate" type="text/html" title="Some understanding of Grassmann numbers out of intuition" /><published>2024-10-10T22:40:02-07:00</published><updated>2024-10-10T22:40:02-07:00</updated><id>https://ulysseszh.github.io/math/2024/10/10/grassmann-num</id><content type="html" xml:base="https://ulysseszh.github.io/math/2024/10/10/grassmann-num.html"><![CDATA[<p>
  <em>This article (except the introduction and the afterwords) is my answer to one of the homework problems that I did when I took a quantum field theory course. The original problem asked to verify the formula for linear change of variables in integration. It was originally written on 2024-02-06.</em>
</p>
<hr/>
<h2 data-label="0.1" id="introduction">Introduction</h2>
<p>Although Grassmann numbers are purely mathematical concept, but like most people, I was introduced to them in physics class. I then had the natural question: how to formally define Grassmann numbers? In a homework given by my professor of QFT course, I found that I had to answer the question to do a problem in the homework in a way that I am satisfied with.</p>
<h2 data-label="0.2" id="numbers">Numbers</h2>
<p>Let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo separator="true">,</mo><mo>+</mo><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{\mbb G_0,+}</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>+</mo><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{\mbb G_1,+}</annotation></semantics></math></span></span> be two abelian groups such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo>∩</mo><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub><mo>=</mo><mrow><mo fence="true">{</mo><mn>0</mn><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">\mbb G_0\cap\mbb G_1=\B{0}</annotation></semantics></math></span></span>. For convenience, for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>∈</mo><mi mathvariant="double-struck">N</mi></mrow><annotation encoding="application/x-tex">k\in\bN</annotation></semantics></math></span></span>, define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msub><mi mathvariant="double-struck">G</mi><mrow><mi>k</mi><mtext> </mtext><mo lspace="0.22em" rspace="0.22em"><mrow><mi mathvariant="normal">m</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">d</mi></mrow></mo><mtext> </mtext><mn>2</mn></mrow></msub></mrow><annotation encoding="application/x-tex">\mbb G_k\ceq\mbb G_{k\bmod2}</annotation></semantics></math></span></span>. Define a multiplication on
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo>∪</mo><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0\cup\mbb G_1</annotation></semantics></math></span></span> such that</p>
<ul>
<li>multiplication is associative, non-degenerate, and distributive over addition;</li>
<li><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span> are <dfn>commuting numbers</dfn> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_1</annotation></semantics></math></span></span> are <dfn>anticommuting numbers</dfn>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∀</mi><msub><mi>ψ</mi><mn>1</mn></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><msub><mi>k</mi><mn>1</mn></msub></msub><mo separator="true">,</mo><msub><mi>ψ</mi><mn>2</mn></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><msub><mi>k</mi><mn>2</mn></msub></msub><mo>:</mo><msub><mi>ψ</mi><mn>1</mn></msub><msub><mi>ψ</mi><mn>2</mn></msub><mo>=</mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mo fence="true">)</mo></mrow><mrow><msub><mi>k</mi><mn>1</mn></msub><msub><mi>k</mi><mn>2</mn></msub></mrow></msup><msub><mi>ψ</mi><mn>2</mn></msub><msub><mi>ψ</mi><mn>1</mn></msub><mo separator="true">;</mo></mrow><annotation encoding="application/x-tex">\forall\psi_1\in\mbb G_{k_1},\psi_2\in\mbb G_{k_2}:
\psi_1\psi_2=\p{-}^{k_1k_2}\psi_2\psi_1;</annotation></semantics></math></span></span></span></li>
<li>and there is a unity <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">1\in\mbb G_0</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>+</mo><mo>⋯</mo><mo>+</mo><mn>1</mn><mo mathvariant="normal">≠</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">1+\cdots+1\ne0</annotation></semantics></math></span></span> for any finite number of summands.</li>
</ul>
<p class="no-indent">
We then have to have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∀</mi><msub><mi>ψ</mi><mn>1</mn></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><msub><mi>k</mi><mn>1</mn></msub></msub><mo separator="true">,</mo><msub><mi>ψ</mi><mn>2</mn></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><msub><mi>k</mi><mn>2</mn></msub></msub><mo>:</mo><msub><mi>ψ</mi><mn>1</mn></msub><msub><mi>ψ</mi><mn>2</mn></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mrow><msub><mi>k</mi><mn>1</mn></msub><mo>+</mo><msub><mi>k</mi><mn>2</mn></msub></mrow></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\forall\psi_1\in\mbb G_{k_1},\psi_2\in\mbb G_{k_2}:
\psi_1\psi_2\in\mbb G_{k_1+k_2}.</annotation></semantics></math></span></span></span> Therefore, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span> is a commutative ring with characteristic zero, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_1</annotation></semantics></math></span></span> is a
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span>-module. We can then define linear functions with this structure. In this sense, the multiplication on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_1</annotation></semantics></math></span></span> defines a symplectic bilinear form.
</p>
<p>These are not enough to define every property we need for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_1</annotation></semantics></math></span></span>. I will introduce more properties as axioms later.</p>
<h2 data-label="0.3" id="tensors">Tensors</h2>
<p>It seems that we need this property as an axiom: for any linear function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mspace/><mspace width="0.1111em"/><mo lspace="0em" rspace="0.17em"/><mtext> ⁣</mtext><mo lspace="0em" rspace="0em">:</mo><mspace width="0.3333em"/><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\func\lmd{\mbb G_k}{\mbb G_0}</annotation></semantics></math></span></span>, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∃</mi><mo stretchy="false">!</mo><mi>φ</mi><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub><mo>:</mo><mi>λ</mi><mo>=</mo><mrow><mo fence="true">(</mo><mi>ψ</mi><mo>↦</mo><mi>φ</mi><mi>ψ</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\exists!\vphi\in\mbb G_k:\lmd=\p{\psi\mapsto\vphi\psi}.</annotation></semantics></math></span></span></span> I call this property the <dfn>first representation property</dfn>, analog to the Riez representation theorem. I will call linear functions that maps objects to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span> <dfn>linear functionals</dfn>, and the <dfn>dual space</dfn> of a <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span>-module as the set of all linear functionals on it.</p>
<p>With the fist representation property, we can identify <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">\mbb G_k</annotation></semantics></math></span></span> with its dual space so that any <dfn>multilinear map (tensor)</dfn> have well-defined components. For any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span>-linear map <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mspace/><mspace width="0.1111em"/><mo lspace="0em" rspace="0.17em"/><mtext> ⁣</mtext><mo lspace="0em" rspace="0em">:</mo><mspace width="0.3333em"/><msup><mrow><mo fence="true">(</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup><mo fence="true">)</mo></mrow><mi>k</mi></msup><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\func T{\p{\mbb G_1^n}^k}{\mbb G_0}</annotation></semantics></math></span></span> (or alternatively called a rank-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> tensor on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span>), we can write it uniquely in the form
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>T</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>ψ</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>ψ</mi><mi>k</mi></msub><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>ψ</mi><mrow><mn>1</mn><msub><mi>i</mi><mn>1</mn></msub></mrow></msub><mo>⋯</mo><msub><mi>ψ</mi><mrow><mi>k</mi><msub><mi>i</mi><mi>k</mi></msub></mrow></msub><msub><mi>a</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow></msub><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc T{\psi_1,\dots,\psi_k}=\psi_{1i_1}\cdots\psi_{ki_k}a_{i_1\cdots i_k},</annotation></semantics></math></span></span></span> where the components
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">T_{i_1\cdots i_k}\in\mbb G_k</annotation></semantics></math></span></span>, and the dummy indices are summed from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>. Denote the set of all rank-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> tensors on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_1^{nk}</annotation></semantics></math></span></span>.</p>
<p>Similarly, we can define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span>-linear maps <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mspace/><mspace width="0.1111em"/><mo lspace="0em" rspace="0.17em"/><mtext> ⁣</mtext><mo lspace="0em" rspace="0em">:</mo><mspace width="0.3333em"/><msup><mrow><mo fence="true">(</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mi>n</mi></msubsup><mo fence="true">)</mo></mrow><mi>k</mi></msup><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\func T{\p{\mbb G_0^n}^k}{\mbb G_0}</annotation></semantics></math></span></span> (or rank-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> tensors on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_0^n</annotation></semantics></math></span></span>), whose components are in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span>, and denote the set of all of them as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>0</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_0^{nk}</annotation></semantics></math></span></span>. Tensors from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>0</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_0^{nk}</annotation></semantics></math></span></span> and those from
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_1^{nk}</annotation></semantics></math></span></span> can be multiplied and contracted together without any problems. However, the result of these operations may not be in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>0</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_0^{nk}</annotation></semantics></math></span></span> or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_1^{nk}</annotation></semantics></math></span></span>, but some tensor that takes arguments from both <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_0^n</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span>.</p>
<h2 data-label="0.4" id="linear-endomorphisms">Linear endomorphisms</h2>
<p>Here we will need another property as an axiom: for any linear function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mspace/><mspace width="0.1111em"/><mo lspace="0em" rspace="0.17em"/><mtext> ⁣</mtext><mo lspace="0em" rspace="0em">:</mo><mspace width="0.3333em"/><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">\func\lmd{\mbb G_k}{\mbb G_k}</annotation></semantics></math></span></span>, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∃</mi><mo stretchy="false">!</mo><mi>φ</mi><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo>:</mo><mi>λ</mi><mo>=</mo><mrow><mo fence="true">(</mo><mi>ψ</mi><mo>↦</mo><mi>φ</mi><mi>ψ</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\exists!\vphi\in\mbb G_0:\lmd=\p{\psi\mapsto\vphi\psi}.</annotation></semantics></math></span></span></span> I call this property the <dfn>second representation property</dfn>. This is very similar to the first representation property, but it covers linear endomorphisms on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">\mbb G_k</annotation></semantics></math></span></span> instead of linear functionals on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">\mbb G_k</annotation></semantics></math></span></span>.</p>
<p>With the second representation property, we can prove that any possible linear endomorphism <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>J</mi></mrow><annotation encoding="application/x-tex">J</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mi>k</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_k^n</annotation></semantics></math></span></span> can be written as a unique matrix in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mrow><mi>n</mi><mo>×</mo><mi>n</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_0^{n\times n}</annotation></semantics></math></span></span> acting on the components of the argument: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>J</mi><mtext> ⁣</mtext><msub><mrow><mo fence="true">(</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mi>i</mi></msub><mo>=</mo><msub><mi>J</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><msub><mi>ψ</mi><mi>j</mi></msub><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc J\psi_i=J_{ij}\psi_j,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>J</mi><mrow><mi>i</mi><mi>j</mi></mrow></msub><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">J_{ij}\in\mbb G_0</annotation></semantics></math></span></span> are called the components of the linear endomorphism <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>J</mi></mrow><annotation encoding="application/x-tex">J</annotation></semantics></math></span></span>. From now on, we do not need to distinguish between matrices in
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mrow><mi>n</mi><mo>×</mo><mi>n</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_0^{n\times n}</annotation></semantics></math></span></span> and linear endomorphisms on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mi>k</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_k^n</annotation></semantics></math></span></span>.</p>
<p>For a matrix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>J</mi><mo>∈</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mrow><mi>n</mi><mo>×</mo><mi>n</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">J\in\mbb G_0^{n\times n}</annotation></semantics></math></span></span>, we can define its determinant as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>det</mi><mo>⁡</mo><mi>J</mi><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>J</mi><mrow><mn>1</mn><msub><mi>i</mi><mn>1</mn></msub></mrow></msub><mo>⋯</mo><msub><mi>J</mi><mrow><mi>n</mi><msub><mi>i</mi><mi>n</mi></msub></mrow></msub><msubsup><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\det J\ceq J_{1i_1}\cdots J_{ni_n}\veps^{\b n}_{i_1\cdots i_n}\in\mbb G_0,</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>ε</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup><mo>∈</mo><msubsup><mi mathvariant="script">T</mi><mn>0</mn><mrow><mi>n</mi><mi>n</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">\veps^{\b n}\in\mcal T_0^{nn}</annotation></semantics></math></span></span> is the Levi-Civita symbol, which is a completely antisymmetric tensor on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_0^n</annotation></semantics></math></span></span> whose components take values in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">{</mo><mo>−</mo><mn>1</mn><mo separator="true">,</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo fence="true">}</mo></mrow><mo>⊂</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\B{-1,0,1}\subset\mbb G_0</annotation></semantics></math></span></span>.</p>
<h2 data-label="0.5" id="analytic-functions">Analytic functions</h2>
<p>For any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo>∈</mo><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">T\in\mcal T_1^{nk}</annotation></semantics></math></span></span>, define a degree-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> <dfn>monomial</dfn> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span> as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>M</mi><mi>T</mi></msub><mspace/><mspace width="0.1111em"/><mo lspace="0em" rspace="0.17em"/><mtext> ⁣</mtext><mo lspace="0em" rspace="0em">:</mo><mspace width="0.3333em"/><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo separator="true">,</mo><mspace width="1em"/><mi>ψ</mi><mo>⟼</mo><mi>T</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\vfunc{M_T}{\mbb G_1^n}{\mbb G_0}{\psi}{\fc T{\psi,\dots,\psi}},</annotation></semantics></math></span></span></span> which is a degree-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> homogeneous function on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span>. Note that different tensors may correspond to the same monomial. Especially, for any
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>&gt;</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">k&gt;n</annotation></semantics></math></span></span>, a degree-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> monomial must be trivial (send any input to zero). Also, if there is any pair of indices such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> is symmetric in exchanging them, then the monomial <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><mi>T</mi></msub></mrow><annotation encoding="application/x-tex">M_T</annotation></semantics></math></span></span> must be trivial. Therefore, we only need to consider the those completely antisymmetric tensors when studying monomials. Denote the set of all completely antisymmetric rank-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> tensors on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_1^{n\b k}</annotation></semantics></math></span></span>, and then the fact that we only need antisymmetric tensors to define monomials can be written as
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>M</mi><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></mrow></msubsup></msub><mo>=</mo><msub><mi>M</mi><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mi>k</mi></mrow></msubsup></msub></mrow><annotation encoding="application/x-tex">M_{\mcal T_1^{n\b k}}=M_{\mcal T_1^{nk}}</annotation></semantics></math></span></span>.</p>
<p>An <dfn>analytic function</dfn> <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi></mrow><annotation encoding="application/x-tex">f</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span> is defined as a sum of monomials: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mspace/><mspace width="0.1111em"/><mo lspace="0em" rspace="0.17em"/><mtext> ⁣</mtext><mo lspace="0em" rspace="0em">:</mo><mspace width="0.3333em"/><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub><mo separator="true">,</mo><mspace width="1em"/><mi>ψ</mi><mo>⟼</mo><munder><mo>∑</mo><mi>k</mi></munder><msub><mi>M</mi><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\vfunc f{\mbb G_1^n}{\mbb G_0}\psi{\sum_k \fc{M_{T^{\b k}}}\psi},</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup><mo>∈</mo><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></mrow></msubsup></mrow><annotation encoding="application/x-tex">T^{\b k}\in\mcal T_1^{n\b k}</annotation></semantics></math></span></span>, whose components may be referred to as <dfn>expansion coefficients</dfn>. We do not need to worry about the convergence because this is a finite sum (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>≤</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">k\le n</annotation></semantics></math></span></span>). Denote the set of all analytic functions on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_1^n</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="script">A</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">\mcal A_n</annotation></semantics></math></span></span>.</p>
<p>Two properties of analytic functions:</p>
<ul>
<li>If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">f\in\mcal A_n</annotation></semantics></math></span></span>, then for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mo>∈</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\dlt\in\mbb G_1^n</annotation></semantics></math></span></span>, the translation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">(</mo><mi>ψ</mi><mo>↦</mo><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo>+</mo><mi>δ</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">\p{\psi\mapsto\fc f{\psi+\dlt}}\in\mcal A_n</annotation></semantics></math></span></span>.</li>
<li>If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">f\in\mcal A_n</annotation></semantics></math></span></span>, then for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>J</mi><mo>∈</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mrow><mi>n</mi><mo>×</mo><mi>n</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">J\in\mbb G_0^{n\times n}</annotation></semantics></math></span></span>, the linear transformation in the argument <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>∘</mo><mi>J</mi><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">f\circ J\in\mcal A_n</annotation></semantics></math></span></span>.</li>
</ul>
<h2 data-label="0.6" id="integrals">Integrals</h2>
<p>Now we define that a linear function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∫</mo><mo>:</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub><mo>→</mo><msub><mi mathvariant="double-struck">G</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">\int:\mcal A_n\to\mbb G_n</annotation></semantics></math></span></span> is called an <dfn>integral</dfn> if it satisfies the following property: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>f</mi><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub><mo separator="true">,</mo><mi>δ</mi><mo>∈</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup><mo>:</mo><mo>∫</mo><mi>f</mi><mo>=</mo><mo>∫</mo><mi>ψ</mi><mo>↦</mo><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo>+</mo><mi>δ</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\forall f\in\mcal A_n,\dlt\in\mbb G_1^n:\int f=\int\psi\mapsto\fc f{\psi+\dlt},</annotation></semantics></math></span></span></span> which intuitively means that an integral is invariant under translation.</p>
<p>With this definition of an integral, we are now interested in the most general form of an integral.</p>
<p>Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∫</mo></mrow><annotation encoding="application/x-tex">\int</annotation></semantics></math></span></span> is linear, we can find its form on monomials, and then sum them up to get the form on all analytic functions. As a linear function on monomials, it must be of the form (by the second representation property) <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>∫</mo><msub><mi>M</mi><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup></msub><mo>=</mo><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup><msubsup><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\int M_{T^{\b k}}=c^{\b k}_{i_1\cdots i_k}T^{\b k}_{i_1\cdots i_k},</annotation></semantics></math></span></span></span> where
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup><mo>∈</mo><msubsup><mi mathvariant="script">T</mi><mn>0</mn><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></mrow></msubsup></mrow><annotation encoding="application/x-tex">c^{\b k}\in\mcal T_0^{n\b k}</annotation></semantics></math></span></span> does not depend on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">T^{\b k}</annotation></semantics></math></span></span>. Plug this form into the translational invariance of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∫</mo></mrow><annotation encoding="application/x-tex">\int</annotation></semantics></math></span></span>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup><msubsup><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>∫</mo><mi>ψ</mi><mo>↦</mo><mrow><mo fence="true">(</mo><msub><mi>ψ</mi><msub><mi>i</mi><mn>1</mn></msub></msub><mo>+</mo><msub><mi>δ</mi><msub><mi>i</mi><mn>1</mn></msub></msub><mo fence="true">)</mo></mrow><mo>⋯</mo><mrow><mo fence="true">(</mo><msub><mi>ψ</mi><msub><mi>i</mi><mi>k</mi></msub></msub><mo>+</mo><msub><mi>δ</mi><msub><mi>i</mi><mi>k</mi></msub></msub><mo fence="true">)</mo></mrow><msubsup><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>∫</mo><mi>ψ</mi><mo>↦</mo><munder><mo>∑</mo><mi>l</mi></munder><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>k</mi><mi>l</mi></mfrac><mo fence="true">)</mo></mrow><msub><mi>ψ</mi><msub><mi>i</mi><mn>1</mn></msub></msub><mo>⋯</mo><msub><mi>ψ</mi><msub><mi>i</mi><mi>l</mi></msub></msub><msub><mi>δ</mi><msub><mi>i</mi><mrow><mi>l</mi><mo>+</mo><mn>1</mn></mrow></msub></msub><mo>⋯</mo><msub><mi>δ</mi><msub><mi>i</mi><mi>k</mi></msub></msub><msubsup><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munder><mo>∑</mo><mi>l</mi></munder><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>k</mi><mi>l</mi></mfrac><mo fence="true">)</mo></mrow><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>l</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>l</mi><mo fence="true">]</mo></mrow></msubsup><msub><mi>δ</mi><msub><mi>i</mi><mrow><mi>l</mi><mo>+</mo><mn>1</mn></mrow></msub></msub><mo>⋯</mo><msub><mi>δ</mi><msub><mi>i</mi><mi>k</mi></msub></msub><msubsup><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	c_{i_1\cdots i_k}^{\b k}T^{\b k}_{i_1\cdots i_k}
	&amp;=\int\psi\mapsto\p{\psi_{i_1}+\dlt_{i_1}}\cdots\p{\psi_{i_k}+\dlt_{i_k}}T^{\b k}_{i_1\cdots i_k}\\
	&amp;=\int\psi\mapsto\sum_l\binom kl\psi_{i_1}\cdots\psi_{i_l}
	\dlt_{i_{l+1}}\cdots\dlt_{i_k}T^{\b k}_{i_1\cdots i_k}\\
	&amp;=\sum_l\binom kl c^{\b l}_{i_1\cdots i_l}\dlt_{i_{l+1}}\cdots\dlt_{i_k}T^{\b k}_{i_1\cdots i_k}
\end{align*}</annotation></semantics></math></span></span></span>
(here the binomial coefficient should be regarded as its image under the natural ring homomorphism from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">Z</mi></mrow><annotation encoding="application/x-tex">\bZ</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span>, which must be non-zero because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span> has characteristic zero). Regarding <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">T^{\b k}</annotation></semantics></math></span></span> as the independent variable, this equation is a homogeneous linear equation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>L</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup><mo fence="true">)</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\fc{L^{\b k}}{T^{\b k}}=0</annotation></semantics></math></span></span> associated with the linear operator <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi></mrow><annotation encoding="application/x-tex">L</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_1^{n\b k}</annotation></semantics></math></span></span> defined as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>L</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup><mo><mi mathvariant="normal">≔</mi></mo><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup><mo>−</mo><munder><mo>∑</mo><mi>l</mi></munder><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>k</mi><mi>l</mi></mfrac><mo fence="true">)</mo></mrow><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>l</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>l</mi><mo fence="true">]</mo></mrow></msubsup><msub><mi>δ</mi><msub><mi>i</mi><mrow><mi>l</mi><mo>+</mo><mn>1</mn></mrow></msub></msub><mo>⋯</mo><msub><mi>δ</mi><msub><mi>i</mi><mi>k</mi></msub></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">L^{\b k}_{i_1\cdots i_k}\ceq
c^{\b k}_{i_1\cdots i_k}-\sum_l\binom kl c^{\b l}_{i_1\cdots i_l}\dlt_{i_{l+1}}\cdots\dlt_{i_k}.</annotation></semantics></math></span></span></span>
For the solution set of the linear equation to be the whole space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mn>1</mn><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></mrow></msubsup></mrow><annotation encoding="application/x-tex">\mcal T_1^{n\b k}</annotation></semantics></math></span></span>, we need <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>L</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">L^{\b k}=0</annotation></semantics></math></span></span>. Again by the second representation property, we need all the components to vanish (strictly speaking, we need the completely antisymmetric part to vanish, but they are already completely antisymmetric): <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>k</mi><mo>≤</mo><mi>n</mi><mo separator="true">,</mo><mi>δ</mi><mo>∈</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>1</mn><mi>n</mi></msubsup><mo separator="true">,</mo><msub><mi>i</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>i</mi><mi>k</mi></msub><mo>:</mo><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>k</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msubsup><mo>−</mo><munder><mo>∑</mo><mi>l</mi></munder><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mi>k</mi><mi>l</mi></mfrac><mo fence="true">)</mo></mrow><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>l</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>l</mi><mo fence="true">]</mo></mrow></msubsup><msub><mi>δ</mi><msub><mi>i</mi><mrow><mi>l</mi><mo>+</mo><mn>1</mn></mrow></msub></msub><mo>⋯</mo><msub><mi>δ</mi><msub><mi>i</mi><mi>k</mi></msub></msub><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\forall k\le n,\dlt\in\mbb G_1^n,i_1,\dots,i_k:
c^{\b k}_{i_1\cdots i_k}-\sum_l\binom kl c^{\b l}_{i_1\cdots i_l}\dlt_{i_{l+1}}\cdots\dlt_{i_k}=0.</annotation></semantics></math></span></span></span>
The first term cancels with the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><mo>=</mo><mi>k</mi></mrow><annotation encoding="application/x-tex">l=k</annotation></semantics></math></span></span> term in the sum, so this equation does not impose any requirement for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b k}</annotation></semantics></math></span></span> but only impose requirements for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mi>l</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b l}</annotation></semantics></math></span></span> with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><mo>&lt;</mo><mi>k</mi></mrow><annotation encoding="application/x-tex">l&lt;k</annotation></semantics></math></span></span>. Then, we can induce on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span>: the equation for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">k=0</annotation></semantics></math></span></span> does nothing; the equation for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">k=1</annotation></semantics></math></span></span> requires <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mn>0</mn><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b 0}</annotation></semantics></math></span></span> to vanish; the equation for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">k=2</annotation></semantics></math></span></span>, given that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mn>0</mn><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b 0}</annotation></semantics></math></span></span> vanishes, now requires <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mn>1</mn><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b 1}</annotation></semantics></math></span></span> to vanish; and so on. For each
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span>, the equation additionally requires <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo>−</mo><mn>1</mn><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b{k-1}}</annotation></semantics></math></span></span> to vanish. Finally, when we reach <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">k=n</annotation></semantics></math></span></span>, which is the end of the induction, we require <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mi>l</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b l}</annotation></semantics></math></span></span> to vanish for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><mo>&lt;</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">l&lt;n</annotation></semantics></math></span></span>, and there is no requirement for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>c</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">c^{\b n}</annotation></semantics></math></span></span>. Therefore, the integral of any monomial is zero except for the degree-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> monomial, and thus we only need to consider the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>th degree term when finding the integral of an analytic function.</p>
<p>Note that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="script">T</mi><mi>k</mi><mrow><mi>n</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></mrow></msubsup><mo>=</mo><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub><msup><mi>ε</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\mcal T_k^{n\b n}=\mbb G_k\veps^{\b n}</annotation></semantics></math></span></span> (in other words, the most general form of a completely antisymmetric rank-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> tensor on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mi>k</mi><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_k^n</annotation></semantics></math></span></span> is a constant in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">\mbb G_k</annotation></semantics></math></span></span> times the Levi-Civita symbol). Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mi>c</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo>=</mo><msub><mi>c</mi><mi>n</mi></msub><msubsup><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo separator="true">,</mo><mspace width="1em"/><msubsup><mi>T</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo>=</mo><mi>d</mi><msubsup><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">c^{\b n}_{i_1\cdots i_n}=c_n\veps^{\b n}_{i_1\cdots i_n},
\quad T^{\b n}_{i_1\cdots i_n}=d\veps^{\b n}_{i_1\cdots i_n},</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>c</mi><mi>n</mi></msub><mo>=</mo><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">c_n=\in\mbb G_0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mo>∈</mo><msub><mi mathvariant="double-struck">G</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">d\in\mbb G_n</annotation></semantics></math></span></span>. The definition of an integral does not impose any requirement for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>c</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">c_n</annotation></semantics></math></span></span>, so it can be any element in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span>. For convenience, define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>c</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn></mrow><annotation encoding="application/x-tex">c_n\ceq1</annotation></semantics></math></span></span> for all <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>, and then we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>∫</mo><msub><mi>M</mi><mrow><mi>d</mi><msup><mi>ε</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></mrow></msub><mo>=</mo><msubsup><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mi>d</mi><msubsup><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo>=</mo><mi>n</mi><mo stretchy="false">!</mo><mtext> </mtext><mi>d</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\int M_{d\veps^{\b n}}=\veps^{\b n}_{i_1\cdots i_n}d\veps^{\b n}_{i_1\cdots i_n}
=n!\,d,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">n!</annotation></semantics></math></span></span> is the image of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo stretchy="false">!</mo></mrow><annotation encoding="application/x-tex">n!</annotation></semantics></math></span></span> under the natural ring homomorphism from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">Z</mi></mrow><annotation encoding="application/x-tex">\bZ</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi mathvariant="double-struck">G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\mbb G_0</annotation></semantics></math></span></span>. The integral of any monomial with its degree different from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> is zero, so the integral of any analytic function is just that of its degree-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> term:
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>∫</mo><mi>ψ</mi><mo>↦</mo><munder><mo>∑</mo><mi>k</mi></munder><msub><mi>M</mi><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>k</mi><mo fence="true">]</mo></mrow></msup></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>n</mi><mo stretchy="false">!</mo><mtext> </mtext><msubsup><mi>T</mi><mrow><mn>1</mn><mo>⋯</mo><mi>n</mi></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\int\psi\mapsto\sum_k \fc{M_{T^{\b k}}}\psi=n!\,T^{\b n}_{1\cdots n}.</annotation></semantics></math></span></span></span></p>
<h2 data-label="0.7" id="linear-change-of-integrated-variable">Linear change of integrated variable</h2>
<p>Now, for a linear endomorphism <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>J</mi><mo>∈</mo><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mrow><mi>n</mi><mo>×</mo><mi>n</mi></mrow></msubsup></mrow><annotation encoding="application/x-tex">J\in\mbb G_0^{n\times n}</annotation></semantics></math></span></span> and an analytic function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">f\in\mcal A_n</annotation></semantics></math></span></span>, consider the integral <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∫</mo><mi>f</mi><mo>∘</mo><mi>J</mi></mrow><annotation encoding="application/x-tex">\int f\circ J</annotation></semantics></math></span></span>. We only needs to consider the degree-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> monomial term, which is
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>M</mi><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>J</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>J</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><msub><mi>j</mi><mn>1</mn></msub></mrow></msub><msub><mi>ψ</mi><msub><mi>j</mi><mn>1</mn></msub></msub><mo>⋯</mo><msub><mi>J</mi><mrow><msub><mi>i</mi><mi>n</mi></msub><msub><mi>j</mi><mi>n</mi></msub></mrow></msub><msub><mi>ψ</mi><msub><mi>j</mi><mi>n</mi></msub></msub><mi>d</mi><msubsup><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msubsup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc{M_{T^{\b n}}}{\fc J\psi}=J_{i_1j_1}\psi_{j_1}\cdots J_{i_nj_n}\psi_{j_n}d\veps^{\b n}_{i_1\cdots i_n},</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup><mo>=</mo><mi>d</mi><msup><mi>ε</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">T^{\b n}=d\veps^{\b n}</annotation></semantics></math></span></span> is used. Notice that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>ε</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><mo>⋯</mo><msub><mi>i</mi><mi>n</mi></msub></mrow></msub><msub><mi>J</mi><mrow><msub><mi>i</mi><mn>1</mn></msub><msub><mi>j</mi><mn>1</mn></msub></mrow></msub><mo>⋯</mo><msub><mi>J</mi><mrow><msub><mi>i</mi><mi>n</mi></msub><msub><mi>j</mi><mi>n</mi></msub></mrow></msub></mrow><annotation encoding="application/x-tex">\veps_{i_1\cdots i_n}J_{i_1j_1}\cdots J_{i_nj_n}</annotation></semantics></math></span></span> itself is a rank-<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> completely antisymmetric tensor on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi mathvariant="double-struck">G</mi><mn>0</mn><mi>n</mi></msubsup></mrow><annotation encoding="application/x-tex">\mbb G_0^n</annotation></semantics></math></span></span>, so it can also be written as a constant times
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>ε</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\veps^{\b n}</annotation></semantics></math></span></span>. By letting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>j</mi><mn>1</mn></msub><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msub><mi>j</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">j_1,\dots,j_n</annotation></semantics></math></span></span> be <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">1,\dots,n</annotation></semantics></math></span></span> respectively, we see that the constant is just <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>det</mi><mo>⁡</mo><mi>J</mi></mrow><annotation encoding="application/x-tex">\det J</annotation></semantics></math></span></span>. Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>M</mi><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>J</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>=</mo><msub><mi>M</mi><msup><mi>T</mi><mrow><mo fence="true">[</mo><mi>n</mi><mo fence="true">]</mo></mrow></msup></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>ψ</mi><mo fence="true">)</mo></mrow><mi>det</mi><mo>⁡</mo><mi>J</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{M_{T^{\b n}}}{\fc J\psi}=\fc{M_{T^{\b n}}}\psi\det J.</annotation></semantics></math></span></span></span> By the linearty of the integral, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">∀</mi><mi>f</mi><mo>∈</mo><msub><mi mathvariant="script">A</mi><mi>n</mi></msub><mo>:</mo><mo>∫</mo><mi>f</mi><mo>∘</mo><mi>J</mi><mo>=</mo><mi>det</mi><mo>⁡</mo><mi>J</mi><mo>∫</mo><mi>f</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\forall f\in\mcal A_n:\int f\circ J=\det J\int f.</annotation></semantics></math></span></span></span></p>
<h2 data-label="0.8" id="afterwords">Afterwords</h2>
<p>Actually, before I wrote my answer, I already know the exterior algebra. In this article, my definition to Grassmann numbers is more abstract and puts the commuting numbers and anticomuuting numbers in more equal footings. This definition is closer to what I intuitively think Grassmann numbers could be.</p>
<p>There are several potential problems in this article:</p>
<ul>
<li>Some axioms are given, but I did not prove that they are consistent.</li>
<li>Some claims are made without proof. They may turn out to be wrong.</li>
<li>I did not prove that the usual definition of Grassmann numbers (with exterior algebra) can be formulated as a special case of my definition.</li>
<li>I am not educated in supersymmetry, which is where Grassmann numbers are applied most. I only made my definition comply with the properties of Grassmann numbers that I have learned for doing the path integral of fermionic fields.</li>
</ul>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="math" /><category term="quantum field theory" /><category term="linear algebra" /><category term="abstract algebra" /><summary type="html"><![CDATA[I was briefly introduced to Grassmann numbers when I studied quantum field theory. I then had the natural question of how we can formally define them. In this article, I went with my intuition and tried to answer this question.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-10-10-grassmann-num.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-10-10-grassmann-num.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[The notational convenience of imaginary time in the derivation of the metric in Poincaré coordinates]]></title><link href="https://ulysseszh.github.io/physics/2024/09/10/poincare-coord-imag.html" rel="alternate" type="text/html" title="The notational convenience of imaginary time in the derivation of the metric in Poincaré coordinates" /><published>2024-09-10T14:19:33-07:00</published><updated>2024-09-10T14:19:33-07:00</updated><id>https://ulysseszh.github.io/physics/2024/09/10/poincare-coord-imag</id><content type="html" xml:base="https://ulysseszh.github.io/physics/2024/09/10/poincare-coord-imag.html"><![CDATA[<h2 data-label="0.1" id="introduction">Introduction</h2>
<p>There are two major conventions for the metric signature: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mo>+</mo><mo separator="true">,</mo><mo>−</mo><mo separator="true">,</mo><mo>−</mo><mo separator="true">,</mo><mo>−</mo><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{+,-,-,-}</annotation></semantics></math></span></span> (west coast) and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mo>−</mo><mo separator="true">,</mo><mo>+</mo><mo separator="true">,</mo><mo>+</mo><mo separator="true">,</mo><mo>+</mo><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{-,+,+,+}</annotation></semantics></math></span></span> (east coast). However, the first convention that I have met in my journey of learning physics is neither of them: the imaginary time. Shortly after, I started using the west coast convention, so I never really used the imaginary time convention seriously. I personally dislike the imaginary time convention, and so do most people in the physics community and history, which is why most modern textbooks use either the west coast or the east coast convention. One of my past physics teachers deemed the imaginary time convention to be a heresy (异端邪说).</p>
<figure>
<img src="/assets/images/figures/2024-09-10-poincare-coord-imag/heresy.jpg" alt="The teacher’s writing"/>

</figure>
<p>However, in some cases, the imaginary time convention can be convenient due to the use of multi-index notation (which is more concise and feature-rich than the Einstein notation). Here is one of such cases: the derivation of the metric in Poincaré coordinates for the anti-de Sitter space.</p>
<p>The <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span></span>-dimensional anti-de Sitter space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi mathvariant="normal">A</mi><mi mathvariant="normal">d</mi><mi mathvariant="normal">S</mi></mrow><mi>d</mi></msub></mrow><annotation encoding="application/x-tex">\mrm{AdS}_d</annotation></semantics></math></span></span> of scale <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi></mrow><annotation encoding="application/x-tex">l</annotation></semantics></math></span></span> is defined as the hyperboloid <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo>−</mo><msup><mi>l</mi><mn>2</mn></msup><mo>=</mo><mo>−</mo><msubsup><mi>T</mi><mn>1</mn><mn>2</mn></msubsup><mo>−</mo><msubsup><mi>T</mi><mn>2</mn><mn>2</mn></msubsup><mo>+</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow><mi>d</mi><mo>−</mo><mn>1</mn></mrow></munderover><msup><mrow><mo fence="true">(</mo><msup><mi>X</mi><mi>i</mi></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">-l^2=-T_1^2-T_2^2+\sum_{i=1}^{d-1}\p{X^i}^2</annotation></semantics></math></span></span></span> in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>M</mi><mrow><mi>d</mi><mo>−</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">M^{d-1,2}</annotation></semantics></math></span></span> (the analogue of the Minkowski space, but with signature <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mo>−</mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">d-1,2</annotation></semantics></math></span></span>). The Poincaré coordinates are defined as
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left right" columnspacing="0em 1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>z</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><mrow><msub><mi>T</mi><mn>1</mn></msub><mo>+</mo><msup><mi>X</mi><mrow><mi>d</mi><mo>−</mo><mn>1</mn></mrow></msup></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>t</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mfrac><mrow><mi>l</mi><msub><mi>T</mi><mn>2</mn></msub></mrow><mrow><msub><mi>T</mi><mn>1</mn></msub><mo>+</mo><msup><mi>X</mi><mrow><mi>d</mi><mo>−</mo><mn>1</mn></mrow></msup></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><msup><mi>x</mi><mi>i</mi></msup></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mfrac><mrow><mi>l</mi><msup><mi>X</mi><mi>i</mi></msup></mrow><mrow><msub><mi>T</mi><mn>1</mn></msub><mo>+</mo><msup><mi>X</mi><mrow><mi>d</mi><mo>−</mo><mn>1</mn></mrow></msup></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>i</mi><mo>=</mo><mn>1</mn><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><mi>d</mi><mo>−</mo><mn>2.</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	z&amp;\ceq\fr{l^2}{T_1+X^{d-1}},\\
	t&amp;\ceq\fr{lT_2}{T_1+X^{d-1}},\\
	x^i&amp;\ceq\fr{lX^i}{T_1+X^{d-1}},&amp;i=1,\ldots,d-2.
\end{align*}</annotation></semantics></math></span></span></span></p>
<h2 data-label="0.2" id="the-derivation">The derivation</h2>
<p>Define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>T</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">T\ceq T_1</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>X</mi><mrow><mi>d</mi><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">X\ceq X^{d-1}</annotation></semantics></math></span></span> just for fun. Then, define two <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>d</mi><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{d-1}</annotation></semantics></math></span></span>-dimensional multi-indices
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Y</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">(</mo><mi mathvariant="normal">i</mi><msub><mi>T</mi><mn>2</mn></msub><mo separator="true">,</mo><msup><mi>X</mi><mn>1</mn></msup><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msup><mi>X</mi><mrow><mi>d</mi><mo>−</mo><mn>2</mn></mrow></msup><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mi>y</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">(</mo><mi mathvariant="normal">i</mi><mi>t</mi><mo separator="true">,</mo><msup><mi>x</mi><mn>1</mn></msup><mo separator="true">,</mo><mo>…</mo><mo separator="true">,</mo><msup><mi>x</mi><mrow><mi>d</mi><mo>−</mo><mn>2</mn></mrow></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Y\ceq\p{\i T_2,X^1,\ldots,X^{d-2}},\quad y\ceq\p{\i t,x^1,\ldots,x^{d-2}}.</annotation></semantics></math></span></span></span></p>
<p>The hyperboloid constraint and the metric (east coast convention) are then <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>X</mi><mn>2</mn></msup><mo>−</mo><msup><mi>T</mi><mn>2</mn></msup><mo>+</mo><msup><mi>Y</mi><mn>2</mn></msup><mo>=</mo><mo>−</mo><msup><mi>l</mi><mn>2</mn></msup><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">d</mi><msup><mi>s</mi><mn>2</mn></msup><mo>=</mo><mi mathvariant="normal">d</mi><msup><mi>X</mi><mn>2</mn></msup><mo>−</mo><mi mathvariant="normal">d</mi><msup><mi>T</mi><mn>2</mn></msup><mo>+</mo><mi mathvariant="normal">d</mi><msup><mi>Y</mi><mn>2</mn></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">X^2-T^2+Y^2=-l^2,\quad \d s^2=\d X^2-\d T^2+\d Y^2,</annotation></semantics></math></span></span></span> which are equivalently <span id="eq:constraint-and-metric" data-label="(1)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">(</mo><mi>X</mi><mo>+</mo><mi>T</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mi>X</mi><mo>−</mo><mi>T</mi><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><msup><mi>l</mi><mn>2</mn></msup><mo>−</mo><msup><mi>Y</mi><mn>2</mn></msup><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">d</mi><msup><mi>s</mi><mn>2</mn></msup><mo>=</mo><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>X</mi><mo>+</mo><mi mathvariant="normal">d</mi><mi>T</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>X</mi><mo>−</mo><mi mathvariant="normal">d</mi><mi>T</mi><mo fence="true">)</mo></mrow><mo>+</mo><mi mathvariant="normal">d</mi><msup><mi>Y</mi><mn>2</mn></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\p{X+T}\p{X-T}=-l^2-Y^2,\quad\d s^2=\p{\d X+\d T}\p{\d X-\d T}+\d Y^2.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1)</annotation></semantics></math></span></span></span></span> </span></span> The definition of the Poincaré coordinates can be written as
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>z</mi><mo>=</mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><mrow><mi>X</mi><mo>+</mo><mi>T</mi></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>y</mi><mo>=</mo><mfrac><mi>z</mi><mi>l</mi></mfrac><mi>Y</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">z=\fr{l^2}{X+T},\quad y=\fr zlY,</annotation></semantics></math></span></span></span> or equivalently <span id="eq:poincare-coord" data-label="(2)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>X</mi><mo>+</mo><mi>T</mi><mo>=</mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><mi>z</mi></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>Y</mi><mo>=</mo><mfrac><mrow><mi>l</mi><mi>y</mi></mrow><mi>z</mi></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">X+T=\fr{l^2}z,\quad Y=\fr{ly}z.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>2</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(2)</annotation></semantics></math></span></span></span></span> </span></span></p>
<p>Substitute Equation <a href="#eq:poincare-coord">2</a> into the first equation in Equation <a href="#eq:constraint-and-metric">1</a>. Then, we have <span id="eq:X-minus-T" data-label="(3)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>X</mi><mo>−</mo><mi>T</mi><mo>=</mo><mo>−</mo><mi>z</mi><mo>−</mo><mfrac><msup><mi>y</mi><mn>2</mn></msup><mi>z</mi></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">X-T=-z-\fr{y^2}z.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(3)</annotation></semantics></math></span></span></span></span> </span></span> Differentiate Equation <a href="#eq:poincare-coord">2</a> and <a href="#eq:X-minus-T">3</a>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">d</mi><mi>X</mi><mo>+</mo><mi mathvariant="normal">d</mi><mi>T</mi><mo>=</mo><mo>−</mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><msup><mi>z</mi><mn>2</mn></msup></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>z</mi><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">d</mi><mi>X</mi><mo>−</mo><mi mathvariant="normal">d</mi><mi>T</mi><mo>=</mo><mo>−</mo><mi mathvariant="normal">d</mi><mi>z</mi><mo>+</mo><mfrac><msup><mi>y</mi><mn>2</mn></msup><msup><mi>z</mi><mn>2</mn></msup></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>z</mi><mo>−</mo><mfrac><mrow><mn>2</mn><mi>y</mi></mrow><mi>z</mi></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">d</mi><mi>Y</mi><mo>=</mo><mi>l</mi><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>y</mi></mrow><mi>z</mi></mfrac><mo>−</mo><mfrac><mi>y</mi><msup><mi>z</mi><mn>2</mn></msup></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\d X+\d T=-\fr{l^2}{z^2}\,\d z,\quad
\d X-\d T=-\d z+\fr{y^2}{z^2}\,\d z-\fr{2y}z\,\d y,\quad
\d Y=l\p{\fr{\d y}z-\fr y{z^2}\,\d z}.</annotation></semantics></math></span></span></span>
Substitute this into the second equation in Equation <a href="#eq:constraint-and-metric">1</a>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">d</mi><msup><mi>s</mi><mn>2</mn></msup><mo>=</mo><mo>−</mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><msup><mi>z</mi><mn>2</mn></msup></mfrac><mi mathvariant="normal">d</mi><mi>z</mi><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">d</mi><mi>z</mi><mo>+</mo><mfrac><msup><mi>y</mi><mn>2</mn></msup><msup><mi>z</mi><mn>2</mn></msup></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>z</mi><mo>−</mo><mfrac><mrow><mn>2</mn><mi>y</mi></mrow><mi>z</mi></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo fence="true">)</mo></mrow><mo>+</mo><msup><mi>l</mi><mn>2</mn></msup><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>y</mi></mrow><mi>z</mi></mfrac><mo>−</mo><mfrac><mi>y</mi><msup><mi>z</mi><mn>2</mn></msup></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><msup><mi>z</mi><mn>2</mn></msup></mfrac><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><msup><mi>y</mi><mn>2</mn></msup><mo>+</mo><mi mathvariant="normal">d</mi><msup><mi>z</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\d s^2=-\fr{l^2}{z^2}\d z\p{-\d z+\fr{y^2}{z^2}\,\d z-\fr{2y}z\,\d y}+l^2\p{\fr{\d y}z-\fr y{z^2}\,\d z}^2
=\fr{l^2}{z^2}\p{\d y^2+\d z^2}.</annotation></semantics></math></span></span></span></p>
<p>Finally, substitute back the definition of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>y</mi></mrow><annotation encoding="application/x-tex">y</annotation></semantics></math></span></span>, and we have the result <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">d</mi><msup><mi>s</mi><mn>2</mn></msup><mo>=</mo><mfrac><msup><mi>l</mi><mn>2</mn></msup><msup><mi>z</mi><mn>2</mn></msup></mfrac><mrow><mo fence="true">(</mo><mo>−</mo><mi mathvariant="normal">d</mi><msup><mi>t</mi><mn>2</mn></msup><mo>+</mo><munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>1</mn></mrow><mrow><mi>d</mi><mo>−</mo><mn>2</mn></mrow></munderover><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><msup><mi>x</mi><mi>i</mi></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><mi mathvariant="normal">d</mi><msup><mi>z</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\d s^2=\fr{l^2}{z^2}\p{-\d t^2+\sum_{i=1}^{d-2}\p{\d x^i}^2+\d z^2}.</annotation></semantics></math></span></span></span></p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="physics" /><category term="general relativity" /><category term="ads space" /><summary type="html"><![CDATA[In general relativity, people usually choose one of the two major metric signatures. However, in certain cases, the imaginary time convention can be more convenient. Here is one of such cases: the derivation of the metric in Poincaré coordinates for the anti-de Sitter space.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-09-10-poincare-coord-imag.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-09-10-poincare-coord-imag.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[The smallest wave packet in the lowest Landau level]]></title><link href="https://ulysseszh.github.io/physics/2024/07/01/landau-wave-packet.html" rel="alternate" type="text/html" title="The smallest wave packet in the lowest Landau level" /><published>2024-07-01T01:01:46-07:00</published><updated>2024-07-01T01:01:46-07:00</updated><id>https://ulysseszh.github.io/physics/2024/07/01/landau-wave-packet</id><content type="html" xml:base="https://ulysseszh.github.io/physics/2024/07/01/landau-wave-packet.html"><![CDATA[<h2 data-label="0.1" id="introduction">Introduction</h2>
<p>Exercise 12.5 from <em>Modern Condensed Matter Physics</em> (Girvin and Yang, 2019) asks to construct a Gaussian wave packet in the lowest Landau level in the Landau gauge, such that it is localized as closely as possible around some point <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">R</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">(</mo><msub><mi>R</mi><mi>x</mi></msub><mo separator="true">,</mo><msub><mi>R</mi><mi>y</mi></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\mbf R\ceq\p{R_x,R_y}</annotation></semantics></math></span></span>.</p>
<p>Actually, we can prove that the smallest wave packet is a Gaussian wave packet. Here is the derivation.</p>
<h2 data-label="0.2" id="the-problem">The problem</h2>
<p>First, for readers who are not familiar with the <a href="https://en.wikipedia.org/wiki/Landau_levels#In_the_Landau_gauge" target="_blank" rel="external">Landau levels</a>, here is a brief introduction. For an electron confined in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mi>y</mi></mrow><annotation encoding="application/x-tex">xy</annotation></semantics></math></span></span> plane under a magnetic field <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">B</mi><mo>=</mo><mi>B</mi><mover accent="true"><mi mathvariant="bold-italic">z</mi><mo>^</mo></mover></mrow><annotation encoding="application/x-tex">\mbf B=B\bhat z</annotation></semantics></math></span></span>, its Hamiltonian is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>H</mi><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msub><mi>m</mi><mi>e</mi></msub></mrow></mfrac><mrow><mo fence="true">(</mo><msubsup><mi>p</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msup><mrow><mo fence="true">(</mo><msub><mi>p</mi><mi>y</mi></msub><mo>−</mo><mfrac><mrow><mi>e</mi><mi>B</mi></mrow><mi>c</mi></mfrac><mi>x</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">H=\fr1{2m_e}\p{p_x^2+\p{p_y-\fr{eB}cx}^2}</annotation></semantics></math></span></span></span> under the Landau gauge <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">A</mi><mo>=</mo><mi>B</mi><mi>x</mi><mover accent="true"><mi mathvariant="bold-italic">y</mi><mo>^</mo></mover></mrow><annotation encoding="application/x-tex">\mbf A=Bx\bhat y</annotation></semantics></math></span></span>. Its eigenstates in the position representation are
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>ψ</mi><mrow><mi>n</mi><mi>k</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>k</mi><mi>y</mi></mrow></msup><msub><mi>H</mi><mi>n</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>l</mi></mfrac><mo>−</mo><mi>k</mi><mi>l</mi><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></msup></mrow><annotation encoding="application/x-tex">\fc{\psi_{nk}}{x,y}=\e^{\i ky}\fc{H_n}{\fr xl-kl}
\e^{-\p{x-kl^2}^2/2l^2}</annotation></semantics></math></span></span></span> labeled by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>∈</mo><mi mathvariant="double-struck">N</mi></mrow><annotation encoding="application/x-tex">n\in\bN</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>∈</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">k\in\bR</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>H</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">H_n</annotation></semantics></math></span></span> is the Hermite polynomial of degree <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> and
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>l</mi><mo><mi mathvariant="normal">≔</mi></mo><msqrt><mrow><mi mathvariant="normal">ℏ</mi><mi>c</mi><mi mathvariant="normal">/</mi><mi>e</mi><mi>B</mi></mrow></msqrt></mrow><annotation encoding="application/x-tex">l\ceq\sqrt{\hbar c/eB}</annotation></semantics></math></span></span>. States with the same <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span> are degenerate in energy (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo>=</mo><mrow><mo fence="true">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi mathvariant="normal">ℏ</mi><mi>e</mi><mi>B</mi><mi mathvariant="normal">/</mi><msub><mi>m</mi><mi>e</mi></msub><mi>c</mi></mrow><annotation encoding="application/x-tex">E_n=\p{n+1/2}\hbar eB/m_ec</annotation></semantics></math></span></span>) and make up the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>th Landau level. The Landau level with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">n=0</annotation></semantics></math></span></span> is called the lowest Landau level.</p>
<p>The problem, now, is this optimization problem: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><munder><mrow><mi>min</mi><mo>⁡</mo></mrow><msub><mi>a</mi><mi>k</mi></msub></munder><mspace width="1em"/></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msup><mi>y</mi><mn>2</mn></msup><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow><mi mathvariant="normal">s</mi><mi mathvariant="normal">t</mi></mrow><mspace width="1em"/></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mn>1</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>x</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><msub><mi>R</mi><mi>x</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>y</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><msub><mi>R</mi><mi>y</mi></msub></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	\min_{a_k}\quad&amp;\mel{\Psi}{x^2+y^2}{\Psi}\\
	\st\quad&amp;\braket{\Psi}{\Psi}=1,\\
	&amp;\mel{\Psi}{x}{\Psi}=R_x,\\
	&amp;\mel{\Psi}{y}{\Psi}=R_y
\end{align*}</annotation></semantics></math></span></span></span> (optimizing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msup><mi>y</mi><mn>2</mn></msup><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a{x^2+y^2}</annotation></semantics></math></span></span> is equivalent to optimizing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>σ</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>σ</mi><mi>y</mi><mn>2</mn></msubsup></mrow><annotation encoding="application/x-tex">\sgm_x^2+\sgm_y^2</annotation></semantics></math></span></span> because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>x</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a x</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>y</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a y</annotation></semantics></math></span></span> are both fixed), where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\ket\Psi</annotation></semantics></math></span></span> is defined as the state whose position representation is
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msub><mi>a</mi><mi>k</mi></msub><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>k</mi><mi>y</mi></mrow></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc\Psi{x,y}=\int\d k\,a_k\e^{\i ky}\e^{-\p{x-kl^2}^2/2l^2}.</annotation></semantics></math></span></span></span></p>
<h2 data-label="0.3" id="the-solution">The solution</h2>
<p>Consider the <a href="https://en.wikipedia.org/wiki/Moment_generating_function" target="_blank" rel="external">moment-generating function</a> <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>M</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>u</mi><mo separator="true">,</mo><mi>v</mi><mo fence="true">)</mo></mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>u</mi><mi>x</mi><mo>+</mo><mi>v</mi><mi>y</mi></mrow></msup><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>∬</mo><mi mathvariant="normal">d</mi><mi>x</mi><mi mathvariant="normal">d</mi><mi>y</mi><mtext> </mtext><msup><mi mathvariant="normal">e</mi><mrow><mi>u</mi><mi>x</mi><mo>+</mo><mi>v</mi><mi>y</mi></mrow></msup><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi mathvariant="normal">i</mi><mi>k</mi><mi>y</mi></mrow></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></msup><mo>∫</mo><mi mathvariant="normal">d</mi><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><msub><mi>a</mi><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></msub><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi>y</mi></mrow></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></msup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>∬</mo><mi mathvariant="normal">d</mi><mi>k</mi><mi mathvariant="normal">d</mi><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><msub><mi>a</mi><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></msub><mo>∫</mo><mi mathvariant="normal">d</mi><mi>x</mi><mtext> </mtext><msup><mi mathvariant="normal">e</mi><mrow><mi>u</mi><mi>x</mi><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></msup><munder><munder><mrow><mo>∫</mo><mi mathvariant="normal">d</mi><mi>y</mi><mtext> </mtext><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>v</mi><mi>y</mi><mo>+</mo><mi mathvariant="normal">i</mi><mrow><mo fence="true">(</mo><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>−</mo><mi>k</mi><mo fence="true">)</mo></mrow><mi>y</mi><mo fence="true">)</mo></mrow></mrow><mo stretchy="true">⏟</mo></munder><mrow><mn>2</mn><mi>π</mi><mi>δ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>−</mo><mi>k</mi><mo>−</mo><mi mathvariant="normal">i</mi><mi>v</mi><mo fence="true">)</mo></mrow></mrow></munder></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>2</mn><mi>π</mi><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><msub><mi>a</mi><mrow><mi>k</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>v</mi></mrow></msub><munder><munder><mrow><mo>∫</mo><mi mathvariant="normal">d</mi><mi>x</mi><mtext> </mtext><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>u</mi><mi>x</mi><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><mrow><mo fence="true">(</mo><mi>k</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>v</mi><mo fence="true">)</mo></mrow><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><mo stretchy="true">⏟</mo></munder><mrow><mi>l</mi><msqrt><mi>π</mi></msqrt><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><msup><mi>l</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><mn>4</mn><mi>k</mi><mi>u</mi><mo>+</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><mn>2</mn><mi mathvariant="normal">i</mi><mi>u</mi><mi>v</mi><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow></munder></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>2</mn><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi>l</mi><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><msup><mi>l</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><mn>2</mn><mi mathvariant="normal">i</mi><mi>u</mi><mi>v</mi><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><msub><mi>a</mi><mrow><mi>k</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>v</mi></mrow></msub><msup><mi mathvariant="normal">e</mi><mrow><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mi>u</mi></mrow></msup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>2</mn><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi>l</mi><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><mrow><mo fence="true">(</mo><msub><mi>a</mi><mi>k</mi></msub><mo>+</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><msub><mi>a</mi><mi>k</mi></msub><mi>u</mi><mo>+</mo><mi mathvariant="normal">i</mi><msubsup><mi>a</mi><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mi>v</mi><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><msup><mi>l</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mn>2</mn><msup><mi>k</mi><mn>2</mn></msup><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><msub><mi>a</mi><mi>k</mi></msub><msup><mi>u</mi><mn>2</mn></msup></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mspace width="2em"/><mspace width="2em"/><mspace width="2em"/><mspace width="2em"/><mrow><mrow/><mo>+</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mrow><mo fence="true">(</mo><msup><mi>l</mi><mn>2</mn></msup><msub><mi>a</mi><mi>k</mi></msub><mo>−</mo><mn>2</mn><msubsup><mi>a</mi><mi>k</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msubsup><mo fence="true">)</mo></mrow><msup><mi>v</mi><mn>2</mn></msup><mo>+</mo><mfrac><mi mathvariant="normal">i</mi><mn>2</mn></mfrac><msup><mi>l</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><msub><mi>a</mi><mi>k</mi></msub><mo>+</mo><mn>2</mn><mi>k</mi><msubsup><mi>a</mi><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo fence="true">)</mo></mrow><mi>u</mi><mi>v</mi><mo>+</mo><mo>⋯</mo><mtext> </mtext><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	\fc M{u,v}&amp;\ceq\mel{\Psi}{\e^{ux+vy}}{\Psi}\\
	&amp;=\iint\d x\d y\,\e^{ux+vy}
	\int\d k\,a_k^*\e^{-\i ky}\e^{-\fr1{2l^2}\p{x-kl^2}^2}
	\int\d k'\,a_{k'}\e^{\i k'y}\e^{-\fr1{2l^2}\p{x-k'l^2}^2}\\
	&amp;=\iint\d k\d k'\,a_k^*a_{k'}\int\d x\,\e^{
		ux-\fr1{2l^2}\p{x-kl^2}^2-\fr1{2l^2}\p{x-k'l^2}^2
	}\underbrace{\int\d y\,\fc\exp{vy+\i\p{k'-k}y}}_{2\pi\fc\dlt{k'-k-\i v}}\\
	&amp;=2\pi\int\d k\,a_k^*a_{k+\i v}\underbrace{\int\d x\,\fc\exp{
		ux-\fr1{2l^2}\p{x-kl^2}^2-\fr1{2l^2}\p{x-\p{k+\i v}l^2}^2
	}}_{l\sqrt\pi\fc\exp{\fr14l^2\p{4ku+u^2+2\i uv+v^2}}}\\
	&amp;=2\pi^{3/2}l\fc\exp{\fr14l^2\p{u^2+2\i uv+v^2}}
	\int\d k\,a_k^*a_{k+\i v}\e^{kl^2u}\\
	&amp;=2\pi^{3/2}l\int\d k\,a_k^*\left(
		a_k+kl^2a_ku+\i a_k'v+\fr14l^2\p{1+2k^2l^2}a_ku^2
	\right.\\&amp;\qquad\qquad\qquad\qquad\left.
		{}+\fr14\p{l^2a_k-2a_k''}v^2
		+\fr\i2l^2\p{a_k+2ka_k'}uv+\cdots
	\right),
\end{align*}</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>a</mi><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo><mi mathvariant="normal">≔</mi></mo><mi mathvariant="normal">d</mi><msub><mi>a</mi><mi>k</mi></msub><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>k</mi></mrow><annotation encoding="application/x-tex">a_k'\ceq\d a_k/\d k</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mi>a</mi><mi>k</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msubsup><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><msub><mi>a</mi><mi>k</mi></msub><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><msup><mi>k</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">a_k''\ceq\d^2a_k/\d k^2</annotation></semantics></math></span></span>. On the other hand, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>M</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>u</mi><mo separator="true">,</mo><mi>v</mi><mo fence="true">)</mo></mrow><mo>=</mo><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mn>1</mn><mo>+</mo><mi>u</mi><mi>x</mi><mo>+</mo><mi>u</mi><mi>y</mi><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>u</mi><mn>2</mn></msup><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>v</mi><mn>2</mn></msup><msup><mi>y</mi><mn>2</mn></msup><mo>+</mo><mi>u</mi><mi>v</mi><mi>x</mi><mi>y</mi><mo>+</mo><mo>⋯</mo><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc M{u,v}=\mel{\Psi}{1+ux+uy+\fr12u^2x^2+\fr12v^2y^2+uvxy+\cdots}{\Psi}.</annotation></semantics></math></span></span></span> Compare the expansion coefficients, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>2</mn><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi>l</mi><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><msub><mi>a</mi><mi>k</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>x</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>2</mn><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><msup><mi>l</mi><mn>3</mn></msup><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><mi>k</mi><msub><mi>a</mi><mi>k</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>y</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>2</mn><mi mathvariant="normal">i</mi><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi>l</mi><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><msubsup><mi>a</mi><mi>k</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msubsup><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><msup><mi>x</mi><mn>2</mn></msup><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><msup><mi>l</mi><mn>3</mn></msup><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mn>2</mn><msup><mi>k</mi><mn>2</mn></msup><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><msub><mi>a</mi><mi>k</mi></msub><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><msup><mi>y</mi><mn>2</mn></msup><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi>l</mi><mo>∫</mo><mi mathvariant="normal">d</mi><mi>k</mi><mtext> </mtext><msubsup><mi>a</mi><mi>k</mi><mo>∗</mo></msubsup><mrow><mo fence="true">(</mo><msup><mi>l</mi><mn>2</mn></msup><mo>−</mo><mn>2</mn><msubsup><mi>a</mi><mi>k</mi><mrow><mo mathvariant="normal">′</mo><mo mathvariant="normal">′</mo></mrow></msubsup><mo fence="true">)</mo></mrow><msub><mi>a</mi><mi>k</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	\braket{\Psi}{\Psi}&amp;=2\pi^{3/2}l\int\d k\,a_k^*a_k,\\
	\mel{\Psi}{x}{\Psi}&amp;=2\pi^{3/2}l^3\int\d k\,a_k^*ka_k,\\
	\mel{\Psi}{y}{\Psi}&amp;=2\i\pi^{3/2}l\int\d k\,a_k^*a_k',\\
	\mel{\Psi}{x^2}{\Psi}&amp;=\fr12\pi^{3/2}l^3\int\d k\,a_k^*\p{1+2k^2l^2}a_k,\\
	\mel{\Psi}{y^2}{\Psi}&amp;=\fr12\pi^{3/2}l\int\d k\,a_k^*\p{l^2-2a_k''}a_k.
\end{align*}</annotation></semantics></math></span></span></span></p>
<p>Define <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>a</mi><mi>k</mi></msub><msqrt><mrow><mn>2</mn><msup><mi>π</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi>l</mi></mrow></msqrt></mrow><annotation encoding="application/x-tex">\fc\vphi k\ceq a_k\sqrt{2\pi^{3/2}l}</annotation></semantics></math></span></span>. Define fictitious position and momentum operators acting on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\vphi</annotation></semantics></math></span></span> as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Ξ</mi><mi>φ</mi><mo>:</mo><mi>k</mi><mo>↦</mo><mi>k</mi><mi>φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">Π</mi><mi>φ</mi><mo>:</mo><mi>k</mi><mo>↦</mo><mo>−</mo><mi mathvariant="normal">i</mi><msup><mi>φ</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\Xi\vphi:k\mapsto k\fc\vphi k,\quad
\Pi\vphi:k\mapsto-\i\fc{\vphi'}k.</annotation></semantics></math></span></span></span> Using the constraints of the original optimization problem and abusing the bra–ket notation on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\vphi</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mn>1</mn><mo separator="true">,</mo><mspace width="1em"/><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ξ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mfrac><msub><mi>R</mi><mi>x</mi></msub><msup><mi>l</mi><mn>2</mn></msup></mfrac><mo separator="true">,</mo><mspace width="1em"/><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Π</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><msub><mi>R</mi><mi>y</mi></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\braket{\vphi}{\vphi}=1,\quad\mel\vphi\Xi\vphi=\fr{R_x}{l^2},\quad
\mel\vphi\Pi\vphi=-R_y.</annotation></semantics></math></span></span></span> The objective function then becomes <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Ψ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><msup><mi>x</mi><mn>2</mn></msup><mo>+</mo><msup><mi>y</mi><mn>2</mn></msup><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ψ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>l</mi><mn>2</mn></msup><mo>+</mo><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="script">H</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\mel{\Psi}{x^2+y^2}{\Psi}=\fr12l^2+\mel{\vphi}{\mcal H}{\vphi},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="script">H</mi><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">Π</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn><mo>+</mo><msup><mi>l</mi><mn>4</mn></msup><msup><mi mathvariant="normal">Ξ</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\mcal H\ceq \Pi^2/2+l^4\Xi^2/2</annotation></semantics></math></span></span> is a fictitious Hamiltonian, which is the Hamiltonian of a harmonic oscillator with mass <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> and angular frequency <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ω</mi><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>l</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\omg\ceq l^2</annotation></semantics></math></span></span>.</p>
<p>The optimization problem can now be re-stated in terms of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\ket\vphi</annotation></semantics></math></span></span> as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><munder><mrow><mi>min</mi><mo>⁡</mo></mrow><mrow><mo fence="true">∣</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow></munder><mspace width="1em"/></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="script">H</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow><mi mathvariant="normal">s</mi><mi mathvariant="normal">t</mi></mrow><mspace width="1em"/></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mn>1</mn><mo separator="true">,</mo><mspace width="1em"/><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Ξ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><msub><mi>R</mi><mi>x</mi></msub><mi mathvariant="normal">/</mi><mi>ω</mi><mo separator="true">,</mo><mspace width="1em"/><mrow><mo fence="true">⟨</mo><mi>φ</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi mathvariant="normal">Π</mi><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mi>φ</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><msub><mi>R</mi><mi>y</mi></msub><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	\min_{\ket\vphi}\quad&amp;\mel\vphi{\mcal H}{\vphi}\\
	\st\quad&amp;\braket\vphi\vphi=1,\quad\mel\vphi\Xi\vphi=R_x/\omg,\quad\mel\vphi\Pi\vphi=-R_y.
\end{align*}</annotation></semantics></math></span></span></span> Physically, this means that we want to find the state of a harmonic oscillator with the given expectation values of position and momentum and the lowest energy. To find it, we can use Hisenberg’s uncertainty principle: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo fence="true">⟨</mo><mi mathvariant="script">H</mi><mo fence="true">⟩</mo></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mrow><mo fence="true">⟨</mo><msup><mi mathvariant="normal">Π</mi><mn>2</mn></msup><mo fence="true">⟩</mo></mrow><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>ω</mi><mn>2</mn></msup><mrow><mo fence="true">⟨</mo><msup><mi mathvariant="normal">Ξ</mi><mn>2</mn></msup><mo fence="true">⟩</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">⟨</mo><mi mathvariant="normal">Π</mi><mo fence="true">⟩</mo></mrow><mn>2</mn></msup><mo>+</mo><msubsup><mi>σ</mi><mi mathvariant="normal">Π</mi><mn>2</mn></msubsup><mo fence="true">)</mo></mrow><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>ω</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><mrow><mo fence="true">⟨</mo><msup><mi mathvariant="normal">Ξ</mi><mn>2</mn></msup><mo fence="true">⟩</mo></mrow><mo>+</mo><msubsup><mi>σ</mi><mi mathvariant="normal">Ξ</mi><mn>2</mn></msubsup><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msubsup><mi>σ</mi><mi mathvariant="normal">Π</mi><mn>2</mn></msubsup><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>ω</mi><mn>2</mn></msup><msubsup><mi>σ</mi><mi mathvariant="normal">Ξ</mi><mn>2</mn></msubsup><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msubsup><mi>R</mi><mi>y</mi><mn>2</mn></msubsup><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msubsup><mi>R</mi><mi>x</mi><mn>2</mn></msubsup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>≥</mo><mi>ω</mi><msub><mi>σ</mi><mi mathvariant="normal">Π</mi></msub><msub><mi>σ</mi><mi mathvariant="normal">Ξ</mi></msub><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>R</mi><mn>2</mn></msup><mo>≥</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>ω</mi><mo>+</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><msup><mi>R</mi><mn>2</mn></msup><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
	\a{\mcal H}&amp;=\fr12\a{\Pi^2}+\fr12\omg^2\a{\Xi^2}\\
	&amp;=\fr12\p{\a\Pi^2+\sgm_\Pi^2}+\fr12\omg^2\p{\a{\Xi^2}+\sgm_\Xi^2}\\
	&amp;=\fr12\sgm_\Pi^2+\fr12\omg^2\sgm_\Xi^2+\fr12R_y^2+\fr12 R_x^2\\
	&amp;\ge\omg\sgm_\Pi\sgm_\Xi+\fr12R^2
	\ge\fr12\omg+\fr12R^2.
\end{align*}</annotation></semantics></math></span></span></span>
The equality in the first “<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≥</mo></mrow><annotation encoding="application/x-tex">\ge</annotation></semantics></math></span></span>” is achieved when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>σ</mi><mi mathvariant="normal">Π</mi></msub><mo>=</mo><mi>ω</mi><msub><mi>σ</mi><mi mathvariant="normal">Ξ</mi></msub></mrow><annotation encoding="application/x-tex">\sgm_\Pi=\omg\sgm_\Xi</annotation></semantics></math></span></span>, and that in the second “<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>≥</mo></mrow><annotation encoding="application/x-tex">\ge</annotation></semantics></math></span></span>” is achieved when the uncertainty principle is saturated. As we know from quantum mechanics, the <a href="https://en.wikipedia.org/wiki/Coherent_state" target="_blank" rel="external">coherent state</a> of a harmonic oscillator satisfies both conditions. The wavefunction of this state is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mrow><mo fence="true">(</mo><mfrac><mi>ω</mi><mi>π</mi></mfrac><mo fence="true">)</mo></mrow><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>4</mn></mrow></msup><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>ω</mi><msup><mrow><mo fence="true">(</mo><mi>k</mi><mo>−</mo><mfrac><msub><mi>R</mi><mi>x</mi></msub><mi>ω</mi></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>−</mo><mi mathvariant="normal">i</mi><msub><mi>R</mi><mi>y</mi></msub><mi>k</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc\vphi k=\p{\fr\omg\pi}^{1/4}
\fc\exp{-\fr12\omg\p{k-\fr{R_x}{\omg}}^2-\i R_yk}.</annotation></semantics></math></span></span></span> Express the final result in terms of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">a_k</annotation></semantics></math></span></span>:
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>a</mi><mi>k</mi></msub><mo>=</mo><mfrac><mn>1</mn><mrow><msqrt><mn>2</mn></msqrt><mi>π</mi></mrow></mfrac><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi mathvariant="normal">i</mi><mi>k</mi><msub><mi>R</mi><mi>y</mi></msub></mrow></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mfrac><mn>1</mn><mrow><mn>2</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><msup><mrow><mo fence="true">(</mo><msub><mi>R</mi><mi>x</mi></msub><mo>−</mo><mi>k</mi><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">a_k=\fr1{\sqrt2\pi}\e^{-\i kR_y}\e^{-\fr1{2l^2}\p{R_x-kl^2}^2}.</annotation></semantics></math></span></span></span> We may work out the integral to get the wave function of the wave packet: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">Ψ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo separator="true">,</mo><mi>y</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mrow><msqrt><mrow><mn>2</mn><mi>π</mi></mrow></msqrt><mi>l</mi></mrow></mfrac><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mfrac><mn>1</mn><mrow><mn>4</mn><msup><mi>l</mi><mn>2</mn></msup></mrow></mfrac><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mi>x</mi><mo>−</mo><msub><mi>R</mi><mi>x</mi></msub><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>+</mo><msup><mrow><mo fence="true">(</mo><mi>y</mi><mo>−</mo><msub><mi>R</mi><mi>y</mi></msub><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>−</mo><mn>2</mn><mi mathvariant="normal">i</mi><mrow><mo fence="true">(</mo><mi>x</mi><mo>+</mo><msub><mi>R</mi><mi>x</mi></msub><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mi>y</mi><mo>−</mo><msub><mi>R</mi><mi>y</mi></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{\Psi}{x,y}=\fr1{\sqrt{2\pi}l}\fc\exp{-\fr1{4l^2}\p{
	\p{x-R_x}^2+\p{y-R_y}^2-2\i\p{x+R_x}\p{y-R_y}
}}.</annotation></semantics></math></span></span></span> This is a Gaussian wave packet centered at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">R</mi></mrow><annotation encoding="application/x-tex">\mbf R</annotation></semantics></math></span></span> with covariance matrix
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Diag</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>l</mi><mn>2</mn></msup><mo separator="true">,</mo><msup><mi>l</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\opc{Diag}{l^2,l^2}</annotation></semantics></math></span></span>.</p>
<h2 data-label="0.4" id="further-problems">Further problems</h2>
<p>The optimal wave packet is indeed Gaussian. This makes me curious about whether this is a coincidence or not.</p>
<p>Another thing worth noting is that this result is actually the Dirac delta wave function peaking at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">R</mi></mrow><annotation encoding="application/x-tex">\mbf R</annotation></semantics></math></span></span> projected into the lowest Landau level. This was actually my first idea to solve the problem. I was like: well, isn’t the Dirac delta the smallest possible wave packet by all means? If the basis is complete, I can surely combine them into a Dirac delta, and it would be very easy to work out <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi>k</mi></msub></mrow><annotation encoding="application/x-tex">a_k</annotation></semantics></math></span></span> in this case. Then, I was like: nah, merely a single Landau level is not complete, so I cannot do that anyway. I then did not even bother to proceed with this approach and went on to trying other methods. It turns out that this approach is actually correct—at least it gives the same result as the correct approach.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="physics" /><category term="quantum mechanics" /><category term="condensed matter physics" /><summary type="html"><![CDATA[The smallest wave packet in the lowest Landau level exists, and is a Gaussian wave packet. This turns out to be related to the coherent state of the harmonic oscillator.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-07-01-landau-wave-packet.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-07-01-landau-wave-packet.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Regularizing the partition function of a hydrogen atom]]></title><link href="https://ulysseszh.github.io/physics/2024/06/30/regularize-hydrogen.html" rel="alternate" type="text/html" title="Regularizing the partition function of a hydrogen atom" /><published>2024-06-30T21:18:12-07:00</published><updated>2024-06-30T21:18:12-07:00</updated><id>https://ulysseszh.github.io/physics/2024/06/30/regularize-hydrogen</id><content type="html" xml:base="https://ulysseszh.github.io/physics/2024/06/30/regularize-hydrogen.html"><![CDATA[<h2 data-label="0.1" id="introduction">Introduction</h2>
<details>
<summary>
The unit system
</summary>
<p>The unit system used in this article is <a href="https://en.wikipedia.org/wiki/Atomic_units" target="_blank" rel="external">Hartree atomic units</a>: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi mathvariant="normal">e</mi></msub><mo>=</mo><msub><mi>k</mi><mi mathvariant="normal">B</mi></msub><mo>=</mo><mi mathvariant="normal">ℏ</mi><mo>=</mo><mn>4</mn><mi>π</mi><msub><mi>ε</mi><mn>0</mn></msub><mo>=</mo><mi>e</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">m_\mrm e=k_\mrm B=\hbar=4\pi\veps_0=e=1</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi mathvariant="normal">e</mi></msub></mrow><annotation encoding="application/x-tex">m_\mrm e</annotation></semantics></math></span></span> is the electron mass.</p>
<p>In this unit system, the Bohr radius is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>a</mi><mi mathvariant="normal">B</mi></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">a_\mrm B=1</annotation></semantics></math></span></span>, which is of angstrom order. Therefore, I will use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mn>10</mn></msup></mrow><annotation encoding="application/x-tex">10^{10}</annotation></semantics></math></span></span> as the order of macroscopic lengths. The Rydberg unit of energy is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mi mathvariant="normal">R</mi><mi mathvariant="normal">y</mi></mrow><mo>=</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\mrm{Ry}=1/2</annotation></semantics></math></span></span>, which is of electronvolt order. Therefore, I will use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">10^3</annotation></semantics></math></span></span> as the order of inverse room temperature.</p>
<p>One can adjust the units to get results for the cases of other hydrogen-like atoms: use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>Z</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>4</mn><mi>π</mi><msub><mi>ε</mi><mn>0</mn></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">Z^2/4\pi\veps_0=1</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn><mi>π</mi><msub><mi>ε</mi><mn>0</mn></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">4\pi\veps_0=1</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> is the atomic number.</p>
<p>In this article, I also assume that the mass of the nucleus is infinite. If you want more accuracy, you can use <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi mathvariant="normal">N</mi></msub><msub><mi>m</mi><mi mathvariant="normal">e</mi></msub><mi mathvariant="normal">/</mi><mrow><mo fence="true">(</mo><msub><mi>m</mi><mi mathvariant="normal">N</mi></msub><mo>+</mo><msub><mi>m</mi><mi mathvariant="normal">e</mi></msub><mo fence="true">)</mo></mrow><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">m_\mrm Nm_\mrm e/\p{m_\mrm N+m_\mrm e}=1</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi mathvariant="normal">e</mi></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">m_\mrm e=1</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>m</mi><mi mathvariant="normal">N</mi></msub></mrow><annotation encoding="application/x-tex">m_\mrm N</annotation></semantics></math></span></span> is the mass of the nucleus.</p>
</details>
<details>
<summary>
Terminology about temperatures
</summary>
<p>I will mainly be working with the inverse temperature <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><mi mathvariant="normal">/</mi><msub><mi>k</mi><mi mathvariant="normal">B</mi></msub><mi>T</mi></mrow><annotation encoding="application/x-tex">\beta\ceq1/k_\mrm BT</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> is the temperature. However, I will still use “temperature” often to give some physical intuition. To avoid confusion in the context of using <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> and in appearance of <a href="https://en.wikipedia.org/wiki/Negative_temperature" target="_blank" rel="external">negative temperature</a>, I would avoid using phrases like “high temperature” and “low temperature”. Instead, here are some terminologies that I am going to use:</p>
<ul>
<li>“Cold (positive) temperature” means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to+\infty</annotation></semantics></math></span></span>.</li>
<li>“Hot positive temperature” means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\beta\to0^+</annotation></semantics></math></span></span>.</li>
<li>“Cold negative temperature” means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><msup><mn>0</mn><mo>−</mo></msup></mrow><annotation encoding="application/x-tex">\beta\to0^-</annotation></semantics></math></span></span>.</li>
<li>“Hot negative temperature” means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to-\infty</annotation></semantics></math></span></span>.</li>
</ul>
</details>
<p>The energy levels of a hydrogen atom are (ignoring fine structures etc.) <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo>=</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">E_n=-1/2n^2</annotation></semantics></math></span></span>, with each energy level labeled by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>∈</mo><msup><mi mathvariant="double-struck">Z</mi><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">n\in\bZ^+</annotation></semantics></math></span></span>, and each energy level has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>g</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>n</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">g_n\ceq n^2</annotation></semantics></math></span></span> degeneracy (ignoring spin degeneracy, which merely contributes to an overall factor of the partition function). The partition function is <span id="eq:Z" data-label="(1)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msub><mi>g</mi><mi>n</mi></msub><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>β</mi><msub><mi>E</mi><mi>n</mi></msub></mrow></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mn>2</mn></msup><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fc Z\beta\ceq\sum_{n=1}^\infty g_n\e^{-\beta E_n}
=\sum_{n=1}^\infty n^2\e^{\beta/2n^2},</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1)</annotation></semantics></math></span></span></span></span> </span></span> which diverges for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>∈</mo><mi mathvariant="double-struck">C</mi></mrow><annotation encoding="application/x-tex">\beta\in\bC</annotation></semantics></math></span></span> (of course, normally we can only have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>∈</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">\beta\in\bR</annotation></semantics></math></span></span>, but the point of saying that it diverges for any complex <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> is that there is no way we can analytically continue the function to get a finite result). Does this mean that statistical mechanics breaks down for this system? Not necessarily. Actually, there are multiple ways we can tackle this divergence.</p>
<p>One should notice that, although this article concentrates on regularizing partition functions and that of the hydrogen atom in particular, all the methods are valid for more general divergent sums.</p>
<p>Here is a sentence that is quoted by many literatures on diverging series, so I want to quote it, too:</p>
<figure class="no-indent">
<blockquote>
<p>Divergente Rækker er i det Hele noget Fandenskap, og det er en Skam at man vover at grunde nogen Demonstrasjon derpaa.</p>
</blockquote>
<figcaption>
—N. H. Abel
</figcaption>
</figure>
<p class="no-indent">
It translates to “Divergent series are in general deadly, and it is shameful that anyone dare to base any proof on them.”
</p>
<h2 data-label="0.2" id="the-physical-answer">The physical answer</h2>
<p>A physicist always tell you that one should not be afraid of infinities. Instead, one should look at where the infinity comes out from the seemingly physical model, where there is something sneakily unphysical which ultimately leads to this unphysical divergence. In our case, the divergence comes from high energy levels. It is then a good time to question whether those high energy levels are physical.</p>
<p>There is a radius associated with each energy level in the sense of the Bohr model: <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>n</mi></msub><mo>=</mo><msup><mi>n</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">r_n=n^2</annotation></semantics></math></span></span>. When <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>n</mi></msub><mo>∼</mo><mi>L</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><msup><mn>0</mn><mn>10</mn></msup></mrow><annotation encoding="application/x-tex">r_n\sim L\ceq10^{10}</annotation></semantics></math></span></span> (which happens at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>∼</mo><mi mathvariant="normal">Λ</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><msup><mn>0</mn><mn>5</mn></msup></mrow><annotation encoding="application/x-tex">n\sim\Lmd\ceq10^5</annotation></semantics></math></span></span>), the orbit is really microscopic now, and the interaction between the electron and the “box” that contains the whole experimental setup is now having significant effects. Or, if there is not a box at all, we can use the size of the universe instead, which is about <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>r</mi><mi>n</mi></msub><mo>∼</mo><mi>L</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><msup><mn>0</mn><mn>36</mn></msup></mrow><annotation encoding="application/x-tex">r_n\sim L\ceq10^{36}</annotation></semantics></math></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Λ</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><msup><mn>0</mn><mn>18</mn></msup></mrow><annotation encoding="application/x-tex">\Lmd\ceq10^{18}</annotation></semantics></math></span></span>). Use the model of particle in a box for energy levels higher than
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">n=\Lmd</annotation></semantics></math></span></span>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">Λ</mi></munderover><msup><mi>n</mi><mn>2</mn></msup><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mo>+</mo><munderover><mo>∑</mo><mrow><msub><mi>n</mi><mi>x</mi></msub><mo separator="true">,</mo><msub><mi>n</mi><mi>y</mi></msub><mo separator="true">,</mo><msub><mi>n</mi><mi>z</mi></msub><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>β</mi><mfrac><mrow><mrow><mo fence="true">(</mo><msubsup><mi>n</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>n</mi><mi>y</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>n</mi><mi>z</mi><mn>2</mn></msubsup><mo fence="true">)</mo></mrow><msup><mi>π</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>L</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">Z=\sum_{n=1}^\Lmd n^2\e^{\beta/2n^2}
+\sum_{n_x,n_y,n_z=1}^\infty\fc\exp{-\beta\fr{\p{n_x^2+n_y^2+n_z^2}\pi^2}{2L^2}},</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi></mrow><annotation encoding="application/x-tex">L</annotation></semantics></math></span></span> is the side length of the box (assuming that the box is cubic). If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi></mrow><annotation encoding="application/x-tex">L</annotation></semantics></math></span></span> is very large, we can approximate the second term as a spherically symmetric integral over the first octant to get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>L</mi><mn>3</mn></msup><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>π</mi><mi>β</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">L^3\p{2\pi\beta}^{-3/2}</annotation></semantics></math></span></span>.</p>
<details>
<summary>
The integral approximation
</summary>
<p>This is actually the result for Boltzmann ideal gas, so it should be familar, but I still write down the calculation here for completeness.</p>
<p>We can approximate <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∑</mo><mrow><msub><mi>n</mi><mi>x</mi></msub><mo separator="true">,</mo><msub><mi>n</mi><mi>y</mi></msub><mo separator="true">,</mo><msub><mi>n</mi><mi>z</mi></msub><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>β</mi><mfrac><mrow><mrow><mo fence="true">(</mo><msubsup><mi>n</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>n</mi><mi>y</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>n</mi><mi>z</mi><mn>2</mn></msubsup><mo fence="true">)</mo></mrow><msup><mi>π</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>L</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo>≈</mo><mi>I</mi><mo><mi mathvariant="normal">≔</mi></mo><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">d</mi><mn>3</mn></msup><mi>n</mi><mtext> </mtext><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>β</mi><mfrac><mrow><mrow><mo fence="true">(</mo><msubsup><mi>n</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>n</mi><mi>y</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>n</mi><mi>z</mi><mn>2</mn></msubsup><mo fence="true">)</mo></mrow><msup><mi>π</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>L</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\sum_{n_x,n_y,n_z=1}^\infty\fc\exp{-\beta\fr{\p{n_x^2+n_y^2+n_z^2}\pi^2}{2L^2}}
\approx I\ceq\int_0^\infty\d^3n\,\fc\exp{-\beta\fr{\p{n_x^2+n_y^2+n_z^2}\pi^2}{2L^2}},</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">d</mi><mn>3</mn></msup><mi>n</mi></mrow><annotation encoding="application/x-tex">\int_0^\infty\d^3n</annotation></semantics></math></span></span> means <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><mi mathvariant="normal">d</mi><msub><mi>n</mi><mi>x</mi></msub><mtext> </mtext><mi mathvariant="normal">d</mi><msub><mi>n</mi><mi>y</mi></msub><mtext> </mtext><mi mathvariant="normal">d</mi><msub><mi>n</mi><mi>z</mi></msub></mrow><annotation encoding="application/x-tex">\int_0^\infty\int_0^\infty\int_0^\infty\d n_x\,\d n_y\,\d n_z</annotation></semantics></math></span></span>. We can then change the integral to spherical coordinates: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>I</mi><mo>=</mo><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><mfrac><mn>1</mn><mn>8</mn></mfrac><mn>4</mn><mi>π</mi><msup><mi>n</mi><mn>2</mn></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>n</mi><mtext> </mtext><mi>exp</mi><mo>⁡</mo><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>β</mi><mfrac><mrow><msup><mi>n</mi><mn>2</mn></msup><msup><mi>π</mi><mn>2</mn></msup></mrow><mrow><mn>2</mn><msup><mi>L</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><msup><mi>L</mi><mn>3</mn></msup><mrow><mn>4</mn><msup><mi>π</mi><mn>2</mn></msup><msup><mi>β</mi><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow></mfrac><msubsup><mo>∫</mo><mrow><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><mi mathvariant="normal">∞</mi></msubsup><mi mathvariant="normal">d</mi><mi>n</mi><mtext> </mtext><msup><mi>n</mi><mn>2</mn></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><msup><mi>n</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">I=\int_0^\infty\fr184\pi n^2\,\d n\,\fc\exp{-\beta\fr{n^2\pi^2}{2L^2}}
=\fr{L^3}{4\pi^2\beta^{3/2}}\int_{-\infty}^\infty\d n\,n^2\e^{-n^2/2},</annotation></semantics></math></span></span></span>
where the factor of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>8</mn></mrow><annotation encoding="application/x-tex">1/8</annotation></semantics></math></span></span> is because we only integrate in the first octant, and the second step utilizes the symmetry of the integrand and redefines the integrated variable. This integral is than a familiar Gaussian integral of order unity. The value of it is not important for later discussion because all the arguments that follow only uses orders of magnitude, but I tell you it is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><mn>2</mn><mi>π</mi></mrow></msqrt></mrow><annotation encoding="application/x-tex">\sqrt{2\pi}</annotation></semantics></math></span></span>, which can be evaluated by integrating by parts once and utilizing the famous <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∫</mo><mrow><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><msup><mi>n</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>n</mi><mo>=</mo><msqrt><mrow><mn>2</mn><mi>π</mi></mrow></msqrt></mrow><annotation encoding="application/x-tex">\int_{-\infty}^{\infty}\e^{-n^2/2}\,\d n=\sqrt{2\pi}</annotation></semantics></math></span></span>. The final result is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>I</mi><mo>=</mo><msup><mi>L</mi><mn>3</mn></msup><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>π</mi><mi>β</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">I=L^3\p{2\pi\beta}^{-3/2}</annotation></semantics></math></span></span>.</p>
<p>Is this an overestimation or underestimation? It is actually an overestimation. Draw a picture of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><msup><mi>n</mi><mn>2</mn></msup><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\e^{-n^2/2}</annotation></semantics></math></span></span> to convince yourself of this. We do not need to estimate how large the error is, though, because we will see that we only need an upper bound to get the arguments we need.</p>
</details>
<p>For the first term, we need to consider how the magnitude of the summand changes with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>. The minimum value of the summand is at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><msqrt><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msqrt></mrow><annotation encoding="application/x-tex">n=\sqrt{\beta/2}</annotation></semantics></math></span></span>. At room temperature, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>∼</mo><mn>1</mn><msup><mn>0</mn><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">\beta\sim10^3</annotation></semantics></math></span></span>, so <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msqrt></mrow><annotation encoding="application/x-tex">\sqrt{\beta/2}</annotation></semantics></math></span></span> is well between <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn></mrow><annotation encoding="application/x-tex">1</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">\Lmd</annotation></semantics></math></span></span>. Therefore, the largest term is either <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">n=1</annotation></semantics></math></span></span> or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">n=\Lmd</annotation></semantics></math></span></span>. The former is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\e^{\beta/2}</annotation></semantics></math></span></span>, which is of order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mn>217</mn></msup></mrow><annotation encoding="application/x-tex">10^{217}</annotation></semantics></math></span></span>, while the latter is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Λ</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\Lmd^2</annotation></semantics></math></span></span>, which is of order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mn>36</mn></msup></mrow><annotation encoding="application/x-tex">10^{36}</annotation></semantics></math></span></span> for the case of the size of the universe. We may then be interested in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">n=2</annotation></semantics></math></span></span> term <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>4</mn><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup></mrow><annotation encoding="application/x-tex">4\e^{\beta/8}</annotation></semantics></math></span></span>, which is of order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mn>54</mn></msup></mrow><annotation encoding="application/x-tex">10^{54}</annotation></semantics></math></span></span>. This is much larger than the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">n=\Lmd</annotation></semantics></math></span></span> term but much smaller than the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">n=1</annotation></semantics></math></span></span> term, so it is second largest term in the sum.</p>
<p>An upper bound of the summation is given by replacing every term except the largest term by the second largest term, which gives <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mo>&lt;</mo><munder><munder><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mo stretchy="true">⏟</mo></munder><mrow><mn>1</mn><msup><mn>0</mn><mn>217</mn></msup></mrow></munder><mo>+</mo><munder><munder><mrow><mrow><mo fence="true">(</mo><mi mathvariant="normal">Λ</mi><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mn>4</mn><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup></mrow><mo stretchy="true">⏟</mo></munder><mrow><mn>1</mn><msup><mn>0</mn><mn>72</mn></msup></mrow></munder><mo>+</mo><munder><munder><mrow><msup><mi>L</mi><mn>3</mn></msup><msup><mrow><mo fence="true">(</mo><mn>2</mn><mi>π</mi><mi>β</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><mo stretchy="true">⏟</mo></munder><mrow><mn>1</mn><msup><mn>0</mn><mn>48</mn></msup></mrow></munder><mo>≈</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z&lt;\underbrace{\e^{\beta/2}}_{10^{217}}
+\underbrace{\p{\Lmd-1}4\e^{\beta/8}}_{10^{72}}+\underbrace{L^3\p{2\pi\beta}^{-3/2}}_{10^{48}}\approx\e^{\beta/2}.</annotation></semantics></math></span></span></span> Therefore, the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">n=1</annotation></semantics></math></span></span> term dominates the entire partition function. This means that the hydrogen atom is extremely likely to be in the ground state (despite the seeming divergence of the partition function). This is intuitive. The probability of the system not being in the ground state is of order <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mrow><mo>−</mo><mn>55</mn></mrow></msup></mrow><annotation encoding="application/x-tex">10^{-55}</annotation></semantics></math></span></span> for the size of the universe and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mrow><mo>−</mo><mn>158</mn></mrow></msup></mrow><annotation encoding="application/x-tex">10^{-158}</annotation></semantics></math></span></span> for a typical macroscopic experiment.</p>
<details>
<summary>
More accurate considerations
</summary>
<p>The usage of the model of particle in a box for energy levels <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>&gt;</mo><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">n&gt;\Lmd</annotation></semantics></math></span></span> gives good enough arguments and results, but one may want to question whether this is appropriate.</p>
<p>What happens if you actually put a hydrogen atom in a box (for simplicity, make the box spherically symmetric)? More accurately, consider the quantum mechanical problem in spherically symmetric potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mo>∼</mo><mo>−</mo><msup><mi>r</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">V\sim-r^{-1}</annotation></semantics></math></span></span> for small <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span></span> but grows fast and high enough at large <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>r</mi></mrow><annotation encoding="application/x-tex">r</annotation></semantics></math></span></span> so that the partition function for bound states is convergent. This is called a confined hydrogen atom. A book chapter <a href="https://doi.org/10.1007/978-3-319-09982-8_3" target="_blank" rel="external"><cite>The Confined Hydrogen Atom Revisited</cite></a> discusses this problem in detail and cited several papers that did the calculations about the energy levels.</p>
</details>
<h2 data-label="0.3" id="cutoff-regularization">Cutoff regularization</h2>
<p>By analyzing the orders of magnitude, we see that we actually do not lose much if we just simply cut off the sum at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>=</mo><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">n=\Lmd</annotation></semantics></math></span></span>. This corresponds to a regularization method called the simple cutoff: it replaces the infinite sum by a finite partial sum. This can be generalized a little by considering a more general cutoff function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi></mrow><annotation encoding="application/x-tex">\chi</annotation></semantics></math></span></span> such that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>x</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow></msub><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\lim_{x\to0^+}\fc \chi x=1</annotation></semantics></math></span></span>. Then, an infinite sum <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></msubsup><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_{n=1}^\infty\fc fn</annotation></semantics></math></span></span> can be written as
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow></munder><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\sum_{n=1}^\infty\fc fn=\lim_{\lmd\to0^+}\sum_{n=1}^\infty\fc fn\fc\chi{\lmd n}.</annotation></semantics></math></span></span></span> The simple cutoff is then the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>θ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc \chi x\ceq\fc\tht{1-x}</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><mi mathvariant="normal">/</mi><mi mathvariant="normal">Λ</mi></mrow><annotation encoding="application/x-tex">\lmd\ceq1/\Lmd</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> is the Heaviside step function. For converging series, this gives the same result as the original sum thanks to the dominated convergence theorem.</p>
<details>
<summary>
For diverging series
</summary>
<p>For diverging series, this may give a finite result. For example, for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>n</mi></msup><msup><mi>n</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\fc fn\ceq\p{-1}^nn^k</annotation></semantics></math></span></span>, this method gives <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>k</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">-\fc\eta{-k}</annotation></semantics></math></span></span> for any complex <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> and any smooth enough <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi></mrow><annotation encoding="application/x-tex">\chi</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>η</mi></mrow><annotation encoding="application/x-tex">\eta</annotation></semantics></math></span></span> is the <a href="https://en.wikipedia.org/wiki/Dirichlet_eta_function" target="_blank" rel="external">Dirichlet eta function</a>. Here is a check for the special case <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\fc\chi x\ceq\e^{-x}</annotation></semantics></math></span></span> (equivalent to the <a href="https://en.wikipedia.org/wiki/Divergent_series#Abel_summation" target="_blank" rel="external">Abel summation</a>). By definition of the <a href="https://en.wikipedia.org/wiki/Polylogarithm" target="_blank" rel="external">polylogarithm</a>, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mi>n</mi></msup><msup><mi>n</mi><mi>k</mi></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi><mi>n</mi></mrow></msup><mo>=</mo><msub><mrow><mi mathvariant="normal">L</mi><mi mathvariant="normal">i</mi></mrow><mrow><mo>−</mo><mi>k</mi></mrow></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi></mrow></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\sum_{n=1}^\infty\p{-1}^nn^k\e^{-\lmd n}=\fc{\mrm{Li}_{-k}}{-\e^{-\lmd}}.</annotation></semantics></math></span></span></span> Now, substitute <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\lmd=0</annotation></semantics></math></span></span>, and utilizing the identity <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi mathvariant="normal">L</mi><mi mathvariant="normal">i</mi></mrow><mi>s</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>s</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\mrm{Li}_s}{-1}=-\fc\eta s</annotation></semantics></math></span></span>, we have the result <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>η</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>k</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">-\fc\eta{-k}</annotation></semantics></math></span></span>.</p>
<p>You may wonder what is the case for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>n</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\fc fn\ceq n^k</annotation></semantics></math></span></span>, which is also a diverging series, and it looks much like the case above. However, the limit at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span> simply does not exist when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>k</mi><mo>≥</mo><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\Re k\ge-1</annotation></semantics></math></span></span> (i.e., when the series diverges). This is because we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi mathvariant="normal">L</mi><mi mathvariant="normal">i</mi></mrow><mi>s</mi></msub><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo>=</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>s</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\mrm{Li}_s}1=\fc\zeta s</annotation></semantics></math></span></span> only for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>s</mi><mo>&gt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\Re s&gt;1</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ζ</mi></mrow><annotation encoding="application/x-tex">\zeta</annotation></semantics></math></span></span> is the <a href="https://en.wikipedia.org/wiki/Riemann_zeta_function" target="_blank" rel="external">Riemann zeta function</a>, but it is undefined for other values of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span></span>. If you analytically continue the result, you will get the famous Rieman zeta function.</p>
</details>
<p>However, although this series may converge for any positive <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span>, the limit as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span> may not exist. If it diverges because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fn</annotation></semantics></math></span></span> grows too fast (or decays too slowly) as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">n\to\infty</annotation></semantics></math></span></span>, then we should expect that the sum also tends to infinity as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span>. Assume that we can characterize this divergence by a Laurent series: <span id="eq:cutoff1" data-label="(2)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><mi mathvariant="normal">∞</mi></munderover><msub><mi>γ</mi><mi>k</mi></msub><msup><mi>λ</mi><mi>k</mi></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\sum_{n=1}^\infty\fc fn\fc\chi{\lmd n}
=\sum_{k=-\infty}^\infty\gma_k\lmd^k.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>2</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(2)</annotation></semantics></math></span></span></span></span> </span></span> If the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span> limit converge, we would expect <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>γ</mi><mrow><mi>k</mi><mo>&lt;</mo><mn>0</mn></mrow></msub></mrow><annotation encoding="application/x-tex">\gma_{k&lt;0}</annotation></semantics></math></span></span> to be zero, and then the result is simply <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>γ</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\gma_0</annotation></semantics></math></span></span>. Therefore, we may also want only <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>γ</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\gma_0</annotation></semantics></math></span></span> when the limit does not exist. To pick out
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>γ</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\gma_0</annotation></semantics></math></span></span>, utilize the residue theorem: <span id="eq:cutoff2" data-label="(3)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo>=</mo><mfrac><mn>1</mn><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">i</mi></mrow></mfrac><mo>∮</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>λ</mi></mrow><mi>λ</mi></mfrac><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\sum_{n=1}^\infty\fc fn=\fr1{2\pi\i}\oint\fr{\d\lmd}\lmd
\sum_{n=1}^\infty\fc fn\fc\chi{\lmd n},</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(3)</annotation></semantics></math></span></span></span></span> </span></span> where the domain of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span> is now analytically continued from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\bR^+</annotation></semantics></math></span></span> to a deleted neighborhood of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span>. Equation <a href="#eq:cutoff2">3</a> is then a generalized version of Equation <a href="#eq:cutoff1">2</a>.</p>
<p>Notice that I have been super slippery in math in the discussion. For example, the Laurent series may not exist at all, and the analytic continuation may not be possible at all; even if they exist, the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span> limit may also be different from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>γ</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">\gma_0</annotation></semantics></math></span></span>. However, I may claim that we should be able to select smooth enough <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi></mrow><annotation encoding="application/x-tex">\chi</annotation></semantics></math></span></span> for all of these to work, and the results will be independent of the choice of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi></mrow><annotation encoding="application/x-tex">\chi</annotation></semantics></math></span></span> as long as Equation <a href="#eq:cutoff2">3</a> works in this form.</p>
<p>Particularly, one can rigorously prove that for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>n</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\fc fn\ceq n^k</annotation></semantics></math></span></span>, the sum obtained by this precedure is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>k</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\zeta{-k}</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ζ</mi></mrow><annotation encoding="application/x-tex">\zeta</annotation></semantics></math></span></span> is the <a href="https://en.wikipedia.org/wiki/Riemann_zeta_function" target="_blank" rel="external">Riemann zeta function</a>, as long as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>x</mi><mi>k</mi></msup><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">x^k\fc\chi x</annotation></semantics></math></span></span> has bounded <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>k</mi><mo>+</mo><mn>2</mn><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{k+2}</annotation></semantics></math></span></span>th derivative and the sum converges. This is proven in an interesting blog <a href="https://terrytao.wordpress.com/2010/04/10/the-euler-maclaurin-formula-bernoulli-numbers-the-zeta-function-and-real-variable-analytic-continuation/" target="_blank" rel="external">article</a>.</p>
<details>
<summary>
Alternative forms of cutoff regularization
</summary>
<p>In some cases, one may discover that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>n</mi></msub><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_n\fc fn\fc\chi{\lmd n}</annotation></semantics></math></span></span> is not analytic when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span> so that the Laurent series expansion is not possible. An example is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>ln</mi><mo>⁡</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n\ceq\ln\ln n</annotation></semantics></math></span></span> (for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>≥</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">n\ge2</annotation></semantics></math></span></span>) with no degeneracies (this system also has a diverging partition function for any complex <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span>). In this case, if you try to use the cutoff function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\fc\chi x\ceq\e^{-x}</annotation></semantics></math></span></span>, the sum goes like <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>λ</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mi>β</mi></mrow></msup><mi mathvariant="normal">/</mi><mi>λ</mi></mrow><annotation encoding="application/x-tex">\p{-\ln\lmd}^{-\beta}/\lmd</annotation></semantics></math></span></span> instead of analytically when
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span>. Proving this is simple. We have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>2</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi><mi>n</mi></mrow></msup><msup><mrow><mo fence="true">(</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mi>β</mi></mrow></msup><mo>≈</mo><msubsup><mo>∫</mo><mn>2</mn><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi><mi>n</mi></mrow></msup><msup><mrow><mo fence="true">(</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mi>β</mi></mrow></msup><mi mathvariant="normal">d</mi><mi>n</mi><mo>=</mo><mfrac><mn>1</mn><mrow><mi>λ</mi><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>λ</mi><mo fence="true">)</mo></mrow><mi>β</mi></msup></mrow></mfrac><msubsup><mo>∫</mo><mrow><mn>2</mn><mi>λ</mi></mrow><mi mathvariant="normal">∞</mi></msubsup><mfrac><mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi></mrow><msup><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>x</mi><mi mathvariant="normal">/</mi><mi>ln</mi><mo>⁡</mo><mi>λ</mi><mo fence="true">)</mo></mrow><mi>β</mi></msup></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">Z_\lmd=\sum_{n=2}^\infty\e^{-\lmd n}\p{\ln n}^{-\beta}
\approx\int_2^\infty\e^{-\lmd n}\p{\ln n}^{-\beta}\d n
=\fr1{\lmd\p{-\ln\lmd}^\beta}\int_{2\lmd}^\infty
\fr{\e^{-x}\,\d x}{\p{1-\ln x/\ln\lmd}^\beta},</annotation></semantics></math></span></span></span>
where the last step uses the substitution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>λ</mi><mi>n</mi></mrow><annotation encoding="application/x-tex">x\ceq\lmd n</annotation></semantics></math></span></span>. Using the binomial theorem, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mo>≈</mo><mfrac><mn>1</mn><mrow><mi>λ</mi><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>λ</mi><mo fence="true">)</mo></mrow><mi>β</mi></msup></mrow></mfrac><msubsup><mo>∫</mo><mrow><mn>2</mn><mi>λ</mi></mrow><mi mathvariant="normal">∞</mi></msubsup><mi mathvariant="normal">d</mi><mi>x</mi><mtext> </mtext><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mo>−</mo><mi>β</mi></mrow><mi>k</mi></mfrac><mo fence="true">)</mo></mrow><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi>ln</mi><mo>⁡</mo><mi>x</mi></mrow><mrow><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>λ</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mi>k</mi></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">Z_\lmd\approx\fr1{\lmd\p{-\ln\lmd}^\beta}\int_{2\lmd}^\infty\d x\,\e^{-x}
\sum_{k=0}^\infty\binom{-\beta}k\p{\fr{\ln x}{-\ln\lmd}}^k,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mfrac linethickness="0px"><mrow><mo>−</mo><mi>β</mi></mrow><mi>k</mi></mfrac><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\binom{-\beta}k</annotation></semantics></math></span></span> is the binomial coefficient. Note that
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Γ</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo>=</mo><msubsup><mo>∫</mo><mn>0</mn><mi mathvariant="normal">∞</mi></msubsup><msup><mi>x</mi><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup><msup><mrow><mo fence="true">(</mo><mi>ln</mi><mo>⁡</mo><mi>x</mi><mo fence="true">)</mo></mrow><mi>k</mi></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>z</mi><mi>x</mi></mrow></msup><mi mathvariant="normal">d</mi><mi>x</mi></mrow><annotation encoding="application/x-tex">\fc{\Gma^{\p k}}z=\int_0^\infty x^{k-1}\p{\ln x}^k\e^{-zx}\d x</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Γ</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup></mrow><annotation encoding="application/x-tex">\Gma^{\p k}</annotation></semantics></math></span></span> is the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span>th derivative to the Euler Gamma function, so the integral for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi></mrow><annotation encoding="application/x-tex">x</annotation></semantics></math></span></span> gives a factor <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">Γ</mi><mrow><mo fence="true">(</mo><mi>k</mi><mo fence="true">)</mo></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>1</mn><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc{\Gma^{\p k}}1</annotation></semantics></math></span></span> in the limit of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span>. Therefore,
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mo>≈</mo><mfrac><mn>1</mn><mrow><mi>λ</mi><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>ln</mi><mo>⁡</mo><mi>λ</mi><mo fence="true">)</mo></mrow><mi>β</mi></msup></mrow></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">Z_\lmd\approx\fr1{\lmd\p{-\ln\lmd}^\beta},</annotation></semantics></math></span></span></span> where only the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">k=0</annotation></semantics></math></span></span> term in the sum is retained for the leading contribution as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span>.</p>
<p>However, for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi><mo>∈</mo><msup><mi mathvariant="double-struck">Z</mi><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">k\in\bZ^+</annotation></semantics></math></span></span>, one can always choose functions <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi><mo separator="true">,</mo><mi>χ</mi></mrow><annotation encoding="application/x-tex">h,\chi</annotation></semantics></math></span></span> so that the sum <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>n</mi></msub><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>h</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_n\fc fn\fc\chi{\lmd\fc hn}</annotation></semantics></math></span></span> goes like <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>λ</mi><mrow><mo>−</mo><mi>k</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\lmd^{-k}</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span>. For example, for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>x</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\fc\chi x\ceq\e^{-x}</annotation></semantics></math></span></span> (equivalent to the <a href="https://en.wikipedia.org/wiki/Divergent_series#Abelian_means" target="_blank" rel="external">Abelian mean</a> or the <a href="https://en.wikipedia.org/wiki/Zeta_function_regularization#Heat_kernel_regularization" target="_blank" rel="external">heat-kernel regularization</a>), we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mo>≈</mo><msubsup><mo>∫</mo><msub><mi>n</mi><mn>0</mn></msub><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>λ</mi><mi>h</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></mrow></msup><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>n</mi><mo>=</mo><msubsup><mo>∫</mo><mrow><mi>λ</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>n</mi><mn>0</mn></msub><mo fence="true">)</mo></mrow></mrow><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>h</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>λ</mi></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mfrac><mrow><mi mathvariant="normal">d</mi><mi>x</mi></mrow><mrow><mi>λ</mi><msup><mi>h</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>h</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>λ</mi></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z_\lmd\approx\int_{n_0}^\infty\e^{-\lmd\fc hn}\fc fn\d n
=\int_{\lmd\fc f{n_0}}^\infty\e^{-x}\fc f{\fc{h^{-1}}{\fr x\lmd}}\fr{\d x}{\lmd\fc{h'}{\fc{h^{-1}}{\fr x\lmd}}}.</annotation></semantics></math></span></span></span>
We can choose <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>h</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mrow><mo fence="true">(</mo><mo>∫</mo><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>n</mi><mo fence="true">)</mo></mrow><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mi>k</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\fc hn\ceq\p{\int\fc fn\d n}^{1/k}</annotation></semantics></math></span></span> so that
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>h</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>λ</mi></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mo>=</mo><mi>k</mi><msup><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>λ</mi></mfrac><mo fence="true">)</mo></mrow><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup><msup><mi>h</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>h</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>λ</mi></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc f{\fc{h^{-1}}{\fr x\lmd}}=k\p{\fr x\lmd}^{k-1}\fc{h'}{\fc{h^{-1}}{\fr x\lmd}}.</annotation></semantics></math></span></span></span> Therefore, as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi><mo>→</mo><msup><mn>0</mn><mo>+</mo></msup></mrow><annotation encoding="application/x-tex">\lmd\to0^+</annotation></semantics></math></span></span>, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mo>≈</mo><mfrac><mn>1</mn><mi>λ</mi></mfrac><msubsup><mo>∫</mo><mrow><mi>λ</mi><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>n</mi><mn>0</mn></msub><mo fence="true">)</mo></mrow></mrow><mi mathvariant="normal">∞</mi></msubsup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>x</mi></mrow></msup><mi>k</mi><msup><mrow><mo fence="true">(</mo><mfrac><mi>x</mi><mi>λ</mi></mfrac><mo fence="true">)</mo></mrow><mrow><mi>k</mi><mo>−</mo><mn>1</mn></mrow></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi><mo>≈</mo><mfrac><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow><msup><mi>λ</mi><mi>k</mi></msup></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z_\lmd\approx\fr1\lmd\int_{\lmd\fc f{n_0}}^\infty\e^{-x}k\p{\fr x\lmd}^{k-1}\,\d x\approx\fr{k!}{\lmd^k}.</annotation></semantics></math></span></span></span> However, this does not guarantee that the Laurent series expansion exists. This is a good trial, though. My math capacity does not allow me to confirm whether this is the case for the example of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>ln</mi><mo>⁡</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n\ceq\ln\ln n</annotation></semantics></math></span></span>.</p>
</details>
<h2 data-label="0.4" id="regularizing-the-hydrogen-atom">Regularizing the hydrogen atom</h2>
<p>After saying so much about cutoff regularization in general, what does it say about the partition function of a hydrogen atom? Try multiplying the cutoff function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\chi{\lmd n}</annotation></semantics></math></span></span> to the summand in Equation <a href="#eq:Z">1</a>: <span id="eq:Z-reg" data-label="(4)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>λ</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mn>2</mn></msup><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mrow><mn>2</mn><mo>−</mo><mn>2</mn><mi>k</mi></mrow></msup><mi>χ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>λ</mi><mi>n</mi><mo fence="true">)</mo></mrow><mo>→</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">Z_\lmd\ceq\sum_{n=1}^\infty n^2\e^{\beta/2n^2}\fc\chi{\lmd n}
=\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}\sum_{n=1}^\infty n^{2-2k}\fc\chi{\lmd n}
\to\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}\fc\zeta{2k-2},</annotation></semantics></math></span></span></span></span>
<span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>4</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(4)</annotation></semantics></math></span></span></span></span> </span></span> where the last step utilizes the result for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>n</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\fc fn\ceq n^k</annotation></semantics></math></span></span>, with which we get rid of the dependence on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow><annotation encoding="application/x-tex">\lmd</annotation></semantics></math></span></span>. The last expression is then identified as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span>.</p>
<p>Now that we get the expression of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span>, we can get some useful things. However, this time we cannot simply use the summand divided by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> to get the probability of each energy level because that will break the normalization of the probability distribution. What we can do, however, is to find the expectation value of the energy using <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><mi mathvariant="normal">d</mi><mi>ln</mi><mo>⁡</mo><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>β</mi></mrow><annotation encoding="application/x-tex">\a E=-\d\ln Z/\d\beta</annotation></semantics></math></span></span>. On the other hand, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>≤</mo><msub><mi>p</mi><mn>1</mn></msub><msub><mi>E</mi><mn>1</mn></msub><mo>+</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mo fence="true">)</mo></mrow><msub><mi>E</mi><mi mathvariant="normal">∞</mi></msub><mo>=</mo><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\a E\le p_1E_1+\p{1-p_1}E_\infty=-p_1/2</annotation></semantics></math></span></span>, so the probability <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">1-p_1</annotation></semantics></math></span></span> that the system is not in the ground state is bounded above by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>+</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">2\a E+1</annotation></semantics></math></span></span>.</p>
<p>The first check to do is to verify that this result is consistent with the known behavior of the system at cold zero temperature, where the system is almost certainly in the ground state; in other words, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>β</mi><mo>→</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow></msub><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\lim_{\beta\to+\infty}\a E=-1/2</annotation></semantics></math></span></span>. To get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> for large <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span>, we notice that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>+</mo><mi mathvariant="normal">∞</mi><mo fence="true">)</mo></mrow><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\fc\zeta{+\infty}=1</annotation></semantics></math></span></span>, so <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo>≈</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">Z\approx\e^{\beta/2}</annotation></semantics></math></span></span>, and this leads to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>≈</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\a E\approx-1/2</annotation></semantics></math></span></span> as expected.</p>
<p>Now, we may try to estimate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> for finite but large <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> (e.g., <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>1</mn><msup><mn>0</mn><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">\beta=10^3</annotation></semantics></math></span></span>) and thus give an upper bound for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">1-p_1</annotation></semantics></math></span></span>. We can study the asymptotic behavior of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> for cold positive temperature. It turns out that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mo>≈</mo><mn>3</mn><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>3</mn><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup></mrow><annotation encoding="application/x-tex">1-p_1\approx3\e^{-3\beta/8}</annotation></semantics></math></span></span>, which is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><msup><mn>0</mn><mrow><mo>−</mo><mn>163</mn></mrow></msup></mrow><annotation encoding="application/x-tex">10^{-163}</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>1</mn><msup><mn>0</mn><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">\beta=10^3</annotation></semantics></math></span></span>. As we can see, without any physical arguments but only with regularization, we get a result that seems sensible and well between the results in the last section for a hydrogen atom confined in a box with a typical macroscopic size or the size of the universe.</p>
<details>
<summary>
Derivation of the asymptotic behavior at cold positive temperature
</summary>
<p>We have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mfrac><mrow><mi mathvariant="normal">d</mi><mi>Z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>β</mi></mrow></mfrac><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z=\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}\fc\zeta{2k-2},\quad
\fr{\d Z}{\d\beta}=\fr12\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}\fc\zeta{2k}.</annotation></semantics></math></span></span></span> Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mo>−</mo><mn>2</mn><mfrac><mrow><mi mathvariant="normal">d</mi><mi>Z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>β</mi></mrow></mfrac><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mrow><mo fence="true">(</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo>−</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z-2\fr{\d Z}{\d\beta}=\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}
\p{\fc\zeta{2k-2}-\fc\zeta{2k}}.</annotation></semantics></math></span></span></span> We can try to find the asymptotic behavior of the coefficient of each term. We have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo>−</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><msup><mi>n</mi><mrow><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn></mrow></msup></mfrac><mo>−</mo><mfrac><mn>1</mn><msup><mi>n</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mo>=</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><mrow><msup><mi>n</mi><mn>2</mn></msup><mo>−</mo><mn>1</mn></mrow><msup><mi>n</mi><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo>=</mo><mfrac><mn>3</mn><msup><mn>2</mn><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><msup><mn>3</mn><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc\zeta{2k-2}-\fc\zeta{2k}=\sum_{n=1}^\infty\p{\fr1{n^{2k-2}}-\fr1{n^{2k}}}
=\sum_{n=1}^\infty\fr{n^2-1}{n^{2k}}
=\fr{3}{2^{2k}}+\O{\fr1{3^{2k}}}.</annotation></semantics></math></span></span></span>
We also have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo>=</mo><mn>1</mn><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mn>2</mn><mrow><mo>−</mo><mn>2</mn><mi>k</mi></mrow></msup><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\zeta{2k-2}=1+\O{2^{-2k}}</annotation></semantics></math></span></span>, of course. Therefore, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mo>≤</mo><mn>2</mn><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>+</mo><mn>1</mn><mo>=</mo><mfrac><mrow><mi>Z</mi><mo>−</mo><mn>2</mn><mi mathvariant="normal">d</mi><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>β</mi></mrow><mi>Z</mi></mfrac><mo>=</mo><mfrac><mrow><munder><mo>∑</mo><mi>k</mi></munder><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mrow><mo fence="true">(</mo><mfrac><mn>3</mn><msup><mn>2</mn><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><msup><mn>3</mn><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow><mrow><munder><mo>∑</mo><mi>k</mi></munder><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><msup><mn>2</mn><mrow><mn>2</mn><mi>k</mi></mrow></msup></mfrac><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">1-p_1\le2\a E+1=\fr{Z-2\d Z/\d\beta}Z
=\fr{\sum_k\fr{\p{\beta/2}^k}{k!}\p{\fr3{2^{2k}}+\O{\fr1{3^{2k}}}}}{\sum_k\fr{\p{\beta/2}^k}{k!}\p{1+\O{\fr1{2^{2k}}}}}.</annotation></semantics></math></span></span></span>
These power series are then simply exponential functions. Therefore, <span id="eq:1-p1" data-label="(5)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mo>≤</mo><mfrac><mrow><mn>3</mn><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>18</mn></mrow></msup><mo fence="true">)</mo></mrow></mrow><mrow><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup><mo fence="true">)</mo></mrow></mrow></mfrac><mo>=</mo><mn>3</mn><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>3</mn><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup><mo>+</mo><mi mathvariant="normal">O</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>4</mn><mi>β</mi><mi mathvariant="normal">/</mi><mn>9</mn></mrow></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">1-p_1\le\fr{3\e^{\beta/8}+\O{\e^{\beta/18}}}{\e^{\beta/2}+\O{\e^{\beta/8}}}
=3\e^{-3\beta/8}+\O{\e^{-4\beta/9}}.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>5</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(5)</annotation></semantics></math></span></span></span></span> </span></span></p>
</details>
<p>Although the asymptotic behavior at cold temperature (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to+\infty</annotation></semantics></math></span></span>) looks good, its behavior is very wrong at some regimes. At some temperature, the monoticity of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> reverts, and then it gets even lower than the ground state energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">-1/2</annotation></semantics></math></span></span> and heads all the way to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">-\infty</annotation></semantics></math></span></span> at some finite temperature.This is clearly unphysical. This suggests that it is wrong to use the regularized result.</p>
<details>
<summary>
Plots
</summary>
<!--
Z[b_]=Sum[Zeta[2k-2](b/2)^k/k!,{k,1,Infinity}]
ZDataPts=Table[{b,N[Z[b]]},{b,-1,2,0.03}];
dZdbDataPts=Table[{b,N[Z'[b]]},{b,-1,2,0.03}];
EDataPts2=Table[{b,N[-Z'[b]/Z[b]]},{b,10.7,20.7,0.1}];
Export["Data.csv",ZDataPts,"CSV"]
Export["dZdbData.csv",dZdbDataPts,"CSV"]
Export["EData.csv",EDataPts2,"CSV"]
-->
<!--
#!/usr/bin/env python3

import matplotlib.pyplot as plt
import numpy as np
import csv

plt.rcParams.update({
	'text.usetex': True,
	'font.size': 11,
	'font.family': 'lmodern',
	'text.latex.preamble': r'''
		\usepackage{lmodern}
		\renewcommand{\d}{\mathrm{d}}
	'''
})
def savefig(filename):
	plt.savefig(filename, transparent=True, format='pdf', bbox_inches='tight')
	plt.figure()

bRoot = 1.07209
dbRoot = 0.55296
bECross = 11.2485
bEPeak = 13.80209489
ECross = -0.5
EPeak = -0.497781

def read_csv(filename):
	x_list = []
	y_list = []
	with open(filename) as file:
		for x, y in csv.reader(file):
			x_list.append(float(x))
			y_list.append(float(y))
	return np.array(x_list), np.array(y_list)

b, z = read_csv('ZData.csv')
b, dzdb = read_csv('dZdbData.csv')
plt.plot(b, z, label=r'$Z$')
plt.plot(b, dzdb, label=r'$\d Z/\d\beta$')
plt.axhline(0, color='black', linestyle='--')
plt.xlabel(r'$\beta$')
plt.xlim(b[0], b[-1])
plt.legend()
savefig('plotZ.pdf')

e_split = [[]]
i_start = [0]
for i in range(b.shape[0]-1):
	ei = -dzdb[i]/z[i]
	eip1 = -dzdb[i+1]/z[i+1]
	e_split[-1].append(ei)
	if abs(ei - eip1) > 10:
		e_split.append([])
		i_start.append(i+1)
e_split[-1].append(eip1)
for i in range(len(e_split)):
	plt.plot(b[i_start[i]:i_start[i]+len(e_split[i])], e_split[i], color='tab:blue')
plt.axvline(bRoot, linestyle='--', color='black')
plt.axvline(0, linestyle='--', color='black')
plt.xlabel(r'$\beta$')
plt.ylabel(r'$\left<E\right>$')
plt.ylim(-15, 15)
plt.xlim(b[0], b[-1])
savefig('plotE.pdf')

b, e = read_csv('EData.csv')
plt.plot(b, e)
plt.axhline(ECross, linestyle='--', color='black')
#plt.scatter([bECross, bEPeak], [ECross, EPeak])
plt.xlabel(r'$\beta$')
plt.ylabel(r'$\left<E\right>$')
plt.xlim(b[0], b[-1])
savefig('plotE2.pdf')
-->
<p>Here is a plot that shows how <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> starts to decrease with temperature at some point and becomes even lower than the ground state energy:</p>
<figure>
<img src="/assets/images/figures/2024-06-30-regularize-hydrogen/plotE2.svg" class="dark-adaptive" alt="Plot of  vs. "/>

</figure>
<p>Here is a plot that shows how <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> goes to infinity at different temperatures:</p>
<figure>
<img src="/assets/images/figures/2024-06-30-regularize-hydrogen/plotE.svg" class="dark-adaptive" alt="Plot of  vs. "/>

</figure>
<p>Here are also plots for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>β</mi></mrow><annotation encoding="application/x-tex">\d Z/\d\beta</annotation></semantics></math></span></span>, if you are curious:</p>
<figure>
<img src="/assets/images/figures/2024-06-30-regularize-hydrogen/plotZ.svg" class="dark-adaptive" alt="Plot of  and  vs. "/>

</figure>
<p>The two vertical asymptotes of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> corresponds to the two zeros of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span>, which are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\beta=0</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>1.0721</mn></mrow><annotation encoding="application/x-tex">\beta=1.0721</annotation></semantics></math></span></span>. It also has a zero, correponding to the zero of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>β</mi></mrow><annotation encoding="application/x-tex">\d Z/\d\beta</annotation></semantics></math></span></span> at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>0.5530</mn></mrow><annotation encoding="application/x-tex">\beta=0.5530</annotation></semantics></math></span></span>. The point where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>=</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">\a E=-1/2</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>11.2486</mn></mrow><annotation encoding="application/x-tex">\beta=11.2486</annotation></semantics></math></span></span>, and the point where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><annotation encoding="application/x-tex">\a E</annotation></semantics></math></span></span> has a local maximum is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>13.8021</mn></mrow><annotation encoding="application/x-tex">\beta=13.8021</annotation></semantics></math></span></span>.</p>
</details>
<p>Another aspect where we can see that this result is wrong is that, if we look at the hot negative temperature limit <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to-\infty</annotation></semantics></math></span></span>, although we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>→</mo><mn>0</mn><mo>=</mo><msub><mrow><mi>sup</mi><mo>⁡</mo></mrow><mi>n</mi></msub><msub><mi>E</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">\a E\to0=\sup_nE_n</annotation></semantics></math></span></span> as expected, it is approaching from the wrong side. In fact, because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">Z&gt;0</annotation></semantics></math></span></span> while <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>β</mi><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\d Z/\d\beta&lt;0</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\beta&lt;0</annotation></semantics></math></span></span>, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>&gt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\a E&gt;0</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\beta&lt;0</annotation></semantics></math></span></span>, exceeding the supremum of the energy levels, which is unphysical.</p>
<details>
<summary>
Derivation of the hot negative temperature limit
</summary>
<!--
First, we need (see Equation 40 in
[Borwein et al., 2000](https://doi.org/10.1016/S0377-0427(00)00336-8))

$$\sum_{k=0}^\infty x^{2k}\fc\zeta{2k}=-\fr\pi2x\cot\pi x.$$

We can then extract $\fc\zeta{2k}$ from this using the residue theorem:

$$\fc\zeta{2k}=\fr1{2\pi\i}\oint\fr{\d x}{x^{2k+1}}\p{-\fr\pi2x\cot\pi x}.$$

Plug this into the expression of $Z$:

$$Z=\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}\fr1{2\pi\i}\oint\fr{\d x}{x^{2k-1}}\p{-\fr\pi2x\cot\pi x}
=\fr\i4\oint\d x\,x^2\e^{\beta/2x^2}\cot\pi x.$$
-->
<p>Here is a non-rigorous derivation. We can rewrite the regularized <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> in a similar form as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mi>Z</mi></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>−</mo><mfrac><mi>β</mi><mn>4</mn></mfrac><mo>+</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mo>−</mo><mn>1</mn><mo>−</mo><mfrac><mi>β</mi><mrow><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><munder><mrow><mi>lim</mi><mo>⁡</mo></mrow><mrow><mi>N</mi><mo>→</mo><mi mathvariant="normal">∞</mi></mrow></munder><mrow><mo fence="true">(</mo><mo>−</mo><mrow><mo fence="true">(</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><mo>+</mo><mfrac><mi>N</mi><mn>2</mn></mfrac><mo fence="true">)</mo></mrow><mi>β</mi><mo>−</mo><mfrac><mn>1</mn><mn>6</mn></mfrac><mi>N</mi><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mi>N</mi><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mn>1</mn><mo>+</mo><mn>2</mn><mi>N</mi><mo fence="true">)</mo></mrow><mo>+</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi>N</mi></munderover><msup><mi>n</mi><mn>2</mn></msup><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
Z&amp;=-\fr\beta4+\sum_{n=1}^\infty n^2\p{\e^{\beta/2n^2}-1-\fr\beta{2n^2}}\\
&amp;=\lim_{N\to\infty}\p{-\p{\fr14+\fr N2}\beta-\fr16N\p{1+N}\p{1+2N}+\sum_{n=1}^Nn^2\e^{\beta/2n^2}}.
\end{align*}</annotation></semantics></math></span></span></span>
For finite <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>, it has a straight line asymptote as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to-\infty</annotation></semantics></math></span></span>. The envelope of this family of straight lines (parametrized by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>N</mi></mrow><annotation encoding="application/x-tex">N</annotation></semantics></math></span></span>) is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo>=</mo><msup><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mn>6</mn><mi>β</mi><mo fence="true">)</mo></mrow><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mi mathvariant="normal">/</mi><mn>36</mn><msqrt><mn>3</mn></msqrt></mrow><annotation encoding="application/x-tex">Z=\p{1-6\beta}^{3/2}/36\sqrt3</annotation></semantics></math></span></span>, which means that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo>∼</mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>β</mi><mo fence="true">)</mo></mrow><mrow><mn>3</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">Z\sim\p{-\beta}^{3/2}</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to-\infty</annotation></semantics></math></span></span>, where “<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∼</mo></mrow><annotation encoding="application/x-tex">\sim</annotation></semantics></math></span></span>” means that the ratio of the two sides approaches a positive constant. Similarly, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>β</mi><mo>∼</mo><mo>−</mo><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>β</mi><mo fence="true">)</mo></mrow><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\d Z/\d\beta\sim-\p{-\beta}^{1/2}</annotation></semantics></math></span></span>. Therefore, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>∼</mo><mo>−</mo><msup><mi>β</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">\a E\sim-\beta^{-1}</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>→</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta\to-\infty</annotation></semantics></math></span></span>.</p>
</details>
<details>
<summary>
Another regularization special to the hydrogen atom
</summary>
<p>Here is a special regularization method for the hydrogen atom which is not applicable to general systems. Consider the second derivative <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>Z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><msup><mi>β</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\d^2Z/\d\beta^2</annotation></semantics></math></span></span> by differentiating the summand twice w.r.t. <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> in Equation <a href="#eq:Z">1</a>, and then take twice antiderivative w.r.t. <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span>. This gives <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Z</mi><mo>=</mo><mi>A</mi><mo>+</mo><mi>B</mi><mi>β</mi><mo>+</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>k</mi><mo>−</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo>=</mo><mi>A</mi><mo>+</mo><mi>B</mi><mi>β</mi><mo>+</mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mn>2</mn></msup><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mo>−</mo><mn>1</mn><mo>−</mo><mfrac><mi>β</mi><mrow><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">Z=A+B\beta+\sum_{k=0}^\infty\fr{\p{\beta/2}^k}{k!}\fc\zeta{2k-2}
=A+B\beta+\sum_{n=1}^\infty n^2\p{\e^{\beta/2n^2}-1-\fr{\beta}{2n^2}},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo separator="true">,</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">A,B</annotation></semantics></math></span></span> are integration constants. The result from the cutoff regularization and
the zeta function regularization is simply <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">A=0</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi><mo>=</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>4</mn></mrow><annotation encoding="application/x-tex">B=-1/4</annotation></semantics></math></span></span>. What is interesting about this is that it already determines the asymptotic behavior of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">1-p_1</annotation></semantics></math></span></span> at cold temperature, which is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub><mo>≈</mo><mn>3</mn><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mn>3</mn><mi>β</mi><mi mathvariant="normal">/</mi><mn>8</mn></mrow></msup></mrow><annotation encoding="application/x-tex">1-p_1\approx3\e^{-3\beta/8}</annotation></semantics></math></span></span> (see Equation <a href="#eq:1-p1">5</a>), no matter what <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo separator="true">,</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">A,B</annotation></semantics></math></span></span> are.</p>
</details>
<h2 data-label="0.5" id="zeta-function-regularization">Zeta function regularization</h2>
<p>For a series <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>n</mi></msub><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_n\fc fn</annotation></semantics></math></span></span>, if it diverges, we can instead consider <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>n</mi></msub><mi>f</mi><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mrow><mo>−</mo><mi>s</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\sum_n\fc fn^{-s}</annotation></semantics></math></span></span> for some <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span></span> whose real part is big enough for the series to converge. Then, we can try to analytically continue to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo>=</mo><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">s=-1</annotation></semantics></math></span></span> to get a finite result for the original series. This is called the zeta function regularization.</p>
<details>
<summary>
When zeta function regularization fails
</summary>
<p>For the zeta function regularization to work, the asymptotic behavior of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc fn</annotation></semantics></math></span></span> needs to be a non-trivial power law as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi><mo>→</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">n\to+\infty</annotation></semantics></math></span></span>. Otherwise, the sum may not converge for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span></span>. For example, consider <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo>=</mo><mi>ln</mi><mo>⁡</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n=\ln\ln n</annotation></semantics></math></span></span> (with no degeneracies). The partition function with zeta function regularization is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>s</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>2</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mrow><mo fence="true">(</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi><mo fence="true">)</mo></mrow><mrow><mi>β</mi><mi>s</mi></mrow></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z_s\ceq\sum_{n=2}^\infty\p{\ln n}^{\beta s}.</annotation></semantics></math></span></span></span> This series is divergent for any complex <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi></mrow><annotation encoding="application/x-tex">s</annotation></semantics></math></span></span>.</p>
</details>
<p>A famous example is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>n</mi></mrow><annotation encoding="application/x-tex">\fc fn\ceq n</annotation></semantics></math></span></span>, which gives <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>n</mi></msub><mi>n</mi><mo>=</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>12</mn></mrow><annotation encoding="application/x-tex">\sum_nn=\fc\zeta{-1}=-1/12</annotation></semantics></math></span></span>. Generally, for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>n</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>n</mi><mi>k</mi></msup></mrow><annotation encoding="application/x-tex">\fc fn\ceq n^k</annotation></semantics></math></span></span>, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mo>∑</mo><mi>n</mi></msub><msup><mi>n</mi><mi>k</mi></msup><mo>=</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mo>−</mo><mi>k</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\sum_nn^k=\fc\zeta{-k}</annotation></semantics></math></span></span>. This is the same as the result for the simple cutoff regularization. This raises the question of whether the results obtained from those two methods are necessary the same whenever they both exist. I do not have a rigorous proof, but a strong argument is that both of them are the result of some analytic continuation, so they should be the same by the uniqueness of analytic continuation.</p>
<p>We can check this with the hydrogen atom. We have, for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo>&gt;</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn></mrow><annotation encoding="application/x-tex">s&gt;1/2</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> real, <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>Z</mi><mi>s</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mrow><mo>−</mo><mn>2</mn><mi>s</mi></mrow></msup><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>s</mi><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><msup><mi>n</mi><mn>2</mn></msup></mrow></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>s</mi><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><munderover><mo>∑</mo><mrow><mi>n</mi><mo>=</mo><mn>1</mn></mrow><mi mathvariant="normal">∞</mi></munderover><msup><mi>n</mi><mrow><mo>−</mo><mn>2</mn><mi>s</mi><mo>−</mo><mn>2</mn><mi>k</mi></mrow></msup><mo>=</mo><munderover><mo>∑</mo><mrow><mi>k</mi><mo>=</mo><mn>0</mn></mrow><mi mathvariant="normal">∞</mi></munderover><mfrac><msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>s</mi><mi>β</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">)</mo></mrow><mi>k</mi></msup><mrow><mi>k</mi><mo stretchy="false">!</mo></mrow></mfrac><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mn>2</mn><mi>s</mi><mo>+</mo><mn>2</mn><mi>k</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Z_s\ceq\sum_{n=1}^\infty n^{-2s}\e^{-s\beta/2n^2}
=\sum_{k=0}^\infty\fr{\p{-s\beta/2}^k}{k!}\sum_{n=1}^\infty n^{-2s-2k}
=\sum_{k=0}^\infty\fr{\p{-s\beta/2}^k}{k!}\fc\zeta{2s+2k}.</annotation></semantics></math></span></span></span>
Analytically continue this result to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>s</mi><mo>=</mo><mo>−</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">s=-1</annotation></semantics></math></span></span>, and then this gives the same result as Equation <a href="#eq:Z-reg">4</a>. The rest will be the same as the last section.</p>
<h2 data-label="0.6" id="can-we-trust-this-result">Can we trust this result?</h2>
<p>However, can we trust this result, though? Everything is becoming fishy. Probabilities are no longer well-defined because how we normally derive them using <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> is causing a divergent sum of probabilities and thus invalid. Yet somehow we are trying to estimate the bound of the probability of the system not being in the ground state and getting an expected result. You must have been feeling uncomfortable about this.</p>
<p>The first thing to ask is what we mean by “the expectation value” when the probability distribution is not even well-defined. If it means nothing physical, can we still trust its expression? The simple answer is no.</p>
<p>As we already see, although the result at cold temperature is sensible, the result at some regimes is clearly unphysical. We can also see similar problems with other systems. Consider the system that has energy levels <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo>=</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n=\ln n</annotation></semantics></math></span></span> (with no degeneracies). We can easily get <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo>=</mo><msub><mo>∑</mo><mi>n</mi></msub><msup><mi>n</mi><mrow><mo>−</mo><mi>β</mi></mrow></msup><mo>=</mo><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">Z=\sum_nn^{-\beta}=\fc\zeta\beta</annotation></semantics></math></span></span>, and thus there is a absi at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\beta=1</annotation></semantics></math></span></span>. For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>&gt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\beta&gt;1</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> converges, and everything looks good. For <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>&lt;</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\beta&lt;1</annotation></semantics></math></span></span>, the system is so hot that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> diverges. Previous arguments suggest that, in this region, the regularized <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> is still <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ζ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>β</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc\zeta\beta</annotation></semantics></math></span></span>. However, we then have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">⟨</mo><mi>E</mi><mo fence="true">⟩</mo></mrow><mo>&lt;</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\a E&lt;0</annotation></semantics></math></span></span> in this region, which is lower than the ground state energy. This clearly should not be trusted.</p>
<p>In another aspect, we should note that since the estimation for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mo>−</mo><msub><mi>p</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">1-p_1</annotation></semantics></math></span></span> does not depend on the size of the box confining the hydrogen atom, its rough agreement with the result in the last section should be considered a coincidence.</p>
<p>Another thing to note is that the result of the regularizations depend on whether we “flatten” the energy levels. We can “flatten” all the energy levels: pretend no degeneracies exist. For example, suppose a system with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>g</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>n</mi></mrow><annotation encoding="application/x-tex">g_n\ceq n</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n\ceq n</annotation></semantics></math></span></span>. However, we can rewrite the same system as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mn>1</mn><mo separator="true">,</mo><mn>2</mn><mo separator="true">,</mo><mn>2</mn><mo separator="true">,</mo><mn>3</mn><mo separator="true">,</mo><mn>3</mn><mo separator="true">,</mo><mn>3</mn><mo separator="true">,</mo><mo>…</mo></mrow><annotation encoding="application/x-tex">E_n\ceq1,2,2,3,3,3,\ldots</annotation></semantics></math></span></span> (or equivalently <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌊</mo><msqrt><mrow><mn>2</mn><mi>n</mi></mrow></msqrt><mo>+</mo><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn><mo fence="true">⌋</mo></mrow></mrow><annotation encoding="application/x-tex">E_n\ceq\floor{\sqrt{2n}+1/2}</annotation></semantics></math></span></span>) <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, with no degeneracies. This “re-grouping” of the energy levels can affect the result of regularizations and whether a zeta function regularization exists. For an immediate example, if we flatten the energy levels of the hydrogen atom, the zeta function regularization does not exist. Another simple example is that, for a system with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo>=</mo><mrow><mi mathvariant="normal">c</mi><mi mathvariant="normal">o</mi><mi mathvariant="normal">n</mi><mi mathvariant="normal">s</mi><mi mathvariant="normal">t</mi></mrow></mrow><annotation encoding="application/x-tex">E_n=\mrm{const}</annotation></semantics></math></span></span>, we can essentially re-group the all-degenerate states to have any positive integer sequence <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>g</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">g_n</annotation></semantics></math></span></span> to get very arbitrary results for the partition function.</p>
<h2 data-label="0.7" id="abscissa-of-convergence">Abscissa of convergence</h2>
<p>Forget about the hydrogen atom, and let us consider a general system with (ever-increasing) energy levels <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">E_n</annotation></semantics></math></span></span> and degeneracies <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>g</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">g_n</annotation></semantics></math></span></span>. For a given system, there is an abscissa of convergence <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\beta_\mrm c</annotation></semantics></math></span></span>, below (hotter than) which the partition function diverges. In other words, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi><mo><mi mathvariant="normal">≔</mi></mo><msub><mo>∑</mo><mi>n</mi></msub><msub><mi>g</mi><mi>n</mi></msub><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi>β</mi><msub><mi>E</mi><mi>n</mi></msub></mrow></msup></mrow><annotation encoding="application/x-tex">Z\ceq\sum_ng_n\e^{-\beta E_n}</annotation></semantics></math></span></span> converges for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>β</mi><mo>&gt;</mo><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\Re\beta&gt;\beta_\mrm c</annotation></semantics></math></span></span> and diverges for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>β</mi><mo>&lt;</mo><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\Re\beta&lt;\beta_\mrm c</annotation></semantics></math></span></span>. For most physical systems, we have
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\beta_\mrm c=0</annotation></semantics></math></span></span>, meaning that it can have any positive temperature, which sounds sensible. The hydrogen atom has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta_\mrm c=+\infty</annotation></semantics></math></span></span>, and a two-level system has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta_\mrm c=-\infty</annotation></semantics></math></span></span>. A system with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo>=</mo><mi>ln</mi><mo>⁡</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n=\ln n</annotation></semantics></math></span></span> and no degeneracy has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\beta_\mrm c=1</annotation></semantics></math></span></span>.</p>
<p>The term “abscissa of convergence” is borrowed from the study of <a href="https://en.wikipedia.org/wiki/General_Dirichlet_series" target="_blank" rel="external">general Dirichlet series</a>. The form of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> is indeed very much like a general Dirichlet series, but a general Dirichlet series requires <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi mathvariant="normal">∞</mi></msub><mo>=</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">E_\infty=+\infty</annotation></semantics></math></span></span>, which is not true for the hydrogen atom. However, the existence of an abscissa of convergence is still true for the more general case.</p>
<p>What does it mean physically to have an abscissa of convergence <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\beta_\mrm c</annotation></semantics></math></span></span>? First, if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mo>−</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta_\mrm c=-\infty</annotation></semantics></math></span></span>, then the system is well behaved at any temperature, which is good and does not need further care.</p>
<p>If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">∣</mo><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo fence="true">∣</mo></mrow><mo>&lt;</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\v{\beta_\mrm c}&lt;\infty</annotation></semantics></math></span></span>, normally one should say the system cannot reach a certain temperature: the system can never be in equilibrium with a heat bath hotter than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\beta_\mrm c</annotation></semantics></math></span></span>. Thermodynamically, one can say that the system needs to absorb an infinite amount of heat to reach this temperature. One can see this easily by considering any sensible system, which has <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\beta_\mrm c=0</annotation></semantics></math></span></span>: for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> to go below zero means to make the temperature hotter than infinity, which of course needs an infinite amount of heat intuitively. One may want to see whether it is possible to regularize <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> to get a finite result for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>β</mi><mo>&lt;</mo><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\Re\beta&lt;\beta_\mrm c</annotation></semantics></math></span></span>. A valid claim to make is that, if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> can be analytically continued to the half real axis to the left of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub></mrow><annotation encoding="application/x-tex">\beta_\mrm c</annotation></semantics></math></span></span>, then any sensible regularization of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> there will give the same result as the analytic continuation. Actually, the analytic continuation is exactly the zeta function regularization if there is no degeneracy (or regarding degenerate states as different energy levels). However, it is possible that the analytic continuation does not exist. There may be a branch cut or a natural boundary. For example, if
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>ln</mi><mo>⁡</mo><msub><mi>p</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">E_n\ceq\ln p_n</annotation></semantics></math></span></span> with no degeneracy, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>p</mi><mi>n</mi></msub></mrow><annotation encoding="application/x-tex">p_n</annotation></semantics></math></span></span> is the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>n</mi></mrow><annotation encoding="application/x-tex">n</annotation></semantics></math></span></span>th prime number, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Z</mi></mrow><annotation encoding="application/x-tex">Z</annotation></semantics></math></span></span> is the <a href="https://en.wikipedia.org/wiki/Analytic_continuation#Example_I:_A_function_with_a_natural_boundary_at_zero_(the_prime_zeta_function)" target="_blank" rel="external">prime zeta function</a>, which has a natural boundary at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">Re</mi><mo>⁡</mo><mi>β</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\Re\beta=0</annotation></semantics></math></span></span>. Even if such a regularization exists, it should be questioned whether it is physical.</p>
<p>If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mo>+</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\beta_\mrm c=+\infty</annotation></semantics></math></span></span>, then the system is not well behaved at any temperature. This is the case for the hydrogen atom. Physically, this means that the system cannot be in equilibrium with a heat bath at any temperature. The problem with regularization is the same as the case with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">∣</mo><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo fence="true">∣</mo></mrow><mo>&lt;</mo><mi mathvariant="normal">∞</mi></mrow><annotation encoding="application/x-tex">\v{\beta_\mrm c}&lt;\infty</annotation></semantics></math></span></span>.</p>
<p>In a previous <a href="/physics/2023/03/30/measure-ensemble.html">article</a> about statistical ensembles, when I defined the partition function, I briefly mentioned that it is only defined for those intensive variables (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi></mrow><annotation encoding="application/x-tex">\beta</annotation></semantics></math></span></span> in the context of this article) such that the partition function converges. I did not talk about what to do with the partition function when it diverges, but what that article implied is that it is simply undefined and that no physical meaning should be assigned to it in principle. The existence of an abscissa of convergence tells us that there is a “hottest possible temperature” for any given system. The hydrogen atom is symply the case where the hottest possible temperature coincides with the coldest possible temperature (which is the absolute zero). For most sensible systems, the hottest possible temperature is just the positive hot limit. For systems such as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>E</mi><mi>n</mi></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>ln</mi><mo>⁡</mo><mi>n</mi></mrow><annotation encoding="application/x-tex">E_n\ceq\ln n</annotation></semantics></math></span></span>, the hottest possible temperature is a finite positive temperature, which is at <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>3.16</mn><mo>×</mo><mn>1</mn><msup><mn>0</mn><mn>5</mn></msup><mtext> </mtext><mi mathvariant="normal">K</mi></mrow><annotation encoding="application/x-tex">3.16\times10^5\,\mrm K</annotation></semantics></math></span></span>, resulting from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">\beta_\mrm c=1</annotation></semantics></math></span></span>. This can be conterintuitive at first, but one should realize that it is not essentially different from the more common case of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>β</mi><mi mathvariant="normal">c</mi></msub><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\beta_\mrm c=0</annotation></semantics></math></span></span>.</p>
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
<hr/>
<ol>
<li id="fn1"><p>This is <a href="https://oeis.org/A002024" target="_blank" rel="external">A002024</a> on OEIS. Coincidentally, the OEIS number of this sequence is the same as the year in which I am writing this article.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="physics" /><category term="statistical mechanics" /><category term="complex" /><category term="regularization" /><category term="long paper" /><summary type="html"><![CDATA[The partition function of a hydrogen atom diverges (only considering bound states). However, we can regularize it to get finite answers. Different regularizations give the same result. They largely agree with the physical arguments for the case of the hydrogen atom at room or cold temperature, but this should be considered a mere coincidence. The results from regularized partition functions cannot generally be trusted.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-06-30-regularize-hydrogen.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-06-30-regularize-hydrogen.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Letting people know when you are asleep]]></title><link href="https://ulysseszh.github.io/guide/2024/02/21/sleep-status.html" rel="alternate" type="text/html" title="Letting people know when you are asleep" /><published>2024-02-21T02:26:45-08:00</published><updated>2024-02-21T02:26:45-08:00</updated><id>https://ulysseszh.github.io/guide/2024/02/21/sleep-status</id><content type="html" xml:base="https://ulysseszh.github.io/guide/2024/02/21/sleep-status.html"><![CDATA[<p>While I have been trying to respond whenever people reach out to me, it is impossible to be available 24/7 due to the simple fact that <a href="https://www.sleepfoundation.org/how-sleep-works/why-do-we-need-sleep" target="_blank" rel="external">a human has to sleep to be alive</a>. While this is annoying, it is also a fact that I cannot change.</p>
<p>Therefore, a natural idea that comes to my mind is to simply let people know when I am asleep so that they do not expect me to respond immediately.</p>
<p>Discord and GitHub have been among my most used platforms for some time, and they both have a feature to let users set a custom status (with a custom text and an emoji). This opens up a possibility of using a program to automatically set the status to indicate that I am asleep.</p>
<p>For Discord, this is as simple as invoking a REST API (<a href="https://support.discord.com/hc/en-us/articles/115002192352-Automated-user-accounts-self-bots" target="_blank" rel="external"><strong>Notice that this is against Discord’s ToS</strong></a>):</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-shell">
        <pre>
          <code>
            <span class="line line-1"><span class="c"># Set sleeping status</span>
</span>
            <span class="line line-2">curl <span class="nt">-X</span> PATCH <span class="se">\</span>
</span>
            <span class="line line-3">	<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
</span>
            <span class="line line-4">	<span class="nt">-H</span> <span class="s2">"Authorization: YoUr.DiScOrD.ToKeN"</span> <span class="se">\</span>
</span>
            <span class="line line-5">	<span class="nt">-d</span> <span class="s1">'{"settings":"WhwKBQoDZG5kEhMKC1NsZWVwaW5nLi4uGgTwn5i0"}'</span> <span class="se">\</span>
</span>
            <span class="line line-6">	https://discord.com/api/v9/users/@me/settings-proto/1
</span>
            <span class="line line-7">
</span>
            <span class="line line-8">
</span>
            <span class="line line-9"><span class="c"># Clear sleeping status</span>
</span>
            <span class="line line-10">curl <span class="nt">-X</span> PATCH <span class="se">\</span>
</span>
            <span class="line line-11">	<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
</span>
            <span class="line line-12">	<span class="nt">-H</span> <span class="s2">"Authorization: YoUr.DiScOrD.ToKeN"</span> <span class="se">\</span>
</span>
            <span class="line line-13">	<span class="nt">-d</span> <span class="s1">'{"settings":"WgoKCAoGb25saW5l"}'</span> <span class="se">\</span>
</span>
            <span class="line line-14">	https://discord.com/api/v9/users/@me/settings-proto/1
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>If you wonder what those base64-encoded strings mean, they are actually the binary contents of protobuf-encoded messages. See <a href="https://github.com/discord-userdoccers/discord-protos/blob/master/discord_protos/discord_users/v1/PreloadedUserSettings.proto" target="_blank" rel="external">this <code>.proto</code> file</a> for the definition of the message structure.</p>
<details>
<summary>
API v8
</summary>
<p>The commands written above was added when editing this article on July 20, 2025, which uses API v9. The latest API version as of originally writing this article was v8, but now <strong>using API v8 will get your account disabled</strong>, so do not use it!</p>
<table class="rouge-table"><tbody><tr><td class="highlight language-shell"><pre><code><span class="line line-1"><span class="c"># Set sleeping status</span>
</span><span class="line line-2">curl <span class="nt">-X</span> PATCH <span class="se">\</span>
</span><span class="line line-3">	<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
</span><span class="line line-4">	<span class="nt">-H</span> <span class="s2">"Authorization: YoUr.DiScOrD.ToKeN"</span> <span class="se">\</span>
</span><span class="line line-5">	<span class="nt">-d</span> <span class="s1">'{"custom_status":{"text":"Sleeping...","emoji_id":null,"emoji_name":"😴","expires_at":null},"status":"dnd"}'</span> <span class="se">\</span>
</span><span class="line line-6">	https://discordapp.com/api/v8/users/@me/settings
</span><span class="line line-7">
</span><span class="line line-8"><span class="c"># Clear sleeping status</span>
</span><span class="line line-9">curl <span class="nt">-X</span> PATCH <span class="se">\</span>
</span><span class="line line-10">	<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
</span><span class="line line-11">	<span class="nt">-H</span> <span class="s2">"Authorization: YoUr.DiScOrD.ToKeN"</span> <span class="se">\</span>
</span><span class="line line-12">	<span class="nt">-d</span> <span class="s1">'{"custom_status":null,"status":"online"}'</span> <span class="se">\</span>
</span><span class="line line-13">	https://discordapp.com/api/v8/users/@me/settings
</span></code></pre></td></tr></tbody></table>
</details>
<p>For GitHub, <a href="https://github.com/orgs/community/discussions/108473" target="_blank" rel="external">there is not a REST API for that</a>, but you can install the <a href="https://github.com/vilmibm/gh-user-status" target="_blank" rel="external">user-status plugin</a> for <a href="https://cli.github.com/" target="_blank" rel="external">GitHub CLI</a>:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-shell">
        <pre>
          <code>
            <span class="line line-1">gh extension <span class="nb">install </span>vilmibm/gh-user-status
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p class="no-indent">
Then, you can set the status with:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-shell">
        <pre>
          <code>
            <span class="line line-1"><span class="c"># Set sleeping status</span>
</span>
            <span class="line line-2">gh user-status <span class="nb">set</span> <span class="s1">'Sleeping...'</span> <span class="nt">--emoji</span><span class="o">=</span><span class="s1">'sleeping'</span> <span class="nt">--limited</span>
</span>
            <span class="line line-3">
</span>
            <span class="line line-4"><span class="c"># Clear sleeping status</span>
</span>
            <span class="line line-5">gh user-status <span class="nb">set</span> <span class="s1">'null'</span> <span class="nt">--expiry</span><span class="o">=</span>1s
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Now, the next step is to run these commands automatically when I fall asleep and wake up. This can be done with <a href="https://www.macrodroid.com/" target="_blank" rel="external">MacroDroid</a>, which can trigger actions based on various triggers. To run arbitrary commands, you can use <a href="https://f-droid.org/en/packages/com.termux.tasker/" target="_blank" rel="external">the Tasker plugin for Termux</a>. To have it working, one also needs to uncomment <code>allow-external-apps = true</code> in <code>~/.termux/termux.properties</code>, and grant MacroDroid the permission to run Termux commands by</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-shell">
        <pre>
          <code>
            <span class="line line-1">adb shell pm grant com.arlosoft.macrodroid com.termux.permission.RUN_COMMAND
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>MacroDroid supports using the return value of <a href="https://developers.google.com/location-context/sleep" target="_blank" rel="external">the sleep API</a> to trigger an action, but this tends to be quite unreliable on my device. Therefore, I use it in conjunction with a quick setting tile that I can toggle manually. The macro has two triggers:</p>
<ul>
<li>Fell Asleep / Woke Up (Android sleep API),</li>
<li>Quick Tile On/Off,</li>
</ul>
<p class="no-indent">
and it has these actions:
</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">If Trigger Fired: Woke Up, or Quick Tile Off
</span>
            <span class="line line-2">	If Sleeping = True
</span>
            <span class="line line-3">		Clear sleeping status on Discord and GitHub
</span>
            <span class="line line-4">		# Include other waking up logic here, such as turning off DND mode
</span>
            <span class="line line-5">	End If
</span>
            <span class="line line-6">	Sleeping = False
</span>
            <span class="line line-7">Else If Trigger Fired: Fell Asleep, or Quick Tile On
</span>
            <span class="line line-8">	If Sleeping = False
</span>
            <span class="line line-9">		Set GitHub and Discord user status to sleeping
</span>
            <span class="line line-10">		# Include other falling asleep logic here, such as turning on DND mode
</span>
            <span class="line line-11">	End If
</span>
            <span class="line line-12">	Sleeping = True
</span>
            <span class="line line-13">End If
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>By the way, I have a bunch of topics that I want to write blog articles about, but I have been quite busy recently, so I may have to pause updating this blog for a while. I hope I can get back to writing soon!</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="guide" /><category term="android" /><category term="github" /><summary type="html"><![CDATA[While I am asleep, the sleeping state is indicated on my Discord and GitHub user status. I achieve this by using MacroDroid.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-02-21-sleep-status.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-02-21-sleep-status.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Using nmcli to connect to eduroam in UCSB]]></title><link href="https://ulysseszh.github.io/guide/2024/01/08/nmcli-eduroam.html" rel="alternate" type="text/html" title="Using nmcli to connect to eduroam in UCSB" /><published>2024-01-08T01:03:36-08:00</published><updated>2024-01-08T01:03:36-08:00</updated><id>https://ulysseszh.github.io/guide/2024/01/08/nmcli-eduroam</id><content type="html" xml:base="https://ulysseszh.github.io/guide/2024/01/08/nmcli-eduroam.html"><![CDATA[<p>Save this certificate to some file, say <code>/YOUR/PATH/TO/ca.pem</code>:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-plain">
        <pre>
          <code>
            <span class="line line-1">-----BEGIN CERTIFICATE-----
</span>
            <span class="line line-2">MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
</span>
            <span class="line line-3">MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
</span>
            <span class="line line-4">GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
</span>
            <span class="line line-5">YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
</span>
            <span class="line line-6">MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
</span>
            <span class="line line-7">BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM
</span>
            <span class="line line-8">GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP
</span>
            <span class="line line-9">ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua
</span>
            <span class="line line-10">BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe
</span>
            <span class="line line-11">3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4
</span>
            <span class="line line-12">YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR
</span>
            <span class="line line-13">rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm
</span>
            <span class="line line-14">ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU
</span>
            <span class="line line-15">oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
</span>
            <span class="line line-16">MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
</span>
            <span class="line line-17">QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
</span>
            <span class="line line-18">b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
</span>
            <span class="line line-19">AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
</span>
            <span class="line line-20">GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
</span>
            <span class="line line-21">Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
</span>
            <span class="line line-22">G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
</span>
            <span class="line line-23">l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
</span>
            <span class="line line-24">smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
</span>
            <span class="line line-25">-----END CERTIFICATE-----
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Then, run</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-shell">
        <pre>
          <code>
            <span class="line line-1">nmcli con mod eduroam 802-1x.eap peap
</span>
            <span class="line line-2">nmcli con mod eduroam 802-11-wireless-security.key-mgmt wpa-eap
</span>
            <span class="line line-3">nmcli con mod eduroam 802-11-wireless-security.proto rsn
</span>
            <span class="line line-4">nmcli con mod eduroam 802-11-wireless-security.pairwise ccmp
</span>
            <span class="line line-5">nmcli con mod eduroam 802-11-wireless-security.group ccmp,tkip
</span>
            <span class="line line-6">nmcli con mod eduroam 802-1x.ca-cert /YOUR/PATH/TO/ca.pem
</span>
            <span class="line line-7">nmcli con mod eduroam 802-1x.phase2-autheap mschapv2
</span>
            <span class="line line-8">nmcli con mod eduroam 802-1x.anonymous-identity anonymous@ucsb.edu
</span>
            <span class="line line-9">nmcli con mod eduroam 802-1x.identity YOUR_EDU_EMAIL_ADDRESS
</span>
            <span class="line line-10">nmcli con mod eduroam 802-1x.password YOUR_PASSWORD
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Finally, you can connect to eduroam now!</p>
<p>This may also apply to eduroam in other campuses, but I haven’t tested it yet.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="guide" /><category term="linux" /><category term="school" /><summary type="html"><![CDATA[Use nmcli to connect to eduroam in UCSB without using the configuration assistant tool provided by eduroam.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2024-01-08-nmcli-eduroam.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2024-01-08-nmcli-eduroam.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[The duality between two plane trajectories related by a conformal map]]></title><link href="https://ulysseszh.github.io/physics/2023/12/22/conformal-trajectory.html" rel="alternate" type="text/html" title="The duality between two plane trajectories related by a conformal map" /><published>2023-12-22T11:19:04-08:00</published><updated>2023-12-22T11:19:04-08:00</updated><id>https://ulysseszh.github.io/physics/2023/12/22/conformal-trajectory</id><content type="html" xml:base="https://ulysseszh.github.io/physics/2023/12/22/conformal-trajectory.html"><![CDATA[<p>I always feel amazed about how 2D physics can often be fascinating due to theorems in complex analysis. This article is about one among such cases.</p>
<p class="no-indent">
<strong>Theorem.</strong> The conformal map <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc wz</annotation></semantics></math></span></span> transforms the trajectory with energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">-B</annotation></semantics></math></span></span> in potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc Uz\ceq A\v{\d w/\d z}^2</annotation></semantics></math></span></span> into the trajectory with energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>A</mi></mrow><annotation encoding="application/x-tex">-A</annotation></semantics></math></span></span> in potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>w</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc Vw\ceq B\v{\d z/\d w}^2</annotation></semantics></math></span></span>.
</p>
<p>This result is pretty amazing in that it reveals a quite implicit duality between the two potentials, and it looks very symmetric as written.</p>
<p>This theorem, as I know of, was first introduced in the appendix of V. I. Arnold’s book <cite>Huygens and Barrow, Newton and Hooke</cite>. Part of this article is already covered in the relevant part of the book.</p>
<h2 data-label="0.1" id="power-law-central-force-potentials">Power-law central-force potentials</h2>
<p>Before I show the proof of it, let me first introduce it by a much more well-known example.</p>
<p>As we all know, Bertrand’s theorem states that the only two types of central-force potentials where all bound orbits are closed are <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>∝</mo><msup><mi>r</mi><mrow><mo>−</mo><mn>1</mn></mrow></msup></mrow><annotation encoding="application/x-tex">U\propto r^{-1}</annotation></semantics></math></span></span> (the Kepler problem) and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>∝</mo><msup><mi>r</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">U\propto r^2</annotation></semantics></math></span></span> (the harmonic oscillator). How the two potentials are special among all sorts of different central-force potentials makes people wonder if there is any connection between them. Fortunately, there is one, and it is obvious once we notice that the complex squaring transforms any center-at-origin ellipses into focus-at-origin ellipses. Inspired by this, it is easy to see that trajectories in the Kepler problem can be transformed into trajectories of harmonic oscillators under complex squaring.</p>
<p>You may ask, how can we notice complex squaring does the said transformation on ellipses? The observation is noticing the simple algebra <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mrow><mo fence="true">(</mo><mi>z</mi><mo>+</mo><mfrac><mn>1</mn><mi>z</mi></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><msup><mi>z</mi><mn>2</mn></msup><mo>+</mo><mfrac><mn>1</mn><msup><mi>z</mi><mn>2</mn></msup></mfrac><mo>+</mo><mn>2</mn><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\p{z+\fr1z}^2=z^2+\fr1{z^2}+2,</annotation></semantics></math></span></span></span> which means that the Joukowski transform <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>↦</mo><mi>z</mi><mo>+</mo><mn>1</mn><mi mathvariant="normal">/</mi><mi>z</mi></mrow><annotation encoding="application/x-tex">z\mapsto z+1/z</annotation></semantics></math></span></span> of a unit circle simply translates under complex squaring. We can then try to generalize this to circles of other radii, whose Joukowski transformations are just ellipses! (If you remember, this is the second time Joukowski transformation appears in my blog. The first time was <a href="/math/2020/06/13/joukowsky-heart.html">here</a>.)</p>
<p>Then, are the Kepler problem and the harmonic oscillator the only two central-force potentials whose trajectories can be transformed into each other by a complex function? The answer is no. In fact, for any trajectory in almost any power-law central-force potential, we can take some power of it to get a trajectory in another power-law central-force potential.</p>
<p>This result can be summarized as follows. Taking the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">(</mo><mi>α</mi><mi mathvariant="normal">/</mi><mn>2</mn><mo>+</mo><mn>1</mn><mo fence="true">)</mo></mrow><annotation encoding="application/x-tex">\p{\alp/2+1}</annotation></semantics></math></span></span>th power of a trajectory with energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span></span> in the potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>=</mo><mi>a</mi><msup><mi>r</mi><mi>α</mi></msup></mrow><annotation encoding="application/x-tex">U=ar^\alp</annotation></semantics></math></span></span> (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo mathvariant="normal">≠</mo><mo>−</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\alp\ne-2</annotation></semantics></math></span></span>) gives a trajectory with energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>F</mi></mrow><annotation encoding="application/x-tex">F</annotation></semantics></math></span></span> in the potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mo>=</mo><mi>b</mi><msup><mi>r</mi><mi>β</mi></msup></mrow><annotation encoding="application/x-tex">V=br^\beta</annotation></semantics></math></span></span>, where
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">(</mo><mi>α</mi><mo>+</mo><mn>2</mn><mo fence="true">)</mo></mrow><mrow><mo fence="true">(</mo><mi>β</mi><mo>+</mo><mn>2</mn><mo fence="true">)</mo></mrow><mo>=</mo><mn>4</mn><mo separator="true">,</mo><mspace width="1em"/><mi>b</mi><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><msup><mrow><mo fence="true">(</mo><mi>α</mi><mo>+</mo><mn>2</mn><mo fence="true">)</mo></mrow><mn>2</mn></msup><mi>E</mi><mo separator="true">,</mo><mspace width="1em"/><mi>F</mi><mo>=</mo><mo>−</mo><mfrac><mn>1</mn><mn>4</mn></mfrac><msup><mrow><mo fence="true">(</mo><mi>α</mi><mo>+</mo><mn>2</mn><mo fence="true">)</mo></mrow><mn>2</mn></msup><mi>a</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\p{\alp+2}\p{\beta+2}=4,\quad b=-\fr14\p{\alp+2}^2E,\quad F=-\fr14\p{\alp+2}^2a.</annotation></semantics></math></span></span></span> To prove this, we just need to reparameterize the transformed trajectory in a new time coordinate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> defined as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>τ</mi><mo>=</mo><msup><mrow><mo fence="true">∣</mo><mi>z</mi><mo fence="true">∣</mo></mrow><mi>α</mi></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\d\tau=\v z^\alp\,\d t</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> is the complex position of the original trajectory. Then, by some calculation and utilizing the energy conservation, we can show that the parameter equation in terms of the new time coordinate satisfy the equation of motion we expect. I will not show the details here because they would be redundant once I prove the more general case using the same methods.</p>
<h3 data-label="0.1.1" id="corollaries-and-applications">Corollaries and applications</h3>
<p>There is an interesting special case, which is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mo>−</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\alp=-2</annotation></semantics></math></span></span>. There is no potential that is dual to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>∝</mo><msup><mi>r</mi><mrow><mo>−</mo><mn>2</mn></mrow></msup></mrow><annotation encoding="application/x-tex">U\propto r^{-2}</annotation></semantics></math></span></span>. Another interesting case is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>=</mo><mo>−</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">\alp=-4</annotation></semantics></math></span></span>, which is dual to itself (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>β</mi><mo>=</mo><mo>−</mo><mn>4</mn></mrow><annotation encoding="application/x-tex">\beta=-4</annotation></semantics></math></span></span>). It kind of means that the coefficient in the potential is “interchangeable” with the energy, and the trajectories can be derived from each other by taking the complex reciprocal.</p>
<p>We can get some interesting results with <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">a=0</annotation></semantics></math></span></span>, which is just the case of a free particle, whose trajectories are all straight lines. Since in this case we necessary have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>F</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">F=0</annotation></semantics></math></span></span>, we can say that the zero-energy trajectory in any power-law potential is related to a straight line by a power. From this result, we can derive some interesting corollaries. For example, the zero-energy trajectory in the Kepler problem is a parabola (square of a straight line), which is well-known. The zero-energy trajectory in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>∝</mo><mo>−</mo><msup><mi>r</mi><mrow><mo>−</mo><mn>4</mn></mrow></msup></mrow><annotation encoding="application/x-tex">U\propto-r^{-4}</annotation></semantics></math></span></span> is a circle passing through the origin (reciprocal of a straight line), which is a pretty interesting not-so-well-known result.</p>
<p>Another interesting result is that, the deflection angle of an incident zero-energy particle scattered by the potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>∝</mo><mo>−</mo><msup><mi>r</mi><mi>α</mi></msup></mrow><annotation encoding="application/x-tex">U\propto-r^\alp</annotation></semantics></math></span></span> is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> under paraxial limit, if <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>α</mi><mo>=</mo><mfrac><mrow><mn>2</mn><mi>φ</mi></mrow><mrow><mi>π</mi><mo>−</mo><mi>φ</mi></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>φ</mi><mo>=</mo><mo>±</mo><mi>θ</mi><mo>−</mo><mn>2</mn><mi>k</mi><mi>π</mi><mo separator="true">,</mo><mspace width="1em"/><mi>k</mi><mo>∈</mo><mi mathvariant="double-struck">N</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\alp=\fr{2\vphi}{\pi-\vphi},\quad\vphi=\pm\tht-2k\pi,\quad k\in\bN.</annotation></semantics></math></span></span></span> This result can be easily derived by using the conformal transform of the real line (actually, a straight line that approaches the real line). The crucial part here is that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> cannot take negative integers because we need <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>&gt;</mo><mo>−</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\alp&gt;-2</annotation></semantics></math></span></span>. The reason is that, when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo>≤</mo><mo>−</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\alp\le-2</annotation></semantics></math></span></span>, paraxial zero-energy particles are bound to sink into the origin, and thus no scattering actually happens. This small pitfall indicates that the trajectory in the dual potential is not a two-side infinite straight line, either, in that limit, in contrast to being seemingly a free particle.</p>
<h2 data-label="0.2" id="some-straightforward-proofs">Some straightforward proofs</h2>
<p>Let’s go back to the theorem I stated at the beginning of this article.</p>
<p class="no-indent">
<em>Proof.</em> Consider a new time coordinate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> defined as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>τ</mi><mo>=</mo><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\d\tau=\v{\d w/\d z}^2\,\d t</annotation></semantics></math></span></span>. Then, the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> satisfies <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>m</mi><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>τ</mi><mn>2</mn></msup></mrow></mfrac></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi>m</mi><mfrac><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi>m</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mo fence="true">)</mo></mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mi>m</mi><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mrow><mo fence="true">(</mo><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>w</mi><mn>2</mn></msup></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mo>+</mo><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>t</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
m\fr{\d^2w}{\d\tau^2}
&amp;=m\fr{\d t}{\d\tau}\fr{\d}{\d t}\p{\fr{\d t}{\d\tau}\fr{\d w}{\d t}}\\
&amp;=m\v{\fr{\d z}{\d w}}^2\fr{\d}{\d t}\p{\v{\fr{\d z}{\d w}}^2\fr{\d w}{\d z}\fr{\d z}{\d t}}\\
&amp;=m\fr{\d z}{\d w}\p{\fr{\d z}{\d w}}^*\p{\p{\fr{\d^2z}{\d w^2}\fr{\d w}{\d z}\fr{\d z}{\d t}}^*\fr{\d z}{\d t}
+\p{\fr{\d z}{\d w}}^*\fr{\d^2 z}{\d t^2}}.
\end{align*}</annotation></semantics></math></span></span></span>
Here we need to substitute <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><msup><mi>t</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\d^2 z/\d t^2</annotation></semantics></math></span></span> by the equation of motion for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>. By computing the real and imaginary parts separately, we can derive that for any holomorphic function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi></mrow><annotation encoding="application/x-tex">f</annotation></semantics></math></span></span>, the gradient of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mrow><mo fence="true">∣</mo><mi>f</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\v f^2</annotation></semantics></math></span></span> expressed as a complex number is <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">∇</mi><msup><mrow><mo fence="true">∣</mo><mi>f</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>=</mo><mn>2</mn><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>f</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mi>f</mi></mrow><annotation encoding="application/x-tex">\nabla\v f^2=2\p{\d f/\d z}^*f</annotation></semantics></math></span></span>. Therefore, the equation of motion for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> is
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>m</mi><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>t</mi><mn>2</mn></msup></mrow></mfrac><mo>=</mo><mo>−</mo><mn>2</mn><mi>A</mi><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>z</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">m\fr{\d^2z}{\d t^2}=-2A\fr{\d w}{\d z}\p{\fr{\d^2w}{\d z^2}}^*.</annotation></semantics></math></span></span></span> According to <a href="https://mathworld.wolfram.com/SeriesReversion.html" target="_blank" rel="external">series reversion</a>, we have
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><msup><mi>z</mi><mn>2</mn></msup><mo>=</mo><mo>−</mo><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mn>3</mn></msup><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><msup><mi>w</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\d^2 w/\d z^2=-\p{\d w/\d z}^3\d^2 z/\d w^2</annotation></semantics></math></span></span>. Therefore, the equation of motion for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> can also be written as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>m</mi><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>t</mi><mn>2</mn></msup></mrow></mfrac><mo>=</mo><mn>2</mn><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mrow><mo>∗</mo><mn>2</mn></mrow></msup><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>w</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">m\fr{\d^2z}{\d t^2}=2A\v{\fr{\d w}{\d z}}^2\p{\fr{\d w}{\d z}}^{*2}\p{\fr{\d^2 z}{\d w^2}}^*.</annotation></semantics></math></span></span></span> Substitute this, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>m</mi><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>τ</mi><mn>2</mn></msup></mrow></mfrac><mo>=</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>w</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mrow><mo fence="true">(</mo><mi>m</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>+</mo><mn>2</mn><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">m\fr{\d^2w}{\d\tau^2}=\fr{\d z}{\d w}\p{\fr{\d^2z}{\d w^2}}^*
\p{m\v{\fr{\d z}{\d t}}^2+2A\v{\fr{\d w}{\d z}}^2}.</annotation></semantics></math></span></span></span> Substitute the energy conservation of the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>+</mo><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>=</mo><mo>−</mo><mi>B</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr12m\v{\fr{\d z}{\d t}}^2+A\v{\fr{\d w}{\d z}}^2=-B,</annotation></semantics></math></span></span></span> and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>m</mi><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>τ</mi><mn>2</mn></msup></mrow></mfrac><mo>=</mo><mo>−</mo><mn>2</mn><mi>B</mi><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><msup><mrow><mo fence="true">(</mo><mfrac><mrow><msup><mi mathvariant="normal">d</mi><mn>2</mn></msup><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><msup><mi>w</mi><mn>2</mn></msup></mrow></mfrac><mo fence="true">)</mo></mrow><mo>∗</mo></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">m\fr{\d^2w}{\d\tau^2}=-2B\fr{\d z}{\d w}\p{\fr{\d^2z}{\d w^2}}^*,</annotation></semantics></math></span></span></span> which is the equation of motion for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> that we expect.
</p>
<p>To get the energy of the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span>, we calculate <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>+</mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>m</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>+</mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mrow><mo fence="true">(</mo><mo>−</mo><mi>B</mi><mo>−</mo><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>4</mn></msup><mo>+</mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mo>−</mo><mi>A</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fr12m\v{\fr{\d w}{\d\tau}}^2+B\v{\fr{\d z}{\d w}}^2
&amp;=\fr12m\v{\fr{\d w}{\d z}\fr{\d z}{\d t}\fr{\d t}{\d\tau}}^2+B\v{\fr{\d z}{\d w}}^2\\
&amp;=\v{\fr{\d w}{\d z}}^2\p{-B-A\v{\fr{\d w}{\d z}}^2}\v{\fr{\d z}{\d w}}^4+B\v{\fr{\d z}{\d w}}^2\\
&amp;=-A,
\end{align*}</annotation></semantics></math></span></span></span> which is the energy conservation of the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> in the potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> that we expect. <span class="qed-wrapper qed-normal"><span class="qed qed-normal"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">□</mi></mrow><annotation encoding="application/x-tex">\square</annotation></semantics></math></span></span></span></span></p>
<p>Noticing that we are only interested in the trajectory, we can just use Maupertuis’ principle to get a simpler proof.</p>
<p class="no-indent">
<em>Proof.</em> <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="script">S</mi><mn>0</mn></msub><mo>=</mo><mo>∫</mo><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><msqrt><mrow><mn>2</mn><mi>m</mi><mrow><mo fence="true">(</mo><mo>−</mo><mi>B</mi><mo>−</mo><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow></msqrt><mo>=</mo><mo>∫</mo><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mo fence="true">∣</mo></mrow><msqrt><mrow><mn>2</mn><mi>m</mi><mrow><mo fence="true">(</mo><mo>−</mo><mi>A</mi><mo>−</mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo fence="true">)</mo></mrow></mrow></msqrt><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\mcal S_0=\int\v{\d z}\sqrt{2m\p{-B-A\v{\fr{\d w}{\d z}}^2}}=\int\v{\d w}\sqrt{2m\p{-A-B\v{\fr{\d z}{\d w}}^2}}.</annotation></semantics></math></span></span></span> The abbreviated action is then exactly the same for the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> and the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span>. Therefore, by Maupertuis’ principle, for any physical trajectory of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>, the trajectory of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> is also physical. <span class="qed-wrapper qed-normal"><span class="qed qed-normal"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">□</mi></mrow><annotation encoding="application/x-tex">\square</annotation></semantics></math></span></span></span></span>
</p>
<h2 data-label="0.3" id="details-worth-noting">Details worth noting</h2>
<h3 data-label="0.3.1" id="invertibility-of-the-conformal-map">Invertibility of the conformal map</h3>
<p>There are two different definitions of a conformal transformation in two dimensions. One is that a function defined on an open subset of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">C</mi></mrow><annotation encoding="application/x-tex">\bC</annotation></semantics></math></span></span> is conformal iff it is holomorphic and its derivative is nowhere zero. The other is that a function is conformal iff it is biholomorphic (is bijective and has a holomorphic inverse).</p>
<p>You may think here I have adopted the second definition because when I say <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>w</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc Vw\ceq B\v{\d z/\d w}^2</annotation></semantics></math></span></span>, I am implicitly assuming that I can take the inverse of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc wz</annotation></semantics></math></span></span> to get the function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc zw</annotation></semantics></math></span></span> and then take the derivative of it. However, if that is the case, an immediate problem is that then the duality between the Kepler problem and the harmonic oscillator, from which I introduced the more general result in the first place, would not be actually covered by the “more general” result. This is because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>↦</mo><msup><mi>z</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">z\mapsto z^2</annotation></semantics></math></span></span> is not biholomorphic (because it is not injective).</p>
<p>Then, why did this never become a problem when we were studying the duality between the Kepler problem and the harmonic oscillator? All we have talked about is how we can derive a trajectory in the Kepler problem by squaring the trajectory of a harmonic oscillator, but we have not discussed about how we can reverse this process, as an essential part of the duality. You may think the reverse of the process would be totally natural given how symmetric our theorem is regarding the two potentials. However, the reverse is not actually well-defined since the inverse of squaring, i.e., taking the square root, is not a single-valued function. Nevertheless, it is still well-defined in some sense: starting with whichever branch we like, tracing one point on the trajectory of the Kepler problem, and moving it along this trajectory for two cycles, we will end up with a trajectory of the harmonic oscillator if we take the square root of the position and ensure we always choose the branch so that the mapping is continuously done.</p>
<p>What about other power-law central potentials? In those cases, we have non-closed trajectories, so we cannot just move along the trajectory for two cycles. For example, if we take <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mo>=</mo><msup><mi>z</mi><mn>3</mn></msup></mrow><annotation encoding="application/x-tex">w=z^3</annotation></semantics></math></span></span>, then the potential would be <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>=</mo><mn>9</mn><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mi>z</mi><mo fence="true">∣</mo></mrow><mn>4</mn></msup></mrow><annotation encoding="application/x-tex">U=9A\v z^4</annotation></semantics></math></span></span>. For any non-closed trajectory, we can uniquely map it to a trajectory of the potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mo>=</mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mi>w</mi><mo fence="true">∣</mo></mrow><mrow><mo>−</mo><mn>4</mn><mi mathvariant="normal">/</mi><mn>3</mn></mrow></msup><mi mathvariant="normal">/</mi><mn>9</mn></mrow><annotation encoding="application/x-tex">V=B\v w^{-4/3}/9</annotation></semantics></math></span></span>. However, we cannot uniquely do the reverse mapping. There would be three different trajectories in the potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> that can be mapped to the same trajectory in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span>, and we can in turn map the trajectory in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> to any of the three trajectories in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> depending on which branch we choose.</p>
<p>Therefore, to generalize this for more general potentials, we can use similar arguments. Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>↦</mo><mi>w</mi></mrow><annotation encoding="application/x-tex">z\mapsto w</annotation></semantics></math></span></span> has non-zero derivative everywhere in our considered region, it is everywhere locally invertible by the Lagrange inversion theorem. We can then bijectively map the trajectories in the two dual potentials locally for every small (and finite) segment and then patch them together to get the global correspondence between the two trajectories. This mapping may not be well-defined globally, but the trajectories can still be considered dual to each other. If the potential also becomes multi-valued due to the mapping <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mo>↦</mo><mi>z</mi></mrow><annotation encoding="application/x-tex">w\mapsto z</annotation></semantics></math></span></span> being multi-valued, then we should imagine this situation like this: at some point, the potential may be different when the particle visit here for the second time. This case does not happen if we only look at power-law potentials, but it does happen for more general cases.</p>
<p>What makes this sense of duality weaker is that one trajectory can be dual to multiple different trajectories. A case worth noting is that sometimes one trajectory can be mapped to infinitely many different trajectories. This happens when the trajectory runs around a logarithmic branch point. However, we can gain the sense of duality back if we can also consider the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>↦</mo><mi>w</mi></mrow><annotation encoding="application/x-tex">z\mapsto w</annotation></semantics></math></span></span> is multi-valued. The notion of conformal transformation is now too limited to cover this case, a better notion is a global analytic function, which generalizes the notion of analytic function to allow for multiple branches.</p>
<h3 data-label="0.3.2" id="requirements-for-the-potential">Requirements for the potential</h3>
<p>Not any potential can be expressed as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">A\v{\d w/\d z}^2</annotation></semantics></math></span></span>. How can we determine whether a potential can be expressed in this form?</p>
<p class="no-indent">
<strong>Theorem.</strong> A continuous potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> can be expressed in the form of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">A\v{\d w/\d z}^2</annotation></semantics></math></span></span> (where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc wz</annotation></semantics></math></span></span> is a conformal transformation) iff one of the following conditions is met:
</p>
<ul>
<li><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is zero everywhere, or</li>
<li><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ln</mi><mo>⁡</mo><mrow><mo fence="true">∣</mo><mi>U</mi><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\ln\v U</annotation></semantics></math></span></span> is a harmonic function on the domain of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span>.</li>
</ul>
<p class="no-indent">
<em>Proof.</em> First, prove the necessity.
</p>
<p>An obvious requirement is that the potential must be positive everywhere or negative everywhere (or zero everywhere, but that is trivial). The sign is determined by the sign of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi></mrow><annotation encoding="application/x-tex">A</annotation></semantics></math></span></span>. Therefore, without loss of generality, we can assume <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">A=1</annotation></semantics></math></span></span> because we can always absorb a factor of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msqrt><mrow><mo fence="true">∣</mo><mi>A</mi><mo fence="true">∣</mo></mrow></msqrt></mrow><annotation encoding="application/x-tex">\sqrt{\v A}</annotation></semantics></math></span></span> into <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> and adjust the overall sign of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> accordingly.</p>
<p>We can decompose <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\p{\d w/\d z}^2</annotation></semantics></math></span></span> in the polar form <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi></mrow></msup><mo>=</mo><mi>U</mi><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\p{\d w/\d z}^2=\v{\d w/\d z}^2\e^{\i\vphi}=U\e^{\i\vphi},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\vphi</annotation></semantics></math></span></span> is a real function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>. Applying the Cauchy–Riemann equations to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mrow><mo fence="true">(</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\p{\d w/\d z}^2</annotation></semantics></math></span></span> gives <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">i</mi><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mo>=</mo><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><msup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">)</mo></mrow><mn>2</mn></msup><mtext>  </mtext><mo>⟹</mo><mtext>  </mtext><mi mathvariant="normal">i</mi><mrow><mo fence="true">(</mo><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi></mrow></msup><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mi>U</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>U</mi><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi></mrow></msup><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mi>φ</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi></mrow></msup><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mi>U</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>U</mi><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi></mrow></msup><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mi>φ</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\i\partial_x\p{\fr{\d w}{\d z}}^2=\partial_y\p{\fr{\d w}{\d z}}^2
\implies\i\p{\e^{\i\vphi}\partial_xU+\i U\e^{\i\vphi}\partial_x\vphi}
=\e^{\i\vphi}\partial_yU+\i U\e^{\i\vphi}\partial_y\vphi.</annotation></semantics></math></span></span></span>
Equate the real and imaginary parts, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>U</mi><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mi>φ</mi><mo>=</mo><mo>−</mo><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mi>U</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="false"><mrow><mi>U</mi><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mi>φ</mi><mo>=</mo><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mi>U</mi><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable></mrow><annotation encoding="application/x-tex">\begin{cases}U\partial_x\vphi=-\partial_yU,\\U\partial_y\vphi=\partial_xU.\end{cases}</annotation></semantics></math></span></span></span> Use the symmetry of second derivatives on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\vphi</annotation></semantics></math></span></span>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mi>φ</mi><mo>−</mo><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mi>φ</mi><mo>=</mo><mn>0</mn><mtext>  </mtext><mo>⟹</mo><mtext>  </mtext><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mfrac><mrow><msub><mi mathvariant="normal">∂</mi><mi>x</mi></msub><mi>U</mi></mrow><mi>U</mi></mfrac><mo>+</mo><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mfrac><mrow><msub><mi mathvariant="normal">∂</mi><mi>y</mi></msub><mi>U</mi></mrow><mi>U</mi></mfrac><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\partial_x\partial_y\vphi-\partial_y\partial_x\vphi=0
\implies\partial_x\fr{\partial_xU}U+\partial_y\fr{\partial_yU}U=0.</annotation></semantics></math></span></span></span> In the language of vector analysis, this is just <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">∇</mi><mn>2</mn></msup><mi>ln</mi><mo>⁡</mo><mi>U</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\nabla^2\ln U=0</annotation></semantics></math></span></span>.</p>
<p>Considering the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is negative everywhere, we have that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ln</mi><mo>⁡</mo><mrow><mo fence="true">∣</mo><mi>U</mi><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\ln\v U</annotation></semantics></math></span></span> is a harmonic function.</p>
<p>Then, prove the sufficiency.</p>
<p>The case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is zero everywhere is trivial. Otherwise, because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ln</mi><mo>⁡</mo><mrow><mo fence="true">∣</mo><mi>U</mi><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\ln\v U</annotation></semantics></math></span></span> is defined everywhere on the domain of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span>, we must have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is non-zero everywhere. Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is continuous, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is either positive everywhere or negative everywhere.</p>
<p>Without loss of generality, assume <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is positive everywhere. Let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\vphi</annotation></semantics></math></span></span> be the harmonic conjugate of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ln</mi><mo>⁡</mo><mi>U</mi></mrow><annotation encoding="application/x-tex">\ln U</annotation></semantics></math></span></span>. Then, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>ln</mi><mo>⁡</mo><mi>U</mi><mo>+</mo><mi mathvariant="normal">i</mi><mi>φ</mi></mrow><annotation encoding="application/x-tex">\ln U+\i\vphi</annotation></semantics></math></span></span> is a holomorphic function. We can then define <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo>=</mo><msqrt><mi>U</mi></msqrt><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>φ</mi><mi mathvariant="normal">/</mi><mn>2</mn></mrow></msup><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\fr{\d w}{\d z}=\sqrt U\e^{\i\vphi/2},</annotation></semantics></math></span></span></span> which is also a holomorphic function. <span class="qed-wrapper qed-normal"><span class="qed qed-normal"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">□</mi></mrow><annotation encoding="application/x-tex">\square</annotation></semantics></math></span></span></span></span></p>
<p>From now on, we will call this requirement on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> as being <dfn>log-harmonic</dfn> for obvious resons.</p>
<p>We should notice that whether <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> is log-harmonic does not respect that any potential can have an additive constant and still be essentially the same potential. An immediate example is that a function that is positive everywhere may be negative somewhere if we add a constant to it. We may then want to ask whether <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> can be log-harmonic if we allow it to be added an additive constant. It is easy to do this: we can just apply the same test to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mo>+</mo><mi>C</mi></mrow><annotation encoding="application/x-tex">U+C</annotation></semantics></math></span></span>, and see if there is some <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span> that makes it work. To illustrate, solve the equation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="normal">∇</mi><mn>2</mn></msup><mi>ln</mi><mo>⁡</mo><mrow><mo fence="true">∣</mo><mi>U</mi><mo>+</mo><mi>C</mi><mo fence="true">∣</mo></mrow><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\nabla^2\ln\v{U+C}=0</annotation></semantics></math></span></span> for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span>, and then see whether it is a constant over the whole complex plane.</p>
<p>A property of log-harmonic functions is that the product of two log-harmonic functions is also log-harmonic.</p>
<h3 data-label="0.3.3" id="trajectories-that-run-out-of-the-domain">Trajectories that run out of the domain</h3>
<p>Trajectories often run out of the domain of the potential. For example, in the discussions about power-law potentials before, though not emphasized, the origin is outside the domain of the potential because it is either a pole or a zero of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi></mrow><annotation encoding="application/x-tex">\d w/\d z</annotation></semantics></math></span></span> (except the trivial case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> is simply proportional to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>). Another example that is rather overlooked is that unbound trajectories go to infinity while infinity is often not in the domain of the potential, either.</p>
<p>What need to take care of is that, when the trajectories run out of the domain, the trajectory is cut off there, and the rest of the trajectory is never considered (even if it may come back to the domain again later). Take the Kepler problem ane the harmonic oscillator as an example. If a trajectory of the harmonic oscillator passes through the origin, which is outside the domain, the trajectory degrades from a closed ellipse to a segment. If you take the square of a segment passing through the origin, you will get a broken line folded into itself, which looks like a particle in the Coulomb field may sink into the origin and then goes back along the exact path it came along. This would confusing if it were physical.</p>
<h2 data-label="0.4" id="arbitrariness-in-the-construction-of-the-conformal-map">Arbitrariness in the construction of the conformal map</h2>
<p>The construction of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>↦</mo><mi>w</mi></mrow><annotation encoding="application/x-tex">z\mapsto w</annotation></semantics></math></span></span> is not unique for a given <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span>.</p>
<h3 data-label="0.4.1" id="rotation-and-translation">Rotation and translation</h3>
<p>First, we can observe that the substitution <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mo>→</mo><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><mi>w</mi><msup><mi mathvariant="normal">e</mi><mrow><mi mathvariant="normal">i</mi><mi>θ</mi></mrow></msup><mo>+</mo><msub><mi>w</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">w\to w'\ceq w\e^{\i\tht}+w_0</annotation></semantics></math></span></span> does not change <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><annotation encoding="application/x-tex">\v{\d w/\d z}</annotation></semantics></math></span></span> (nor thus <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span>). The real number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> is a function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> in principle, but if we want <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> to be holomorphic on a connected region, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>θ</mi></mrow><annotation encoding="application/x-tex">\tht</annotation></semantics></math></span></span> must be a constant (except the trivial case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">w=0</annotation></semantics></math></span></span>).</p>
<p>The dual trajectory does change, though, but the dual potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> is also changed, too. Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">∣</mo></mrow><mo>=</mo><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>w</mi><mo fence="true">∣</mo></mrow></mrow><annotation encoding="application/x-tex">\v{\d z/\d w'}=\v{\d z/\d w}</annotation></semantics></math></span></span>, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>V</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>=</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow><mo>=</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mrow><mo fence="true">(</mo><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>−</mo><msub><mi>w</mi><mn>0</mn></msub><mo fence="true">)</mo></mrow><msup><mi mathvariant="normal">e</mi><mrow><mo>−</mo><mi mathvariant="normal">i</mi><mi>θ</mi></mrow></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{V'}{w'}=\fc Vw=\fc V{\p{w'-w_0}\e^{-\i\tht}}.</annotation></semantics></math></span></span></span> Therefore, the dual trajectory and the dual potential are also rotated and translated by the same amount.</p>
<h3 data-label="0.4.2" id="scaling">Scaling</h3>
<p>Before introducing scaling, I need to add some words about the unit systems. In the above discussions, I have never mentioned what units or dimensions do <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo separator="true">,</mo><mi>w</mi><mo separator="true">,</mo><mi>A</mi><mo separator="true">,</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">z,w,A,B</annotation></semantics></math></span></span> have. The natural way of thinking is to let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo separator="true">,</mo><mi>w</mi></mrow><annotation encoding="application/x-tex">z,w</annotation></semantics></math></span></span> have the dimension of length and let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo separator="true">,</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">A,B</annotation></semantics></math></span></span> have the dimension of energy. However, this is not the only way of thinking. We will later see that the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>-space and the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span>-space can have totally different dimensions.</p>
<p>The dimensions or units of variables in a physical formula can be totally different from what they were originally intended to be. For example, when a particle is rotating, its motion needs to satisfy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi mathvariant="bold">r</mi><mo>˙</mo></mover><mo>=</mo><mi mathvariant="bold-italic">ω</mi><mo>×</mo><mi mathvariant="bold">r</mi></mrow><annotation encoding="application/x-tex">\dot{\mbf r}=\bs\omg\times\mbf r</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold-italic">ω</mi></mrow><annotation encoding="application/x-tex">\bs\omg</annotation></semantics></math></span></span> is the angular velocity. However, although <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="bold">r</mi></mrow><annotation encoding="application/x-tex">\mbf r</annotation></semantics></math></span></span> has the dimension of length when it is first introduced, this formula is satisfied by any rotating vectors. A typical example is that the angular momentum changes according to this formula when a rigid body is doing precession. For another example, in classical mechanics and general relativity, the coordinates used to describe the motion of a particle are often not in the dimension of length, but have all sorts of dimensions. For another example that is less well-known, just because the <a href="https://en.wikipedia.org/wiki/Berry_connection_and_curvature" target="_blank" rel="external">Berry connection</a> has the same gauge transformation as the electromagnetic potential, a bunch of formulas that are useful in electromagnetic theory can be applied to the Berry connection to define all sorts of interesting quantities with rich physical implications. The units of Berry connection are, however, very unimportant because they are literally arbitrary.</p>
<p>Therefore, what does a unit system actually bring us in a physical theory? The only thing it brings us is the ability to conveniently see in what aspects our theories are invariant under the scaling of some quantities. For example, in classical mechanics, we can scale the mass and the potential of any system with the same factor, and then the system will still behave the same in terms of the time-dependent length-based motion. This is because the part of the dimension of energy that is independent of length and time is to the first power of the dimension of mass. For similar reasons, we can derive another two scaling invariances, one about length-scaling and the other about time-scaling. In quantum mechanics, we suffer one less such scaling invariances because of the existence of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">ℏ</mi></mrow><annotation encoding="application/x-tex">\hbar</annotation></semantics></math></span></span>; in special relativity, we suffer one less such scaling invariances because of the existence of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span></span>; and in general relativity, we suffer two less such scaling invariances because of the existence of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span></span>. This is the incentive of introducing natural units in physics: they give us a more clear image of how our theory can be scaled leaving the physics invariant.</p>
<p>As for dimensional analysis, the essence of it is to find the required form of theory so that it satisfies some sort of scaling invariance. For example, we can use dimensional analysis to derive that the frequency of a harmonic oscillator is proportional to the square root of the ratio of the stiffness to the mass. We know this must be correct because this is the only theory that is consistent with the three scaling invariances that must be satisfied by any theories under the framework of classical mechanics.</p>
<p>Now, consider the scaling in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span>, i.e., <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mo>→</mo><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><mi>w</mi><mi mathvariant="normal">/</mi><mi>C</mi></mrow><annotation encoding="application/x-tex">w\to w'\ceq w/C</annotation></semantics></math></span></span> for some non-zero real number <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span>. The potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi></mrow><annotation encoding="application/x-tex">U</annotation></semantics></math></span></span> can be kept invariant by scaling <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>A</mi><mo>→</mo><msup><mi>A</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><msup><mi>C</mi><mn>2</mn></msup><mi>A</mi></mrow><annotation encoding="application/x-tex">A\to A'\ceq C^2A</annotation></semantics></math></span></span>. However, we cannot change <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span></span> if we want to leave the trajectory of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> unchanged because it is determined by the energy of the trajectory of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>. Therefore, the dual potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi></mrow><annotation encoding="application/x-tex">V</annotation></semantics></math></span></span> would be scaled to
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msup><mi>V</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi>C</mi><mn>2</mn></msup><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow><mo>=</mo><msup><mi>C</mi><mn>2</mn></msup><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>C</mi><msup><mi>w</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc{V'}{w'}=C^2\fc Vw=C^2\fc V{Cw'}.</annotation></semantics></math></span></span></span> This means that physics is unchanged if length is scaled by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span></span> and energy and potential are both scaled by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>C</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">C^2</annotation></semantics></math></span></span>. This corresponds to one of the three scaling invariances in classical mechanics that we talked about before.</p>
<p>What is interesting here is that the length-scaling in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span>-space is done independently of that in the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>-space. This means that the length dimension in the two systems are independent of each other, so the two systems can have totally different unit systems.</p>
<h2 data-label="0.5" id="canonical-transformation-of-time">Canonical transformation of time</h2>
<p>The transformation from <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> seems like a coordinate transformation, which is covered by canonical transformations. However, here we have an additional requirement about the form of the Hamiltonian: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>H</mi><mo>=</mo><mfrac><msubsup><mi>p</mi><mi>z</mi><mn>2</mn></msubsup><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo>+</mo><mi>U</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><mi>K</mi><mo>=</mo><mfrac><msubsup><mi>p</mi><mi>w</mi><mn>2</mn></msubsup><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo>+</mo><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">H=\fr{p_z^2}{2m}+\fc Uz,\quad K=\fr{p_w^2}{2m}+\fc Vw,</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span> is the transformed Hamiltonian (or called the Kamiltonian in the jargon of canonical transformations). This is not generally true because the transformation in the generalized momentum is restrictively determined when the transformation in the generalized coordinate is already given. From the proof of the original theorem, we can see that a transformation in time is a must, which is given by
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>τ</mi><mo>=</mo><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\d\tau=\v{\d w/\d z}^2\,\d t</annotation></semantics></math></span></span>.</p>
<p>The problem is that the canonical transformations covered in most textbooks usually do not allow for a transformation in time, but only for a transformation in the canonical variables. Therefore, I need to first address the problem of integrating the transformation of time into the theory of canonical transformations. I will not do this for the most general case, but only for the case general enough for the purpose of explaining the case interesting this article.</p>
<h3 data-label="0.5.1" id="change-in-the-time-variable-in-the-stationary-action-principle">Change in the time variable in the stationary-action principle</h3>
<p>Before diving into the general canonical transformation, let’s first consider the case where the transformation is only in the time variable.</p>
<p>Consider a system with the Lagrangian <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc L{q,\dot q}</annotation></semantics></math></span></span> (not explicitly dependent on time). Then, the action can be expressed as <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>S</mi><mo>=</mo><msubsup><mo>∫</mo><msub><mi>t</mi><mn>1</mn></msub><msub><mi>t</mi><mn>2</mn></msub></msubsup><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>t</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">S=\int_{t_1}^{t_2}\fc L{q,\dot q}\d t.</annotation></semantics></math></span></span></span> The same integral can be expressed in terms of a new time variable <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> as
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>S</mi><mo>=</mo><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo fence="true">)</mo></mrow><mfrac><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">S=\int_{\tau_1}^{\tau_2}\fc L{q,\mathring q\dot\tau}\fr{\d\tau}{\dot\tau},</annotation></semantics></math></span></span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mo><mi mathvariant="normal">≔</mi></mo><mi mathvariant="normal">d</mi><mi>q</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>τ</mi></mrow><annotation encoding="application/x-tex">\mathring q\ceq\d q/\d\tau</annotation></semantics></math></span></span> is the generalized velocity in the new time variable. The transformed Lagrangian, or what I want to call the <dfn>Magrangian</dfn> <a href="#fn1" class="footnote-ref" id="fnref1" role="doc-noteref"><sup>1</sup></a>, is then <span id="eq:magrangian" data-label="(1)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>M</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>L</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo fence="true">)</mo></mrow><mfrac><mn>1</mn><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc M{q,\mathring q}\ceq\fc L{q,\mathring q\dot\tau}\fr1{\dot\tau}.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>1</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(1)</annotation></semantics></math></span></span></span></span> </span></span> For the case that we are concerning, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span> is a positive real function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span></span> but does not (explicitly) depend on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span>. The limits <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>τ</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>τ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\tau_1,\tau_2</annotation></semantics></math></span></span> satisfy the condition
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>τ</mi><mn>2</mn></msub><mo>−</mo><msub><mi>τ</mi><mn>1</mn></msub><mo>=</mo><msubsup><mo>∫</mo><msub><mi>t</mi><mn>1</mn></msub><msub><mi>t</mi><mn>2</mn></msub></msubsup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\tau_2-\tau_1=\int_{t_1}^{t_2}\fc{\dot\tau}q\,\d t.</annotation></semantics></math></span></span></span> This relation is crucial. When finding the variation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mi>S</mi></mrow><annotation encoding="application/x-tex">\dlt S</annotation></semantics></math></span></span>, we are fixing <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>t</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>t</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">t_1,t_2</annotation></semantics></math></span></span>. However, we cannot fix both <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>τ</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>τ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\tau_1,\tau_2</annotation></semantics></math></span></span> because their difference is dependent on the path
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>t</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc qt</annotation></semantics></math></span></span>. What we can do is to fix <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>τ</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">\tau_1</annotation></semantics></math></span></span> and to let <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>τ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\tau_2</annotation></semantics></math></span></span> have a variation given by <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mo>=</mo><msubsup><mo>∫</mo><msub><mi>t</mi><mn>1</mn></msub><msub><mi>t</mi><mn>2</mn></msub></msubsup><msup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow><mi>δ</mi><mi>q</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mo>=</mo><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mfrac><mrow><msup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mi>δ</mi><mi>q</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>τ</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\dlt\tau_2=\int_{t_1}^{t_2}\fc{\dot\tau'}q\dlt q\,\d t
=\int_{\tau_1}^{\tau_2}\fr{\fc{\dot\tau'}q}{\fc{\dot\tau}q}\dlt q\,\d\tau,</annotation></semantics></math></span></span></span>
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">\dot\tau'</annotation></semantics></math></span></span> is the derivative (or gradient, in higher dimensions) of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span> as a function of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi></mrow><annotation encoding="application/x-tex">q</annotation></semantics></math></span></span>. As can be seen, only if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span> is a constant (i.e., <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> is simply an affine transform of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>t</mi></mrow><annotation encoding="application/x-tex">t</annotation></semantics></math></span></span>) does <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\dlt\tau_2</annotation></semantics></math></span></span> vanish for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mi>q</mi></mrow><annotation encoding="application/x-tex">\dlt q</annotation></semantics></math></span></span>.</p>
<p>Using the well-known variation of the action when there is variation in the time coordinate, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>δ</mi><mi>S</mi><mo>=</mo><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>−</mo><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mo fence="true">)</mo></mrow><mi>δ</mi><mi>q</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mo>−</mo><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\dlt S=\int_{\tau_1}^{\tau_2}
\p{\fr{\partial M}{\partial q}-\fr{\d}{\d\tau}\fr{\partial M}{\partial\mathring q}}\dlt q\,\d t
-\fc{K}{\fc q{\tau_2},\fc{\mathring q}{\tau_2}}\dlt\tau_2,</annotation></semantics></math></span></span></span>
where <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>K</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mo>−</mo><mi>M</mi></mrow><annotation encoding="application/x-tex">\fc K{q,\mathring q}\ceq\mathring q\fr{\partial M}{\partial\mathring q}-M</annotation></semantics></math></span></span></span> is the energy (or the Kamiltonian, but as a function of generalized coordinates and velocities) of the system.</p>
<details>
<summary>
A quick check of this variation
</summary>
<p>Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc q{\tau_2}</annotation></semantics></math></span></span> is fixed, we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo>=</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo>+</mo><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo>+</mo><mi>δ</mi><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo>+</mo><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo>=</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo>+</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mo>+</mo><mi>δ</mi><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mtext>  </mtext><mo>⟹</mo><mtext>  </mtext><mi>δ</mi><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo>=</mo><mo>−</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fc q{\tau_2}=\fc q{\tau_2+\dlt\tau_2}+\fc{\dlt q}{\tau_2+\dlt\tau_2}
=\fc q{\tau_2}+\fc{\mathring q}{\tau_2}\dlt\tau_2+\fc{\dlt q}{\tau_2}
\implies\fc{\dlt q}{\tau_2}=-\fc{\mathring q}{\tau_2}\dlt\tau_2.</annotation></semantics></math></span></span></span>
Now, calculate the variation of the action: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>δ</mi><mi>S</mi><mo>=</mo><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mi>δ</mi><mi>q</mi><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mi>δ</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>τ</mi><mo>+</mo><mi>M</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><msub><mi>τ</mi><mn>2</mn></msub><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\dlt S=\int_{\tau_1}^{\tau_2}
\p{\fr{\partial M}{\partial q}\dlt q+\fr{\partial M}{\partial\mathring q}\dlt\mathring q}\d\tau
+\fc M{\fc q{\tau_2},\fc{\mathring q}{\tau_2}}\dlt\tau_2.</annotation></semantics></math></span></span></span>
Recall the derivation of the Euler–Lagrange equation. For the second term in the integrand, we can integrate by parts to get <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mi>δ</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mtext> </mtext><mi mathvariant="normal">d</mi><mi>τ</mi><mo>=</mo><msubsup><mrow><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mi>δ</mi><mi>q</mi><mo fence="true">∣</mo></mrow><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mo>−</mo><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mi>δ</mi><mi>q</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>τ</mi><mo>=</mo><msub><mrow><mo>−</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mo fence="true">∣</mo></mrow><msub><mi>τ</mi><mn>2</mn></msub></msub><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub><mo>−</mo><msubsup><mo>∫</mo><msub><mi>τ</mi><mn>1</mn></msub><msub><mi>τ</mi><mn>2</mn></msub></msubsup><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mi>δ</mi><mi>q</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>τ</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\int_{\tau_1}^{\tau_2}\fr{\partial M}{\partial\mathring q}\dlt\mathring q\,\d\tau
=\abar{\fr{\partial M}{\partial\mathring q}\dlt q}{\tau_1}^{\tau_2}
-\int_{\tau_1}^{\tau_2}\fr{\d}{\d\tau}\fr{\partial M}{\partial\mathring q}\dlt q\,\d\tau
=\abar{-\fr{\partial M}{\partial\mathring q}\mathring q}{\tau_2}\dlt\tau_2
-\int_{\tau_1}^{\tau_2}\fr{\d}{\d\tau}\fr{\partial M}{\partial\mathring q}\dlt q\,\d\tau.</annotation></semantics></math></span></span></span> Substitute this back into the expression for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mi>S</mi></mrow><annotation encoding="application/x-tex">\dlt S</annotation></semantics></math></span></span>, and we have the desired result.</p>
</details>
<p>If we let the first term in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mi>S</mi></mrow><annotation encoding="application/x-tex">\dlt S</annotation></semantics></math></span></span> vanish, we would get the well-known Euler–Lagrange equation:</p>
<p>
  <span id="eq:transformed-EL" data-label="(2)">
    <span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>−</mo><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">\fr{\partial M}{\partial q}-\fr{\d}{\d\tau}\fr{\partial M}{\partial\mathring q}=0.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>2</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(2)</annotation></semantics></math></span></span></span></span> </span>
  </span>
</p>
<p>However, that term is not zero because there is another term in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><mi>S</mi></mrow><annotation encoding="application/x-tex">\dlt S</annotation></semantics></math></span></span>. If we want the Euler–Lagrange equation to be satisfied, we need the second term to be zero. This means that either <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span> is zero or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\dlt\tau_2</annotation></semantics></math></span></span> is zero. The latter case will lead us to the trivial case because we have just derived that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>δ</mi><msub><mi>τ</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">\dlt\tau_2</annotation></semantics></math></span></span> is zero only if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span> is a constant. The former case can be satisfied, however. If the Euler–Lagrange equation is satisfied, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span> is a conserved quantity due to the symmetry of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span>-translation. Then, if <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span> happens to be zero at some point, it will be zero over the whole motion, and the stationary-action principle will be satisfied by the motion between any two points.</p>
<p>We can explicitly show that Equation <a href="#eq:transformed-EL">2</a> can be derived from the original Euler–Lagrange equation under the zero-energy condition.</p>
<p class="no-indent">
<em>Proof.</em> We need to first derive the condition of zero energy in the old time variable. Take derivatives of Equation <a href="#eq:magrangian">1</a> with respect to <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow><annotation encoding="application/x-tex">\mathring q</annotation></semantics></math></span></span>, and we have <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mfrac><mn>1</mn><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mfrac><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr{\partial M}{\partial\mathring q}=\fr{\partial L}{\partial\dot q}\dot\tau\fr1{\dot\tau}
=\fr{\partial L}{\partial\dot q}.</annotation></semantics></math></span></span></span> Therefore, the Kamiltonian is <span id="eq:K-H" data-label="(3)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>K</mi><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac><mover accent="true"><mi>q</mi><mo>˚</mo></mover><mo>−</mo><mi>M</mi><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac><mfrac><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mfrac><mo>−</mo><mfrac><mi>L</mi><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mfrac><mo>=</mo><mfrac><mi>H</mi><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mfrac><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">K=\fr{\partial M}{\partial\mathring q}\mathring q-M=\fr{\partial L}{\partial\dot q}\fr{\dot q}{\dot\tau}-\fr L{\dot\tau}
=\fr H{\dot\tau},</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>3</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(3)</annotation></semantics></math></span></span></span></span> </span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi><mo><mi mathvariant="normal">≔</mi></mo><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mi mathvariant="normal">∂</mi><mi>L</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mo>−</mo><mi>L</mi></mrow><annotation encoding="application/x-tex">H\ceq\dot q\partial L/\partial\dot q-L</annotation></semantics></math></span></span> is the original Hamiltonian. This relation means that the condition <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">K=0</annotation></semantics></math></span></span> is equivalent to the condition <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">H=0</annotation></semantics></math></span></span>.
</p>
<p>Then, use Equation <a href="#eq:magrangian">1</a> to explicitly calculate the lhs of Equation <a href="#eq:transformed-EL">2</a>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>−</mo><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>M</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˚</mo></mover></mrow></mfrac></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac><mover accent="true"><mi>q</mi><mo>˚</mo></mover><msup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow><mo fence="true">)</mo></mrow><mfrac><mn>1</mn><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>−</mo><mi>L</mi><mfrac><mrow><msup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></mfrac><mo>−</mo><mfrac><mn>1</mn><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>−</mo><mfrac><mi mathvariant="normal">d</mi><mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mfrac><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac><mo fence="true">)</mo></mrow><mfrac><mn>1</mn><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow></mfrac><mo>+</mo><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>L</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mover accent="true"><mi>q</mi><mo>˙</mo></mover></mrow></mfrac><mover accent="true"><mi>q</mi><mo>˙</mo></mover><mo>−</mo><mi>L</mi><mo fence="true">)</mo></mrow><mfrac><mrow><msup><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow></mrow><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mtext> ⁣</mtext><msup><mrow><mo fence="true">(</mo><mi>q</mi><mo fence="true">)</mo></mrow><mn>2</mn></msup></mrow></mfrac></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><mo>=</mo><mn>0.</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
\fr{\partial M}{\partial q}-\fr{\d}{\d\tau}\fr{\partial M}{\partial\mathring q}
&amp;=\p{\fr{\partial L}{\partial q}+\fr{\partial L}{\partial\dot q}\mathring q\fc{\dot\tau'}q}\fr1{\fc{\dot\tau}q}
-L\fr{\fc{\dot\tau'}q}{\fc{\dot\tau}q^2}-\fr1{\fc{\dot\tau}q}\fr{\d}{\d t}\fr{\partial L}{\partial\dot q}\\
&amp;=\p{\fr{\partial L}{\partial q}-\fr{\d}{\d t}\fr{\partial L}{\partial\dot q}}\fr1{\fc{\dot\tau}q}
+\p{\fr{\partial L}{\partial\dot q}\dot q-L}\fr{\fc{\dot\tau'}q}{\fc{\dot\tau}q^2}\\
&amp;=0.
\end{align*}</annotation></semantics></math></span></span></span>
<span class="qed-wrapper qed-last"><span class="qed qed-last"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">□</mi></mrow><annotation encoding="application/x-tex">\square</annotation></semantics></math></span></span></span></span></p>
<h3 data-label="0.5.2" id="specifying-tau-vs.-specifying-dottau">Specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> vs. specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span></h3>
<p>We will see that specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span>, which is what we have done in the above discussion, is pretty different from specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span>. The latter is much simpler, but the former is the one that is used for the conformal duality between potentials. Although I do not have to discuss what the transformation should look like when we specify <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> instead of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span>, I will still do this because I need to point it out that it is quite different from the case we have discussed.</p>
<p>Recall that the canonical transformation is just a transformation of coordinates in the phase space that preserves the canonical one-form up to a total differential. Adding the idea of time transformation into this has a difficulty that time is not a coordinate in the phase space. Including the time coordinate, the actual one-form that needs to be preserved is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">d</mi><mi>S</mi><mo>=</mo><mi>p</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>q</mi><mo>−</mo><mi>H</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\d S=p\,\d q-H\,\d t,</annotation></semantics></math></span></span></span> which is exactly the total differential of the action. Therefore, we have <span id="eq:preserved-form" data-label="(4)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>p</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>q</mi><mo>−</mo><mi>H</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mo>=</mo><mi>P</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>Q</mi><mo>−</mo><mi>K</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>τ</mi><mo>+</mo><mi mathvariant="normal">d</mi><mi>G</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">p\,\d q-H\,\d t=P\,\d Q-K\,\d\tau+\d G,</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>4</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(4)</annotation></semantics></math></span></span></span></span> </span></span> where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi><mo separator="true">,</mo><mi>Q</mi></mrow><annotation encoding="application/x-tex">P,Q</annotation></semantics></math></span></span> are the new canonical variables, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span> is the transformed Hamiltonian, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> is called the generating function of the canonical transformation. Assume <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> are both functions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo separator="true">,</mo><mi>Q</mi><mo separator="true">,</mo><mi>t</mi></mrow><annotation encoding="application/x-tex">q,Q,t</annotation></semantics></math></span></span>. Then, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>p</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>q</mi><mo>−</mo><mi>H</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mo>=</mo><mi>P</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>Q</mi><mo>−</mo><mi>K</mi><mrow><mo fence="true">(</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>τ</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>q</mi><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>τ</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>Q</mi></mrow></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>Q</mi><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>τ</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>t</mi></mrow></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mo fence="true">)</mo></mrow><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>G</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>q</mi><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>G</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>Q</mi></mrow></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>Q</mi><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>G</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>t</mi></mrow></mfrac><mtext> </mtext><mi mathvariant="normal">d</mi><mi>t</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">p\,\d q-H\,\d t=P\,\d Q
-K\p{\fr{\partial\tau}{\partial q}\,\d q+\fr{\partial\tau}{\partial Q}\,\d Q+\fr{\partial\tau}{\partial t}\,\d t}
+\fr{\partial G}{\partial q}\,\d q+\fr{\partial G}{\partial Q}\,\d Q+\fr{\partial G}{\partial t}\,\d t.</annotation></semantics></math></span></span></span> Compare the coefficients of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>q</mi><mo separator="true">,</mo><mi mathvariant="normal">d</mi><mi>Q</mi><mo separator="true">,</mo><mi mathvariant="normal">d</mi><mi>t</mi></mrow><annotation encoding="application/x-tex">\d q,\d Q,\d t</annotation></semantics></math></span></span> on both sides, and we have <span id="eq:canonical-tau" data-label="(5)"><span class="katex-display-table"> <span class="katex-display-numbered"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>p</mi><mo>+</mo><mi>K</mi><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>τ</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>−</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>G</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>q</mi></mrow></mfrac><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mspace width="1em"/><mi>P</mi><mo>−</mo><mi>K</mi><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>τ</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>Q</mi></mrow></mfrac><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>G</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>Q</mi></mrow></mfrac><mo>=</mo><mn>0</mn><mo separator="true">,</mo><mspace width="1em"/><mi>H</mi><mo>−</mo><mi>K</mi><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>τ</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>t</mi></mrow></mfrac><mo>+</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>G</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>t</mi></mrow></mfrac><mo>=</mo><mn>0.</mn></mrow><annotation encoding="application/x-tex">p+K\fr{\partial\tau}{\partial q}-\fr{\partial G}{\partial q}=0,\quad
P-K\fr{\partial\tau}{\partial Q}+\fr{\partial G}{\partial Q}=0,\quad
H-K\fr{\partial\tau}{\partial t}+\fr{\partial G}{\partial t}=0.</annotation></semantics></math></span></span></span></span> <span class="katex-display-number"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">(</mo><mn>5</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(5)</annotation></semantics></math></span></span></span></span> </span></span> These equations determines
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo separator="true">,</mo><mi>P</mi><mo separator="true">,</mo><mi>K</mi></mrow><annotation encoding="application/x-tex">Q,P,K</annotation></semantics></math></span></span>. They will satisfy Hamilton’s equation: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mfrac><mrow><mi mathvariant="normal">d</mi><mi>Q</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>K</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>P</mi></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><mfrac><mrow><mi mathvariant="normal">d</mi><mi>P</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>τ</mi></mrow></mfrac><mo>=</mo><mo>−</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>K</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>Q</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\fr{\d Q}{\d\tau}=\fr{\partial K}{\partial P},\quad
\fr{\d P}{\d\tau}=-\fr{\partial K}{\partial Q}.</annotation></semantics></math></span></span></span></p>
<details>
<summary>
An example
</summary>
<p>Consider the Hamiltonian <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi><mo>=</mo><mi>p</mi><mo>+</mo><mi>q</mi></mrow><annotation encoding="application/x-tex">H=p+q</annotation></semantics></math></span></span>. The motion is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>q</mi><mo>=</mo><msub><mi>q</mi><mn>0</mn></msub><mo>+</mo><mi>t</mi><mo separator="true">,</mo><mspace width="1em"/><mi>p</mi><mo>=</mo><msub><mi>p</mi><mn>0</mn></msub><mo>−</mo><mi>t</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">q=q_0+t,\quad p=p_0-t.</annotation></semantics></math></span></span></span> Consider the new time variable <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi><mo>=</mo><mi>t</mi><mi mathvariant="normal">/</mi><mi>q</mi></mrow><annotation encoding="application/x-tex">\tau=t/q</annotation></semantics></math></span></span> and the generating function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi><mo>=</mo><mi>Q</mi><mi>q</mi></mrow><annotation encoding="application/x-tex">G=Qq</annotation></semantics></math></span></span>. With Equation <a href="#eq:canonical-tau">5</a> and the expression for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>H</mi></mrow><annotation encoding="application/x-tex">H</annotation></semantics></math></span></span> and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span>, we have a set of five equations: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>p</mi><mo>−</mo><mi>K</mi><mfrac><mn>1</mn><msup><mi>q</mi><mn>2</mn></msup></mfrac><mi>t</mi><mo>−</mo><mi>Q</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>P</mi><mo>+</mo><mi>q</mi><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>H</mi><mo>−</mo><mi>K</mi><mfrac><mn>1</mn><mi>q</mi></mfrac><mo>=</mo><mn>0</mn><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>τ</mi><mo>=</mo><mfrac><mi>t</mi><mi>q</mi></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>H</mi><mo>=</mo><mi>p</mi><mo>+</mo><mi>q</mi></mrow></mstyle></mtd></mtr></mtable></mrow><mtext>  </mtext><mo>⟹</mo><mtext>  </mtext><mrow><mo fence="true">{</mo><mtable rowspacing="0.36em" columnalign="left left" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>q</mi><mo>=</mo><mo>−</mo><mi>P</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>p</mi><mo>=</mo><mfrac><mrow><mi>Q</mi><mo>−</mo><mi>P</mi><mi>τ</mi></mrow><mrow><mn>1</mn><mo>−</mo><mi>τ</mi></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>K</mi><mo>=</mo><mfrac><mrow><mrow><mo fence="true">(</mo><mi>P</mi><mo>−</mo><mi>Q</mi><mo fence="true">)</mo></mrow><mi>P</mi></mrow><mrow><mn>1</mn><mo>−</mo><mi>τ</mi></mrow></mfrac><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>t</mi><mo>=</mo><mo>−</mo><mi>P</mi><mi>τ</mi><mo separator="true">,</mo></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>H</mi><mo>=</mo><mfrac><mrow><mi>Q</mi><mo>−</mo><mi>P</mi></mrow><mrow><mn>1</mn><mo>−</mo><mi>τ</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable></mrow></mrow><annotation encoding="application/x-tex">\begin{dcases}
p-K\fr1{q^2}t-Q=0,\\
P+q=0,\\
H-K\fr1q=0,\\
\tau=\fr tq,\\
H=p+q
\end{dcases}\implies\begin{dcases}
q=-P,\\
p=\fr{Q-P\tau}{1-\tau},\\
K=\fr{\p{P-Q}P}{1-\tau},\\
t=-P\tau,\\
H=\fr{Q-P}{1-\tau}.
\end{dcases}</annotation></semantics></math></span></span></span>
With the expression for the Kamiltonian <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span>, we get the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>Q</mi><mo separator="true">,</mo><mi>P</mi></mrow><annotation encoding="application/x-tex">Q,P</annotation></semantics></math></span></span>: <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>Q</mi><mo>=</mo><mfrac><mrow><mrow><mo fence="true">(</mo><mn>2</mn><mo>−</mo><mi>τ</mi><mo fence="true">)</mo></mrow><mi>τ</mi></mrow><mrow><mn>1</mn><mo>−</mo><mi>τ</mi></mrow></mfrac><msub><mi>P</mi><mn>0</mn></msub><mo>+</mo><mrow><mo fence="true">(</mo><mn>1</mn><mo>−</mo><mi>τ</mi><mo fence="true">)</mo></mrow><msub><mi>Q</mi><mn>0</mn></msub><mo separator="true">,</mo><mspace width="1em"/><mi>P</mi><mo>=</mo><mfrac><msub><mi>P</mi><mn>0</mn></msub><mrow><mn>1</mn><mo>−</mo><mi>τ</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">Q=\fr{\p{2-\tau}\tau}{1-\tau}P_0+\p{1-\tau}Q_0,\quad P=\fr{P_0}{1-\tau}.</annotation></semantics></math></span></span></span> This is consistent with the motion of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>q</mi><mo separator="true">,</mo><mi>p</mi></mrow><annotation encoding="application/x-tex">q,p</annotation></semantics></math></span></span> as can be verified with calculation.</p>
</details>
<p>It seems that specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> is much easier than specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span>. We can easily discuss the most general case and perfectly recover the equation of motion without having to impose a bizarre condition like the zero energy. This is because specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span> is, in some sense, more general than specifying <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span>: we can always find the total derivative of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> for any form of it, but we cannot always find <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>τ</mi></mrow><annotation encoding="application/x-tex">\tau</annotation></semantics></math></span></span> given the form of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover></mrow><annotation encoding="application/x-tex">\dot\tau</annotation></semantics></math></span></span> because of limitations on the integrability.</p>
<h3 data-label="0.5.3" id="the-conformal-transformation-as-a-canonical-transformation">The conformal transformation as a canonical transformation</h3>
<p>Now, we can discuss the conformal transformation as a canonical transformation. The procedure is pretty analogous to that in the previous section, but this time the conclusion would only be valid under the zero-energy condition.</p>
<p>Denote the real and imaginary parts of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo separator="true">,</mo><mi>y</mi></mrow><annotation encoding="application/x-tex">x,y</annotation></semantics></math></span></span>, and the real and imaginary parts of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi></mrow><annotation encoding="application/x-tex">w</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi><mo separator="true">,</mo><mi>Y</mi></mrow><annotation encoding="application/x-tex">X,Y</annotation></semantics></math></span></span>. The Cauchy–Riemann equations give <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>u</mi><mo><mi mathvariant="normal">≔</mi></mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>X</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>x</mi></mrow></mfrac><mo>=</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>Y</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>y</mi></mrow></mfrac><mo separator="true">,</mo><mspace width="1em"/><mi>v</mi><mo><mi mathvariant="normal">≔</mi></mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>X</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>y</mi></mrow></mfrac><mo>=</mo><mo>−</mo><mfrac><mrow><mi mathvariant="normal">∂</mi><mi>Y</mi></mrow><mrow><mi mathvariant="normal">∂</mi><mi>x</mi></mrow></mfrac><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">u\ceq\fr{\partial X}{\partial x}=\fr{\partial Y}{\partial y},\quad
v\ceq\fr{\partial X}{\partial y}=-\fr{\partial Y}{\partial x}.</annotation></semantics></math></span></span></span> Here <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo separator="true">,</mo><mi>v</mi></mrow><annotation encoding="application/x-tex">u,v</annotation></semantics></math></span></span> are two real functions defined for convenience. They can either be functions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>x</mi><mo separator="true">,</mo><mi>y</mi></mrow><annotation encoding="application/x-tex">x,y</annotation></semantics></math></span></span> or functions of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>X</mi><mo separator="true">,</mo><mi>Y</mi></mrow><annotation encoding="application/x-tex">X,Y</annotation></semantics></math></span></span>, depending on which are more convenient. With <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>u</mi><mo separator="true">,</mo><mi>v</mi></mrow><annotation encoding="application/x-tex">u,v</annotation></semantics></math></span></span>, we have
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi mathvariant="normal">d</mi><mi>X</mi><mo>=</mo><mi>u</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi><mo>+</mo><mi>v</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo separator="true">,</mo><mspace width="1em"/><mi mathvariant="normal">d</mi><mi>Y</mi><mo>=</mo><mo>−</mo><mi>v</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi><mo>+</mo><mi>u</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo separator="true">,</mo></mrow><annotation encoding="application/x-tex">\d X=u\,\d x+v\,\d y,\quad\d Y=-v\,\d x+u\,\d y,</annotation></semantics></math></span></span></span> The time transformation is given by <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mover accent="true"><mi>τ</mi><mo>˙</mo></mover><mo>=</mo><msup><mrow><mo fence="true">∣</mo><mfrac><mrow><mi mathvariant="normal">d</mi><mi>w</mi></mrow><mrow><mi mathvariant="normal">d</mi><mi>z</mi></mrow></mfrac><mo fence="true">∣</mo></mrow><mn>2</mn></msup><mo>=</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">\dot\tau=\v{\fr{\d w}{\d z}}^2=u^2+v^2.</annotation></semantics></math></span></span></span> The original Hamiltonian is <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>H</mi><mo>=</mo><mfrac><mrow><msubsup><mi>p</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>p</mi><mi>y</mi><mn>2</mn></msubsup></mrow><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo>+</mo><mi>A</mi><mrow><mo fence="true">(</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mo>+</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">H=\fr{p_x^2+p_y^2}{2m}+A\p{u^2+v^2}+B</annotation></semantics></math></span></span></span> (the last term is added because we want it to be zero during the motion). Substitute these into Equation <a href="#eq:preserved-form">4</a>, and we have (<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">d</mi><mi>G</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">\d G=0</annotation></semantics></math></span></span>)
<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow/></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><msub><mi>p</mi><mi>x</mi></msub><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi><mo>+</mo><msub><mi>p</mi><mi>y</mi></msub><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo>−</mo><mrow><mo fence="true">(</mo><mfrac><mrow><msubsup><mi>p</mi><mi>x</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>p</mi><mi>y</mi><mn>2</mn></msubsup></mrow><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo>+</mo><mi>A</mi><mrow><mo fence="true">(</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mo>+</mo><mi>B</mi><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>t</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mo>=</mo><mrow/></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow/><msub><mi>P</mi><mi>X</mi></msub><mrow><mo fence="true">(</mo><mi>u</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi><mo>+</mo><mi>v</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo fence="true">)</mo></mrow><mo>+</mo><msub><mi>P</mi><mi>Y</mi></msub><mrow><mo fence="true">(</mo><mo>−</mo><mi>v</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>x</mi><mo>+</mo><mi>u</mi><mtext> </mtext><mi mathvariant="normal">d</mi><mi>y</mi><mo fence="true">)</mo></mrow><mo>−</mo><mi>K</mi><mrow><mo fence="true">(</mo><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup><mo fence="true">)</mo></mrow><mi mathvariant="normal">d</mi><mi>t</mi><mi mathvariant="normal">.</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">\begin{align*}
&amp;p_x\,\d x+p_y\,\d y-\p{\fr{p_x^2+p_y^2}{2m}+A\p{u^2+v^2}+B}\d t\\
={}&amp;P_X\p{u\,\d x+v\,\d y}+P_Y\p{-v\,\d x+u\,\d y}-K\p{u^2+v^2}\d t.
\end{align*}</annotation></semantics></math></span></span></span>
Then, after some calculations, we have perfectly the expected result <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>p</mi><mi>x</mi></msub><mo>=</mo><mi>u</mi><msub><mi>P</mi><mi>X</mi></msub><mo>−</mo><mi>v</mi><msub><mi>P</mi><mi>Y</mi></msub><mo separator="true">,</mo><mspace width="1em"/><msub><mi>p</mi><mi>y</mi></msub><mo>=</mo><mi>v</mi><msub><mi>P</mi><mi>X</mi></msub><mo>+</mo><mi>u</mi><msub><mi>P</mi><mi>Y</mi></msub><mo separator="true">,</mo><mspace width="1em"/><mi>K</mi><mo>=</mo><mfrac><mrow><msubsup><mi>P</mi><mi>X</mi><mn>2</mn></msubsup><mo>+</mo><msubsup><mi>P</mi><mi>Y</mi><mn>2</mn></msubsup></mrow><mrow><mn>2</mn><mi>m</mi></mrow></mfrac><mo>+</mo><mfrac><mi>B</mi><mrow><msup><mi>u</mi><mn>2</mn></msup><mo>+</mo><msup><mi>v</mi><mn>2</mn></msup></mrow></mfrac><mo>+</mo><mi>A</mi><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">p_x=uP_X-vP_Y,\quad p_y=vP_X+uP_Y,\quad
K=\fr{P_X^2+P_Y^2}{2m}+\fr{B}{u^2+v^2}+A.</annotation></semantics></math></span></span></span>
The condition <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">K=0</annotation></semantics></math></span></span> specifies the energy of the dual trajectory.</p>
<section id="footnotes" class="footnotes footnotes-end-of-document" role="doc-endnotes">
<hr/>
<ol>
<li id="fn1"><p>For unknown reasons, the transformed Hamiltonian is called the Kamiltonian just because we often use the symbol <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>K</mi></mrow><annotation encoding="application/x-tex">K</annotation></semantics></math></span></span> to represent it. However, there is not a similar convention for the transformed Lagrangian, so I would like to use the letter <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>M</mi></mrow><annotation encoding="application/x-tex">M</annotation></semantics></math></span></span> and call it the Magrangian. The surname “Lagrange” is originated from the French phrase <em>la grange</em> (meaning “the barn”), and correspondingly “Magrange” may refer to the French phrase <em>ma grange</em> (meaning “my barn”). This pun then can make “Magrangian” kind of mean “my Lagrangian”.<a href="#fnref1" class="footnote-back" role="doc-backlink">↩︎</a></p></li>
</ol>
</section>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="physics" /><category term="complex" /><category term="classical mechanics" /><category term="canonical transformation" /><category term="kepler problem" /><category term="mathematical physics" /><category term="vector analysis" /><category term="long paper" /><summary type="html"><![CDATA[The conformal map <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>w</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow></mrow><annotation encoding="application/x-tex">\fc wz</annotation></semantics></math></span></span> transforms the trajectory with energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>B</mi></mrow><annotation encoding="application/x-tex">-B</annotation></semantics></math></span></span> in potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>U</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>z</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>A</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>w</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>z</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc Uz\ceq A\v{\d w/\d z}^2</annotation></semantics></math></span></span> into the trajectory with energy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>−</mo><mi>A</mi></mrow><annotation encoding="application/x-tex">-A</annotation></semantics></math></span></span> in potential <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>V</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>w</mi><mo fence="true">)</mo></mrow><mo><mi mathvariant="normal">≔</mi></mo><mi>B</mi><msup><mrow><mo fence="true">∣</mo><mi mathvariant="normal">d</mi><mi>z</mi><mi mathvariant="normal">/</mi><mi mathvariant="normal">d</mi><mi>w</mi><mo fence="true">∣</mo></mrow><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\fc Vw\ceq B\v{\d z/\d w}^2</annotation></semantics></math></span></span>. I will prove this beautiful result and show some implications of it.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2023-12-22-conformal-trajectory.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2023-12-22-conformal-trajectory.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Embed the latest Mastodon post in my website]]></title><link href="https://ulysseszh.github.io/update/2023/11/19/embed-mastodon.html" rel="alternate" type="text/html" title="Embed the latest Mastodon post in my website" /><published>2023-11-19T13:51:36-08:00</published><updated>2023-11-19T13:51:36-08:00</updated><id>https://ulysseszh.github.io/update/2023/11/19/embed-mastodon</id><content type="html" xml:base="https://ulysseszh.github.io/update/2023/11/19/embed-mastodon.html"><![CDATA[<p>As we all know you can <a href="https://help.twitter.com/en/using-x/embed-x-feed" target="_blank" rel="external">embed a Twitter timeline</a> in your website like this:</p>
<details>
<summary>
A Twitter timeline
</summary>
<a class="twitter-timeline" id="twitter-timeline-UlyssesZhan" data-height="400" href="https://twitter.com/UlyssesZhan">Tweets by UlyssesZhan</a>
<script><![CDATA[
document.getElementById('twitter-timeline-UlyssesZhan').setAttribute('data-theme', matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
]]]]><![CDATA[></script>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"/>
</details>
<p>You can also embed a Twitter post like this:</p>
<details>
<summary>
A Twitter post
</summary>
<blockquote class="twitter-tweet" id="twitter-1561297804596695041">
<a href="https://twitter.com/UlyssesZhan/status/1561297804596695041">Twitter post from UlyssesZhan</a>
</blockquote>
<script><![CDATA[
document.getElementById('twitter-1561297804596695041').setAttribute('data-theme', matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
]]]]><![CDATA[></script>
<script async="" src="https://platform.twitter.com/widgets.js" charset="utf-8"/>
</details>
<p>However, <a href="https://github.com/mastodon/mastodon/issues/1065#issuecomment-297531140" target="_blank" rel="external">there is no official way of embedding a Mastodon timeline</a>. At most, you can embed a specific Mastodon post like this:</p>
<details>
<summary>
A Mastodon post
</summary>
<div class="embed-container">
<iframe id="mastodon.social-ulysseszhan-111417118208218240" src="https://mastodon.social/@ulysseszhan/111417118208218240/embed" class="mastodon-embed" allowfullscreen="" scrolling="">
</iframe>
</div>
<script src="https://mastodon.social/embed.js" async=""/>
<script><![CDATA[
(async () => {
	const iframe = document.getElementById('mastodon.social-ulysseszhan-111417118208218240');
	new MutationObserver((mutations, observer) => {
		if (!mutations.some(m => m.attributeName === 'height')) {
			return;
		}
		iframe.parentNode.style.paddingBottom = iframe.height + 'px';
		observer.disconnect();
	}).observe(iframe, { attributes: true });
})();
]]]]><![CDATA[></script>
</details>
<p>This just embeds a specific Mastodon post instead of dynamically grabbing the latest posts. Also, this embed requires JavaScript on the client side, which I have been trying to avoid. Another downside of this embed is that <a href="https://stackoverflow.com/a/74523939" target="_blank" rel="external">it does not have a light-theme version</a>.</p>
<p>Thanks to Mastodon’s API, the community implemented <a href="https://mastodon-embeds.glitch.me" target="_blank" rel="external">various ways of embedding Mastodon timelines or posts</a>. I then decided to develop my own way of embedding Mastodon posts. Here was the roadmap:</p>
<ul>
<li>The home page of my website shows my latest Mastodon post.</li>
<li>It should be rendered server-side, without the necessity of client-side JavaScript.</li>
<li>Blend the post in the webpage with a style consistent with rest of the webpage.</li>
</ul>
<p>How do I ensure the embedded post is always the latest one if it was rendered server-side? This means I have to somehow trigger the building and deployment of by website automatically whenever a new Mastodon post is created. Thanks to the <a href="https://github.com/huginn/huginn" target="_blank" rel="external">Huginn</a> instance deployed on my self-hosted server, I can monitor my Mastodon account and trigger a GitHub Actions workflow whenever there is a new post.</p>
<p>Here is then the idea of implementing the roadmap:</p>
<ol type="1">
<li>On the Jekyll side:
<ol type="1">
<li>Write a Jekyll hook at <code>:site</code> <code>:after_init</code> that reads the <a href="https://mastodon.social/@ulysseszhan.rss" target="_blank" rel="external">RSS feed of my Mastodon account</a> to get all information I need.</li>
<li>Write a Liquid template that can be populated with the collected information.</li>
<li>Include the Liquid template in the home page of my website and write some SCSS to style it.</li>
</ol></li>
<li>On the GitHub side:
<ol type="1">
<li>Use <a href="https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages" target="_blank" rel="external">GitHub Actions to build and deploy on GitHub Pages</a> and make the GitHub Actions triggered by <a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch" target="_blank" rel="external"><code>workflow_dispatch</code></a>.</li>
<li>Create a <a href="https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-personal-access-token-classic" target="_blank" rel="external">GitHub personal access token</a>. It will then be used to trigger <a href="https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event" target="_blank" rel="external">GitHub Actions through REST API</a>.</li>
</ol></li>
<li>On the Huginn side:
<ol type="1">
<li>Create an agent to monitor the RSS feed of my Mastodon account.</li>
<li>Create an agent to send HTTP requests to invoke GitHub’s REST API. It receives events from the first agent and triggers the GitHub Actions workflow.</li>
</ol></li>
</ol>
<p>Great! Now, my website can show my latest Mastodon post on the home page.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="update" /><category term="web" /><category term="jekyll" /><category term="selfhosting" /><summary type="html"><![CDATA[I show the latest Mastodon post in my website hosted on GitHub Pages, and it does not require JavaScript on the client side. How do I do that?]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2023-11-19-embed-mastodon.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2023-11-19-embed-mastodon.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[Rotational symmetry of plane lattices as a simple example of algebraic number theory]]></title><link href="https://ulysseszh.github.io/math/2023/11/09/lattice-algebraic.html" rel="alternate" type="text/html" title="Rotational symmetry of plane lattices as a simple example of algebraic number theory" /><published>2023-11-09T23:53:41-08:00</published><updated>2023-11-09T23:53:41-08:00</updated><id>https://ulysseszh.github.io/math/2023/11/09/lattice-algebraic</id><content type="html" xml:base="https://ulysseszh.github.io/math/2023/11/09/lattice-algebraic.html"><![CDATA[<p>Here is an exercise problem from <em>Modern Condensed Matter Physics</em> (Girvin and Yang, 2019):<sup>©</sup></p>
<blockquote>
<strong>Exercise 3.9.</strong> Show that five-fold rotation symmetry is inconsistent with lattice translation symmetry in 2D. Since 3D lattices can be formed by stacking 2D lattices, this conclusion holds in 3D as well.
</blockquote>
<p class="no-indent">
Before I saw this problem, I had never thought about whether a plane lattice can have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>-fold symmetry for any positive integer <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>. I was surprised at first that I cannot have a translationally symmetric lattice with 5-fold symmetry. After some thinking, I did realize that I cannot imagine a 5-fold symmetric plane lattice, so such a lattice cannot exist intuitively.
</p>
<p>Actually, the only allowed rotational symmetries are 2-fold, 3-fold, 4-fold, and 6-fold. This result is known as the <a href="https://en.wikipedia.org/wiki/Crystallographic_restriction_theorem" target="_blank" rel="external">crystallographic restriction theorem</a>. Then, how to prove it?</p>
<p>After jiggling around the possible structure of the symmetry group of a plane lattice, I finally proved it. I found that this proof is actually a simple and good example of how algebraic number theory can be used in physics.</p>
<p>Before diving into the proof, we need to first prove a simple lemma about real analysis:</p>
<p class="no-indent">
<strong>Lemma 1.</strong> If <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> is a subgroup of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup><mo separator="true">,</mo><mo>+</mo><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(\mathbb R^2,+)</annotation></semantics></math></span></span> that is discrete and spans <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\mathbb R^2</annotation></semantics></math></span></span>, then there exist two linearly independent elements in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\mathbb R^2</annotation></semantics></math></span></span> that generate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span>.
</p>
<p class="no-indent">
<em>Proof.</em> Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> spans <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\mathbb R^2</annotation></semantics></math></span></span>, there exist two linearly independent elements <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>g</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>g</mi><mn>2</mn></msub><mo>∈</mo><mi>G</mi></mrow><annotation encoding="application/x-tex">g_1,g_2\in G</annotation></semantics></math></span></span>.
</p>
<p>Consider the vector subspace <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mn>1</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><msub><mi>g</mi><mn>1</mn></msub><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">V_1\coloneqq g_1\mathbb R</annotation></semantics></math></span></span> and the subgroup <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mn>1</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><mi>G</mi><mo>∩</mo><msub><mi>V</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">G_1\coloneqq G\cap V_1</annotation></semantics></math></span></span>. Obviously, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">G_1</annotation></semantics></math></span></span> should be generated by some element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>h</mi><mn>1</mn></msub><mo>∈</mo><msub><mi>G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">h_1\in G_1</annotation></semantics></math></span></span> (this is because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>V</mi><mn>1</mn></msub><mo>≃</mo><mi mathvariant="double-struck">R</mi></mrow><annotation encoding="application/x-tex">V_1\simeq\mathbb R</annotation></semantics></math></span></span>, and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">G_1</annotation></semantics></math></span></span> as a discrete set must have a smallest positive element under that isomorphism, which must be the generator of
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">G_0</annotation></semantics></math></span></span> because it would otherwise not be the smallest positive element). Therefore, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>G</mi><mn>1</mn></msub><mo>=</mo><msub><mi>h</mi><mn>1</mn></msub><mi mathvariant="double-struck">Z</mi></mrow><annotation encoding="application/x-tex">G_1=h_1\mathbb Z</annotation></semantics></math></span></span>. Also, because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>h</mi><mn>1</mn></msub><mo mathvariant="normal">≠</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">h_1\ne0</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>h</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>g</mi><mn>2</mn></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\left\{h_1,g_2\right\}</annotation></semantics></math></span></span> must span <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\mathbb R^2</annotation></semantics></math></span></span>.</p>
<p>Let <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>T</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>a</mi><msub><mi>h</mi><mn>1</mn></msub><mo>+</mo><mi>b</mi><msub><mi>g</mi><mn>2</mn></msub><mo>∈</mo><mi>G</mi><mtext> </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext> </mtext><mi>a</mi><mo>∈</mo><mrow><mo fence="true">[</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo fence="true">)</mo></mrow><mo separator="true">,</mo><mi>b</mi><mo>∈</mo><mrow><mo fence="true">[</mo><mn>0</mn><mo separator="true">,</mo><mn>1</mn><mo fence="true">]</mo></mrow><mo fence="true">}</mo></mrow><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">T\coloneqq\left\{ah_1+bg_2\in G\,\middle|\,a\in\left[0,1\right),b\in\left[0,1\right]\right\}.</annotation></semantics></math></span></span></span> Then, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> must be discrete (because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> is) and bounded, and contains at least the element <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>g</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">g_2</annotation></semantics></math></span></span>. Express every element in <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi></mrow><annotation encoding="application/x-tex">T</annotation></semantics></math></span></span> as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><msub><mi>h</mi><mn>1</mn></msub><mo>+</mo><mi>b</mi><msub><mi>g</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">ah_1+bg_2</annotation></semantics></math></span></span> and pick out the one element with the smallest non-zero <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>b</mi></mrow><annotation encoding="application/x-tex">b</annotation></semantics></math></span></span>, and denote it as
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>h</mi><mn>2</mn></msub><mo>=</mo><msup><mi>a</mi><mo>⋆</mo></msup><msub><mi>h</mi><mn>1</mn></msub><mo>+</mo><msup><mi>b</mi><mo>⋆</mo></msup><msub><mi>g</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">h_2=a^\star h_1+b^\star g_2</annotation></semantics></math></span></span>. Certainly, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>h</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>h</mi><mn>2</mn></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\left\{h_1,h_2\right\}</annotation></semantics></math></span></span> span <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\mathbb R^2</annotation></semantics></math></span></span>.</p>
<p>Now, for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>∈</mo><mi>G</mi></mrow><annotation encoding="application/x-tex">g\in G</annotation></semantics></math></span></span>, we can express it uniquely as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>g</mi><mo>=</mo><mi>a</mi><msub><mi>h</mi><mn>1</mn></msub><mo>+</mo><mi>b</mi><msub><mi>g</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">g=ah_1+bg_2</annotation></semantics></math></span></span>. Define <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><msub><mi>c</mi><mn>2</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌊</mo><mfrac><mi>b</mi><msup><mi>b</mi><mo>⋆</mo></msup></mfrac><mo fence="true">⌋</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msub><mi>c</mi><mn>1</mn></msub><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">⌊</mo><mi>a</mi><mo>−</mo><msup><mi>a</mi><mo>⋆</mo></msup><msub><mi>c</mi><mn>2</mn></msub><mo fence="true">⌋</mo></mrow><mo separator="true">,</mo><mspace width="1em"/><msup><mi>g</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo><mi mathvariant="normal">≔</mi></mo><mi>g</mi><mo>−</mo><msub><mi>c</mi><mn>1</mn></msub><msub><mi>h</mi><mn>1</mn></msub><mo>−</mo><msub><mi>c</mi><mn>2</mn></msub><msub><mi>h</mi><mn>2</mn></msub><mi mathvariant="normal">.</mi></mrow><annotation encoding="application/x-tex">c_2\coloneqq\left\lfloor\frac{b}{b^\star}\right\rfloor,\quad
c_1\coloneqq\left\lfloor a-a^\star c_2\right\rfloor,\quad
g'\coloneqq g-c_1h_1-c_2h_2.</annotation></semantics></math></span></span></span> Then,
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>g</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>∈</mo><mi>T</mi></mrow><annotation encoding="application/x-tex">g'\in T</annotation></semantics></math></span></span>, and if we express it as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>g</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><msup><mi>a</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msub><mi>h</mi><mn>1</mn></msub><mo>+</mo><msup><mi>b</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><msub><mi>g</mi><mn>2</mn></msub></mrow><annotation encoding="application/x-tex">g'=a'h_1+b'g_2</annotation></semantics></math></span></span>, then <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup></mrow><annotation encoding="application/x-tex">b'</annotation></semantics></math></span></span> is smaller than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo>⋆</mo></msup></mrow><annotation encoding="application/x-tex">b^\star</annotation></semantics></math></span></span>. By definition of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo>⋆</mo></msup></mrow><annotation encoding="application/x-tex">b^\star</annotation></semantics></math></span></span>, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>b</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>=</mo><mn>0</mn></mrow><annotation encoding="application/x-tex">b'=0</annotation></semantics></math></span></span>, so
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>g</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mo>∈</mo><msub><mi>G</mi><mn>1</mn></msub></mrow><annotation encoding="application/x-tex">g'\in G_1</annotation></semantics></math></span></span>. Hence, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo fence="true">{</mo><msub><mi>h</mi><mn>1</mn></msub><mo separator="true">,</mo><msub><mi>h</mi><mn>2</mn></msub><mo fence="true">}</mo></mrow><annotation encoding="application/x-tex">\left\{h_1,h_2\right\}</annotation></semantics></math></span></span> generates <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span>. <span class="qed-wrapper qed-normal"><span class="qed qed-normal"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">□</mi></mrow><annotation encoding="application/x-tex">\square</annotation></semantics></math></span></span></span></span></p>
<p>Now, we are ready to prove our main result:</p>
<p class="no-indent">
<strong>Theorem.</strong> There is a discrete subset of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mn>2</mn></msup></mrow><annotation encoding="application/x-tex">\mathbb R^2</annotation></semantics></math></span></span> that has both translational symmetry and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>-fold symmetry iff <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mo stretchy="false">(</mo><mi>m</mi><mo stretchy="false">)</mo><mo>≤</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\varphi(m)\le2</annotation></semantics></math></span></span>, where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi></mrow><annotation encoding="application/x-tex">\varphi</annotation></semantics></math></span></span> is <a href="https://en.wikipedia.org/wiki/Euler%27s_totient_function" target="_blank" rel="external">Euler’s totient function</a>.
</p>
<p class="no-indent">
<em>Proof.</em> For the neccessity, prove by contradiction. I instead prove that a set that has the said symmetries must not be discrete.
</p>
<p>Denote the plane as <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">C</mi></mrow><annotation encoding="application/x-tex">\mathbb C</annotation></semantics></math></span></span>. Assume that there is an <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>-fold symmetry around point <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span>. Then, for any lattice site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi></mrow><annotation encoding="application/x-tex">z</annotation></semantics></math></span></span>, the point <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>R</mi><mi>z</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>α</mi><mi>z</mi></mrow><annotation encoding="application/x-tex">Rz\coloneqq\alpha z</annotation></semantics></math></span></span> (where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi><mo><mi mathvariant="normal">≔</mi></mo><msup><mi mathvariant="normal">e</mi><mrow><mn>2</mn><mi>π</mi><mi mathvariant="normal">i</mi><mi mathvariant="normal">/</mi><mi>m</mi></mrow></msup></mrow><annotation encoding="application/x-tex">\alpha\coloneqq\mathrm e^{2\pi\mathrm i/m}</annotation></semantics></math></span></span>) is also a lattice site. Assume that there is a translational symmetry with translation <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi></mrow><annotation encoding="application/x-tex">a</annotation></semantics></math></span></span>, then the point <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>T</mi><mi>z</mi><mo><mi mathvariant="normal">≔</mi></mo><mi>z</mi><mo>+</mo><mi>a</mi></mrow><annotation encoding="application/x-tex">Tz\coloneqq z+a</annotation></semantics></math></span></span> is also a lattice site. Without loss of generality, we can adjust the orientation of our coordinate system and the length unit so that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>a</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">a=1</annotation></semantics></math></span></span>.</p>
<p>The group <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> generated by <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">{</mo><mi>R</mi><mo separator="true">,</mo><mi>T</mi><mo stretchy="false">}</mo></mrow><annotation encoding="application/x-tex">\{R,T\}</annotation></semantics></math></span></span> is a subgroup of the symmetry group of the lattice. Its action <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>S</mi><mo><mi mathvariant="normal">≔</mi></mo><mrow><mo fence="true">{</mo><mi>g</mi><mn>0</mn><mtext> </mtext><mo fence="true" lspace="0.05em" rspace="0.05em">|</mo><mtext> </mtext><mi>g</mi><mo>∈</mo><mi>G</mi><mo fence="true">}</mo></mrow></mrow><annotation encoding="application/x-tex">S\coloneqq\left\{g0\,\middle|\,g\in G\right\}</annotation></semantics></math></span></span></span> on the point <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> is a subset of all the lattice sites (this is only true when <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> is a lattice site; I will discuss later the other case). Notice that for any <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>z</mi><mo>∈</mo><mi>S</mi><mo separator="true">,</mo><mi>n</mi><mo>∈</mo><mi mathvariant="double-struck">Z</mi></mrow><annotation encoding="application/x-tex">z\in S,n\in\mathbb Z</annotation></semantics></math></span></span>, we have <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>T</mi><mi>n</mi></msup><mi>R</mi><mi>z</mi><mo>=</mo><mi>n</mi><mo>+</mo><mi>α</mi><mi>z</mi><mo>∈</mo><mi>S</mi></mrow><annotation encoding="application/x-tex">T^nRz=n+\alpha z\in S</annotation></semantics></math></span></span>. Therefore, by expanding any polynomial with integer coefficients using <a href="https://en.wikipedia.org/wiki/Horner%27s_method" target="_blank" rel="external">Horner’s rule</a>, we can see that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">Z</mi><mo stretchy="false">[</mo><mi>α</mi><mo stretchy="false">]</mo><mo>⊆</mo><mi>S</mi></mrow><annotation encoding="application/x-tex">\mathbb Z[\alpha]\subseteq S</annotation></semantics></math></span></span>.</p>
<p>Because <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math></span></span> is an algebraic integer of degree <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mo stretchy="false">(</mo><mi>m</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\varphi(m)</annotation></semantics></math></span></span> (the minimal polynomial of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>α</mi></mrow><annotation encoding="application/x-tex">\alpha</annotation></semantics></math></span></span> is known as the <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>th <a href="https://en.wikipedia.org/wiki/Cyclotomic_polynomial" target="_blank" rel="external">cyclotomic polynomial</a>), the generating set of <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">Z</mi><mo stretchy="false">[</mo><mi>α</mi><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">\mathbb Z[\alpha]</annotation></semantics></math></span></span> must have at least <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mo stretchy="false">(</mo><mi>m</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">\varphi(m)</annotation></semantics></math></span></span> elements. Therefore, according to Lemma 1, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="double-struck">Z</mi><mo stretchy="false">[</mo><mi>α</mi><mo stretchy="false">]</mo></mrow><annotation encoding="application/x-tex">\mathbb Z[\alpha]</annotation></semantics></math></span></span> is discrete iff <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mo stretchy="false">(</mo><mi>m</mi><mo stretchy="false">)</mo><mo>≤</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\varphi(m)\le2</annotation></semantics></math></span></span>.</p>
<p>For the case where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>0</mn></mrow><annotation encoding="application/x-tex">0</annotation></semantics></math></span></span> is not a lattice site, we can generate <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>S</mi></mrow><annotation encoding="application/x-tex">S</annotation></semantics></math></span></span> by acting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>G</mi></mrow><annotation encoding="application/x-tex">G</annotation></semantics></math></span></span> on any lattice site <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">z_0</annotation></semantics></math></span></span>. We can then easily prove that <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mn>0</mn></msub><mo>+</mo><mi mathvariant="double-struck">Z</mi><mo stretchy="false">[</mo><mi>α</mi><mo stretchy="false">]</mo><mo>⊆</mo><mi>S</mi></mrow><annotation encoding="application/x-tex">z_0+\mathbb Z[\alpha]\subseteq S</annotation></semantics></math></span></span>. To prove this, we just need to see that we can act <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>R</mi><mrow><mo>−</mo><mi>k</mi></mrow></msup></mrow><annotation encoding="application/x-tex">R^{-k}</annotation></semantics></math></span></span> on <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>z</mi><mn>0</mn></msub></mrow><annotation encoding="application/x-tex">z_0</annotation></semantics></math></span></span> before further acting <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi>T</mi><mi>n</mi></msup><mi>R</mi></mrow><annotation encoding="application/x-tex">T^nR</annotation></semantics></math></span></span> on it for <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span></span> times. All the other steps are the same and still valid.</p>
<p>For the sufficiency, because there are only finitely many <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>’s that satisfy <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mtext> ⁣</mtext><mrow><mo fence="true">(</mo><mi>m</mi><mo fence="true">)</mo></mrow><mo>≤</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\varphi\!\left(m\right)\le2</annotation></semantics></math></span></span>. Therefore, we can enumerate these <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>’s and see that we can easily construct a plane lattice with both translational symmetry and <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>-fold symmetry for each <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>. <span class="qed-wrapper qed-normal"><span class="qed qed-normal"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi mathvariant="normal">□</mi></mrow><annotation encoding="application/x-tex">\square</annotation></semantics></math></span></span></span></span></p>
<p>I know the original problem in the book was probably not intended to be solved in this way, but it is really amazing how some seemingly purely mathematical areas can have their applications in physics, especially in an exercise problem of a physics textbook where pure mathematics is pretty unexpected.</p>
<p>Unfortunately, this proof, which is based on algebraic properties of certain complex numbers, does not generalize to higher dimensions because we cannot use the complex plane to represent a high-dimensional space.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="math" /><category term="complex" /><category term="condensed matter physics" /><category term="algebraic number theory" /><category term="lattice" /><category term="mathematical physics" /><summary type="html"><![CDATA[For a plane lattice, there is only a finite number of different rotational symmetries that are compatible with the discrete translational symmetry. For example, the 5-fold rotational symmetry is not one of them. Why is that? It turns out that whether an <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span></span>-fold symmetry is compatible with translational symmetry is the same as whether <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>φ</mi><mo stretchy="false">(</mo><mi>m</mi><mo stretchy="false">)</mo><mo>≤</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">\varphi(m)\le2</annotation></semantics></math></span></span>.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2023-11-09-lattice-algebraic.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2023-11-09-lattice-algebraic.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html"><![CDATA[I restructured my blog]]></title><link href="https://ulysseszh.github.io/update/2023/11/06/restructure.html" rel="alternate" type="text/html" title="I restructured my blog" /><published>2023-11-06T00:06:52-08:00</published><updated>2023-11-06T00:06:52-08:00</updated><id>https://ulysseszh.github.io/update/2023/11/06/restructure</id><content type="html" xml:base="https://ulysseszh.github.io/update/2023/11/06/restructure.html"><![CDATA[<h2 data-label="0.1" id="rendering-equations-server-side">Rendering equations server-side</h2>
<p>I have been using <a href="https://mathjax.org" target="_blank" rel="external">MathJax</a> as a client-side equation renderer to render equations on my blog for a long time.</p>
<p>The main problem about the client-side rendering is that it makes people that turn off JavaScript on their browsers (e.g. for privacy reasons) unable to see the equations in my articles. Another problem is that it is annoying to wait for the browser to render all the equations, especially if the site owner could have rendered them for you.</p>
<p>I actually have had some experience in server-side equation rendering in Jekyll. In <a href="/programming/2022/11/08/math-emails.html">a past post</a>, I talked about how I used Jekyll and <a href="https://katex.org" target="_blank" rel="external">KaTeX</a> to render equations in emails server-side. For the <a href="https://sunniesnow.github.io" target="_blank" rel="external">website of Sunniesnow</a> (see <a href="/update/2023/09/08/sunniesnow.html">here</a> for a related post), I use <a href="https://github.com/linjer/jekyll-katex/" target="_blank" rel="external">jekyll-katex</a> to render the equations server-side.</p>
<p>Then, I thought, what is stopping me to render equations server-side on my blog? I then started the migration.</p>
<h3 data-label="0.1.1" id="the-painful-building">The painful building</h3>
<p>The easiest way to switch to server-side equation rendering is just to use <a href="https://github.com/kramdown/math-katex" target="_blank" rel="external">kramdown-math-katex</a>. Install the gem, add an option <code>math_engine: katex</code> into the Kramdown configurations of <code>_config.yml</code>, add the needed CSS to the theme, and… What is my computer doing? It is just stuck at building the site!</p>
<p>By adding the <code>--verbose</code> option to the <code>jekyll serve</code> command, I can see what it was doing. I can see that it is never stuck on any step, but rendering each article that has equations (especially those with a ton of ones) takes seconds. Because I have dozens of articles with equations, it takes minutes to build the site. It seems that although KaTeX has always been advertising itself as the fastest math typesetting library for the web, it is not fast enough for me to use it to render equations server-side.</p>
<p>A way to mitigate this issue is to use the <code>--incremental</code> option of <code>jekyll serve</code>. This makes the building much faster except the first time. I can also expect Jekyll to support <a href="https://github.com/jekyll/jekyll/issues/9434" target="_blank" rel="external">lazy building</a> in the future, which will entirely skip the building phase and build the files as needed on the fly.</p>
<p>I found another way to partially mitigate this issue. On my blog, I have been extensively utilizing the <code>markdownify</code> filter to render Markdown inside the templates, including the title of the posts, the excerpt of the posts, and something else. Those are rendered in multiple places, including the homepage, the archive page, the Atom feed, and the search page. Since now rendering Markdown is being very slow, I decided to cache the rendered Markdowns. A very simple strategy is as follows:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-ruby">
        <pre>
          <code>
            <span class="line line-1"><span class="k">def</span> <span class="nf">markdownify</span> <span class="n">input</span>
</span>
            <span class="line line-2">	<span class="no">UlyssesZhan</span><span class="p">.</span><span class="nf">markdown_snippet_cache</span><span class="p">[</span><span class="n">input</span><span class="p">]</span> <span class="o">||=</span> <span class="no">Filters</span><span class="p">.</span><span class="nf">instance_method</span><span class="p">(</span><span class="ss">:markdownify</span><span class="p">).</span><span class="nf">bind_call</span> <span class="nb">self</span><span class="p">,</span> <span class="n">input</span>
</span>
            <span class="line line-3"><span class="k">end</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>Also, for most of the time I actually do not need to see the Markdown styling in the titles and excerpts, so I can also disable the <code>markdownify</code> filter depending on the site configuration, like this:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-ruby">
        <pre>
          <code>
            <span class="line line-1"><span class="k">def</span> <span class="nf">markdownify</span> <span class="n">input</span>
</span>
            <span class="line line-2">	<span class="k">return</span> <span class="n">input</span> <span class="k">if</span> <span class="vi">@context</span><span class="p">.</span><span class="nf">registers</span><span class="p">[</span><span class="ss">:site</span><span class="p">].</span><span class="nf">config</span><span class="p">[</span><span class="s1">'avoid_markdown'</span><span class="p">]</span>
</span>
            <span class="line line-3">	<span class="no">UlyssesZhan</span><span class="p">.</span><span class="nf">markdown_snippet_cache</span><span class="p">[</span><span class="n">input</span><span class="p">]</span> <span class="o">||=</span> <span class="no">Filters</span><span class="p">.</span><span class="nf">instance_method</span><span class="p">(</span><span class="ss">:markdownify</span><span class="p">).</span><span class="nf">bind_call</span> <span class="nb">self</span><span class="p">,</span> <span class="n">input</span>
</span>
            <span class="line line-4"><span class="k">end</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>If I do not want to modify the site configuration file, I can also utilize an environment variable. I can use a <a href="https://jekyllrb.com/docs/plugins/hooks/#built-in-hook-owners-and-events" target="_blank" rel="external">after-init hook</a> to set the configuration item based on the environment variable.</p>
<p>Rendering archives has also been very slow even with this Markdown disabling trick (for some reason I do not know). I decide to use another environment variable to disable the rendering of archives. Change the line <code>gem 'jekyll-archives'</code> in Gemfile to this:</p>
<table class="rouge-table">
  <tbody>
    <tr>
      <td class="highlight language-ruby">
        <pre>
          <code>
            <span class="line line-1"><span class="n">gem</span> <span class="s1">'jekyll-archives'</span><span class="p">,</span> <span class="ss">install_if: </span><span class="o">!</span><span class="no">ENV</span><span class="p">[</span><span class="s1">'JEKYLL_NO_ARCHIVE'</span><span class="p">]</span>
</span>
          </code>
        </pre>
      </td>
    </tr>
  </tbody>
</table>
<p>By using <code>--incremental</code> and these two tricks together, I can finally build the site in seconds if I only modify one post during <code>jekyll serve</code>.</p>
<h3 data-label="0.1.2" id="cross-referencing">Cross-referencing</h3>
<p>It seems that I cannot cross-reference equations using server-side means. First, <a href="https://github.com/KaTeX/KaTeX/issues/2003" target="_blank" rel="external">KaTeX does not support cross-referencing</a>, and the current workarounds are not acceptable for my use cases.</p>
<p>I then looked at <a href="https://github.com/kramdown/math-mathjaxnode" target="_blank" rel="external">kramdown-math-mathjaxnode</a>, which uses the MathJax Node library to render equations server-side. The MathJax Node library itself does support rendering equation numbers, but kramdown-math-mathjaxnode does not support cross-referencing either. What is worse is that it has not been maintained for years, which means I probably had to rewrite the plugin myself, but I did not have spare time.</p>
<p>Even worse, Kramdown is just not suitable for implementing cross-referencing. I briefly looked at Kramdown’s source codes, and I realized that if I was about to write a math engine for Kramdown to support cross-reference, I would have to refactor Kramdown a bit. Actually, cross-referencing is quite a non-trivial feature for markup languages because of references that cannot be resolved during the first compilation. In <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>LaTeX</mtext></mrow><annotation encoding="application/x-tex">\LaTeX</annotation></semantics></math></span></span>, those references are resolved in the second compilation. I would need to refactor Kramdown to support a similar workflow to make it possible to implement cross-referencing.</p>
<p>Then, I looked at other Markdown engines. For Ruby, the only successful Markdown engine besides Kramdown that I know was <a href="https://github.com/vmg/redcarpet" target="_blank" rel="external">Redcarpet</a> (it used to be the default Markdown engine of Jekyll), and it was not designed with cross-referencing in mind either. Its developer even <a href="https://github.com/vmg/redcarpet/issues/313#issuecomment-35110367" target="_blank" rel="external">rejected to support math-related features</a> a long time ago.</p>
<p>This is why I looked at non-Ruby Markdown engines. The first option that I came up with and also the option that I finally chose is <a href="https://pandoc.org" target="_blank" rel="external">Pandoc</a>.</p>
<p>Pandoc is power in that its form of customization is <em>filters</em>, which transforms the whole parsed AST of the document. Because the whole AST is visible at once for a filter, it is then possible to implement cross-referencing by using a filter. Fortunately, someone has already written such a filter, and it is called <a href="https://github.com/lierdakil/pandoc-crossref" target="_blank" rel="external">pandoc-crossref</a>. What is good about this approach is that it is independent of the math engine that I use: I can use MathJax or KaTeX, client-side or server-side, and it does not matter. The only drawback about it is that it does not support cross-reference a particular line in <code>align</code> or <code>eqnarray</code> environment, which is a feature that I have used in some of my posts. I have to reword those posts to avoid using that feature.</p>
<p>Now that we have a filter, we then need a way to let Pandoc render the math expressions server-side. Fortunately (again), someone has already written a filter for this purpose, and it is called <a href="https://github.com/xu-cheng/pandoc-katex" target="_blank" rel="external">pandoc-katex</a>. Append this filter after the pandoc-crossref filter, and we are done.</p>
<p>The drawback about Pandoc is that it has no Ruby implementations, which means the only way to utilize Pandoc in Jekyll is to write a wrapper of it in Ruby and develop a Jekyll plugin for using that wrapper of Pandoc as the Markdown engine. Fortunately, someone has already done this: the wrapper is called <a href="https://github.com/xwmx/pandoc-ruby" target="_blank" rel="external">pandoc-ruby</a>, and the Jekyll plugin is called <a href="https://github.com/mfenner/jekyll-pandoc" target="_blank" rel="external">jekyll-pandoc</a>.</p>
<p>Although the math rendering problem is solved, a somewhat unrelated problem arises: Pandoc does not use <a href="https://github.com/rouge-ruby/rouge" target="_blank" rel="external">Rouge</a> to highlight code blocks, but I like Rouge. Unfortunately, no one has written a Pandoc filter to use Rouge to highlight code blocks for me; but fortunately, I can write one myself quickly because it is easy enough, especially if I utilize <a href="https://github.com/htdebeer/paru" target="_blank" rel="external">Paru</a>, which contains an API library to help me with writing Pandoc filters in Ruby.</p>
<p>Paru is actually an alternative to pandoc-ruby. Now that I also use Paru, I started to wonder if I should use pandoc-ruby at all. Considering that jekyll-pandoc has not been maintained for years, I decided to write my own Jekyll plugin to use Paru as the Markdown engine, and the simple plugin is called <a href="https://github.com/UlyssesZh/jekyll-paru" target="_blank" rel="external">jekyll-paru</a>.</p>
<h3 data-label="0.1.3" id="tedious-work-of-reformatting-the-old-posts">Tedious work of reformatting the old posts</h3>
<p>Using kramdown-math-katex is the only option that I do not need to adjust most of my posts. Another option, <a href="https://github.com/linjer/jekyll-katex/" target="_blank" rel="external">jekyll-katex</a>, is not compatible with the markup that I use to write equations. I could not either just wrap the whole <code>{{ content }}</code> inside the <code>{% katexmm %}</code> block (due to some errors that I do not know), and the error messages then were impossible to utilize to help me locate the incompatibilities.</p>
<p>For the option that I finally use, Pandoc, I also have to adjust most of my posts. The major incompatibility is that I need to change all <code>\label</code> and <code>\ref</code> to the format recognizable by pandoc-crossref. Another incompatibility is that I need to use <code>{target=_blank}</code> instead of <code>{:target="_blank"}</code> to indicate a link to be opened in a new tab (as well as other HTML attributes that I use this syntax to embed in Markdown). Also, Pandoc does not allow blank lines inside math display blocks, which I have used in some of my posts (by the way, <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mtext>LaTeX</mtext></mrow><annotation encoding="application/x-tex">\LaTeX</annotation></semantics></math></span></span> does not allow those blank lines either, which is pretty annoying).</p>
<p>I then wrote a simple script that use regular expressions to help me with this refactoring task. However, because of the diversity of the syntaxes that I used, I still need to check the posts manually after I ran the script. This makes the refactoring task still very tedious.</p>
<h3 data-label="0.1.4" id="the-much-more-complicated-github-actions-workflow">The much more complicated GitHub Actions workflow</h3>
<p>Now, to build my site, the machine needs pandoc, pandoc-crossref, and pandoc-katex, none of which are Ruby Gems. I need to set up Haskell environment and Rust environment to install them. In GitHub Actions, I can use <a href="https://github.com/haskell-actions/setup" target="_blank" rel="external">haskell-actions/setup</a> to set up Haskell environment and <a href="https://github.com/baptiste0928/cargo-install" target="_blank" rel="external">cargo-install</a> to install Cargo packages.</p>
<p>I do not know how I managed to make the GitHub Actions workflow file work expectedly at one shot, but I did.</p>
<h3 data-label="0.1.5" id="table-of-contents-and-searching">Table of contents and searching</h3>
<p>I have been using <a href="https://github.com/toshimaru/jekyll-toc" target="_blank" rel="external">jekyll-toc</a> to generate the table of contents for each post. The problem with using it now is that it strips the HTML in headings and only keeps the text, so headings with math expressions will not be rendered with nice math typesetting. It was not a problem previously because the client-side math rendering script will render the math expressions in the table of contents. Now that I switched to server-side math rendering, I had to patch jekyll-toc to make it work.</p>
<p>The search functionality was implemented by myself. It is a simple client-side searching powered by <a href="https://lunrjs.com" target="_blank" rel="external">Lunr</a>. I also had to refactor the search functionality a bit to make the search results be rendered with math expressions (which were previously also handled by the client-side math rendering script).</p>
<h2 data-label="0.2" id="updating-the-theme">Updating the theme</h2>
<p>The reason that I updated the theme is actually quite dramatic. This originated from me trying to use kramdown-math-katex. To ensure that the KaTeX CSS has the correct version with the KaTeX renderer used by katex-ruby, I decided to <code>@import</code> the <a href="https://github.com/glebm/katex-ruby/blob/main/vendor/katex/sprockets/stylesheets/_katex.scss" target="_blank" rel="external">SCSS file</a> found in the repo of katex-ruby into my theme. I found that the SCSS file utilizes a function <code>asset-path</code> to load the fonts, but my CSS pre-processor does not support it, so I tried to extend my CSS pre-processor.</p>
<p>Jekyll uses <a href="https://github.com/jekyll/jekyll-sass-converter" target="_blank" rel="external">jekyll-sass-converter</a> to render CSS files, which once (v2) used <a href="https://github.com/sass/sassc-ruby" target="_blank" rel="external">sassc</a>, but now (v3) uses <a href="https://github.com/ntkme/sass-embedded-host-ruby" target="_blank" rel="external">sass-embedded</a>. The former does not support extension of custom SCSS functions, but the latter does. Therefore, I need to upgrade my jekyll-sass-converter to v3. I actually could have upgraded it earlier because I have been using Jekyll v4 for a long time, but I deliberately kept using jekyll-sass-converter v2 because <a href="https://github.com/helaili/jekyll-action" target="_blank" rel="external">jekyll-action</a>, which I used, had <a href="https://github.com/helaili/jekyll-action/issues/150" target="_blank" rel="external">an issue about using sass-embedded</a>. However, I have long ago migrated from jekyll-action to GitHub’s official <a href="https://github.com/actions/upload-pages-artifact" target="_blank" rel="external">upload-pages-artifact</a>, so I can now upgrade jekyll-sass-converter to v3.</p>
<p>Then why does this have anything to do with the theme I used (which is <a href="https://github.com/jekyll/minima" target="_blank" rel="external">Minima</a>)? After I upgraded jekyll-sass-converter to v3, I found that there are some <a href="https://github.com/jekyll/minima/issues/709" target="_blank" rel="external">deprecation warnings in the SCSS files</a> (they are actually already fixed, but I do not know why the issue is still open). This was also when I noticed that Minima has not released a new version <strong>for 4 years</strong>, and the last stable release is v2.5.1.</p>
<p>Then, how did I upgrade to Minima v3? I actually just tried to use the master branch of the Git repo of Minima, and I found that it was great.</p>
<h3 data-label="0.2.1" id="placeholder-files-for-customization">Placeholder files for customization</h3>
<p>I am glad to see Minima v3 introduced the include <code>custom-head.html</code> which allows for custom additional HTML metadata and the SCSS file <code>minima/custom-variables.scss</code> and <code>minima/custom-styles.scss</code> which allows for custom SCSS rules to override the default ones.</p>
<p>Although it took me some time to migrate my already present SCSS files and HTML metadata to the new structure, I am glad that Minima adopted this new structure that is more useful and more modern.</p>
<h3 data-label="0.2.2" id="skins">Skins</h3>
<p>Another feature that I really like about Minima v3 is the support of skins. Minima now comes with several pre-defined skins which I can choose from. The default skin called <code>classic</code> is the one that originated from Minima v2, based on which I wrote my own skin.</p>
<p>I still remember a long time ago I tried to make my site support dark theme. It was such a pain because there are so many colors hardcoded in the theme so that I have to rewrite a large part of the SCSS files provided by Minima to support dark theme. Now, Minima v3 has a pre-defined skin called <code>auto</code>, which adaptively looks the same as <code>classic</code> or <code>dark</code> based on the browser’s <code>prefers-color-scheme</code>. I can now implement my skin based on <code>auto</code> (select my skin in the site’s configuration file and <code>@import</code> the <code>auto</code> skin in my skin’s SCSS file), and the codes are now much cleaner.</p>]]></content><author><name>UlyssesZhan</name><email>ulysseszhan@gmail.com</email></author><category term="update" /><category term="jekyll" /><category term="tex" /><category term="update" /><category term="web" /><summary type="html"><![CDATA[If you have not noticed, the equations on my blog are now rendered server-side. This change makes it possible for those who turn off JavaScript on their browsers to see the equations. I also updated the theme from Minima v2 to Minima v3.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://ulysseszh.github.io/assets/images/covers/2023-11-06-restructure.png" /><media:content medium="image" url="https://ulysseszh.github.io/assets/images/covers/2023-11-06-restructure.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry></feed>