triqs.operators.util.hamiltonians.make_operator_real

triqs.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.

Returns:

H_real – The real part of H.

Return type:

Operator