# Hamiltonians¶

A set of Python functions to construct standard Hamiltonians is provided in the module pytriqs.operators.util.hamiltonians. Namely, three standard local interaction Hamiltonians are implemented: Slater, (Hubbard-)Kanamori and density-density Hamiltonians. The Hamiltonians can be written for any set of spin and orbital names. Note that there is no actual notion of spin, the spin names simply identify a division of the GF structure into non-hybridizing blocks.

pytriqs.operators.util.hamiltonians.h_int_slater(spin_names, orb_names, U_matrix, off_diag=None, map_operator_structure=None, H_dump=None, complex=False)[source]

Create a Slater Hamiltonian using fully rotationally-invariant 4-index interactions:

$H = \frac{1}{2} \sum_{ijkl,\sigma \sigma'} U_{ijkl} a_{i \sigma}^\dagger a_{j \sigma'}^\dagger a_{l \sigma'} a_{k \sigma}.$
Parameters: spin_names : list of strings Names of the spins, e.g. [‘up’,’down’]. orb_names : list of strings or int Names of the orbitals, e.g. [0,1,2] or [‘t2g’,’eg’]. U_matrix : 4D matrix or array The fully rotationally-invariant 4-index interaction $$U_{ijkl}$$. off_diag : boolean Do we have (orbital) off-diagonal elements? If yes, the operators and blocks are denoted by (‘spin’, ‘orbital’), otherwise by (‘spin_orbital’,0). map_operator_structure : dict Mapping of names of GF blocks names from one convention to another, e.g. {(‘up’, 0): (‘up_0’, 0), (‘down’, 0): (‘down_0’,0)}. If provided, the operators and blocks are denoted by the mapping of ('spin', 'orbital'). H_dump : string Name of the file to which the Hamiltonian should be written. complex : bool Whether there are complex values in the interaction. If False, passing a complex U will cause an error. H : Operator The Hamiltonian.
pytriqs.operators.util.hamiltonians.h_int_kanamori(spin_names, orb_names, U, Uprime, J_hund, off_diag=None, map_operator_structure=None, H_dump=None)[source]

Create a Kanamori Hamiltonian using the density-density, spin-fip and pair-hopping interactions.

$H = \frac{1}{2} \sum_{(i \sigma) \neq (j \sigma')} U_{i j}^{\sigma \sigma'} n_{i \sigma} n_{j \sigma'} - \sum_{i \neq j} J a^\dagger_{i \uparrow} a_{i \downarrow} a^\dagger_{j \downarrow} a_{j \uparrow} + \sum_{i \neq j} J a^\dagger_{i \uparrow} a^\dagger_{i \downarrow} a_{j \downarrow} a_{j \uparrow}.$
Parameters: spin_names : list of strings Names of the spins, e.g. [‘up’,’down’]. orb_names : list of strings or int Names of the orbitals, e.g. [0,1,2] or [‘t2g’,’eg’]. U : 2D matrix or array $$U_{ij}^{\sigma \sigma} (same spins)$$ Uprime : 2D matrix or array $$U_{ij}^{\sigma \bar{\sigma}} (opposite spins)$$ J_hund : scalar $$J$$ off_diag : boolean Do we have (orbital) off-diagonal elements? If yes, the operators and blocks are denoted by (‘spin’, ‘orbital’), otherwise by (‘spin_orbital’,0). map_operator_structure : dict Mapping of names of GF blocks names from one convention to another, e.g. {(‘up’, 0): (‘up_0’, 0), (‘down’, 0): (‘down_0’,0)}. If provided, the operators and blocks are denoted by the mapping of ('spin', 'orbital'). H_dump : string Name of the file to which the Hamiltonian should be written. H : Operator The Hamiltonian.
pytriqs.operators.util.hamiltonians.h_int_density(spin_names, orb_names, U, Uprime, off_diag=None, map_operator_structure=None, H_dump=None)[source]

Create a density-density Hamiltonian.

$H = \frac{1}{2} \sum_{(i \sigma) \neq (j \sigma')} U_{i j}^{\sigma \sigma'} n_{i \sigma} n_{j \sigma'}.$
Parameters: spin_names : list of strings Names of the spins, e.g. [‘up’,’down’]. orb_names : list of strings or int Names of the orbitals, e.g. [0,1,2] or [‘t2g’,’eg’]. U : 2D matrix or array $$U_{ij}^{\sigma \sigma} (same spins)$$ Uprime : 2D matrix or array $$U_{ij}^{\sigma \bar{\sigma}} (opposite spins)$$ off_diag : boolean Do we have (orbital) off-diagonal elements? If yes, the operators and blocks are denoted by (‘spin’, ‘orbital’), otherwise by (‘spin_orbital’,0). map_operator_structure : dict Mapping of names of GF blocks names from one convention to another, e.g. {(‘up’, 0): (‘up_0’, 0), (‘down’, 0): (‘down_0’,0)}. If provided, the operators and blocks are denoted by the mapping of ('spin', 'orbital'). H_dump : string Name of the file to which the Hamiltonian should be written. H : Operator The Hamiltonian.
pytriqs.operators.util.hamiltonians.diagonal_part(H)[source]

Extract the density part from an operator H.

The density part is a sum of all those monomials of H that are products of occupation number operators $$n_1 n_2 n_3 \ldots$$.

Parameters: H : Operator The operator from which the density part is extracted. n_part : Operator The density part of H.
pytriqs.operators.util.hamiltonians.make_operator_real(H, tol=0)[source]

Return the real part of a given operator H checking that its imaginary part is below tolerance.

Parameters: H : Operator The operator to be converted. tol : float Tolerance threshold for the imaginary part of the operator’s coefficients. H_real : Operator The real part of H.