dgamore.hamiltonian#
Lattice model setup. Hamiltonian assembles the (multi-orbital) Hubbard model: the real-space hopping
\(t_{ab}(R)\), the local interaction \(U_{abcd}\) and the non-local interaction \(V_{abcd}(R)\). It
offers convenience builders (single-band, orbital-diagonal, Kanamori, 2D \(t\)-\(t'\)-\(t''\)),
readers/writers for wannier90 / wien2k hr/hk and umatrix files, and Fourier transforms to obtain the
band dispersion \(\varepsilon_{ab}(k)\) and momentum-dependent interaction \(V_{abcd}(q)\).
HoppingElement and InteractionElement are small validated containers for single hopping/
interaction entries.
- class dgamore.hamiltonian.Hamiltonian[source]#
Bases:
objectClass to handle the Hamiltonian of the Hubbard model. Contains the hopping terms (
er) and the local (local_interaction) and nonlocal interaction (nonlocal_interaction) terms. Has a few helper methods to simplify adding terms to the Hamiltonian.- get_ek(k_grid: KGrid = None) ndarray[source]#
Returns the band dispersion \(\varepsilon_{ab}(k)\), computing and caching it from the real-space hopping on
k_gridif not already set.
- get_local_u() LocalInteraction[source]#
Returns the local interaction. Since the local interaction is momentum-independent, its momentum-space and real-space representations coincide.
- Returns:
The local interaction as a
LocalInteraction.- Return type:
- get_vq(q_grid: KGrid) Interaction[source]#
Returns the momentum-dependent non-local interaction \(V_{abcd}(q)\) by Fourier-transforming the real-space interaction onto
q_grid.- Parameters:
q_grid (KGrid) – The
KGriddefining the momentum grid.- Returns:
The non-local interaction as an
Interaction.- Return type:
- interaction_orbital_diagonal(u: float, n_bands: int = 1) Hamiltonian[source]#
Sets a purely orbital-diagonal local interaction for a multi-band model: the interaction tensor is zero everywhere except the
[0,0,0,0]element, which is set tou.- Parameters:
- Returns:
self(for chaining).- Return type:
- kanamori_interaction_d(n_bands: int, udd: float, jdd: float, vdd: float = None) Hamiltonian[source]#
Adds the Kanamori interaction terms ONLY for d orbitals to the Hamiltonian. The interaction terms are defined by the Hubbard
udd(U), the exchange interactionjdd(J) and the inter-orbital density-density interactionvdd(V or sometimes U’).vddis an optional parameter, if left empty, it is set to V=U-2J.- Parameters:
- Returns:
self(for chaining).- Return type:
- kanamori_interaction_dp(nd_bands: int = 0, np_bands: int = 0, udd: float = 0.0, upp: float = 0.0, udp: float = 0.0, jdd: float = 0.0, jpp: float = 0.0, jdp: float = 0.0, vdd: float = None, vpp: float = None) Hamiltonian[source]#
Adds the full Kanamori interaction terms for d and p orbitals to the Hamiltonian. The interaction terms are defined by the local interaction Hubbard U, the exchange interaction J and the inter-orbital density-density interaction V or sometimes U’. vdd (vpp) (vdp) are optional parameters, if left empty, they are set to V=U-2J.
- Parameters:
nd_bands (int) – Number of d orbitals (placed first in the orbital ordering).
np_bands (int) – Number of p orbitals (placed after the d orbitals).
udd (float) – Intra-orbital Hubbard \(U_{dd}\).
upp (float) – Intra-orbital Hubbard \(U_{pp}\).
udp (float) – The d-p inter-orbital interaction (used as \(V_{dp}\)).
jdd (float) – Hund’s exchange \(J_{dd}\).
jpp (float) – Hund’s exchange \(J_{pp}\).
jdp (float) – The d-p exchange \(J_{dp}\).
vdd (float) – Inter-orbital \(V_{dd}\); defaults to \(U_{dd} - 2 J_{dd}\) if None.
vpp (float) – Inter-orbital \(V_{pp}\); defaults to \(U_{pp} - 2 J_{pp}\) if None.
- Returns:
self(for chaining).- Return type:
- kanamori_interaction_p(n_bands: int, upp: float, jpp: float, vpp: float = None) Hamiltonian[source]#
Adds the Kanamori interaction terms ONLY for p orbitals to the Hamiltonian. The interaction terms are defined by the Hubbard
upp(U), the exchange interactionjpp(J) and the inter-orbital density-density interactionvpp(V or sometimes U’).vppis an optional parameter, if left empty, it is set to V=U-2J.- Parameters:
- Returns:
self(for chaining).- Return type:
- kinetic_one_band_2d_t_tp_tpp(t: float, tp: float, tpp: float) Hamiltonian[source]#
Adds the kinetic terms for a one-band model in 2D with nearest (t), next-nearest (tp) and next-next-nearest (tpp) neighbor hopping.
- Parameters:
- Returns:
self(for chaining).- Return type:
- read_hk_w2k(fname: str, spin_sym: bool = True)[source]#
Reads a Hamiltonian \(H_{bb'}(k)\) from a text file.
Expects a text file with white-space separated values in the syntax as generated by wannier90: the first line is a header with three integers, optionally followed by ‘#’-prefixed comment:
<no of k-points> <no of wannier functions> <no of bands (ignored)>
For each k-point, there is a header line with the x, y, z coordinates of the k-point, followed by <nbands> rows as lines of 2*<nbands> values each, which are the real and imaginary part of each column.
- Parameters:
- Returns:
A pair
(ham, kpoints)wherehamis a newHamiltonianwithekset to the complex array \(H(k)\) (k-point first, then band indices) andkpointsis the real array of k-point(x, y, z)components (transposed).- Raises:
RuntimeError – If a spin-orbit Hamiltonian has an odd band count.
ValueError – If the file contains fewer k-points than declared in the header.
- read_hr_w2k(filename: str = './wannier_hr.dat') Hamiltonian[source]#
Reads the
wannier_hr.datfile from a wien2k hr file and sets the real-space kinetic Hamiltonian. This is then typically Fourier-transformed to momentum space to obtain the k-dependent band dispersion.- Parameters:
filename (str) – Path to the
wannier_hr.datfile.- Returns:
self(for chaining).- Return type:
- read_umatrix(filename: str) Hamiltonian[source]#
Reads a file and creates the interaction matrix from it. The file should contain the number of bands in the first line and the number of r values in the second line. From the third line onwards it should contain the interaction matrix entries. It looks very similar to the format of a wannier_hr.dat file. The format is: r_lat_x r_lat_y r_lat_z orb1 orb2 orb3 orb4 realvalue imagvalue, where r_lat is the relative lattice vector and orb1-4 are the orbital indices. The interaction is assumed to be purely real. The ordering of the entries themselves does not matter. Note: The file must not contain any comments or empty lines.
- Parameters:
filename (str) – Path to the umatrix file.
- Returns:
self(for chaining).- Return type:
- set_ek(ek: ndarray) Hamiltonian[source]#
Sets the band dispersion directly (bypassing the Fourier transform).
- Parameters:
ek (ndarray) – The band dispersion array.
- Returns:
self(for chaining).- Return type:
- single_band_interaction(u: float) Hamiltonian[source]#
Sets the local interaction for a single-band model from a single Hubbard \(U\).
- Parameters:
u (float) – The Hubbard interaction \(U\).
- Returns:
self(for chaining).- Return type:
- class dgamore.hamiltonian.HoppingElement(r_lat: list, orbs: list, value: float = 0.0)[source]#
Bases:
objectData class to store a hopping element of the Hamiltonian. The hopping element is defined by the relative lattice vector
r_lat, the orbitalsorbsand the value of the hoppingvalue. A hopping element represents a single line in a w2k file. Added this to make the code more readable and to avoid passing around lists of values.
- class dgamore.hamiltonian.InteractionElement(r_lat: list[int], orbs: list[int], value: float)[source]#
Bases:
objectData class to store an interaction element of the Hamiltonian. The interaction element is defined by the relative lattice vector
r_lat, the orbitalsorbsand the value of the interactionvalue. An interaction element represents a single entry in the interaction matrix. Added this to make the code more readable and to avoid passing around lists of values.