momentGW.pbc.fock

Fock matrix and static self-energy parts with periodic boundary conditions.

Module Contents

momentGW.pbc.fock.search_chempot_constrained(w, v, nphys, nelec, occupancy=2)

Search for a chemical potential, constraining the k-point dependent occupancy to ensure no crossover of states. If this is not possible, a ValueError will be raised.

Parameters:
  • w (numpy.ndarray) – Eigenvalues at each k-point.

  • v (numpy.ndarray) – Eigenvectors at each k-point.

  • nphys (int) – Number of physical states.

  • nelec (int) – Number of electrons.

  • occupancy (int, optional) – Number of electrons per state. Default value is 2.

Returns:

  • chempot (float) – Chemical potential.

  • error (float) – Error in the number of electrons.

momentGW.pbc.fock.search_chempot_unconstrained(w, v, nphys, nelec, occupancy=2)

Search for a chemical potential, without constraining the k-point dependent occupancy.

Parameters:
  • w (numpy.ndarray) – Eigenvalues at each k-point.

  • v (numpy.ndarray) – Eigenvectors at each k-point.

  • nphys (int) – Number of physical states.

  • nelec (int) – Number of electrons.

  • occupancy (int, optional) – Number of electrons per state. Default value is 2.

Returns:

  • chempot (float) – Chemical potential.

  • error (float) – Error in the number of electrons.

momentGW.pbc.fock.search_chempot(w, v, nphys, nelec, occupancy=2)

Search for a chemical potential, first trying with k-point restraints and if that doesn’t succeed then without.

Parameters:
  • w (numpy.ndarray) – Eigenvalues at each k-point.

  • v (numpy.ndarray) – Eigenvectors at each k-point.

  • nphys (int) – Number of physical states.

  • nelec (int) – Number of electrons.

  • occupancy (int, optional) – Number of electrons per state. Default value is 2.

Returns:

  • chempot (float) – Chemical potential.

  • error (float) – Error in the number of electrons.

momentGW.pbc.fock.minimize_chempot(se, fock, nelec, occupancy=2, x0=0.0, tol=1e-06, maxiter=200)

Optimise the shift in auxiliary energies to satisfy the electron number, ensuring that the same shift is applied at all k-points.

Parameters:
  • se (tuple of dyson.Lehmann) – Self-energy object at each k-point.

  • fock (numpy.ndarray) – Fock matrix at each k-point.

  • nelec (int) – Number of electrons.

  • occupancy (int, optional) – Number of electrons per state. Default value is 2.

  • x0 (float, optional) – Initial guess value. Default value is 0.0.

  • tol (float, optional) – Threshold in the number of electrons. Default value is 1e-6.

  • maxiter (int, optional) – Maximum number of iterations. Default value is 200.

Returns:

  • se (tuple of dyson.Lehmann) – Self-energy object at each k-point.

  • opt (scipy.optimize.OptimizeResult) – Result of the optimisation.

class momentGW.pbc.fock.FockLoop(gw, gf=None, se=None, **kwargs)

Bases: FockLoop

Self-consistent loop for the density matrix via the Hartree–Fock self-consistent field for spin-restricted periodic systems.

Parameters:
  • gw (BaseKGW) – GW object.

  • gf (tuple of dyson.Lehmann, optional) – Initial Green’s function object at each k-point. If None, use gw.init_gf(). Default value is None.

  • se (tuple of dyson.Lehmann, optional) – Initial self-energy object at each k-point. If passed, use as dynamic part of the self-energy. If None, self-energy is assumed to be static and fully defined by the Fock matrix. Default value is None.

  • fock_diis_space (int, optional) – DIIS space size for the Fock matrix. Default value is 10.

  • fock_diis_min_space (int, optional) – Minimum DIIS space size for the Fock matrix. Default value is 1.

  • conv_tol_nelec (float, optional) – Convergence tolerance for the number of electrons. Default value is 1e-6.

  • conv_tol_rdm1 (float, optional) – Convergence tolerance for the density matrix. Default value is 1e-8.

  • max_cycle_inner (int, optional) – Maximum number of inner iterations. Default value is 100.

  • max_cycle_outer (int, optional) – Maximum number of outer iterations. Default value is 20.

property naux

Get the number of auxiliary states.

property nqmo

Get the number of quasiparticle MOs.

property kpts

Get the k-points object.

property nelec

Get the number of electrons.

property h1e

Get the core Hamiltonian.

property mo_coeff

Get the MO coefficients.

property nmo

Get the number of MOs.

property nocc

Get the number of occupied MOs.

auxiliary_shift(fock, se=None)

Optimise a shift in the auxiliary energies to best satisfy the electron number.

Parameters:
  • fock (numpy.ndarray) – Fock matrix.

  • se (tuple of dyson.Lehmann, optional) – Self-energy at each k-point. If None, use self.se. Default value is None.

Returns:

se – Self-energy at each k-point.

Return type:

tuple of dyson.Lehmann

Notes

If there is no dynamic part of the self-energy (self.se is None), this method returns None.

search_chempot(gf=None)

Search for a chemical potential for a given Green’s function.

Parameters:

gf (tuple of dyson.Lehmann, optional) – Green’s function at each k-point. If None, use self.gf. Default value is None.

Returns:

  • chempot (float) – Chemical potential.

  • nerr (float) – Error in the number of electrons.

solve_dyson(fock, se=None)

Solve the Dyson equation for a given Fock matrix.

Parameters:
  • fock (numpy.ndarray) – Fock matrix at each k-point.

  • se (tuple of dyson.Lehmann, optional) – Self-energy at each k-point. If None, use self.se. Default value is None.

Returns:

  • gf (tuple of dyson.Lehmann) – Green’s function at each k-point.

  • nerr (float) – Error in the number of electrons.

Notes

If there is no dynamic part of the self-energy (self.se is None), this method simply diagonalises the Fock matrix and returns the Lehmann representation of the resulting zeroth-order Green’s function.

kernel(integrals=None)

Driver for the Fock loop.

Parameters:

integrals (KIntegrals, optional) – Integrals object. If None, generate from scratch. Default value is None.

Returns:

  • converged (bool) – Whether the loop has converged.

  • gf (tuple of dyson.Lehmann) – Green’s function object at each k-point.

  • se (tuple of dyson.Lehmann) – Self-energy object at each k-point.

make_rdm1(gf=None)

Get the first-order reduced density matrix.

Parameters:

gf (dyson.Lehmann, optional) – Green’s function object. If None, use either self.gf, or the mean-field Green’s function. Default value is None.

Returns:

rdm1 – First-order reduced density matrix.

Return type:

numpy.ndarray

get_fock(integrals, rdm1, h1e=None)

Get the Fock matrix.

Parameters:
  • integrals (BaseIntegrals) – Integrals object.

  • rdm1 (numpy.ndarray) – First-order reduced density matrix.

  • h1e (numpy.ndarray, optional) – Core Hamiltonian. If None, use self.h1e. Default value is None.

Returns:

fock – Fock matrix.

Return type:

numpy.ndarray