Skip to content

Commit 6f873a7

Browse files
Deployed 71675b0 with MkDocs version: 1.6.0
1 parent 73ca0f7 commit 6f873a7

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

example_problem/index.html

+23-23
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@
623623
<h1 id="example-calculate-chern-numbers-for-the-haldane-model">Example: Calculate Chern numbers for the Haldane Model</h1>
624624
<h2 id="main-problem-and-dependencies">Main Problem and Dependencies</h2>
625625
<p><strong>1. Generate an array of Chern numbers for the Haldane model on a hexagonal lattice by sweeping the following parameters: the on-site energy to next-nearest-neighbor coupling constant ratio (<span class="arithmatex">\(m/t_2\)</span> from -6 to 6 with <span class="arithmatex">\(N\)</span> samples) and the phase (<span class="arithmatex">\(\phi\)</span> from -<span class="arithmatex">\(\pi\)</span> to <span class="arithmatex">\(\pi\)</span> with <span class="arithmatex">\(N\)</span> samples) values. Given the lattice spacing <span class="arithmatex">\(a\)</span>, the nearest-neighbor coupling constant <span class="arithmatex">\(t_1\)</span>, the next-nearest-neighbor coupling constant <span class="arithmatex">\(t_2\)</span>, the grid size <span class="arithmatex">\(\delta\)</span> for discretizing the Brillouin zone in the <span class="arithmatex">\(k_x\)</span> and <span class="arithmatex">\(k_y\)</span> directions (assuming the grid sizes are the same in both directions), and the number of sweeping grid points <span class="arithmatex">\(N\)</span> for <span class="arithmatex">\(m/t_2\)</span> and <span class="arithmatex">\(\phi\)</span>.</strong></p>
626-
<div class="highlight"><pre><span></span><code><span class="sd">&#39;&#39;&#39;</span>
626+
<p><div class="highlight"><pre><span></span><code><span class="sd">&#39;&#39;&#39;</span>
627627
<span class="sd">Inputs:</span>
628628
<span class="sd">delta : float</span>
629629
<span class="sd"> The grid size in kx and ky axis for discretizing the Brillouin zone.</span>
@@ -649,7 +649,7 @@ <h2 id="main-problem-and-dependencies">Main Problem and Dependencies</h2>
649649
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
650650
<span class="kn">import</span> <span class="nn">cmath</span>
651651
<span class="kn">from</span> <span class="nn">math</span> <span class="kn">import</span> <span class="n">pi</span><span class="p">,</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">sqrt</span>
652-
</code></pre></div>
652+
</code></pre></div></p>
653653
<h2 id="subproblems">Subproblems</h2>
654654
<p><strong>1.1 Write a Haldane model Hamiltonian on a hexagonal lattice, given the following parameters: wavevector components <span class="arithmatex">\(k_x\)</span> and <span class="arithmatex">\(k_y\)</span> (momentum) in the x and y directions, lattice spacing <span class="arithmatex">\(a\)</span>, nearest-neighbor coupling constant <span class="arithmatex">\(t_1\)</span>, next-nearest-neighbor coupling constant <span class="arithmatex">\(t_2\)</span>, phase <span class="arithmatex">\(\phi\)</span> for the next-nearest-neighbor hopping, and the on-site energy <span class="arithmatex">\(m\)</span>.</strong></p>
655655
<p><strong><em>Scientists Annotated Background:</em></strong></p>
@@ -685,10 +685,10 @@ <h2 id="subproblems">Subproblems</h2>
685685
<div class="arithmatex">\[
686686
{d_2} = {t_1}\sum\nolimits_i {\sin (\mathbf{k} \cdot {\mathbf{a}_i})} = {t_1}\left[ {\sin \left( {{k_y}a} \right) + \sin \left( {\sqrt 3 {k_x}a/2 - {k_y}a/2} \right) + \sin \left( { - \sqrt 3 {k_x}a/2 - {k_y}a/2} \right)} \right] \\
687687
\]</div>
688-
<p>$$
689-
{d_3} = m - 2{t_2}\sin \phi \sum\nolimits_i {\sin (\mathbf{k} \cdot {\mathbf{b}_i})} = m - 2{t_2}\sin \phi \left[ {\sin \left( {\sqrt 3 {k_x}a} \right) + \sin \left( { - \sqrt 3 {k_x}a/2 + 3{k_y}a/2} \right) + \sin \left( { - \sqrt 3 {k_x}a/2 - 3{k_y}a/2} \right)} \right] \
690-
$$
691-
where <span class="arithmatex">\(\sigma_i\)</span> are the Pauli matrices and <span class="arithmatex">\(I\)</span> is the identity matrix.
688+
<div class="arithmatex">\[
689+
{d_3} = m - 2{t_2}\sin \phi \sum\nolimits_i {\sin (\mathbf{k} \cdot {\mathbf{b}_i})} = m - 2{t_2}\sin \phi \left[ {\sin \left( {\sqrt 3 {k_x}a} \right) + \sin \left( { - \sqrt 3 {k_x}a/2 + 3{k_y}a/2} \right) + \sin \left( { - \sqrt 3 {k_x}a/2 - 3{k_y}a/2} \right)} \right] \\
690+
\]</div>
691+
<p>where <span class="arithmatex">\(\sigma_i\)</span> are the Pauli matrices and <span class="arithmatex">\(I\)</span> is the identity matrix.
692692
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">calc_hamiltonian</span><span class="p">(</span><span class="n">kx</span><span class="p">,</span> <span class="n">ky</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">t1</span><span class="p">,</span> <span class="n">t2</span><span class="p">,</span> <span class="n">phi</span><span class="p">,</span> <span class="n">m</span><span class="p">):</span>
693693
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
694694
<span class="sd"> Function to generate the Haldane Hamiltonian with a given set of parameters.</span>
@@ -747,15 +747,15 @@ <h2 id="subproblems">Subproblems</h2>
747747
<strong>1.2 Calculate the Chern number using the Haldane Hamiltonian, given the grid size <span class="arithmatex">\(\delta\)</span> for discretizing the Brillouin zone in the <span class="arithmatex">\(k_x\)</span> and <span class="arithmatex">\(k_y\)</span> directions (assuming the grid sizes are the same in both directions), the lattice spacing <span class="arithmatex">\(a\)</span>, the nearest-neighbor coupling constant <span class="arithmatex">\(t_1\)</span>, the next-nearest-neighbor coupling constant <span class="arithmatex">\(t_2\)</span>, the phase <span class="arithmatex">\(\phi\)</span> for the next-nearest-neighbor hopping, and the on-site energy <span class="arithmatex">\(m\)</span>.</strong></p>
748748
<p><strong><em>Scientists Annotated Background:</em></strong></p>
749749
<p>Source: Fukui, Takahiro, Yasuhiro Hatsugai, and Hiroshi Suzuki. "Chern numbers in discretized Brillouin zone: efficient method of computing (spin) Hall conductances." Journal of the Physical Society of Japan 74.6 (2005): 1674-1677.</p>
750-
<p>Here we can discretize the two-dimensional Brillouin zone into grids with step <span class="arithmatex">\(\delta {k_x} = \delta {k_y} = \delta\)</span>. If we define the U(1) gauge field on the links of the lattice as <span class="arithmatex">\(U_\mu (\mathbf{k}_l) := \frac{\left\langle n(\mathbf{k}_l)\middle|n(\mathbf{k}_l + \hat{\mu})\right\rangle}{\left|\left\langle n(\mathbf{k}_l)\middle|n(\mathbf{k}_l + \hat{\mu})\right\rangle\right|}\)</span>, where <span class="arithmatex">\(\left|n(\mathbf{k}_l)\right\rangle\)</span> is the eigenvector of Hamiltonian at <span class="arithmatex">\(\mathbf{k}_l\)</span>, <span class="arithmatex">\(\hat{\mu}\)</span> is a small displacement vector in the direction <span class="arithmatex">\(\mu\)</span> with magnitude <span class="arithmatex">\(\delta\)</span>, and <span class="arithmatex">\(\mathbf{k}_l\)</span> is one of the momentum space lattice points <span class="arithmatex">\(l\)</span>. The corresponding curvature (flux) becomes
751-
$$
752-
F_{xy}(\mathbf{k}<em xy="xy">l) := \ln \left[U_x(\mathbf{k}_l)U_y(\mathbf{k}_l+\hat{x})U_x^{-1}(\mathbf{k}_l+\hat{y})U_y^{-1}(\mathbf{k}_l)\right]
753-
$$
754-
and the Chern number of a band can be calculated as
755-
$$
756-
c = \frac{1}{2\pi i} \Sigma_l F</em>_l),
750+
<p>Here we can discretize the two-dimensional Brillouin zone into grids with step <span class="arithmatex">\(\delta {k_x} = \delta {k_y} = \delta\)</span>. If we define the U(1) gauge field on the links of the lattice as <span class="arithmatex">\(U_\mu (\mathbf{k}_l) := \frac{\left\langle n(\mathbf{k}_l)\middle|n(\mathbf{k}_l + \hat{\mu})\right\rangle}{\left|\left\langle n(\mathbf{k}_l)\middle|n(\mathbf{k}_l + \hat{\mu})\right\rangle\right|}\)</span>, where <span class="arithmatex">\(\left|n(\mathbf{k}_l)\right\rangle\)</span> is the eigenvector of Hamiltonian at <span class="arithmatex">\(\mathbf{k}_l\)</span>, <span class="arithmatex">\(\hat{\mu}\)</span> is a small displacement vector in the direction <span class="arithmatex">\(\mu\)</span> with magnitude <span class="arithmatex">\(\delta\)</span>, and <span class="arithmatex">\(\mathbf{k}_l\)</span> is one of the momentum space lattice points <span class="arithmatex">\(l\)</span>. The corresponding curvature (flux) becomes</p>
751+
<div class="arithmatex">\[
752+
F_{xy}(\mathbf{k}_l) := \ln \left[U_x(\mathbf{k}_l)U_y(\mathbf{k}_l+\hat{x})U_x^{-1}(\mathbf{k}_l+\hat{y})U_y^{-1}(\mathbf{k}_l)\right]
753+
\]</div>
754+
<p>and the Chern number of a band can be calculated as</p>
755+
<p>$$
756+
c = \frac{1}{2\pi i} \Sigma_l F_{xy}(\mathbf{k}_l),
757757
$$
758-
where the summation is over all the lattice points }(\mathbf{k<span class="arithmatex">\(l\)</span>. Note that the Brillouin zone of a hexagonal lattice with spacing <span class="arithmatex">\(a\)</span> can be chosen as a rectangle with <span class="arithmatex">\(0 \le {k_x} \le k_{x0} = 2\sqrt 3 \pi /(3a),0 \le {k_y} \le k_{y0} = 4\pi /(3a)\)</span>.</p>
758+
where the summation is over all the lattice points <span class="arithmatex">\(l\)</span>. Note that the Brillouin zone of a hexagonal lattice with spacing <span class="arithmatex">\(a\)</span> can be chosen as a rectangle with <span class="arithmatex">\(0 \le {k_x} \le k_{x0} = 2\sqrt 3 \pi /(3a),0 \le {k_y} \le k_{y0} = 4\pi /(3a)\)</span>.
759759
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">compute_chern_number</span><span class="p">(</span><span class="n">delta</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">t1</span><span class="p">,</span> <span class="n">t2</span><span class="p">,</span> <span class="n">phi</span><span class="p">,</span> <span class="n">m</span><span class="p">):</span>
760760
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
761761
<span class="sd"> Function to compute the Chern number with a given set of parameters.</span>
@@ -778,7 +778,7 @@ <h2 id="subproblems">Subproblems</h2>
778778
<span class="sd"> chern_number : float</span>
779779
<span class="sd"> The Chern number, a real number that should be close to an integer. The imaginary part is cropped out due to the negligible magnitude.</span>
780780
<span class="sd"> &quot;&quot;&quot;</span>
781-
</code></pre></div>
781+
</code></pre></div></p>
782782
<div class="highlight"><pre><span></span><code><span class="c1"># test case 1</span>
783783
<span class="n">delta</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">200</span>
784784
<span class="n">a</span> <span class="o">=</span> <span class="mi">1</span>
@@ -806,7 +806,7 @@ <h2 id="subproblems">Subproblems</h2>
806806
<span class="n">m</span> <span class="o">=</span> <span class="mi">1</span>
807807
<span class="k">assert</span> <span class="n">np</span><span class="o">.</span><span class="n">allclose</span><span class="p">(</span><span class="n">compute_chern_number</span><span class="p">(</span><span class="n">delta</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">t1</span><span class="p">,</span> <span class="n">t2</span><span class="p">,</span> <span class="n">phi</span><span class="p">,</span> <span class="n">m</span><span class="p">),</span> <span class="n">target</span><span class="p">)</span>
808808
</code></pre></div>
809-
<p><strong>1.3 Make a 2D array of Chern numbers by sweeping the parameters: the on-site energy to next-nearest-neighbor coupling ratio (<span class="arithmatex">\(m/t_2\)</span> from -6 to 6 with <span class="arithmatex">\(N\)</span> samples) and phase (<span class="arithmatex">\(\phi\)</span> from -<span class="arithmatex">\(\pi\)</span> to <span class="arithmatex">\(\pi\)</span> with <span class="arithmatex">\(N\)</span> samples) values. Given the grid size <span class="arithmatex">\(\delta\)</span> for discretizing the Brillouin zone in the <span class="arithmatex">\(k_x\)</span> and <span class="arithmatex">\(k_y\)</span> directions (assuming the grid sizes are the same in both directions), the lattice spacing <span class="arithmatex">\(a\)</span>, the nearest-neighbor coupling constant <span class="arithmatex">\(t_1\)</span>, and the next-nearest-neighbor coupling constant <span class="arithmatex">\(t_2\)</span>.</strong></p>
809+
<p><strong>1.3 Make a 2D array of Chern numbers by sweeping the parameters: the on-site energy to next-nearest-neighbor coupling ratio (<span class="arithmatex">\(m/t_2\)</span> from -6 to 6 with <span class="arithmatex">\(N\)</span> samples) and phase (<span class="arithmatex">\(\phi\)</span> from -<span class="arithmatex">\(\pi\)</span> to <span class="arithmatex">\(\pi\)</span> with <span class="arithmatex">\(N\)</span> samples) values. Given the grid size <span class="arithmatex">\(\delta\)</span> for discretizing the Brillouin zone in the <span class="arithmatex">\(k_x\)</span> and <span class="arithmatex">\(k_y\)</span> directions (assuming the grid sizes are the same in both directions), the lattice spacing <span class="arithmatex">\(a\)</span>, the nearest-neighbor coupling constant <span class="arithmatex">\(t_1\)</span>, and the next-nearest-neighbor coupling constant <span class="arithmatex">\(t_2\)</span>.</strong>
810810
<div class="highlight"><pre><span></span><code><span class="k">def</span> <span class="nf">compute_chern_number_grid</span><span class="p">(</span><span class="n">delta</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">t1</span><span class="p">,</span> <span class="n">t2</span><span class="p">,</span> <span class="n">N</span><span class="p">):</span>
811811
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
812812
<span class="sd"> Function to calculate the Chern numbers by sweeping the given set of parameters and returns the results along with the corresponding swept next-nearest-neighbor coupling constant and phase.</span>
@@ -831,36 +831,36 @@ <h2 id="subproblems">Subproblems</h2>
831831
<span class="sd"> phi_values: array of length N</span>
832832
<span class="sd"> The swept phase values.</span>
833833
<span class="sd"> &quot;&quot;&quot;</span>
834-
</code></pre></div>
834+
</code></pre></div></p>
835835
<h2 id="domain-specific-test-cases">Domain Specific Test Cases</h2>
836836
<p><strong>Both the <span class="arithmatex">\(k\)</span>-space and sweeping grid sizes are set to very rough values to make the computation faster, feel free to increase them for higher accuracy.</strong></p>
837837
<p><strong>At zero on-site energy, the Chern number is 1 for <span class="arithmatex">\(\phi &gt; 0\)</span>, and the Chern number is -1 for <span class="arithmatex">\(\phi &lt; 0\)</span>.</strong></p>
838838
<p><strong>For complementary plots, we can see that these phase diagrams are similar to the one in the original paper: Fig.2 in <a href="https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.61.2015">Haldane, F. D. M. (1988)</a>. To achieve a better match, decrease all grid sizes.</strong></p>
839839
<p><strong>Compare the following three test cases. We can find that the phase diagram is independent of the value of <span class="arithmatex">\(t_1\)</span>, and the ratio of <span class="arithmatex">\(t_2/t_1\)</span>, which is consistent with our expectations.</strong></p>
840-
<div class="highlight"><pre><span></span><code><span class="c1"># Test Case 1</span>
840+
<p><div class="highlight"><pre><span></span><code><span class="c1"># Test Case 1</span>
841841
<span class="n">delta</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">30</span>
842842
<span class="n">a</span> <span class="o">=</span> <span class="mf">1.0</span>
843843
<span class="n">t1</span> <span class="o">=</span> <span class="mf">4.0</span>
844844
<span class="n">t2</span> <span class="o">=</span> <span class="mf">1.0</span>
845845
<span class="n">N</span> <span class="o">=</span> <span class="mi">40</span>
846846
</code></pre></div>
847-
<p><a class="glightbox" href="../figures/chern_number_1.png" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="../figures/chern_number_1.png" /></a></p>
848-
<div class="highlight"><pre><span></span><code><span class="c1"># Test Case 2</span>
847+
<a class="glightbox" href="../figures/chern_number_1.png" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="../figures/chern_number_1.png" /></a></p>
848+
<p><div class="highlight"><pre><span></span><code><span class="c1"># Test Case 2</span>
849849
<span class="n">delta</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">30</span>
850850
<span class="n">a</span> <span class="o">=</span> <span class="mf">1.0</span>
851851
<span class="n">t1</span> <span class="o">=</span> <span class="mf">5.0</span>
852852
<span class="n">t2</span> <span class="o">=</span> <span class="mf">1.0</span>
853853
<span class="n">N</span> <span class="o">=</span> <span class="mi">40</span>
854854
</code></pre></div>
855-
<p><a class="glightbox" href="../figures/chern_number_2.png" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="../figures/chern_number_2.png" /></a></p>
856-
<div class="highlight"><pre><span></span><code><span class="c1"># Test Case 3</span>
855+
<a class="glightbox" href="../figures/chern_number_2.png" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="../figures/chern_number_2.png" /></a></p>
856+
<p><div class="highlight"><pre><span></span><code><span class="c1"># Test Case 3</span>
857857
<span class="n">delta</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">30</span>
858858
<span class="n">a</span> <span class="o">=</span> <span class="mf">1.0</span>
859859
<span class="n">t1</span> <span class="o">=</span> <span class="mf">1.0</span>
860860
<span class="n">t2</span> <span class="o">=</span> <span class="mf">0.2</span>
861861
<span class="n">N</span> <span class="o">=</span> <span class="mi">40</span>
862862
</code></pre></div>
863-
<p><a class="glightbox" href="../figures/chern_number_3.png" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="../figures/chern_number_3.png" /></a></p>
863+
<a class="glightbox" href="../figures/chern_number_3.png" data-type="image" data-width="auto" data-height="auto" data-desc-position="bottom"><img alt="" src="../figures/chern_number_3.png" /></a></p>
864864

865865

866866

0 commit comments

Comments
 (0)