def __init__(self, system, grid, local, slow, lmax, moldens=None): ''' **Arguments:** system The system to be partitioned. grid The integration grid local Whether or not to use local (non-periodic) grids. slow When ``True``, also the AIM properties are computed that use the AIM overlap operators. lmax The maximum angular momentum in multipole expansions. **Optional arguments:** moldens The all-electron density grid data. ''' JustOnceClass.__init__(self) self._system = system self._grid = grid self._local = local self._slow = slow self._lmax = lmax # Caching stuff, to avoid recomputation of earlier results self._cache = Cache() # Caching of work arrays to avoid reallocation if moldens is not None: self._cache.dump('moldens', moldens) # Initialize the subgrids if local: self._init_subgrids() # Some screen logging self._init_log_base() self._init_log_scheme() self._init_log_memory() if log.do_medium: log.blank()
def __init__(self, coordinates, numbers, pseudo_numbers, grid, moldens, spindens, local, lmax): ''' **Arguments:** coordinates An array (N, 3) with centers for the atom-centered grids. numbers An array (N,) with atomic numbers. pseudo_numbers An array (N,) with effective charges. When set to None, this defaults to``numbers.astype(float)``. grid The integration grid moldens The spin-summed electron density on the grid. spindens The spin difference density on the grid. (Can be None) local Whether or not to use local (non-periodic) subgrids for atomic integrals. lmax The maximum angular momentum in multipole expansions. ''' # Init base class JustOnceClass.__init__(self) # Some type checking for first three arguments natom, coordinates, numbers, pseudo_numbers = typecheck_geo(coordinates, numbers, pseudo_numbers) self._natom = natom self._coordinates = coordinates self._numbers = numbers self._pseudo_numbers = pseudo_numbers # Assign remaining arguments as attributes self._grid = grid self._moldens = moldens self._spindens = spindens self._local = local self._lmax = lmax # Caching stuff, to avoid recomputation of earlier results self._cache = Cache() # Initialize the subgrids if local: self._init_subgrids() # Some screen logging self._init_log_base() self._init_log_scheme() self._init_log_memory() if log.do_medium: log.blank()
def clear(self): '''Discard all cached results, e.g. because wfn changed''' JustOnceClass.clear(self) self.cache.clear()