triqs.operators.util.extractors.extract_h_dict
- triqs.operators.util.extractors.extract_h_dict()
Signature : (many_body_operator H, bool ignore_irrelevant = false) -> dict2_t<real_or_complex>
Extract coefficients of the normal quadratic part \(\sum_{ij}h_{ij} c^\dagger_i c_j\) from a Hamiltonian H as a 2-index dictionary.
- Parameters:
H (Operator) – The Hamiltonian.
ignore_irrelevant (bool) – If True, ignore all irrelevant terms in H. Otherwise raise an exception when such terms are met.
- Returns:
h_dict – The 2-index dictionary of the quadratic part coefficients, {(i,j) : float}.
- Return type:
dict