Class CoulombTensorQI

java.lang.Object
ffx.numerics.multipole.MultipoleTensor
ffx.numerics.multipole.CoulombTensorQI
Direct Known Subclasses:
EwaldTensorQI, GKTensorQI, TholeTensorQI

public class CoulombTensorQI extends MultipoleTensor
The CoulombTensorQI class computes derivatives of 1/|r| via recursion to arbitrary order for Cartesian multipoles in a quasi-internal frame.
Since:
1.0
Author:
Michael J. Schnieders
See Also:
  • Constructor Details

    • CoulombTensorQI

      public CoulombTensorQI(int order)
  • Method Details

    • setR

      public void setR(double dx, double dy, double dz)
      Set the separation vector.
      Specified by:
      setR in class MultipoleTensor
      Parameters:
      dx - Separation along the X-axis.
      dy - Separation along the Y-axis.
      dz - Separation along the Z-axis.
    • source

      protected void source(double[] T000)
      Generate source terms for the Coulomb Challacombe et al. recursion.
      Specified by:
      source in class MultipoleTensor
      Parameters:
      T000 - Location to store the source terms.
    • order1

      protected void order1()
      Hard coded computation of the Cartesian multipole tensors up to 1st order.
      Specified by:
      order1 in class MultipoleTensor
    • order2

      protected void order2()
      Hard coded computation of the Cartesian multipole tensors up to 2nd order.
      Specified by:
      order2 in class MultipoleTensor
    • order3

      protected void order3()
      Hard coded computation of the Cartesian multipole tensors up to 3rd order.
      Specified by:
      order3 in class MultipoleTensor
    • order4

      protected void order4()
      Hard coded computation of the Cartesian multipole tensors up to 4th order.
      Specified by:
      order4 in class MultipoleTensor
    • order5

      protected void order5()
      Hard coded computation of the Cartesian multipole tensors up to 5th order, which is needed for quadrupole-quadrupole forces.
      Specified by:
      order5 in class MultipoleTensor
    • order6

      protected void order6()
      Hard coded computation of the Cartesian multipole tensors up to 6th order, which is needed for quadrupole-quadrupole forces and orthogonal space sampling.
      Specified by:
      order6 in class MultipoleTensor
    • multipoleIPotentialAtK

      protected void multipoleIPotentialAtK(PolarizableMultipole mI, int order)
      Compute the field components due to multipole I at site K.
      Specified by:
      multipoleIPotentialAtK in class MultipoleTensor
      Parameters:
      mI - PolarizableMultipole at site I.
      order - Compute derivatives of the potential up to this order. Order 0: Electrostatic potential (E000) Order 1: First derivatives: d/dX is E100, d/dY is E010, d/dZ is E001. Order 2: Second derivatives: d2/dXdX is E200, d2/dXdY is E110 (needed for quadrupole energy) Order 3: 3rd derivatives: (needed for quadrupole forces).
    • chargeIPotentialAtK

      protected void chargeIPotentialAtK(PolarizableMultipole mI, int order)
      Compute the field components due to charge I at site K.
      Specified by:
      chargeIPotentialAtK in class MultipoleTensor
      Parameters:
      mI - PolarizableMultipole at site I.
      order - Compute derivatives of the potential up to this order. Order 0: Electrostatic potential (E000) Order 1: First derivatives: d/dX is E100, d/dY is E010, d/dZ is E001. Order 2: Second derivatives: d2/dXdX is E200, d2/dXdY is E110 (needed for quadrupole energy) Order 3: 3rd derivatives: (needed for quadrupole forces).
    • dipoleIPotentialAtK

      protected void dipoleIPotentialAtK(double uxi, double uyi, double uzi, int order)
      Compute the induced dipole field components due to site I at site K.
      Specified by:
      dipoleIPotentialAtK in class MultipoleTensor
      Parameters:
      uxi - X-dipole component.
      uyi - Y-dipole component.
      uzi - Z-dipole component.
      order - Potential order.
    • quadrupoleIPotentialAtK

      protected void quadrupoleIPotentialAtK(PolarizableMultipole mI, int order)
      Compute the field components due to quadrupole I at site K.
      Specified by:
      quadrupoleIPotentialAtK in class MultipoleTensor
      Parameters:
      mI - PolarizableMultipole at site I.
      order - Compute derivatives of the potential up to this order. Order 0: Electrostatic potential (E000) Order 1: First derivatives: d/dX is E100, d/dY is E010, d/dZ is E001. Order 2: Second derivatives: d2/dXdX is E200, d2/dXdY is E110 (needed for quadrupole energy) Order 3: 3rd derivatives: (needed for quadrupole forces).
    • multipoleKPotentialAtI

      protected void multipoleKPotentialAtI(PolarizableMultipole mK, int order)
      Compute the field components due to multipole K at site I.
      Specified by:
      multipoleKPotentialAtI in class MultipoleTensor
      Parameters:
      mK - PolarizableMultipole at site K.
      order - Compute derivatives of the potential up to this order. Order 0: Electrostatic potential (E000) Order 1: First derivatives: d/dX is E100, d/dY is E010, d/dZ is E001. Order 2: Second derivatives: d2/dXdX is E200, d2/dXdY is E110 (needed for quadrupole energy) Order 3: 3rd derivatives: (needed for quadrupole forces).
    • chargeKPotentialAtI

      protected void chargeKPotentialAtI(PolarizableMultipole mK, int order)
      Compute the field components due to multipole K at site I.
      Specified by:
      chargeKPotentialAtI in class MultipoleTensor
      Parameters:
      mK - PolarizableMultipole at site K.
      order - Compute derivatives of the potential up to this order. Order 0: Electrostatic potential (E000) Order 1: First derivatives: d/dX is E100, d/dY is E010, d/dZ is E001. Order 2: Second derivatives: d2/dXdX is E200, d2/dXdY is E110 (needed for quadrupole energy) Order 3: 3rd derivatives: (needed for quadrupole forces).
    • dipoleKPotentialAtI

      protected void dipoleKPotentialAtI(double uxk, double uyk, double uzk, int order)
      Compute the induced dipole field components due to site K at site I.
      Specified by:
      dipoleKPotentialAtI in class MultipoleTensor
      Parameters:
      uxk - X-dipole component.
      uyk - Y-dipole component.
      uzk - Z-dipole component.
      order - Potential order.
    • quadrupoleKPotentialAtI

      protected void quadrupoleKPotentialAtI(PolarizableMultipole mK, int order)
      Compute the field components due to multipole K at site I.
      Specified by:
      quadrupoleKPotentialAtI in class MultipoleTensor
      Parameters:
      mK - PolarizableMultipole at site K.
      order - Compute derivatives of the potential up to this order. Order 0: Electrostatic potential (E000) Order 1: First derivatives: d/dX is E100, d/dY is E010, d/dZ is E001. Order 2: Second derivatives: d2/dXdX is E200, d2/dXdY is E110 (needed for quadrupole energy) Order 3: 3rd derivatives: (needed for quadrupole forces).
    • Tlmnj

      protected double Tlmnj(int l, int m, int n, int j, double[] r, double[] T000)
      This routine implements the recurrence relations for computation of any Cartesian multipole tensor in ~O(L^8) time, where L is the total order l + m + n, given the auxiliary elements T0000.
      It implements the recursion relationships in brute force fashion, without saving intermediate values. This is useful for finding a single tensor, rather than all binomial(L + 3, 3).
      The specific recursion equations (41-43) and set of auxiliary tensor elements from equation (40) can be found in Challacombe et al.
      Specified by:
      Tlmnj in class MultipoleTensor
      Parameters:
      l - int The number of (d/dx) operations.
      m - int The number of (d/dy) operations.
      n - int The number of (d/dz) operations.
      j - int j = 0 is the Tlmn tensor, j .GT. 0 is an intermediate.
      r - double[] The {x,y,z} coordinates.
      T000 - double[] Initial auxiliary tensor elements from Eq. (40).
      Returns:
      double The requested Tensor element (intermediate if j .GT. 0).
    • noStorageRecursion

      protected void noStorageRecursion(double[] r, double[] tensor)
      This method is a driver to collect elements of the Cartesian multipole tensor given the recursion relationships implemented by the method "Tlmnj", which can be called directly to get a single tensor element. It does not store intermediate values of the recursion, causing it to scale O(order^8). For order = 5, this approach is a factor of 10 slower than recursion that stores intermediates.
      Specified by:
      noStorageRecursion in class MultipoleTensor
      Parameters:
      r - double[] vector between two sites. r[0] and r[1] must equal 0.0.
      tensor - double[] length must be at least binomial(order + 3, 3).
    • noStorageRecursion

      protected void noStorageRecursion(double[] tensor)
      This method is a driver to collect elements of the Cartesian multipole tensor given the recursion relationships implemented by the method "Tlmnj", which can be called directly to get a single tensor element. It does not store intermediate values of the recursion, causing it to scale O(order^8). For order = 5, this approach is a factor of 10 slower than recursion that stores intermediates.
      Specified by:
      noStorageRecursion in class MultipoleTensor
      Parameters:
      tensor - double[] length must be at least binomial(order + 3, 3).
    • recursion

      protected void recursion(double[] r, double[] tensor)
      This method is a driver to collect elements of the Cartesian multipole tensor using recursion relationships and storing intermediate values. It scales approximately O(order^4).
      Specified by:
      recursion in class MultipoleTensor
      Parameters:
      r - double[] vector between two sites.
      tensor - double[] length must be at least binomial(order + 3, 3).
    • recursion

      protected void recursion(double[] tensor)
      This method is a driver to collect elements of the Cartesian multipole tensor using recursion relationships and storing intermediate values. It scales approximately O(order^4).
      Specified by:
      recursion in class MultipoleTensor
      Parameters:
      tensor - double[] length must be at least binomial(order + 3, 3).
    • codeTensorRecursion

      protected String codeTensorRecursion(double[] r, double[] tensor)
      This function is a driver to collect elements of the Cartesian multipole tensor. Collecting all tensors scales slightly better than O(order^4).

      For a multipole expansion truncated at quadrupole order, for example, up to order 5 is needed for energy gradients. The number of terms this requires is binomial(5 + 3, 3) or 8! / (5! * 3!), which is 56.

      The packing of the tensor elements for order = 1
      tensor[0] = 1/|r|
      tensor[1] = -x/|r|^3
      tensor[2] = -y/|r|^3
      tensor[3] = -z/|r|^3

      Specified by:
      codeTensorRecursion in class MultipoleTensor
      Parameters:
      r - double[] vector between two sites.
      tensor - double[] length must be at least binomial(order + 3, 3).
      Returns:
      Java code for the tensor recursion.
      Since:
      1.0