def derivative(self, a_xG, c_axiv, q=-1): for c_xiv in c_axiv.values(): c_xiv.fill(0.0) run([ self.lfs_a[a].iderivative(a_xG, c_axiv.get(a), q) for a in self.atom_indices ])
def integrate(self, a_xG, c_axi, q=-1): for c_xi in c_axi.values(): c_xi.fill(0.0) run([ self.lfs_a[a].iintegrate(a_xG, c_axi.get(a), q) for a in self.atom_indices ])
def add(self, a_xG, c_axi=1.0, q=-1): if isinstance(c_axi, float): assert q == -1 c_xi = np.array([c_axi]) run([lfs.iadd(a_xG, c_xi) for lfs in self.lfs_a.values()]) else: run([self.lfs_a[a].iadd(a_xG, c_axi.get(a), q, True) for a in self.atom_indices])
def sum(self, a_x, broadcast=False): """Sum up array. The default behavior is to let the owner-node return the result in a_x. With broadcast=True, all nodes will return the result in a_x.""" run(self.isum(a_x, broadcast))
def integrate(self, a_xg, result_xi, k=None): """Calculate integrals of arrays times localized functions. Return the integral of extended arrays times localized functions in result_xi. Correct phase-factors are used if the **k**-point index k is not None (Bloch boundary-condtions).""" run(self.iintegrate(a_xg, result_xi, k))
def derivative(self, a_xg, result_xic, k=None): """Calculate derivatives of localized integrals. Return the *x*- *y*- and *z*-derivatives of the integral of extended arrays times localized functions in result_xi. Correct phase-factors are used if the **k**-point index k is not None (Block boundary-condtions).""" run(self.iderivative(a_xg, result_xic, k))
def add(self, a_xg, coef_xi, k=None, communicate=False): """Add localized functions to extended arrays. Add the product of coef_xi and the localized functions to a_xg. With Bloch boundary-condtions, k is used to index the phase-factors. If communicate is True, coef_xi will be broadcasted from the root-CPU.""" run(self.iadd(a_xg, coef_xi, k, communicate))
def derivative(self, a_xG, c_axiv, q=-1): for c_xiv in c_axiv.values(): c_xiv.fill(0.0) run([self.lfs_a[a].iderivative(a_xG, c_axiv.get(a), q) for a in self.atom_indices])
def integrate(self, a_xG, c_axi, q=-1): for c_xi in c_axi.values(): c_xi.fill(0.0) run([self.lfs_a[a].iintegrate(a_xG, c_axi.get(a), q) for a in self.atom_indices])