def dip_moment(cell, dm_kpts, unit='Debye', verbose=logger.NOTE, grids=None, rho=None, kpts=np.zeros((1, 3))): ''' Dipole moment in the unit cell (is it well defined)? Args: cell : an instance of :class:`Cell` dm_kpts (a list of ndarrays) : density matrices of k-points Return: A list: the dipole moment on x, y and z components ''' from pyscf.pbc.dft import gen_grid from pyscf.pbc.dft import numint if grids is None: grids = gen_grid.UniformGrids(cell) if rho is None: rho = numint.KNumInt().get_rho(cell, dm_kpts, grids, kpts, cell.max_memory) return pbchf.dip_moment(cell, dm_kpts, unit, verbose, grids, rho, kpts)
def dip_moment(cell, dm, unit='Debye', verbose=logger.NOTE, grids=None, rho=None, kpt=np.zeros(3)): ''' Dipole moment in the unit cell. Args: cell : an instance of :class:`Cell` dm_kpts (a list of ndarrays) : density matrices of k-points Return: A list: the dipole moment on x, y and z components ''' dm = dm[0] + dm[1] return pbchf.dip_moment(cell, dm, unit, verbose, grids, rho, kpt)