Package ffx.numerics.multipole
Class CoulombTensorQI
java.lang.Object
ffx.numerics.multipole.MultipoleTensor
ffx.numerics.multipole.CoulombTensorQI
- Direct Known Subclasses:
EwaldTensorQI
,GKTensorQI
,TholeTensorQI
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:
-
Field Summary
Fields inherited from class ffx.numerics.multipole.MultipoleTensor
coordinates, coulombSource, il, im, in, o1, operator, order, R, r2, size, t000, T000, t001, t002, t003, t004, t005, t006, t010, t011, t012, t013, t014, t015, t020, t021, t022, t023, t024, t030, t031, t032, t033, t040, t041, t042, t050, t051, t060, t100, t101, t102, t103, t104, t105, t110, t111, t112, t113, t114, t120, t121, t122, t123, t130, t131, t132, t140, t141, t150, t200, t201, t202, t203, t204, t210, t211, t212, t213, t220, t221, t222, t230, t231, t240, t300, t301, t302, t303, t310, t311, t312, t320, t321, t330, t400, t401, t402, t410, t411, t420, t500, t501, t510, t600, work, x, y, z
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
chargeIPotentialAtK
(PolarizableMultipole mI, int order) Compute the field components due to charge I at site K.protected void
chargeKPotentialAtI
(PolarizableMultipole mK, int order) Compute the field components due to multipole K at site I.protected String
codeTensorRecursion
(double[] r, double[] tensor) This function is a driver to collect elements of the Cartesian multipole tensor.protected String
codeVectorTensorRecursion
(double[] r, double[] tensor) This function is a driver to collect elements of the Cartesian multipole tensor.protected void
dipoleIPotentialAtK
(double uxi, double uyi, double uzi, int order) Compute the induced dipole field components due to site I at site K.protected void
dipoleKPotentialAtI
(double uxk, double uyk, double uzk, int order) Compute the induced dipole field components due to site K at site I.protected void
multipoleIPotentialAtK
(PolarizableMultipole mI, int order) Compute the field components due to multipole I at site K.protected void
multipoleKPotentialAtI
(PolarizableMultipole mK, int order) Compute the field components due to multipole K at site I.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.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.protected void
order1()
Hard coded computation of the Cartesian multipole tensors up to 1st order.protected void
order2()
Hard coded computation of the Cartesian multipole tensors up to 2nd order.protected void
order3()
Hard coded computation of the Cartesian multipole tensors up to 3rd order.protected void
order4()
Hard coded computation of the Cartesian multipole tensors up to 4th order.protected void
order5()
Hard coded computation of the Cartesian multipole tensors up to 5th order, which is needed for quadrupole-quadrupole forces.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.protected void
quadrupoleIPotentialAtK
(PolarizableMultipole mI, int order) Compute the field components due to quadrupole I at site K.protected void
quadrupoleKPotentialAtI
(PolarizableMultipole mK, int order) Compute the field components due to multipole K at site I.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.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.void
setR
(double dx, double dy, double dz) Set the separation vector.protected void
source
(double[] T000) Generate source terms for the Coulomb Challacombe et al. recursion.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.Methods inherited from class ffx.numerics.multipole.MultipoleTensor
codePotentialMultipoleI, codePotentialMultipoleISIMD, codePotentialMultipoleK, codePotentialMultipoleKSIMD, contractMultipoleI, dipoleTorque, generateTensor, generateTensor, getd2EdZ2, getdEdZ, getTensor, log, multipoleEnergy, multipoleEnergy, multipoleEnergyAndGradient, multipoleGradient, multipoleTorque, polarizationEnergy, polarizationEnergy, polarizationEnergyAndGradient, polarizationEnergyS, potentialMultipoleI, quadrupoleTorque, setR, setTensor, ti, totalEnergy
-
Constructor Details
-
CoulombTensorQI
public CoulombTensorQI(int order) Create a new CoulombTensorQI object.- Parameters:
order
- The tensor order.
-
-
Method Details
-
setR
public void setR(double dx, double dy, double dz) Set the separation vector.- Specified by:
setR
in classMultipoleTensor
- 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 classMultipoleTensor
- 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 classMultipoleTensor
-
order2
protected void order2()Hard coded computation of the Cartesian multipole tensors up to 2nd order.- Specified by:
order2
in classMultipoleTensor
-
order3
protected void order3()Hard coded computation of the Cartesian multipole tensors up to 3rd order.- Specified by:
order3
in classMultipoleTensor
-
order4
protected void order4()Hard coded computation of the Cartesian multipole tensors up to 4th order.- Specified by:
order4
in classMultipoleTensor
-
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 classMultipoleTensor
-
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 classMultipoleTensor
-
multipoleIPotentialAtK
Compute the field components due to multipole I at site K.- Specified by:
multipoleIPotentialAtK
in classMultipoleTensor
- 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
Compute the field components due to charge I at site K.- Specified by:
chargeIPotentialAtK
in classMultipoleTensor
- 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 classMultipoleTensor
- Parameters:
uxi
- X-dipole component.uyi
- Y-dipole component.uzi
- Z-dipole component.order
- Potential order.
-
quadrupoleIPotentialAtK
Compute the field components due to quadrupole I at site K.- Specified by:
quadrupoleIPotentialAtK
in classMultipoleTensor
- 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
Compute the field components due to multipole K at site I.- Specified by:
multipoleKPotentialAtI
in classMultipoleTensor
- 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
Compute the field components due to multipole K at site I.- Specified by:
chargeKPotentialAtI
in classMultipoleTensor
- 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 classMultipoleTensor
- Parameters:
uxk
- X-dipole component.uyk
- Y-dipole component.uzk
- Z-dipole component.order
- Potential order.
-
quadrupoleKPotentialAtI
Compute the field components due to multipole K at site I.- Specified by:
quadrupoleKPotentialAtI
in classMultipoleTensor
- 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 classMultipoleTensor
- 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 classMultipoleTensor
- 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 classMultipoleTensor
- 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 classMultipoleTensor
- 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 classMultipoleTensor
- Parameters:
tensor
- double[] length must be at least binomial(order + 3, 3).
-
codeTensorRecursion
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 classMultipoleTensor
- 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
-
codeVectorTensorRecursion
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- 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
-