dgamore.bubble_gen#

Generalized bare susceptibilities (the “bubbles”). BubbleGenerator builds the products of two Green’s functions \(\chi_{0;abcd} = -\beta\, G_{ad}\, G_{cb}\) in the particle-hole and particle-particle channels, both local and momentum-dependent. The non-local versions are evaluated either by an FFT over the BZ or by a direct momentum-shift einsum, distributed over MPI ranks and optionally accelerated on the GPU (CuPy).

class dgamore.bubble_gen.BubbleGenerator[source]#

Bases: object

Collection of static factory methods that build the generalized bare susceptibilities (bubbles) from a Green’s function in the particle-hole and particle-particle channels, both local and momentum-dependent.

static create_generalized_chi0(g_dmft: GreensFunction, niw: int, niv: int, beta: float) LocalFourPoint[source]#

Returns the local generalized bare susceptibility \(\chi_{0;abcd}^{\omega\nu} = -\beta\, G_{ad}^{\nu}\, G_{cb}^{\nu-\omega}\).

Parameters:
  • g_dmft (GreensFunction) – The local (DMFT) GreensFunction.

  • niw (int) – Number of positive bosonic frequencies.

  • niv (int) – Number of positive fermionic frequencies.

  • beta (float) – Inverse temperature \(\beta\).

Returns:

The local bubble as a LocalFourPoint with one bosonic and one fermionic frequency axis.

Return type:

LocalFourPoint

static create_generalized_chi0_pp_w0(g_dmft: GreensFunction, niv_pp: int, beta: float) LocalFourPoint[source]#

Returns the local particle-particle bare bubble at \(\omega = 0\), \(\chi_{0;abcd}^{\nu} = -\beta\, G_{ad}^{\nu}\, G_{cb}^{-\nu}\).

Parameters:
  • g_dmft (GreensFunction) – The local (DMFT) GreensFunction.

  • niv_pp (int) – Number of positive fermionic frequencies of the pp bubble.

  • beta (float) – Inverse temperature \(\beta\).

Returns:

The local pp bubble as a LocalFourPoint in pp notation at \(\omega = 0\).

Return type:

LocalFourPoint

static create_generalized_chi0_q(giwk: GreensFunction, niw: int, niv: int, q_list: ndarray, q_grid: KGrid, beta: float, use_gpu: bool = False) FourPoint[source]#

Returns the momentum-dependent generalized bare susceptibility \(\chi_{0;abcd}^{q\nu} = -\beta \sum_k G^{k}_{ad}\, G^{k-q}_{cb}\), evaluated by a direct momentum-shift and a fused einsum over the explicit list of q-points (preallocated buffers).

Parameters:
  • giwk (GreensFunction) – The momentum-dependent GreensFunction.

  • niw (int) – Number of positive bosonic frequencies.

  • niv (int) – Number of positive fermionic frequencies.

  • q_list (ndarray) – Array of integer q-point index triplets to compute.

  • q_grid (KGrid) – The KGrid providing the momentum normalization (nk_tot).

  • beta (float) – Inverse temperature \(\beta\).

  • use_gpu (bool) – If True, compute with CuPy on the GPU; otherwise with NumPy on the CPU.

Returns:

The bubble as a FourPoint over the given q-points (compressed momentum, half niw range).

Return type:

FourPoint

static create_generalized_chi0_q_auto(mpi_distributor: MpiDistributor, giwk: GreensFunction, niw: int, niv: int, q_list: ndarray, q_grid: KGrid, beta: float, logger: DgaLogger)[source]#

Dispatches create_generalized_chi0_q() to the GPU when CuPy and a usable CUDA device are available (assigning one GPU per MPI rank round-robin), otherwise falls back to the CPU.

Parameters:
  • mpi_distributor (MpiDistributor) – MPI distributor over the q-points (see MpiDistributor).

  • giwk (GreensFunction) – The momentum-dependent GreensFunction.

  • niw (int) – Number of positive bosonic frequencies.

  • niv (int) – Number of positive fermionic frequencies.

  • q_list (ndarray) – Array of integer q-point index triplets to compute.

  • q_grid (KGrid) – The KGrid providing the momentum normalization.

  • beta (float) – Inverse temperature \(\beta\).

  • logger (DgaLogger) – Logger used to report whether GPU acceleration is used.

Returns:

The bubble as a FourPoint over the given q-points.

static create_generalized_chi0_q_fft(mpi_dist_irrk: MpiDistributor, giwk: GreensFunction, niw: int, niv: int, k_grid: KGrid, beta: float, use_gpu: bool = False) FourPoint[source]#

Returns the momentum-dependent generalized bare susceptibility \(\chi_{0;abcd}^{q\nu} = -\beta \sum_k G^{k}_{ad}\, G^{k-q}_{cb}\), evaluated via an FFT over the BZ with preallocated buffers. The result is computed on rank 0 over the irreducible BZ and scattered across ranks.

Parameters:
  • mpi_dist_irrk (MpiDistributor) – MPI distributor over the irreducible BZ q-points (see MpiDistributor).

  • giwk (GreensFunction) – The momentum-dependent GreensFunction.

  • niw (int) – Number of positive bosonic frequencies.

  • niv (int) – Number of positive fermionic frequencies.

  • k_grid (KGrid) – The KGrid over which the BZ sum/FFT is performed.

  • beta (float) – Inverse temperature \(\beta\).

  • use_gpu (bool) – If True, compute with CuPy on the GPU; otherwise with NumPy on the CPU.

Returns:

The bubble as a FourPoint over the irreducible BZ (compressed momentum, half niw range).

Return type:

FourPoint

static create_generalized_chi0_q_fft_auto(mpi_dist_irrk: MpiDistributor, giwk: GreensFunction, niw: int, niv: int, k_grid: KGrid, beta: float, logger: DgaLogger)[source]#

Dispatches create_generalized_chi0_q_fft() to the GPU when CuPy and a usable CUDA device are available (assigning one GPU per MPI rank round-robin), otherwise falls back to the CPU.

Parameters:
  • mpi_dist_irrk (MpiDistributor) – MPI distributor over the irreducible BZ q-points (see MpiDistributor).

  • giwk (GreensFunction) – The momentum-dependent GreensFunction.

  • niw (int) – Number of positive bosonic frequencies.

  • niv (int) – Number of positive fermionic frequencies.

  • k_grid (KGrid) – The KGrid over which the BZ sum/FFT is performed.

  • beta (float) – Inverse temperature \(\beta\).

  • logger (DgaLogger) – Logger used to report whether GPU acceleration is used.

Returns:

The bubble as a FourPoint over the irreducible BZ.

static create_generalized_chi0_q_pp_w0(giwk: GreensFunction, niv_pp: int, q_grid: KGrid) FourPoint[source]#

Returns the momentum-dependent particle-particle bare bubble at \(\omega = 0\), \(\chi_{0;abcd}^{\vec{k}(\omega=0)\nu} = G_{ad}^{k}\, G_{bc}^{-k}\) with \(G_{bc}^{-k} = G_{cb}^{*k}\). Note that no factor of \(-\beta\) is included here.

Parameters:
  • giwk (GreensFunction) – The momentum-dependent GreensFunction.

  • niv_pp (int) – Number of positive fermionic frequencies of the pp bubble.

  • q_grid (KGrid) – The KGrid defining the momentum grid.

Returns:

The momentum-dependent pp bubble as a FourPoint (no bosonic axis, pp notation, compressed q).

Return type:

FourPoint