grogupy.core module
- grogupy.core.build_hh_ss(dh)[source]
It builds the Hamiltonian and Overlap matrix from the sisl.dh class.
It restructures the data in the SPIN BOX representation, where NS is the number of supercells and NO is the number of orbitals.
- Args:
- dhsisl.physics.Hamiltonian
Hamiltonian read in by sisl
- Returns:
- hh(NS, NO, NO) np.array_like
Hamiltonian in SPIN BOX representation
- ss(NS, NO, NO) np.array_like
Overlap matrix in SPIN BOX representation
- grogupy.core.calc_Vu(H, Tu)[source]
Calculates the local perturbation in case of a spin rotation.
- Args:
- H(NO, NO) np.array_like
Hamiltonian
- Tu(NO, NO) array_like
Rotation around u
- Returns:
- Vu1(NO, NO) np.array_like
First order perturbed matrix
- Vu2(NO, NO) np.array_like
Second order perturbed matrix
- grogupy.core.onsite_projection(matrix, idx1, idx2)[source]
It produces the slices of a matrix for the on site projection.
The slicing is along the last two axes as these contains the orbital indexing.
- Args:
- matrix(…, :, :) np.array_like
Some matrix
- idxnp.array_like
The indexes of the orbitals
- Returns:
- np.array_like
Reduced matrix based on the projection
- grogupy.core.parallel_Gk(HK, SK, eran, eset)[source]
Calculates the Greens function by inversion.
It calculates the Greens function on all the energy levels at the same time.
- Args:
- HK(NO, NO), np.array_like
Hamiltonian at a given k point
- SK(NO, NO), np.array_like
Overlap Matrix at a given k point
- eran(eset) np.array_like
Energy sample along the contour
- esetint
Number of energy samples along the contour
- Returns:
- Gk(eset, NO, NO), np.array_like
Green’s function at a given k point
- grogupy.core.remove_clutter_for_save(pairs, magnetic_entities)[source]
Removes unimportant data from the dictionaries.
It is used before saving to throw away data that is not needed for post processing.
- Args:
- pairsdict
Contains all the pair information
- magnetic_entitiesdict
Contains all the magnetic entity information
- Returns:
- pairsdict
Contains all the reduced pair information
- magnetic_entitiesdict
Contains all the reduced magnetic entity information
- grogupy.core.sequential_GK(HK, SK, eran, eset)[source]
Calculates the Greens function by inversion.
It calculates sequentially over the energy levels.
- Args:
- HK(NO, NO), np.array_like
Hamiltonian at a given k point
- SK(NO, NO), np.array_like
Overlap Matrix at a given k point
- eran(eset) np.array_like
Energy sample along the contour
- esetint
Number of energy samples along the contour
- Returns:
- Gk(eset, NO, NO), np.array_like
Green’s function at a given k point
- grogupy.core.setup_pairs_and_magnetic_entities(magnetic_entities, pairs, dh, simulation_parameters)[source]
It creates the complete structure of the dictionaries and fills some basic data.
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.
- Args:
- pairsdict
Contains the initial pair information
- magnetic_entitiesdict
Contains the initial magnetic entity information
- dhsisl.physics.Hamiltonian
Hamiltonian read in by sisl
- simulation_parametersdict
A set of parameters from the simulation
- Returns:
- pairsdict
Contains the initial information and the complete structure
- magnetic_entitiesdict
Contains the initial information and the complete structure