dyson.util.moments#

Moment utilities.

Functions

build_block_tridiagonal(on_diagonal, ...[, ...])

Build a block tridiagonal matrix.

get_chebyshev_scaling_parameters(min_value, ...)

Get the Chebyshev scaling parameters.

gf_moments_to_se_moments(gf_moments[, ...])

Convert moments of the Green's function to those of the self-energy.

se_moments_to_gf_moments(static, se_moments)

Convert moments of the self-energy to those of the Green's function.

dyson.util.moments.se_moments_to_gf_moments(static: Array, se_moments: Array, overlap: Array | None = None, check_error: bool = True) Array[source]#

Convert moments of the self-energy to those of the Green’s function.

Parameters:
  • static – Static part of the self-energy.

  • se_moments – Moments of the self-energy.

  • overlap – The overlap matrix (zeroth moment of the Green’s function). If None, the zeroth moment of the Green’s function is assumed to be the identity matrix.

  • check_error – Whether to check the errors in the orthogonalisation of the moments.

Returns:

Moments of the Green’s function.

Notes

The first \(m\) moments of the self-energy, along with the static part, are sufficient to define the first \(m+2\) moments of the Green’s function.

dyson.util.moments.gf_moments_to_se_moments(gf_moments: Array, check_error: bool = True) tuple[Array, Array][source]#

Convert moments of the Green’s function to those of the self-energy.

Parameters:
  • gf_moments – Moments of the Green’s function.

  • check_error – Whether to check the errors in the orthogonalisation of the moments.

Returns:

Static part of the self-energy. moments: Moments of the self-energy.

Return type:

static

Notes

The first \(m+2\) moments of the Green’s function are sufficient to define the first \(m\) moments of the self-energy, along with the static part.

dyson.util.moments.build_block_tridiagonal(on_diagonal: list[Array], off_diagonal_upper: list[Array], off_diagonal_lower: list[Array] | None = None) Array[source]#

Build a block tridiagonal matrix.

Parameters:
  • on_diagonal – On-diagonal blocks.

  • off_diagonal_upper – Off-diagonal blocks for the upper half of the matrix.

  • off_diagonal_lower – Off-diagonal blocks for the lower half of the matrix. If None, use the transpose of off_diagonal_upper.

Returns:

A block tridiagonal matrix with the given blocks.

Notes

The number of on-diagonal blocks should be one greater than the number of off-diagonal blocks.

dyson.util.moments.get_chebyshev_scaling_parameters(min_value: float, max_value: float, epsilon: float = 0.001) tuple[float, float][source]#

Get the Chebyshev scaling parameters.

Parameters:
  • min_value – Minimum value of the range.

  • max_value – Maximum value of the range.

  • epsilon – Small value to avoid division by zero.

Returns:

A tuple containing the scaling factor and the shift.