grogupy.physics.Hamiltonian

class grogupy.physics.Hamiltonian(infile: str | tuple[Hamiltonian, DensityMatrix | None], scf_xcf_orientation: list | ndarray[Any, dtype[_ScalarType_co]] = array([0, 0, 1]))[source]

This class contains the data and the methods related to the Hamiltonian and geometry.

It sets up the instance based on the path to the Hamiltonian of the DFT calculation and the DFT exchange orientation.

Parameters

infile: Union[str, tuple[sisl.physics.Hamiltonian, Union[sisl.physics.DensityMatrix, None]]]

Path to the .fdf file or the sisl Hamiltonian and Density matrix, DM is optional

scf_xcf_orientation: Union[list, NDArray]. optional

The reference orientation, by default [0,0,1]

Examples

Creating a Hamiltonian from the DFT calculation.

>>> fdf_path = "/Users/danielpozsar/Downloads/Fe3GeTe2/Fe3GeTe2.fdf"
>>> scf_xcf_orientation = np.array([0,0,1])
>>> hamiltonian = Hamiltonian(fdf_path, scf_xcf_orientation)
>>> print(hamiltonian)
<grogupy.Hamiltonian scf_xcf_orientation=[0 0 1], orientation=[0 0 1], NO=84>

Methods

extract_exchange_field() :

Extracts the exchange field and time reversal symmetric and breaking parts

rotate(orientation) :

It rotates the exchange field of the Hamiltonian.

HkSk(k) :

Sets up the Hamiltonian and the overlap matrix at a given k-point.

copy() :

Return a copy of this Pair

Attributes

dh_ds_id: str

Hash of the underlying system so MagneticEntities cannot be mixed between Hamiltonians

_dh: sisl.physics.Hamiltonian

The sisl Hamiltonian

_ds: Union[sisl.physics.DensityMatrix, None]

The sisl density matrix or None if it is not given

infile: str

The path to the .fdf file

H: NDArray

Hamiltonian built from the sisl Hamiltonian

S: NDArray

Overlap matrix built from the sisl Hamiltonian

scf_xcf_orientation: NDArray

Orientation of the DFT exchange field

orientation: NDArray

Current orientation of the XCF filed

NO: int

Number of orbitals in the Hamiltonian

cell: NDArray

The unit cell vectors

nsc: NDArray

Number of supercells in each direction

sc_off: NDArray

Supercell indices

uc_in_sc_index: int

Unit cell index

H_uc: NDArray

Unit cell Hamiltonian

times: grogupy.batch.timing.DefaultTimer

It contains and measures runtime

__init__(infile: str | tuple[Hamiltonian, DensityMatrix | None], scf_xcf_orientation: list | ndarray[Any, dtype[_ScalarType_co]] = array([0, 0, 1])) None[source]

Initialize hamiltonian

Methods

HkSk([k])

Sets up the Hamiltonian and the overlap matrix at a given k-point.

__init__(infile[, scf_xcf_orientation])

Initialize hamiltonian

copy()

Returns the deepcopy of the instance.

extract_exchange_field()

Extract the exchange field and other useful quantities.

rotate(orientation)

It rotates the exchange field of the Hamiltonian.

Attributes

H_uc

NO

cell

dh_ds_id

The ID of the Hamiltonian and the Density Matrix.

geometry

nsc

number_of_hamiltonians

sc_off

uc_in_sc_index