Class MultipoleTensor
- Direct Known Subclasses:
CoulombTensorGlobal
,CoulombTensorQI
This class serves as the abstract parent to both and defines all shared logic. Non-abstract methods are declared final to disallow unnecessary overrides.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CoordinateSystem
The coordinate system in use (global or QI).protected final double[]
These are the "source" terms for the recursion for the Coulomb operator (1/R).protected final int
Order plus one.protected final int
im = (Order plus one)^2.protected final int
in = (Order plus one)^3.protected final int
Order plus 1.protected Operator
The OPERATOR in use.protected final int
Order of the tensor recursion (5th is needed for AMOEBA forces).protected double
Separation distance.protected double
Separation distance squared.protected final int
Size = (order + 1) * (order + 2) * (order + 3) / 6;protected final int
No derivatives.protected final double[]
Store the auxiliary tensor memory to avoid memory consumption.protected final int
First derivative with respect to z.protected final int
Second derivative with respect to z.protected final int
Third derivative with respect to z.protected final int
Fourth derivative with respect to z.protected final int
Fifth derivative with respect to z.protected final int
Sixth derivative with respect to z.protected final int
First derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Second derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Third derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Fourth derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Derivatives with respect to y and z.protected final int
Fifth derivative with respect to y.protected final int
Derivatives with respect to y and z.protected final int
Sixth derivative with respect to y.protected final int
First derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Second derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Third derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Fourth derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Derivatives with respect to x, y and z.protected final int
Derivatives with respect to x and y.protected final int
Fifth derivative with respect to x.protected final int
Derivatives with respect to x and z.protected final int
Derivatives with respect to x and y.protected final int
Sixth derivative with respect to x.protected final double[]
Store the work array to avoid memory consumption.protected double
Xk - Xi.protected double
Yk - Yi.protected double
Zk - Zi. -
Constructor Summary
ConstructorDescriptionMultipoleTensor
(CoordinateSystem coordinates, int order) Constructor for MultipoleTensor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
chargeIPotentialAtK
(PolarizableMultipole mI, int order) Compute the field components due to charge I at site K.protected abstract void
chargeKPotentialAtI
(PolarizableMultipole mK, int order) Compute the field components due to multipole K at site I.protected void
codePotentialMultipoleI
(PolarizableMultipole mI, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at K due to multipole moments at the origin.protected void
codePotentialMultipoleISIMD
(PolarizableMultipole mI, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at K due to multipole moments at the origin using SIMD instructions.protected void
codePotentialMultipoleK
(PolarizableMultipole mK, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at the origin due to multipole moments at site K.protected void
codePotentialMultipoleKSIMD
(PolarizableMultipole mK, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at the origin due to multipole moments at site K using SIMD instructions.protected abstract String
codeTensorRecursion
(double[] r, double[] tensor) This function is a driver to collect elements of the Cartesian multipole tensor.protected double
contractMultipoleI
(PolarizableMultipole mI, double[] T, int l, int m, int n) Contract multipole moments with their respective electrostatic potential derivatives.protected abstract void
dipoleIPotentialAtK
(double uxi, double uyi, double uzi, int order) Compute the induced dipole field components due to site I at site K.protected abstract void
dipoleKPotentialAtI
(double uxk, double uyk, double uzk, int order) Compute the induced dipole field components due to site K at site I.protected final void
dipoleTorque
(PolarizableMultipole m, double[] torque) Compute the torque on a permanent dipole.void
Generate the tensor using hard-coded methods or via recursion.final void
generateTensor
(double[] r) For the MultipoleTensorTest class and testing.double
getd2EdZ2.double
getdEdZ()
getdEdZ.protected final void
getTensor
(double[] T) Load the tensor components.void
log
(double[] tensor) log.protected final double
Contract a multipole with the potential and its derivatives.double
Permanent multipole energy.double
multipoleEnergyAndGradient
(PolarizableMultipole mI, PolarizableMultipole mK, double[] Gi, double[] Gk, double[] Ti, double[] Tk) Permanent multipole energy and gradient.protected final void
multipoleGradient
(PolarizableMultipole m, double[] g) Compute the permanent multipole gradient.protected abstract void
multipoleIPotentialAtK
(PolarizableMultipole mI, int order) Compute the field components due to multipole I at site K.protected abstract void
multipoleKPotentialAtI
(PolarizableMultipole mK, int order) Compute the field components due to multipole K at site I.protected final void
multipoleTorque
(PolarizableMultipole m, double[] torque) Compute the torque on a permanent multipole.protected abstract 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 abstract 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 abstract void
order1()
Hard coded computation of the Cartesian multipole tensors up to 1st order.protected abstract void
order2()
Hard coded computation of the Cartesian multipole tensors up to 2nd order.protected abstract void
order3()
Hard coded computation of the Cartesian multipole tensors up to 3rd order.protected abstract void
order4()
Hard coded computation of the Cartesian multipole tensors up to 4th order.protected abstract void
order5()
Hard coded computation of the Cartesian multipole tensors up to 5th order, which is needed for quadrupole-quadrupole forces.protected abstract 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 final double
Contract an induced dipole with the potential and its derivatives.double
polarizationEnergy
(PolarizableMultipole mI, PolarizableMultipole mK, double scaleEnergy) Polarization Energy.double
polarizationEnergyAndGradient
(PolarizableMultipole mI, PolarizableMultipole mK, double inductionMask, double energyMask, double mutualMask, double[] Gi, double[] Ti, double[] Tk) Polarization Energy and Gradient.protected final double
Contract an induced dipole with the potential and its derivatives.protected final void
potentialMultipoleI
(PolarizableMultipole mI, double[] T, int l, int m, int n) Collect the field at R due to Q multipole moments at the origin (site I).protected abstract void
quadrupoleIPotentialAtK
(PolarizableMultipole mI, int order) Compute the field components due to quadrupole I at site K.protected abstract void
quadrupoleKPotentialAtI
(PolarizableMultipole mK, int order) Compute the field components due to multipole K at site I.protected final void
quadrupoleTorque
(PolarizableMultipole m, double[] torque) Compute the torque on a permanent quadrupole.protected abstract 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 abstract 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.final void
setR
(double[] r) Set the separation vector.abstract void
setR
(double dx, double dy, double dz) Set the separation vector.protected final void
setTensor
(double[] T) Set the tensor components.protected abstract void
source
(double[] T000) Generate source terms for the Challacombe et al. recursion.protected final int
ti
(int dx, int dy, int dz) The index is based on the idea of filling tetrahedron.protected abstract 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.double
totalEnergy
(PolarizableMultipole mI, PolarizableMultipole mK, double scaleEnergy, double[] energyComponents) Permanent Multipole + Polarization Energy.
-
Field Details
-
order
protected final int orderOrder of the tensor recursion (5th is needed for AMOEBA forces). -
o1
protected final int o1Order plus 1. -
il
protected final int ilOrder plus one. -
im
protected final int imim = (Order plus one)^2. -
in
protected final int inin = (Order plus one)^3. -
size
protected final int sizeSize = (order + 1) * (order + 2) * (order + 3) / 6; -
operator
The OPERATOR in use. -
coulombSource
protected final double[] coulombSourceThese are the "source" terms for the recursion for the Coulomb operator (1/R). -
work
protected final double[] workStore the work array to avoid memory consumption. Note that rather than use an array for intermediate values, a 4D matrix was tried. It was approximately 50% slower than the linear work array. -
T000
protected final double[] T000Store the auxiliary tensor memory to avoid memory consumption. -
coordinates
The coordinate system in use (global or QI). -
R
protected double RSeparation distance. -
r2
protected double r2Separation distance squared. -
x
protected double xXk - Xi. -
y
protected double yYk - Yi. -
z
protected double zZk - Zi. -
t000
protected final int t000No derivatives. -
t100
protected final int t100First derivative with respect to x. -
t010
protected final int t010First derivative with respect to y. -
t001
protected final int t001First derivative with respect to z. -
t200
protected final int t200Second derivative with respect to x. -
t020
protected final int t020Second derivative with respect to y. -
t002
protected final int t002Second derivative with respect to z. -
t110
protected final int t110Derivatives with respect to x and y. -
t101
protected final int t101Derivatives with respect to x and z. -
t011
protected final int t011Derivatives with respect to y and z. -
t300
protected final int t300Third derivative with respect to x. -
t030
protected final int t030Third derivative with respect to y. -
t003
protected final int t003Third derivative with respect to z. -
t210
protected final int t210Derivatives with respect to x and y. -
t201
protected final int t201Derivatives with respect to x and z. -
t120
protected final int t120Derivatives with respect to x and y. -
t021
protected final int t021Derivatives with respect to y and z. -
t102
protected final int t102Derivatives with respect to x and z. -
t012
protected final int t012Derivatives with respect to y and z. -
t111
protected final int t111Derivatives with respect to x, y and z. -
t400
protected final int t400Fourth derivative with respect to x. -
t040
protected final int t040Fourth derivative with respect to y. -
t004
protected final int t004Fourth derivative with respect to z. -
t310
protected final int t310Derivatives with respect to x and y. -
t301
protected final int t301Derivatives with respect to x and z. -
t130
protected final int t130Derivatives with respect to x and y. -
t031
protected final int t031Derivatives with respect to y and z. -
t103
protected final int t103Derivatives with respect to x and z. -
t013
protected final int t013Derivatives with respect to y and z. -
t220
protected final int t220Derivatives with respect to x and y. -
t202
protected final int t202Derivatives with respect to x and z. -
t022
protected final int t022Derivatives with respect to y and z. -
t211
protected final int t211Derivatives with respect to x, y and z. -
t121
protected final int t121Derivatives with respect to x, y and z. -
t112
protected final int t112Derivatives with respect to x, y and z. -
t500
protected final int t500Fifth derivative with respect to x. -
t050
protected final int t050Fifth derivative with respect to y. -
t005
protected final int t005Fifth derivative with respect to z. -
t410
protected final int t410Derivatives with respect to x and y. -
t401
protected final int t401Derivatives with respect to x and z. -
t140
protected final int t140Derivatives with respect to x and y. -
t041
protected final int t041Derivatives with respect to y and z. -
t104
protected final int t104Derivatives with respect to x and z. -
t014
protected final int t014Derivatives with respect to y and z. -
t320
protected final int t320Derivatives with respect to x and y. -
t302
protected final int t302Derivatives with respect to x and z. -
t230
protected final int t230Derivatives with respect to x and y. -
t032
protected final int t032Derivatives with respect to y and z. -
t203
protected final int t203Derivatives with respect to x and z. -
t023
protected final int t023Derivatives with respect to y and z. -
t311
protected final int t311Derivatives with respect to x, y and z. -
t131
protected final int t131Derivatives with respect to x, y and z. -
t113
protected final int t113Derivatives with respect to x, y and z. -
t221
protected final int t221Derivatives with respect to x, y and z. -
t212
protected final int t212Derivatives with respect to x, y and z. -
t122
protected final int t122Derivatives with respect to x, y and z. -
t600
protected final int t600Sixth derivative with respect to x. -
t060
protected final int t060Sixth derivative with respect to y. -
t006
protected final int t006Sixth derivative with respect to z. -
t510
protected final int t510Derivatives with respect to x and y. -
t501
protected final int t501Derivatives with respect to x and z. -
t150
protected final int t150Derivatives with respect to x and y. -
t051
protected final int t051Derivatives with respect to y and z. -
t105
protected final int t105Derivatives with respect to x and z. -
t015
protected final int t015Derivatives with respect to y and z. -
t420
protected final int t420Derivatives with respect to x and y. -
t402
protected final int t402Derivatives with respect to x and z. -
t240
protected final int t240Derivatives with respect to x and y. -
t042
protected final int t042Derivatives with respect to y and z. -
t204
protected final int t204Derivatives with respect to x and z. -
t024
protected final int t024Derivatives with respect to y and z. -
t411
protected final int t411Derivatives with respect to x, y and z. -
t141
protected final int t141Derivatives with respect to x, y and z. -
t114
protected final int t114Derivatives with respect to x, y and z. -
t330
protected final int t330Derivatives with respect to x and y. -
t303
protected final int t303Derivatives with respect to x and z. -
t033
protected final int t033Derivatives with respect to y and z. -
t321
protected final int t321Derivatives with respect to x, y and z. -
t231
protected final int t231Derivatives with respect to x, y and z. -
t213
protected final int t213Derivatives with respect to x, y and z. -
t312
protected final int t312Derivatives with respect to x, y and z. -
t132
protected final int t132Derivatives with respect to x, y and z. -
t123
protected final int t123Derivatives with respect to x, y and z. -
t222
protected final int t222Derivatives with respect to x, y and z.
-
-
Constructor Details
-
MultipoleTensor
Constructor for MultipoleTensor.- Parameters:
coordinates
- aCoordinateSystem
object.order
- The order of the tensor.
-
-
Method Details
-
getd2EdZ2
public double getd2EdZ2()getd2EdZ2.- Returns:
- a double.
-
getdEdZ
public double getdEdZ()getdEdZ.- Returns:
- a double.
-
log
public void log(double[] tensor) log.- Parameters:
tensor
- an array ofinvalid reference
double
-
multipoleEnergy
Permanent multipole energy.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.- Returns:
- a double.
-
multipoleEnergyAndGradient
public double multipoleEnergyAndGradient(PolarizableMultipole mI, PolarizableMultipole mK, double[] Gi, double[] Gk, double[] Ti, double[] Tk) Permanent multipole energy and gradient.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.Gi
- Coordinate gradient at site I.Gk
- Coordinate gradient at site K.Ti
- Torque at site I.Tk
- Torque at site K.- Returns:
- the permanent multipole energy.
-
polarizationEnergy
public double polarizationEnergy(PolarizableMultipole mI, PolarizableMultipole mK, double scaleEnergy) Polarization Energy.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.scaleEnergy
- a double.- Returns:
- a double.
-
polarizationEnergyAndGradient
public double polarizationEnergyAndGradient(PolarizableMultipole mI, PolarizableMultipole mK, double inductionMask, double energyMask, double mutualMask, double[] Gi, double[] Ti, double[] Tk) Polarization Energy and Gradient.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.inductionMask
- a double.energyMask
- a double.mutualMask
- a double.Gi
- an array ofinvalid reference
double
Ti
- an array ofinvalid reference
double
Tk
- an array ofinvalid reference
double
- Returns:
- a double.
-
totalEnergy
public double totalEnergy(PolarizableMultipole mI, PolarizableMultipole mK, double scaleEnergy, double[] energyComponents) Permanent Multipole + Polarization Energy.- Parameters:
mI
- PolarizableMultipole at site I.mK
- PolarizableMultipole at site K.scaleEnergy
- a double.energyComponents
- The permanent and induced energy components.- Returns:
- a double.
-
setR
public final void setR(double[] r) Set the separation vector.- Parameters:
r
- The separation vector.
-
setR
public abstract void setR(double dx, double dy, double dz) Set the separation vector.- Parameters:
dx
- Separation along the X-axis.dy
- Separation along the Y-axis.dz
- Separation along the Z-axis.
-
generateTensor
public final void generateTensor(double[] r) For the MultipoleTensorTest class and testing.- Parameters:
r
- an array ofinvalid reference
double
-
generateTensor
public void generateTensor()Generate the tensor using hard-coded methods or via recursion. -
source
protected abstract void source(double[] T000) Generate source terms for the Challacombe et al. recursion.- Parameters:
T000
- Location to store the source terms.
-
ti
protected final int ti(int dx, int dy, int dz) The index is based on the idea of filling tetrahedron.1/r has an index of 0.
derivatives of x are first; indices from 1..o for d/dx..(d/dx)^o
derivatives of x and y are second; base triangle of size (o+1)(o+2)/2
derivatives of x, y and z are last; total size (o+1)*(o+2)*(o+3)/6
This function is useful to set up masking constants:
static int Tlmn = ti(l,m,n,order)
For example the (d/dy)^2 (1/R) storage location:
static int T020 = ti(0,2,0,order)- Parameters:
dx
- int The number of d/dx operations.dy
- int The number of d/dy operations.dz
- int The number of d/dz operations.- Returns:
- int in the range (0..binomial(order + 3, 3) - 1)
-
contractMultipoleI
Contract multipole moments with their respective electrostatic potential derivatives.- Parameters:
mI
- PolarizableMultipole at site I.T
- array of electrostatic potential and partial derivativesl
- apply (d/dx)^l to the potentialm
- apply (d/dy)^l to the potentialn
- apply (d/dz)^l to the potential- Returns:
- the contracted interaction.
-
potentialMultipoleI
Collect the field at R due to Q multipole moments at the origin (site I).- Parameters:
mI
- PolarizableMultipole at site I.T
- Electrostatic potential and partial derivativesl
- apply (d/dx)^l to the potentialm
- apply (d/dy)^l to the potentialn
- apply (d/dz)^l to the potential
-
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- Parameters:
r
- The separation vector.tensor
- The tensor elements.- Returns:
- The tensor recursion code.
- Since:
- 1.0
-
codePotentialMultipoleI
protected void codePotentialMultipoleI(PolarizableMultipole mI, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at K due to multipole moments at the origin.- Parameters:
mI
- PolarizableMultipole at site I.T
- Electrostatic potential and partial derivatives.l
- apply (d/dx)^l to the potential.m
- apply (d/dy)^l to the potential.n
- apply (d/dz)^l to the potential.sb
- Append the code to the StringBuilder.
-
codePotentialMultipoleISIMD
protected void codePotentialMultipoleISIMD(PolarizableMultipole mI, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at K due to multipole moments at the origin using SIMD instructions.- Parameters:
mI
- PolarizableMultipole at site I.T
- Electrostatic potential and partial derivatives.l
- apply (d/dx)^l to the potential.m
- apply (d/dy)^l to the potential.n
- apply (d/dz)^l to the potential.sb
- Append the code to the StringBuilder.
-
codePotentialMultipoleK
protected void codePotentialMultipoleK(PolarizableMultipole mK, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at the origin due to multipole moments at site K.- Parameters:
mK
- PolarizableMultipole at site I.T
- Electrostatic potential and partial derivatives.l
- apply (d/dx)^l to the potential.m
- apply (d/dy)^l to the potential.n
- apply (d/dz)^l to the potential.sb
- Append the code to the StringBuilder.
-
codePotentialMultipoleKSIMD
protected void codePotentialMultipoleKSIMD(PolarizableMultipole mK, double[] T, int l, int m, int n, StringBuilder sb) Collect the potential its partial derivatives at the origin due to multipole moments at site K using SIMD instructions.- Parameters:
mK
- PolarizableMultipole at site I.T
- Electrostatic potential and partial derivatives.l
- apply (d/dx)^l to the potential.m
- apply (d/dy)^l to the potential.n
- apply (d/dz)^l to the potential.sb
- Append the code to the StringBuilder.
-
multipoleEnergy
Contract a multipole with the potential and its derivatives.- Parameters:
m
- PolarizableMultipole at the site of the potential.- Returns:
- The permanent multipole energy.
-
multipoleGradient
Compute the permanent multipole gradient.- Parameters:
m
- PolarizableMultipole at the site of the potential.g
- The atomic gradient.
-
multipoleTorque
Compute the torque on a permanent multipole.- Parameters:
m
- PolarizableMultipole at the site of the potential.torque
- an array ofinvalid reference
double
-
dipoleTorque
Compute the torque on a permanent dipole.- Parameters:
m
- PolarizableMultipole at the site of the potential.torque
- an array ofinvalid reference
double
-
quadrupoleTorque
Compute the torque on a permanent quadrupole.- Parameters:
m
- PolarizableMultipole at the site of the potential.torque
- an array ofinvalid reference
double
-
polarizationEnergy
Contract an induced dipole with the potential and its derivatives.- Parameters:
m
- PolarizableMultipole at the site of the potential.- Returns:
- The polarization energy.
-
polarizationEnergyS
Contract an induced dipole with the potential and its derivatives.- Parameters:
m
- PolarizableMultipole at the site of the potential.- Returns:
- The polarization energy.
-
getTensor
protected final void getTensor(double[] T) Load the tensor components.- Parameters:
T
- an array ofinvalid reference
double
-
setTensor
protected final void setTensor(double[] T) Set the tensor components.- Parameters:
T
- an array ofinvalid reference
double
-
noStorageRecursion
protected abstract 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.- Parameters:
tensor
- double[] length must be at least binomial(order + 3, 3).
-
noStorageRecursion
protected abstract 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.- Parameters:
r
- double[] vector between two sites.tensor
- double[] length must be at least binomial(order + 3, 3).
-
Tlmnj
protected abstract 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.- 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).
- Since:
- 1.0
-
recursion
protected abstract 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).- Parameters:
tensor
- double[] length must be at least binomial(order + 3, 3).
-
recursion
protected abstract 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).- Parameters:
r
- double[] vector between two sites.tensor
- double[] length must be at least binomial(order + 3, 3).
-
order1
protected abstract void order1()Hard coded computation of the Cartesian multipole tensors up to 1st order. -
order2
protected abstract void order2()Hard coded computation of the Cartesian multipole tensors up to 2nd order. -
order3
protected abstract void order3()Hard coded computation of the Cartesian multipole tensors up to 3rd order. -
order4
protected abstract void order4()Hard coded computation of the Cartesian multipole tensors up to 4th order. -
order5
protected abstract void order5()Hard coded computation of the Cartesian multipole tensors up to 5th order, which is needed for quadrupole-quadrupole forces. -
order6
protected abstract 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. -
multipoleIPotentialAtK
Compute the field components due to multipole I at site K.- 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.- 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 abstract void dipoleIPotentialAtK(double uxi, double uyi, double uzi, int order) Compute the induced dipole field components due to site I at site K.- 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.- 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.- 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.- 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 abstract void dipoleKPotentialAtI(double uxk, double uyk, double uzk, int order) Compute the induced dipole field components due to site K at site I.- 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.- 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).
-