Skip to content

Commit

Permalink
deploy: 5c0d625
Browse files Browse the repository at this point in the history
  • Loading branch information
utf committed Dec 13, 2024
1 parent d168877 commit 6271654
Show file tree
Hide file tree
Showing 17 changed files with 116 additions and 64 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/sumo-bandplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-bandstats.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-dosplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-kgen.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-optplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo-phonon-bandplot.doctree
Binary file not shown.
Binary file modified .doctrees/sumo.electronic_structure.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion _modules/sumo/cli/bandplot.html
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ <h1>Source code for sumo.cli.bandplot</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="n">code</span> <span class="o">==</span> <span class="s2">&quot;vasp&quot;</span><span class="p">:</span>
<span class="k">for</span> <span class="n">vr_file</span> <span class="ow">in</span> <span class="n">filenames</span><span class="p">:</span>
<span class="n">vr</span> <span class="o">=</span> <span class="n">BSVasprun</span><span class="p">(</span><span class="n">vr_file</span><span class="p">,</span> <span class="n">parse_projected_eigen</span><span class="o">=</span><span class="n">parse_projected</span><span class="p">)</span>
<span class="n">bs</span> <span class="o">=</span> <span class="n">vr</span><span class="o">.</span><span class="n">get_band_structure</span><span class="p">(</span><span class="n">line_mode</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">bs</span> <span class="o">=</span> <span class="n">vr</span><span class="o">.</span><span class="n">get_band_structure</span><span class="p">(</span><span class="n">line_mode</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">efermi</span><span class="o">=</span><span class="s2">&quot;smart&quot;</span><span class="p">)</span>
<span class="n">bandstructures</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">bs</span><span class="p">)</span>
<span class="n">bs</span> <span class="o">=</span> <span class="n">get_reconstructed_band_structure</span><span class="p">(</span><span class="n">bandstructures</span><span class="p">)</span>
<span class="k">elif</span> <span class="n">code</span> <span class="o">==</span> <span class="s2">&quot;castep&quot;</span><span class="p">:</span>
Expand Down
37 changes: 28 additions & 9 deletions _modules/sumo/cli/bandstats.html

Large diffs are not rendered by default.

39 changes: 30 additions & 9 deletions _modules/sumo/electronic_structure/bandstructure.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high

<div class="viewcode-block" id="get_reconstructed_band_structure">
<a class="viewcode-back" href="../../../sumo.electronic_structure.html#sumo.electronic_structure.bandstructure.get_reconstructed_band_structure">[docs]</a>
<span class="k">def</span> <span class="nf">get_reconstructed_band_structure</span><span class="p">(</span><span class="n">list_bs</span><span class="p">,</span> <span class="n">efermi</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">force_kpath_branches</span><span class="o">=</span><span class="kc">True</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">get_reconstructed_band_structure</span><span class="p">(</span>
<span class="n">list_bs</span><span class="p">,</span> <span class="n">efermi</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">force_kpath_branches</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">return_forced_branch_kpt_map</span><span class="o">=</span><span class="kc">False</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Combine a list of band structures into a single band structure.</span>

<span class="sd"> This is typically very useful when you split non self consistent</span>
Expand All @@ -250,12 +252,17 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high
<span class="sd"> across all band structures is used.</span>
<span class="sd"> force_kpath_branches (bool): Force a linemode band structure to contain</span>
<span class="sd"> branches by adding repeated high-symmetry k-points in the path.</span>
<span class="sd"> return_forced_branch_kpt_map (bool): If True, return a mapping of the</span>
<span class="sd"> the new k-points to the original k-points.</span>

<span class="sd"> Returns:</span>
<span class="sd"> :obj:`pymatgen.electronic_structure.bandstructure.BandStructure` or \</span>
<span class="sd"> :obj:`pymatgen.electronic_structure.bandstructureBandStructureSymmLine`:</span>
<span class="sd"> A band structure object. The type depends on the type of the band</span>
<span class="sd"> structures in ``list_bs``.</span>
<span class="sd"> If return_forced_branch_kpt_map is True, then a tuple is returned</span>
<span class="sd"> containing the band structure and the mapping from the new k-points</span>
<span class="sd"> to the original k-points.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="k">if</span> <span class="n">efermi</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">efermi</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">(</span><span class="n">b</span><span class="o">.</span><span class="n">efermi</span> <span class="k">for</span> <span class="n">b</span> <span class="ow">in</span> <span class="n">list_bs</span><span class="p">)</span> <span class="o">/</span> <span class="nb">len</span><span class="p">(</span><span class="n">list_bs</span><span class="p">)</span>
Expand Down Expand Up @@ -284,16 +291,20 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high
<span class="n">structure</span><span class="o">=</span><span class="n">list_bs</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">structure</span><span class="p">,</span>
<span class="n">projections</span><span class="o">=</span><span class="n">projections</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">if</span> <span class="n">force_kpath_branches</span><span class="p">:</span>
<span class="k">return</span> <span class="n">force_branches</span><span class="p">(</span><span class="n">bs</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">return</span> <span class="n">bs</span></div>
<span class="n">branch_bs</span><span class="p">,</span> <span class="n">mapping</span> <span class="o">=</span> <span class="n">force_branches</span><span class="p">(</span><span class="n">bs</span><span class="p">,</span> <span class="n">return_mapping</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="k">if</span> <span class="n">force_kpath_branches</span> <span class="ow">and</span> <span class="n">return_forced_branch_kpt_map</span><span class="p">:</span>
<span class="k">return</span> <span class="n">branch_bs</span><span class="p">,</span> <span class="n">mapping</span>
<span class="k">elif</span> <span class="n">force_kpath_branches</span><span class="p">:</span>
<span class="k">return</span> <span class="n">branch_bs</span>
<span class="k">elif</span> <span class="n">return_forced_branch_kpt_map</span><span class="p">:</span>
<span class="k">return</span> <span class="n">bs</span><span class="p">,</span> <span class="n">mapping</span>
<span class="k">return</span> <span class="n">bs</span></div>



<div class="viewcode-block" id="force_branches">
<a class="viewcode-back" href="../../../sumo.electronic_structure.html#sumo.electronic_structure.bandstructure.force_branches">[docs]</a>
<span class="k">def</span> <span class="nf">force_branches</span><span class="p">(</span><span class="n">bandstructure</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">force_branches</span><span class="p">(</span><span class="n">bandstructure</span><span class="p">,</span> <span class="n">return_mapping</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Force a linemode band structure to contain branches.</span>

<span class="sd"> Branches give a specific portion of the path from one high-symmetry point</span>
Expand All @@ -305,9 +316,14 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high

<span class="sd"> Args:</span>
<span class="sd"> bandstructure: A band structure object.</span>
<span class="sd"> return_mapping: If True, return a mapping of the new k-points (with branches)</span>
<span class="sd"> to the original k-points.</span>

<span class="sd"> Returns:</span>
<span class="sd"> A band structure with brnaches.</span>
<span class="sd"> A band structure with branches.</span>
<span class="sd"> If return_forced_branch_kpt_map is True, then a tuple is returned</span>
<span class="sd"> containing the band structure and the mapping from the new k-points</span>
<span class="sd"> to the original k-points.</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">kpoints</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="n">k</span><span class="o">.</span><span class="n">frac_coords</span> <span class="k">for</span> <span class="n">k</span> <span class="ow">in</span> <span class="n">bandstructure</span><span class="o">.</span><span class="n">kpoints</span><span class="p">])</span>
<span class="n">labels_dict</span> <span class="o">=</span> <span class="p">{</span><span class="n">k</span><span class="p">:</span> <span class="n">v</span><span class="o">.</span><span class="n">frac_coords</span> <span class="k">for</span> <span class="n">k</span><span class="p">,</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">bandstructure</span><span class="o">.</span><span class="n">labels_dict</span><span class="o">.</span><span class="n">items</span><span class="p">()}</span>
Expand All @@ -318,6 +334,7 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high
<span class="c1"># already.</span>
<span class="n">dup_ids</span> <span class="o">=</span> <span class="p">[]</span>
<span class="n">high_sym_kpoints</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="nb">map</span><span class="p">(</span><span class="nb">tuple</span><span class="p">,</span> <span class="n">labels_dict</span><span class="o">.</span><span class="n">values</span><span class="p">()))</span>
<span class="n">mapping</span> <span class="o">=</span> <span class="p">{}</span>
<span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">k</span> <span class="ow">in</span> <span class="nb">enumerate</span><span class="p">(</span><span class="n">kpoints</span><span class="p">):</span>
<span class="n">dup_ids</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
<span class="k">if</span> <span class="p">(</span>
Expand All @@ -330,6 +347,7 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high
<span class="p">)</span>
<span class="p">):</span>
<span class="n">dup_ids</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
<span class="n">mapping</span><span class="p">[</span><span class="nb">len</span><span class="p">(</span><span class="n">dup_ids</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">i</span>

<span class="n">kpoints</span> <span class="o">=</span> <span class="n">kpoints</span><span class="p">[</span><span class="n">dup_ids</span><span class="p">]</span>

Expand All @@ -340,15 +358,18 @@ <h1>Source code for sumo.electronic_structure.bandstructure</h1><div class="high
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">bandstructure</span><span class="o">.</span><span class="n">projections</span><span class="p">)</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">projections</span><span class="p">[</span><span class="n">spin</span><span class="p">]</span> <span class="o">=</span> <span class="n">bandstructure</span><span class="o">.</span><span class="n">projections</span><span class="p">[</span><span class="n">spin</span><span class="p">][:,</span> <span class="n">dup_ids</span><span class="p">]</span>

<span class="k">return</span> <span class="nb">type</span><span class="p">(</span><span class="n">bandstructure</span><span class="p">)(</span>
<span class="n">bs</span> <span class="o">=</span> <span class="nb">type</span><span class="p">(</span><span class="n">bandstructure</span><span class="p">)(</span>
<span class="n">kpoints</span><span class="p">,</span>
<span class="n">eigenvals</span><span class="p">,</span>
<span class="n">bandstructure</span><span class="o">.</span><span class="n">lattice_rec</span><span class="p">,</span>
<span class="n">bandstructure</span><span class="o">.</span><span class="n">efermi</span><span class="p">,</span>
<span class="n">labels_dict</span><span class="p">,</span>
<span class="n">structure</span><span class="o">=</span><span class="n">bandstructure</span><span class="o">.</span><span class="n">structure</span><span class="p">,</span>
<span class="n">projections</span><span class="o">=</span><span class="n">projections</span><span class="p">,</span>
<span class="p">)</span></div>
<span class="p">)</span>
<span class="k">if</span> <span class="n">return_mapping</span><span class="p">:</span>
<span class="k">return</span> <span class="n">bs</span><span class="p">,</span> <span class="n">mapping</span>
<span class="k">return</span> <span class="n">bs</span></div>



Expand Down
2 changes: 1 addition & 1 deletion _modules/sumo/electronic_structure/dos.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ <h1>Source code for sumo.electronic_structure.dos</h1><div class="highlight"><pr
<span class="k">else</span><span class="p">:</span>
<span class="n">vr</span> <span class="o">=</span> <span class="n">vasprun</span>

<span class="n">band</span> <span class="o">=</span> <span class="n">vr</span><span class="o">.</span><span class="n">get_band_structure</span><span class="p">()</span>
<span class="n">band</span> <span class="o">=</span> <span class="n">vr</span><span class="o">.</span><span class="n">get_band_structure</span><span class="p">(</span><span class="n">efermi</span><span class="o">=</span><span class="s2">&quot;smart&quot;</span><span class="p">)</span>
<span class="n">dos</span> <span class="o">=</span> <span class="n">vr</span><span class="o">.</span><span class="n">complete_dos</span>

<span class="n">dos</span><span class="p">,</span> <span class="n">band</span> <span class="o">=</span> <span class="n">_scissor_dos</span><span class="p">(</span><span class="n">dos</span><span class="p">,</span> <span class="n">band</span><span class="p">,</span> <span class="n">scissor</span><span class="p">)</span>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sumo-optplot.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h2>Command-Line Interface<a class="headerlink" href="#command-line-interface" t
<h3>Positional Arguments<a class="headerlink" href="#positional-arguments" title="Link to this heading"></a></h3>
<dl class="option-list">
<dt><kbd>M</kbd></dt>
<dd><p>Possible choices: loss, absorption, n_real, n_imag, eps_imag, eps_real</p>
<dd><p>Possible choices: n_real, n_imag, eps_imag, loss, absorption, eps_real</p>
<p>Optical properties to plot. Multiple choices will be displayed as subplots. Accepted values: “absorption” (optical absorption over distance), “loss” (energy-loss function -Im(1/eps)), “eps_real” and “eps_imag” (real and imaginary parts of the dielectric function), “n_real” (real part of complex refractive index)”n_imag” (imaginary part of RI, also known as the extinction coefficient kappa.)</p>
<p>Default: “absorption”</p>
</dd>
Expand Down
Loading

0 comments on commit 6271654

Please sign in to comment.