:py:mod:`momentGW.pbc.tda` ========================== .. py:module:: momentGW.pbc.tda .. autoapi-nested-parse:: Construct TDA moments with periodic boundary conditions. Module Contents --------------- .. py:class:: dTDA(gw, nmom_max, integrals, mo_energy=None, mo_occ=None) Bases: :py:obj:`momentGW.tda.dTDA` Compute the self-energy moments using dTDA with periodic boundary conditions. :param gw: GW object. :type gw: BaseKGW :param nmom_max: Maximum moment number to calculate. :type nmom_max: int :param integrals: Density-fitted integrals at each k-point. :type integrals: KIntegrals :param mo_energy: Molecular orbital energies at each k-point. Keys are "g" and "w" for the Green's function and screened Coulomb interaction, respectively. If `None`, use `gw.mo_energy` for both. Default value is `None`. :type mo_energy: dict, optional :param mo_occ: Molecular orbital occupancies at each k-point. Keys are "g" and "w" for the Green's function and screened Coulomb interaction, respectively. If `None`, use `gw.mo_occ` for both. Default value is `None`. :type mo_occ: dict, optional .. py:property:: nov Get the number of ov states in W. .. py:property:: kpts Get the k-points. .. py:property:: nkpts Get the number of k-points. .. py:property:: nmo Get the number of MOs. .. py:property:: naux Get the number of auxiliaries. .. py:method:: build_dd_moments() Build the moments of the density-density response. :returns: **moments** -- Moments of the density-density response at each k-point. :rtype: numpy.ndarray .. py:method:: kernel(exact=False) Run the polarizability calculation to compute moments of the self-energy. :param exact: Has no effect and is only present for compatibility with `dRPA`. Default value is `False`. :type exact: bool, optional :returns: * **moments_occ** (*numpy.ndarray*) -- Moments of the occupied self-energy at each k-point. * **moments_vir** (*numpy.ndarray*) -- Moments of the virtual self-energy at each k-point. .. py:method:: convolve(eta, mo_energy_g=None, mo_occ_g=None) Handle the convolution of the moments of the Green's function and screened Coulomb interaction. :param eta: Moments of the density-density response partly transformed into moments of the screened Coulomb interaction at each k-point. :type eta: numpy.ndarray :param mo_energy_g: Energies of the Green's function at each k-point. If `None`, use `self.mo_energy_g`. Default value is `None`. :type mo_energy_g: numpy.ndarray, optional :param mo_occ_g: Occupancies of the Green's function at each k-point. If `None`, use `self.mo_occ_g`. Default value is `None`. :type mo_occ_g: numpy.ndarray, optional :returns: * **moments_occ** (*numpy.ndarray*) -- Moments of the occupied self-energy at each k-point. * **moments_vir** (*numpy.ndarray*) -- Moments of the virtual self-energy at each k-point. .. py:method:: build_se_moments(moments_dd) Build the moments of the self-energy via convolution. :param moments_dd: Moments of the density-density response at each k-point. :type moments_dd: numpy.ndarray :returns: * **moments_occ** (*numpy.ndarray*) -- Moments of the occupied self-energy at each k-point. * **moments_vir** (*numpy.ndarray*) -- Moments of the virtual self-energy at each k-point. .. py:method:: build_dp_moments() Build the moments of the dynamic polarizability for optical spectra calculations. :returns: **moments** -- Moments of the dynamic polarizability. :rtype: numpy.ndarray .. py:method:: build_dd_moment_inv() Build the first inverse (`n=-1`) moment of the density-density response. :returns: **moment** -- First inverse (`n=-1`) moment of the density-density response. :rtype: numpy.ndarray .. rubric:: Notes This is not the full `n=-1` moment, which is .. math:: D^{-1} - D^{-1} V^\dagger (I + V D^{-1} V^\dagger)^{-1} \\ V D^{-1} but rather .. math:: (I + V D^{-1} V^\dagger)^{-1} V D^{-1} which ensures that the function scales properly. The final contractions are done when constructing the matrix-vector product. .. py:method:: mpi_slice(n) Return the start and end index for the current process for total size `n`. :param n: Total size. :type n: int :returns: * **p0** (*int*) -- Start index for current process. * **p1** (*int*) -- End index for current process. .. py:method:: mpi_size(n) Return the number of states in the current process for total size `n`. :param n: Total size. :type n: int :returns: **size** -- Number of states in current process. :rtype: int