Ejemplo n.º 1
0
    def __init__(self, coordinates, numbers, pseudo_numbers, grid, moldens,
                 proatomdb, spindens=None, local=True, lmax=3,
                 wcor_numbers=None, wcor_rcut_max=2.0, wcor_rcond=0.1,
                 threshold=1e-6, maxiter=500, greedy=False):
        '''
           **Arguments:** (that are not defined in ``CPart``)

           proatomdb
                In instance of ProAtomDB that contains all the reference atomic
                densities.

           **Optional arguments:** (that are not defined in ``CPart``)

           threshold
                The procedure is considered to be converged when the maximum
                change of the charges between two iterations drops below this
                threshold.

           maxiter
                The maximum number of iterations. If no convergence is reached
                in the end, no warning is given.

           greedy
                Reduce the CPU cost at the expense of more memory consumption.
        '''
        HirshfeldIMixin.__init__(self, threshold, maxiter, greedy)
        HirshfeldCPart.__init__(self, coordinates, numbers, pseudo_numbers,
                                grid, moldens, proatomdb, spindens, local,
                                lmax, wcor_numbers, wcor_rcut_max, wcor_rcond)
Ejemplo n.º 2
0
    def __init__(self,
                 system,
                 grid,
                 local,
                 moldens,
                 proatomdb,
                 wcor_numbers=None,
                 wcor_rcut_max=2.0,
                 wcor_rcond=0.1,
                 lmax=3,
                 threshold=1e-6,
                 maxiter=500,
                 greedy=False):
        '''
           **Optional arguments:** (that are not present in the base class)

           threshold
                The procedure is considered to be converged when the maximum
                change of the charges between two iterations drops below this
                threshold.

           maxiter
                The maximum number of iterations. If no convergence is reached
                in the end, no warning is given.
        '''
        HirshfeldIMixin.__init__(self, threshold, maxiter, greedy)
        HirshfeldCPart.__init__(self, system, grid, local, moldens, proatomdb,
                                wcor_numbers, wcor_rcut_max, wcor_rcond, lmax)
Ejemplo n.º 3
0
    def __init__(self, system, grid, local, moldens, proatomdb, wcor_numbers=None, wcor_rcut_max=2.0, wcor_rcond=0.1, lmax=3, threshold=1e-6, maxiter=500, greedy=False):
        '''
           **Optional arguments:** (that are not present in the base class)

           threshold
                The procedure is considered to be converged when the maximum
                change of the charges between two iterations drops below this
                threshold.

           maxiter
                The maximum number of iterations. If no convergence is reached
                in the end, no warning is given.
        '''
        HirshfeldIMixin.__init__(self, threshold, maxiter, greedy)
        HirshfeldCPart.__init__(self, system, grid, local, moldens, proatomdb, wcor_numbers, wcor_rcut_max, wcor_rcond, lmax)
Ejemplo n.º 4
0
 def get_memory_estimates(self):
     if self.local:
         row = [('Weight corrections (fit)',
                 np.array([n in self._wcor_numbers
                           for n in self.numbers]), 0)]
     else:
         row = [('Weight corrections (fit)', np.zeros(self.natom), 1)]
     return (HirshfeldCPart.get_memory_estimates(self) +
             HirshfeldEMixin.get_memory_estimates(self) + row)
Ejemplo n.º 5
0
 def get_memory_estimates(self):
     if self.local:
         row = [('Weight corrections (fit)', np.array([n in self._wcor_numbers for n in self.numbers]), 0)]
     else:
         row = [('Weight corrections (fit)', np.zeros(self.natom), 1)]
     return (
         HirshfeldCPart.get_memory_estimates(self) +
         HirshfeldEMixin.get_memory_estimates(self) +
         row
     )
Ejemplo n.º 6
0
 def eval_proatom(self, index, output, grid=None):
     if self._greedy:
         HirshfeldIMixin.eval_proatom(self, index, output, grid)
     else:
         HirshfeldCPart.eval_proatom(self, index, output, grid)
Ejemplo n.º 7
0
 def get_memory_estimates(self):
     return (HirshfeldCPart.get_memory_estimates(self) +
             HirshfeldIMixin.get_memory_estimates(self))
Ejemplo n.º 8
0
 def eval_proatom(self, index, output, grid=None):
     if self._greedy:
         HirshfeldIMixin.eval_proatom(self, index, output, grid)
     else:
         HirshfeldCPart.eval_proatom(self, index, output, grid)
Ejemplo n.º 9
0
 def get_memory_estimates(self):
     return (
         HirshfeldCPart.get_memory_estimates(self) +
         HirshfeldIMixin.get_memory_estimates(self)
     )