コード例 #1
0
 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
     ])
コード例 #2
0
 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
     ])
コード例 #3
0
ファイル: lfc.py プロジェクト: yihsuanliu/gpaw
 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])
コード例 #4
0
    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))
コード例 #5
0
    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))
コード例 #6
0
ファイル: localized_functions.py プロジェクト: qsnake/gpaw
    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))
コード例 #7
0
ファイル: localized_functions.py プロジェクト: qsnake/gpaw
    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))
コード例 #8
0
    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))
コード例 #9
0
    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))
コード例 #10
0
ファイル: localized_functions.py プロジェクト: qsnake/gpaw
    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))
コード例 #11
0
ファイル: localized_functions.py プロジェクト: qsnake/gpaw
    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))
コード例 #12
0
ファイル: lfc.py プロジェクト: qsnake/gpaw
 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])
コード例 #13
0
ファイル: lfc.py プロジェクト: qsnake/gpaw
 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])