<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">build_hh_ss</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">dh</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#build_hh_ss"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.build_hh_ss"title="Link to this definition"></a></dt>
<dd><p>It builds the Hamiltonian and Overlap matrix from the sisl.dh class.</p>
<p>It restructures the data in the SPIN BOX representation, where NS is
the number of supercells and NO is the number of orbitals.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>dh<spanclass="classifier">sisl.physics.Hamiltonian</span></dt><dd><p>Hamiltonian read in by sisl</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>hh<spanclass="classifier">(NS, NO, NO) np.array_like</span></dt><dd><p>Hamiltonian in SPIN BOX representation</p>
</dd>
<dt>ss<spanclass="classifier">(NS, NO, NO) np.array_like</span></dt><dd><p>Overlap matrix in SPIN BOX representation</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">calc_Vu</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">H</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">Tu</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#calc_Vu"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.calc_Vu"title="Link to this definition"></a></dt>
<dd><p>Calculates the local perturbation in case of a spin rotation.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">onsite_projection</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">matrix</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">idx1</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">idx2</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#onsite_projection"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.onsite_projection"title="Link to this definition"></a></dt>
<dd><p>It produces the slices of a matrix for the on site projection.</p>
<p>The slicing is along the last two axes as these contains the orbital indexing.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">parallel_Gk</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">HK</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">SK</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">eran</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">eset</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#parallel_Gk"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.parallel_Gk"title="Link to this definition"></a></dt>
<dd><p>Calculates the Greens function by inversion.</p>
<p>It calculates the Greens function on all the energy levels at the same time.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>HK<spanclass="classifier">(NO, NO), np.array_like</span></dt><dd><p>Hamiltonian at a given k point</p>
</dd>
<dt>SK<spanclass="classifier">(NO, NO), np.array_like</span></dt><dd><p>Overlap Matrix at a given k point</p>
</dd>
<dt>eran<spanclass="classifier">(eset) np.array_like</span></dt><dd><p>Energy sample along the contour</p>
</dd>
<dt>eset<spanclass="classifier">int</span></dt><dd><p>Number of energy samples along the contour</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>Gk<spanclass="classifier">(eset, NO, NO), np.array_like</span></dt><dd><p>Green’s function at a given k point</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">remove_clutter_for_save</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">pairs</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">magnetic_entities</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#remove_clutter_for_save"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.remove_clutter_for_save"title="Link to this definition"></a></dt>
<dd><p>Removes unimportant data from the dictionaries.</p>
<p>It is used before saving to throw away data that
is not needed for post processing.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>pairs<spanclass="classifier">dict</span></dt><dd><p>Contains all the pair information</p>
</dd>
<dt>magnetic_entities<spanclass="classifier">dict</span></dt><dd><p>Contains all the magnetic entity information</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>pairs<spanclass="classifier">dict</span></dt><dd><p>Contains all the reduced pair information</p>
</dd>
<dt>magnetic_entities<spanclass="classifier">dict</span></dt><dd><p>Contains all the reduced magnetic entity information</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">sequential_GK</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">HK</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">SK</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">eran</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">eset</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#sequential_GK"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.sequential_GK"title="Link to this definition"></a></dt>
<dd><p>Calculates the Greens function by inversion.</p>
<p>It calculates sequentially over the energy levels.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>HK<spanclass="classifier">(NO, NO), np.array_like</span></dt><dd><p>Hamiltonian at a given k point</p>
</dd>
<dt>SK<spanclass="classifier">(NO, NO), np.array_like</span></dt><dd><p>Overlap Matrix at a given k point</p>
</dd>
<dt>eran<spanclass="classifier">(eset) np.array_like</span></dt><dd><p>Energy sample along the contour</p>
</dd>
<dt>eset<spanclass="classifier">int</span></dt><dd><p>Number of energy samples along the contour</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>Gk<spanclass="classifier">(eset, NO, NO), np.array_like</span></dt><dd><p>Green’s function at a given k point</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.core.</span></span><spanclass="sig-name descname"><spanclass="pre">setup_pairs_and_magnetic_entities</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">magnetic_entities</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pairs</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">dh</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">simulation_parameters</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/core.html#setup_pairs_and_magnetic_entities"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.core.setup_pairs_and_magnetic_entities"title="Link to this definition"></a></dt>
<dd><p>It creates the complete structure of the dictionaries and fills some basic data.</p>
<p>It creates orbital indexes, spin box indexes, coordinates and tags for magnetic entities.
Furthermore it creates the structures for the energies, the perturbed potentials and
the Greens function calculation. It dose the same for the pairs.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>pairs<spanclass="classifier">dict</span></dt><dd><p>Contains the initial pair information</p>
</dd>
<dt>magnetic_entities<spanclass="classifier">dict</span></dt><dd><p>Contains the initial magnetic entity information</p>
</dd>
<dt>dh<spanclass="classifier">sisl.physics.Hamiltonian</span></dt><dd><p>Hamiltonian read in by sisl</p>
</dd>
<dt>simulation_parameters<spanclass="classifier">dict</span></dt><dd><p>A set of parameters from the simulation</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>pairs<spanclass="classifier">dict</span></dt><dd><p>Contains the initial information and the complete structure</p>
</dd>
<dt>magnetic_entities<spanclass="classifier">dict</span></dt><dd><p>Contains the initial information and the complete structure</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</section>
<sectionid="module-grogupy.grogu">
<spanid="grogupy-grogu-module"></span><h2>grogupy.grogu module<aclass="headerlink"href="#module-grogupy.grogu"title="Link to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.grogu.</span></span><spanclass="sig-name descname"><spanclass="pre">main</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">simulation_parameters</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">magnetic_entities</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pairs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/grogu.html#main"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.grogu.main"title="Link to this definition"></a></dt>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.grogu.</span></span><spanclass="sig-name descname"><spanclass="pre">parse_command_line</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/grogu.html#parse_command_line"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.grogu.parse_command_line"title="Link to this definition"></a></dt>
<dd><p>This function can read input from the command line.</p>
</dd></dl>
</section>
<sectionid="module-grogupy.io">
<spanid="grogupy-io-module"></span><h2>grogupy.io module<aclass="headerlink"href="#module-grogupy.io"title="Link to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">load_pickle</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">infile</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#load_pickle"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.load_pickle"title="Link to this definition"></a></dt>
<dd><p>Loads the data from the infile with pickle.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>infile<spanclass="classifier">str</span></dt><dd><p>Path to infile</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>data<spanclass="classifier">dict</span></dt><dd><p>A dictionary of data</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">print_atoms_and_pairs</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">magnetic_entities</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">pairs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#print_atoms_and_pairs"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.print_atoms_and_pairs"title="Link to this definition"></a></dt>
<dd><p>It prints the pair and magnetic entity information for the grogu out.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>magnetic_entities<spanclass="classifier">dict</span></dt><dd><p>It contains the data on the magnetic entities</p>
</dd>
<dt>pairs<spanclass="classifier">dict</span></dt><dd><p>It contains the data on the pairs</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">print_job_description</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">simulation_parameters</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#print_job_description"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.print_job_description"title="Link to this definition"></a></dt>
<dd><p>It prints the parameters and the description of the job.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>simulation_parameters<spanclass="classifier">dict</span></dt><dd><p>It contains the simulations parameters</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">print_parameters</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">simulation_parameters</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#print_parameters"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.print_parameters"title="Link to this definition"></a></dt>
<dd><p>It prints the simulation parameters for the grogu out.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>simulation_parameters<spanclass="classifier">dict</span></dt><dd><p>It contains the simulations parameters</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">print_runtime_information</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">times</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#print_runtime_information"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.print_runtime_information"title="Link to this definition"></a></dt>
<dd><p>It prints the runtime information for the grogu out.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>times<spanclass="classifier">dict</span></dt><dd><p>It contains the runtime data</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">process_input_args</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">default_arguments</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">fdf_arguments</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">command_line_arguments</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">accepted_inputs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">['infile',</span><spanclass="pre">'outfile',</span><spanclass="pre">'scf_xcf_orientation',</span><spanclass="pre">'ref_xcf_orientations',</span><spanclass="pre">'kset',</span><spanclass="pre">'kdirs',</span><spanclass="pre">'ebot',</span><spanclass="pre">'eset',</span><spanclass="pre">'esetp',</span><spanclass="pre">'parallel_solver_for_Gk',</span><spanclass="pre">'padawan_mode']</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#process_input_args"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.process_input_args"title="Link to this definition"></a></dt>
<dd><p>It returns the final simulation parameters based on the inputs.</p>
<p>The merging is done in the order of priority:
1. command line arguments
2. fdf arguments
3. default arguments</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>default_arguments<spanclass="classifier">dict</span></dt><dd><p>Default arguments from grogupy</p>
</dd>
<dt>fdf_arguments<spanclass="classifier">dict</span></dt><dd><p>Arguments read from the fdf input file</p>
</dd>
<dt>command_line_arguments<spanclass="classifier">dict</span></dt><dd><p>Arguments from the command line</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>dict</dt><dd><p>The final simulation parameters</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">read_fdf</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">path</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#read_fdf"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.read_fdf"title="Link to this definition"></a></dt>
<dd><p>It reads the simulation parameters, magnetic entities and pairs from the fdf.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>path<spanclass="classifier">string</span></dt><dd><p>The path to the .fdf file</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>fdf_arguments<spanclass="classifier">dict</span></dt><dd><p>The read input arguments from the fdf file</p>
</dd>
<dt>magnetic_entities<spanclass="classifier">list</span></dt><dd><p>It contains the dictionaries associated with the magnetic entities</p>
</dd>
<dt>pairs<spanclass="classifier">dict</span></dt><dd><p>It contains the dictionaries associated with the pair information</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.io.</span></span><spanclass="sig-name descname"><spanclass="pre">save_pickle</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">outfile</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">data</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/io.html#save_pickle"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.io.save_pickle"title="Link to this definition"></a></dt>
<dd><p>Saves the data in the outfile with pickle.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>outfile<spanclass="classifier">str</span></dt><dd><p>Path to outfile</p>
</dd>
<dt>data<spanclass="classifier">dict</span></dt><dd><p>Contains the data</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</section>
<sectionid="module-grogupy.magnetism">
<spanid="grogupy-magnetism-module"></span><h2>grogupy.magnetism module<aclass="headerlink"href="#module-grogupy.magnetism"title="Link to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.magnetism.</span></span><spanclass="sig-name descname"><spanclass="pre">blow_up_orbindx</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">orb_indices</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/magnetism.html#blow_up_orbindx"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.magnetism.blow_up_orbindx"title="Link to this definition"></a></dt>
<dd><p>Function to blow up orbital indices to make SPIN BOX indices.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>orb_indices<spanclass="classifier">np.array_like</span></dt><dd><p>These are the indices in ORBITAL BOX</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>orb_indices<spanclass="classifier">np.array_like</span></dt><dd><p>These are the indices in SPIN BOX</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.magnetism.</span></span><spanclass="sig-name descname"><spanclass="pre">calculate_anisotropy_tensor</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">mag_ent</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/magnetism.html#calculate_anisotropy_tensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.magnetism.calculate_anisotropy_tensor"title="Link to this definition"></a></dt>
<dd><p>Calculates the renormalized anisotropy tensor from the energies.</p>
<p>It uses the grogu convention for output.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>mag_ent<spanclass="classifier">dict</span></dt><dd><p>An element from the magnetic entities</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>K<spanclass="classifier">np.array_like</span></dt><dd><p>elements of the anisotropy tensor</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.magnetism.</span></span><spanclass="sig-name descname"><spanclass="pre">calculate_exchange_tensor</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">pair</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/magnetism.html#calculate_exchange_tensor"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.magnetism.calculate_exchange_tensor"title="Link to this definition"></a></dt>
<dd><p>Calculates the exchange tensor from the energies.</p>
<p>It produces the isotropic exchange, the relevant elements
from the Dzyaloshinskii-Morilla (Dm) tensor, the symmetric-anisotropy
and the complete exchange tensor.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>pair<spanclass="classifier">dict</span></dt><dd><p>An element from the pairs</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.magnetism.</span></span><spanclass="sig-name descname"><spanclass="pre">parse_magnetic_entity</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">dh</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">atom</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">l</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">None</span></span></em>, <emclass="sig-param"><spanclass="o"><spanclass="pre">**</span></span><spanclass="n"><spanclass="pre">kwargs</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/magnetism.html#parse_magnetic_entity"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.magnetism.parse_magnetic_entity"title="Link to this definition"></a></dt>
<dd><p>Function to define orbital indexes of a given magnetic entity.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>dh<spanclass="classifier">sisl.physics.Hamiltonian</span></dt><dd><p>Hamiltonian from sisl</p>
</dd>
<dt>atom<spanclass="classifier">integer or list of integers, optional</span></dt><dd><p>Defining atom (or atoms) in the unit cell forming the magnetic entity. Defaults to None</p>
</dd>
<dt>l<spanclass="classifier">integer, optional</span></dt><dd><p>Defining the angular momentum channel. Defaults to None</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>list</dt><dd><p>The orbital indexes of the given magnetic entity</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.magnetism.</span></span><spanclass="sig-name descname"><spanclass="pre">spin_tracer</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">M</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/magnetism.html#spin_tracer"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.magnetism.spin_tracer"title="Link to this definition"></a></dt>
<dd><p>Spin tracer utility.</p>
<p>This takes an operator with the orbital-spin sequence:
<dt>dict</dt><dd><p>It contains the traced matrix with “x”, “y”, “z” and “c”</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</section>
<sectionid="module-grogupy.utilities">
<spanid="grogupy-utilities-module"></span><h2>grogupy.utilities module<aclass="headerlink"href="#module-grogupy.utilities"title="Link to this heading"></a></h2>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">RotM</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">theta</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">u</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">eps</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">1e-10</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#RotM"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.RotM"title="Link to this definition"></a></dt>
<dd><p>Definition of rotation matrix with angle theta around direction u.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>theta<spanclass="classifier">float</span></dt><dd><p>The angle of rotation</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">RotMa2b</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">a</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">b</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">eps</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">1e-10</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#RotMa2b"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.RotMa2b"title="Link to this definition"></a></dt>
<dd><p>Definition of rotation matrix rotating unit vector a to unit vector b.</p>
<p>Function returns array R such that R @ a = b holds.</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">commutator</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">a</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">b</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#commutator"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.commutator"title="Link to this definition"></a></dt>
<dd><p>Shorthand for commutator.</p>
<p>Commutator of two matrices in the mathematical sense.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>a<spanclass="classifier">np.array_like</span></dt><dd><p>The first matrix</p>
</dd>
<dt>b<spanclass="classifier">np.array_like</span></dt><dd><p>The second matrix</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>np.array_like</dt><dd><p>The commutator of a and b</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">crossM</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">u</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#crossM"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.crossM"title="Link to this definition"></a></dt>
<dd><p>Definition for the cross-product matrix.</p>
<p>It acts as a cross product with vector u.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>u<spanclass="classifier">list or np.array_like</span></dt><dd><p>The second vector in the cross product</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>np.array_like</dt><dd><p>The matrix that represents teh cross product with a vector</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">hsk</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">H</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">ss</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">sc_off</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">k</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">(0,</span><spanclass="pre">0,</span><spanclass="pre">0)</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#hsk"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.hsk"title="Link to this definition"></a></dt>
<dd><p>Speed up Hk and Sk generation.</p>
<p>Calculates the Hamiltonian and the Overlap matrix at a given k point. It is faster that the sisl version.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>H<spanclass="classifier">np.array_like</span></dt><dd><p>Hamiltonian in spin box form</p>
</dd>
<dt>ss<spanclass="classifier">np.array_like</span></dt><dd><p>Overlap matrix in spin box form</p>
</dd>
<dt>sc_off<spanclass="classifier">list</span></dt><dd><p>supercell indexes of the Hamiltonian</p>
</dd>
<dt>k<spanclass="classifier">tuple, optional</span></dt><dd><p>The k point where the matrices are set up. Defaults to (0, 0, 0)</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>np.array_like</dt><dd><p>Hamiltonian at the given k point</p>
</dd>
<dt>np.array_like</dt><dd><p>Overlap matrix at the given k point</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">int_de_ke</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">traced</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">we</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#int_de_ke"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.int_de_ke"title="Link to this definition"></a></dt>
<dd><p>It numerically integrates the traced matrix.</p>
<p>It is a wrapper from numpy.trapz and it contains the
relevant constants to calculate the energy integral from
equation 93 or 96.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>traced<spanclass="classifier">np.array_like</span></dt><dd><p>The trace of a matrix or a matrix product</p>
</dd>
<dt>we<spanclass="classifier">float</span></dt><dd><p>The weight of a point on the contour</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>float</dt><dd><p>The energy calculated from the integral formula</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">make_contour</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">emin</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">-20</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">emax</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">0.0</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">enum</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">42</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">p</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">150</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#make_contour"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.make_contour"title="Link to this definition"></a></dt>
<dd><p>A more sophisticated contour generator.</p>
<p>Calculates the parameters for the complex contour integral. It uses the
Legendre-Gauss quadrature method. It returns a class that contains
the information for the contour integral.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>emin<spanclass="classifier">int, optional</span></dt><dd><p>Energy minimum of the contour. Defaults to -20</p>
</dd>
<dt>emax<spanclass="classifier">float, optional</span></dt><dd><p>Energy maximum of the contour. Defaults to 0.0, so the Fermi level</p>
</dd>
<dt>enum<spanclass="classifier">int, optional</span></dt><dd><p>Number of sample points along the contour. Defaults to 42</p>
</dd>
<dt>p<spanclass="classifier">int, optional</span></dt><dd><p>Shape parameter that describes the distribution of the sample points. Defaults to 150</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>ccont</dt><dd><p>Contains all the information for the contour integral</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">make_kset</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">dirs</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">'xyz'</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">NUMK</span></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="default_value"><spanclass="pre">20</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#make_kset"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.make_kset"title="Link to this definition"></a></dt>
<dd><p>Simple k-grid generator to sample the Brillouin zone.</p>
<p>Depending on the value of the dirs
argument k sampling in 1,2 or 3 dimensions is generated.
If dirs argument does not contain either of x, y or z
a kset of a single k-pont at the origin is returned. The total number of k points is the NUMK**(dimensions)</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>dirs<spanclass="classifier">str, optional</span></dt><dd><p>Directions of the k points in the Brillouin zone. They are the three lattice vectors. Defaults to “xyz”</p>
</dd>
<dt>NUMK<spanclass="classifier">int, optional</span></dt><dd><p>The number of k points in a direction. Defaults to 20</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>np.array_like</dt><dd><p>An array of k points that uniformly sample the Brillouin zone in the given directions</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">read_siesta_emin</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">eigfile</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#read_siesta_emin"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.read_siesta_emin"title="Link to this definition"></a></dt>
<dd><p>It reads the lowest energy level from the siesta run.</p>
<p>It uses the .EIG file from siesta that contains the eigenvalues.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>eigfile<spanclass="classifier">str</span></dt><dd><p>The path to the .EIG file</p>
<spanclass="sig-prename descclassname"><spanclass="pre">grogupy.utilities.</span></span><spanclass="sig-name descname"><spanclass="pre">tau_u</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="n"><spanclass="pre">u</span></span></em><spanclass="sig-paren">)</span><aclass="reference internal"href="../_modules/grogupy/utilities.html#tau_u"><spanclass="viewcode-link"><spanclass="pre">[source]</span></span></a><aclass="headerlink"href="#grogupy.utilities.tau_u"title="Link to this definition"></a></dt>
<dd><p>Pauli matrix in direction u.</p>
<p>Returns the vector u in the basis of the Pauli matrices.</p>
<dlclass="simple">
<dt>Args:</dt><dd><dlclass="simple">
<dt>u<spanclass="classifier">list or np.array_like</span></dt><dd><p>The direction</p>
</dd>
</dl>
</dd>
<dt>Returns:</dt><dd><dlclass="simple">
<dt>np.array_like</dt><dd><p>Arbitrary direction in the base of the Pauli matrices</p>