Next Article in Journal
The Use of High-Throughput Transcriptomics to Identify Pathways with Therapeutic Significance in Podocytes
Previous Article in Journal
On the Modulatory Roles of Neuregulins/ErbB Signaling on Synaptic Plasticity
Previous Article in Special Issue
Polyelectrolyte-Nanoplatelet Complexation: Is It Possible to Predict the State Diagram?
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A New Relatively Simple Approach to Multipole Interactions in Either Spherical Harmonics or Cartesians, Suitable for Implementation into Ewald Sums

by
Christian J. Burnham
and
Niall J. English
*
School of Chemical and Bioprocess Engineering, University College Dublin, Belfield, Dublin 4, Ireland
*
Author to whom correspondence should be addressed.
Int. J. Mol. Sci. 2020, 21(1), 277; https://doi.org/10.3390/ijms21010277
Submission received: 13 November 2019 / Revised: 12 December 2019 / Accepted: 20 December 2019 / Published: 31 December 2019
(This article belongs to the Special Issue Computational Approaches in Materials Science)

Abstract

:
We present a novel derivation of the multipole interaction (energies, forces and fields) in spherical harmonics, which results in an expression that is able to exactly reproduce the results of earlier Cartesian formulations. Our method follows the derivations of Smith (W. Smith, CCP5 Newsletter 1998, 46, 18.) and Lin (D. Lin, J. Chem. Phys. 2015, 143, 114115), who evaluate the Ewald sum for multipoles in Cartesian form, and then shows how the resulting expressions can be converted into spherical harmonics, where the conversion is performed by establishing a relation between an inner product on the space of symmetric traceless Cartesian tensors, and an inner product on the space of harmonic polynomials on the unit sphere. We also introduce a diagrammatic method for keeping track of the terms in the multipole interaction expression, such that the total electrostatic energy can be viewed as a ‘sum over diagrams’, and where the conversion to spherical harmonics is represented by ‘braiding’ subsets of Cartesian components together. For multipoles of maximum rank n, our algorithm is found to have scaling of n 3.7 vs. n 4.5 for our most optimised Cartesian implementation.

1. Introduction

Point-charge electrostatic models have been a mainstay of molecular simulation for years. Increasing in sophistication, many authors have also implemented dipole interactions, such that the electrostatics on each nuclear site is modelled by the combination of a dipole and a charge, which requires that the simulation code be capable of calculating both charge–dipole and dipole–dipole interactions in addition to the usual charge–charge interactions required for point charge models. This presented particular problems for treatment of long-range interactions, as typically handled by an Ewald sum, or related schemes, as such algorithms were initially developed for the case of point charge models, and thus needed to be modified in order to account for dipole interactions. Fortunately, the problem of adapting Ewald sums for dipoles has largely been solved, and, Smith [1] in particular has provided a formulation which is well organised and easy to follow.
In recent years, some groups have moved even beyond the dipole level, exploring the use of yet higher terms in the multipole expansion of the charge distribution, where the terms in the next three ranks are referred to by names quadrupole, octopole and hexadecapole. Again though, the problem is faced—how to implement these terms in a simulation code, and how to modify an Ewald sum, or similar algorithm, such that it can properly handle the higher order multipoles interactions.
There is currently a strong need for such methods, given that there now exist reliable convenient methods to partition the charge distribution from electronic-structure calculations into atomic multipoles residing on each nuclear site, with the most notable method being the Distributed Multipole Analysis (DMA) approach of Stone and coworkers [2,3,4]. DMA provides a particularly appealing route for the construction of accurate empirical models, because researchers should now be able take the values of atomic multipoles as output from a DMA analysis as input for their models. However, doing this depends, of course, on the ability to write code which can calculate the required multipole interactions, and this is far from trivial.
Progress has been made, with popular molecular-dynamics packages, such as DL-POLY [5] and TINKER [6] having functionality to evaluate potential-energy surfaces with multipole interactions. So, in a sense, this is a solved problem, but it is still worth exploring, given the complexity of the current approaches, if there are any ways to simplify the mathematical and computational approaches for computing multipole interactions.
Smith’s method can, in principle, be used up to arbitrary rank, and his original paper even includes the terms up to quadrupole. However, there is a noticeable increase in complexity and computational cost incurred by going up to higher ranks, such that the quadrupole terms are both more difficult to both derive and to calculate than the dipole terms, and, it seems like it would be a significant undertaking to extend this approach to yet higher ranks.
However, it was recently shown by Lin [7] that we do not have to derive the higher multipole terms “by hand”, as it were. Instead, it is possible to derive a more general formula which more or less automatically generates the expression for any degree multipole, without resorting to increasingly tedious algebra.
It is true that past formulations by Smith and others [8,9] are extendable to arbitrarily higher rank multipoles, but Lin’s work is, to our best knowledge, the first to give such a direct closed form expression for the interaction between multipoles of any rank. However, even Lin’s extension to Smith’s approach suffers from a drawback, which is that they both choose to evaluate the multipole interaction in Cartesians. Furthermore, this is a problem because, as it turns out, the Cartesian representation of multipoles is highly redundant. This is due to the presence of symmetries in the Cartesian representation, resulting in the use of far more numbers than is strictly required to represent each multipole, making it hard to calculate the multipole interactions in the minimal number of operations.
Bearing this in mind, it is possible to make many optimisations in the Cartesian implementation, such that these redundancies have relatively minimal impact. Most notably, it is possible to take advantage of the fact that the traces of the Cartesian tensors do not contribute to the total energies/forces of the multipole interaction, and so remove them, an approach that has been used with success by both Lin and Huang [10,11]. It is also possible to write the required sums in such a way that the redundancy from the remaining tensor symmetries is reduced.
However, to increase computational efficiency even further, what is really needed is an expression in which the multipoles are described by a completely non redundant basis. Furthermore, it has long been known that this is provided by moving from a Cartesian representation to spherical harmonics.
It could be argued that a Cartesian-multipole representation is more compatible with existing molecular dynamics codes, given they are normally mostly written in Cartesians. Furthermore, it is certainly true that most people prefer thinking in terms of Cartesians, than the somewhat complex spherical harmonics. However, the spherical harmonics approach ultimately proves to be faster, and more elegant, and so is arguably worth the extra effort for codes which make heavy use of multipoles.
Writing the interaction in terms of spherical harmonics is usually regarded as a formidable task, requiring mastery of the mathematics of manipulating these objects, and intimate knowledge of the spherical harmonics’ properties. Furthermore, the complexity is further multiplied when it comes to modifying the treatment of long-range interactions, such as when handled by Ewald sums. Even so, a derivation of the Ewald sum for multipoles has been given by Leslie [12], who described his implementation of multipoles in the DL-MULTI software package, which can be interfaced with DL-POLY [5] molecular dynamics software package. Leslie gave the expression for the Ewald sum form of the multipole interaction in terms of Stone’s S functions. These functions, which are derived in ref. [13], act give the interaction tensor components between two multipoles on different sites, each described in their local reference frames, where the necessary orientational information is described by Wigner rotation matrices, and where the S function also contains a spherical harmonic, which acts to mediate the interaction between.
Another derivation has recently been given by Simmonett et al. [14] who proposed a method for converting the Ewald sum into the spherical harmonic formulation of Stone, which required the aid of symbolic algebra package to derive. Furthermore, the resulting expression requires the calculation of hard to interpret ‘contamination terms’ in the tensorial interactions between the multipoles, which arise from the modification of the multipole interaction due to the Gaussian screening functions that are present in the real-space part of the Ewald sum. Although the above derivations appear complete and satisfactory, they do depend on fairly technical knowledge, which is presumably why many in the community have been slow to implement such approaches.
In the present contribution, we aim to rectify this situation by providing a surprisingly straightforward derivation of the multipole interaction in spherical harmonics which, unusually, does not require any detailed technical knowledge of the theory of spherical harmonics. Our method provides a direct connection between the Cartesian and spherical harmonic representations, such that it becomes straightforward to transform between the two representations, and our final expressions lend themselves to being easily implemented in Ewald sum type methods. Now, we seek to provide a comprehensive account of the full development of this Cartesian formulation, so this will necessarily involve some presentation of relatively well-known, pervious material in the theory and (spherical-harmonics) presentation and treatment of multipoles. Still, in the present contribution, we wish to provide a full, and self-contained development of a Cartesian formulation, in addition to an intuitive associated graphical representation.
We do not claim that the resulting expressions are superior to previous derivations, such as that given by Leslie and Simmonett et al.; we are full of admiration for their work. However, the approach presented here is significantly different to standard derivations, which makes it interesting in itself, and our resulting expressions are also in a different form, though they must be completely equivalent in their predictions, to those obtained with other methods. We also think our approach will be of interest in showing how the Smith and Lin method for Cartesian multipoles can be transformed into a spherical harmonic equivalent, while preserving the essential structure of their solution.
It would, of course, be of enormous interest to find a reasonably direct way of connecting our expressions for the multipole interaction in spherical harmonics to those produced by other derivations. However, this appears far from trivial, given we have taken what seems to be such a radically different approach to that used by other authors.
Our approach is also very much inspired by the work of Applequist [15,16], who published two papers detailing some quite beautiful theorems on the deep connection between homogeneous polynomials and Cartesian tensors, and also on the properties of the Maxwell Cartesian spherical harmonics, which are the natural Cartesian analogues of the spherical harmonics, both of which we will have cause to use in the course of this work.
Our approach is summarised as follows. We first essentially follow the approaches of Smith and Lin to give the multipole interactions in terms of Cartesians. We then proceed to show how this interaction can be converted into spherical harmonic form. This is done with the aid of three key ideas. (i) the use of a diagrammatic representation of the interaction between multipole sites, which greatly clarifies the math, as it turns out the complete interaction can be calculated in a ‘sum over diagrams’ type sense. (ii) the use of spherical harmonics to construct an orthogonal basis for the traceless multipole tensors, such that the Cartesian to spherical harmonic conversion can be achieved by way of Stone’s tables of spherical harmonics, as given in reference [13]. (iii) the recognition that the multipole interaction can be written in terms of so-called tensor inner products, which we will show are proportional to inner products involving spherical harmonics, allowing us to convert the entire multipole interaction into spherical-harmonic form.

2. Results

2.1. The Multipole Expansion

Consider a cluster of N c charges, with charges q m , at positions r + Δ r m , where the Δ is used to signify that the displacements are typically quite small (at least, they are closer to r than any test sites probing the fields from the distribution). We then define the rank-n Cartesian multipole tensors (n = 0,1,…), M ( n ) , of the distribution, with respect to r , according to
M ( n ) = 1 n ! m = 1 N c q m Δ R m ( n )
where Δ R m ( n ) = Δ r m Δ r m Δ r m . . is a tensor product, with Cartesian components Δ R α β γ . . m ( n ) = Δ r α m Δ r β m Δ r γ m . . , in which each Greek index is one of x , y , z , and there being n factors of type Δ r α m in the product. Furthermore, where, for n = 0, the tensor becomes unity: Δ R m ( 0 ) = 1 (see Section 4.1).
Note: In Equation (1), and throughout, we are following Smith in subsuming the inverse factorial in the definition of each multipole, but we warn that other authors use different conventions, and it is important to check which convention is being used when comparing different works.
The rank 0 multipole, M ( 0 ) , which is a scalar, is just the sum of the charge. The rank 1 multipole M ( 1 ) multipole is referred to as the dipole moment, and is a vector with components M x ( 1 ) , M y ( 1 ) , M z ( 1 ) . The rank 2 multipole, M ( 2 ) is called the quadrupole, and has 9 components: M x x ( 2 ) , M x y ( 2 ) , M x z ( 2 ) , etc., and the rank 3 multipole with 27 components is called the hexadecapole, and so on.
It is clear from their definition in Equation (1). that each multipole tensor is symmetric under any permutation of its indices; e.g., for the rank-3 multipole tensor, M α β γ ( 3 ) = M α γ β ( 3 ) = M β γ α ( 3 ) = M β α γ ( 3 ) = M γ α β ( 3 ) = M γ β α ( 3 ) . Furthermore, it can be shown that the same is true in any axis frame. This permutation symmetry means that the multipole tensors belong to a class that are referred to as symmetric tensors, and we will have frequent cause to make use of this symmetry throughout this work.
The multipoles are useful because the electrostatic properties of the cluster can often be written in terms of a rapidly converging series over multipole moments of increasing rank, rather than having to sum over the individual charges themselves. To see this, let us place the charge distribution in a background non-uniform electrostatic potential, ϕ ( r ) . Then, the electrostatic energy, U ( r ) , of the cluster due to ϕ ( r ) is given by
U ( r ) = m q m ϕ ( r + Δ r m )
Now, using the inner product notation A ( n ) , B ( n ) t , where A ( n ) , B ( n ) t indicates an inner product over tensors A ( n ) and B ( n ) (see Section 4.1)
A ( n ) , B ( n ) t = α β γ . . A α β γ . . ( n ) B α β γ . . ( n )
the Taylor series expansion of ϕ ( r + Δ r m ) can be written as
ϕ ( r + Δ r ) = n = 0 1 n ! Δ R ( n ) , ( n ) t ϕ ( r )
where ( n ) = . . with components α β γ . . ( n ) = n / r α r β r γ . . (again, see Section 4.1).
Now, defining the rank n symmetric electrostatic field tensors ϕ ( n ) ( r ) from
ϕ ( n ) ( r ) = ( n ) ϕ ( r )
Furthermore, substituting Equation (4) into Equation (2) and using Equation (1), we can rewrite the energy expression as
U ( r ) = n = 0 M ( n ) , ϕ ( n ) ( r ) t ,
Similarly, it can be shown from the elementary theory of multipoles, and from using another Taylor series expansion, that the electrostatic potential at r , from a charge cluster around the origin, with multipoles M ( n ) is given by
ϕ ( r ) = n = 0 ( 1 ) n M ( n ) , ( n ) t { 1 r } .
where we have set 4 π ϵ 0 = 1 to simplify the formulae.
Thus, assuming the above series converges, and we wish to calculate the electrostatic potential from the charge cluster, we are justified in ignoring the fine details of the charge distribution and just working with its multipoles up to a maximum rank, where these multipoles are calculated from the multipole expansion of the charge distribution in Equation (1), and where we imagine the multipoles are placed on the multipole expansion site, in this case at the origin.

2.2. Traceless Tensors and the Detracing Operator

The trace of a rank 2 tensor is given by the sum of its diagonal elements,
T r ( A ( 2 ) ) = α A α α ( 2 ) .
In general, and following Applequist [15] (Section 2.3), we will define the trace of a rank n symmetric Cartesian tensor as
T r ( A ( n ) ) α β γ . . = χ A α β γ . . χ χ ( n ) ,
where the trace tensor, T r ( A ( n ) ) , is a symmetric tensor of rank n − 2.
Tensors for which T r ( A ( n ) ) = 0 will be referred to as traceless. In fact, we have already encountered two such tensors: (i) the ϕ ( n ) ( r ) tensor, defined in Equation (5) above, and (ii) the ( n ) { 1 / r } tensor which occurs in Equation (7).
To show that the ϕ ( n ) ( r ) tensor is traceless, we combine Equations (5) and (9) to obtain
T r ( ϕ ( n ) ) α β γ . . = α β γ . . ( n 2 ) 2 ϕ ( r ) = 0 ,
where we have used the fact that the electrostatic potential in free space is a solution to Laplace’s eqn, 2 ϕ ( r ) = 0 . Thus, ϕ ( n ) ( r ) is traceless, and, given that 1 / r is just the potential from a unit charge, a similar argument shows that ( n ) { 1 / r } is also traceless.
As an aside, it may be argued that in real systems the Laplacian is not zero, because any real atomic site will experience a non-zero charge-density from the inter-atomic and inter-molecular charge-clouds from the other electrons. However, the standard multipole expansion for the interatomic electrostatic energy does not account for such effects, and they will henceforth be assumed to be zero.
The addition of any two rank n traceless tensors, or the multiplication of a traceless tensor by a scalar will result in another traceless tensor. Thus, the traceless tensors of rank n form a vector subspace of rank n tensors. As such we ought to be able to find a projection operator which projects out the non-traceless part of any rank n symmetric tensor. For example, we might (correctly) guess that the rank 2 tensor A ( 2 ) has the traceless projection A α β t ( 2 ) = r α r β T r { A ( 2 ) } δ α , β / 3 . Furthermore, we will now show how to find this projection in general.
Before we begin, it is convenient to introduce R ( n ) tensors, R ( n ) = r r r r . . , with components R α β γ . . ( n ) = r α r β r γ r δ . . , and where R ( 0 ) = 1 by convention (see Section 4.1).
We will now make use of a theorem due to Hobson, [17] which has been extensively discussed by Applequist, ref [15,16] that the projection of the R ( n ) tensors onto the subspace of traceless tensors is given by
R t ( n ) = D ̂ R ( n ) = ( 1 ) n r 2 n + 1 ( 2 n 1 ) ! ! ( n ) { 1 r }
where D ̂ is the so-called detracing projection operator onto the subspace of traceless tensors, and where R t ( n ) = D ̂ R ( n ) is the traceless tensor resulting from the projection of R ( n ) into that traceless subspace. Furthermore, where that R t ( n ) is traceless follows immediately from the traceless nature of ( n ) { 1 / r } .
Applequist refers to R t ( n ) as the Maxwell Cartesian spherical harmonics, given that these gradients were investigated by James Clerk Maxwell [18], and given that, although they are not orthogonal, they behave in many senses like the Cartesian analogue of the spherical harmonic polynomials, of which more later.
For the moment we can think of the D ̂ operator as being defined by Equation (11), and so our job is to show that D ̂ defined this way is indeed the detracing projection operator.
Firstly, we need a way to express the action of D ̂ on a general degree n tensor. Applequist has provided a closed-form expression for the matrix representation of D ̂ [15], but here we will show a perhaps easier method, which is to infer these coefficients from Equation (11).
This is perhaps easiest shown by way of example. From Equation (11), and calculating the repeated derivatives of 1 / r , we find that
( D ̂ R ( 1 ) ) α = r α
( D ̂ R ( 2 ) ) α β = r α r β r 2 3 δ α , β
( D ̂ R ( 3 ) ) α β γ = r α r β r γ r 2 5 ( r α δ β , γ + r β δ α , γ + r γ δ α , β )
( D ̂ R ( 4 ) ) α β γ δ = r α r β r γ r δ r 2 7 ( r α r β δ γ , δ + ) + r 4 35 ( δ α β δ γ δ + )
where the term in brackets corresponds to a sum over all distinct permutations of the indices.
We can now define the action of the D ̂ operator on a general tensor, A ( n ) , through substituting components of A ( n ) for those of R ( n ) , which gives
( D ̂ A ( 1 ) ) α = A α
( D ̂ A ( 2 ) ) α β = A α β 1 3 χ A χ χ δ α , β
( D ̂ A ( 3 ) ) α β γ = A α β γ 1 5 χ ( A χ χ α δ β , γ + A χ χ β δ α , γ + A χ χ γ δ α , β )
( D ̂ A ( 4 ) ) α β γ δ = A α β γ δ 1 7 χ ( A χ χ α β δ γ , δ + ) + 1 35 χ 1 χ 2 A χ 1 χ 1 χ 2 χ 2 ( δ α β δ γ δ + ) .
We will now show that the D ̂ A ( n ) are traceless. Starting from a result from Applequist [15] (Section 3.3) that it always possible to find r i vectors such that any degree n tensor can be expressed as a linear combination in R i ( n ) , viz
A ( n ) = i C i R i ( n )
We then apply the D ̂ operator to both sides of the above to give
D ̂ A ( n ) = i C i D ̂ R i ( n )
and given that every D ̂ R i ( n ) is traceless we have that D ̂ A ( n ) must also be traceless, which was to be shown.
To show that D ̂ is a proection operator onto the subspace of traceless tensors we first note that every term in ( D ̂ R ( n ) ) α β γ . . in Equations (12)–(15) is of the form
C r 2 m r α r β . . δ γ , δ δ ϵ , η . . ,
where C is some constant and where it is easy to show that there must be m Kronecker deltas if the term is to be dimensionally correct. That each term must be in this form can be shown from induction on the repeated directional derivatives of 1 / r .
Looking again at Equations (12)–(15), we also see that, for each degree n, there is always a first term with m = 0, i.e., containing no factors of r 2 , or Kronecker deltas, which is given by r α r β r γ . . . Again, this can be shown from induction.
Now, consider what happens when we make the substitution from R ( n ) to A ( n ) in expression 22, which gives
C χ 1 , χ 2 . . χ m A χ 1 χ 1 χ 2 χ 2 . . χ m χ m . . α β . . ( n ) δ γ , δ δ ϵ , η . . ,
where the sum involves taking m traces of A ( n ) . Then if A ( n ) = A t ( n ) is a traceless tensor, the above must be equal to zero for every term except the m = 0 term, which is equal to A α β γ . . t ( n ) . Furthermore, it follows that D ̂ A t ( n ) = A t ( n ) .
In general, we have that A ( n ) is not traceless, but given that, for any A ( n ) , we have already shown that D ̂ A ( n ) is traceless, we also have that D ̂ ( D ̂ A ( n ) ) = D ̂ A ( n ) , and so D ̂ D ̂ = D ̂ . It follows that D ̂ is the detracing projection operator, which projects onto the entire subspace of traceless tensors.

2.3. The Multipole Interaction in Terms of Traceless Tensors

In this section, we will show how the multipole interaction can be written in terms of traceless tensors.
We begin with an observation that If A ( n ) is a rank n tensor and B t ( n ) is a traceless tensor of the same rank, then the inner product A ( n ) , B t ( n ) t = D ̂ A ( n ) , B t ( n ) t .
To see this, write A ( n ) = A t ( n ) + A ( n ) , where A t ( n ) = D ̂ A ( n ) is the traceless part of A ( n ) , and A ( n ) is the non-traceless remainder, then A ( n ) , B t ( n ) t = 0 , because A ( n ) is completely outside the traceless subspace as a result of this decomposition, by construction, and the result follows.
We will now show that the traces of the multipole tensors make no contribution to the energies forces and torques, and so can be set to zero if desired.
Given that ϕ ( n ) ( r ) is traceless, we can use the above theorem to show that the inner product in Equation (6) can be written as either M ( n ) , ϕ ( n ) ( r ) t = M t ( n ) , ϕ ( n ) ( r ) t , and similarly, the inner product in Equation (7) can also be written using either M ( n ) or M t ( n ) , without making any difference to the result.
We have shown that the energy of a multipole in a background field is independent of its trace, and the field from a multipole, as given by Equation (7) is also independent of the multipole traces. Thus, the energies of any set of interacting multipoles are also independent of their traces, and the same is true for all the forces and torques being that they involve gradients of the energy.
Finally, we will show that the electrostatic potential from a multipole distribution at a given point in space can be written in terms of the traceless tensors R t ( n ) and M t ( n ) . Substitution of Equation (11) into Equation (7) gives
ϕ ( r ) = n = 0 ( 2 n 1 ) ! ! r 2 n + 1 M ( n ) , R t ( n ) t .
Furthermore, given the claim at the start of this section, we could use the substitutions M ( n ) , R t ( n ) t = M t ( n ) , R t ( n ) t = M t ( n ) , R ( n ) t in the above.

2.4. The Multipole Interaction Generating Formula

The ( n ) { 1 / r } gradients play a central role in the theory of multipoles, as should already be evident from the last section. However, as shown by Smith, the Ewald sum analogue of the multipole interaction requires the calculation of more general gradients, in which spherically symmetric functions, here written as B ( r ) , are substituted for the 1 / r terms in equalities like Equation (7). That is, instead of calculating the ( n ) { 1 / r } gradients, we will now be interested in finding gradients ( n ) { B 0 ( r ) } , with the knowledge that, should we wish to find results for the non-Ewald regular multipole expansion then we can simply set B ( r ) = 1 / r in the final expressions.
In particular, the Ewald sum analogue to the normal multipole formulae requires using the kernel B ( r ) = e r f c ( α r ) / r , where erfc(x) is the complimentary error function, which corresponds to the interaction of a unit charge with a negative Gaussian ‘screening’ density, where the screening density is of the form ρ ( r ) = A e x p ( a 2 r 2 ) (suitably normalised).
To simplify these gradient calculations, Smith defines the radial functions, B m ( r ) , where the zeroth term is given by B 0 ( r ) = B ( r ) , and with the higher order terms defined according to
B m + 1 ( r ) = B m ( r ) / r
from which it follows that if B 0 ( r ) = 1 / r , then B 1 ( r ) = 1 / r 3 , B 2 ( r ) = 3 / r 5 , and, in general, B m ( r ) = ( 2 m 1 ) ! ! / r 2 m + 1 , where ! ! is the double factorial.
As might be expected, the expressions are somewhat more complicated when the B 0 ( r ) = e r f c ( α r ) / r kernel is used, but the repeated derivatives for these functions can be readily evaluated in terms of Gaussian functions.
It is instructive to calculate the first few terms in the directional gradients of the B 0 ( r ) functions. Begin by recalling that for a general spherically symmetric function, f ( r ) , we have that f ( r ) / r α = f ( r ) r α / r . It then follows that
r α B m ( r ) = r α B m + 1 ( r )
from which the first two directional derivatives evaluate to
B 0 ( r ) r α = B 1 ( r ) r α ( = r α r 3 )
and
2 B 0 ( r ) r α r β = B 2 ( r ) r α r β B 1 ( r ) δ α , β ( = 1 r 5 ( 3 r α r β δ α , β r 2 ) )
where the terms in brackets are the results for the particular choice of B 0 ( r ) = 1 / r , and where we note that these terms can be written in terms of the Maxwell Cartesian spherical harmonics we encountered in Equation (11).
It is of course possible to continue calculating higher-order terms in this fashion, but the main point we want to make here is that the first two directional derivatives of B 0 ( r ) above contain terms in B l ( r ) , for some value of l ; in general, as a consequence of the chain rule, it can be shown that gradient terms in every order can be expressed as a series in B l ( r ) , where the l th derivative requires calculated functions up to the l th term.
Returning to the multipole problem, suppose that there are two multipole sites, i and j , at locations r i and r j respectively, each of which carry a set of multipoles of different ranks, where the multipoles are placed at the site locations. Then the electrostatic energy of this pair is due to each multipole on site i interacting with every multipole on site j , which can be determined by first evaluating the field at r j from the multipoles at r i according to Equation (7), and then calculating the energy of the multipoles on j in the presence of that field according to Equation (5). Labelling this energy U j i ( r j i ) , we obtain
U j i ( r j i ) = d j = 0 M j ( d j ) , j ( d j ) t d i = 0 ( 1 ) d i M i ( d i ) , j ( d i ) t { B 0 ( r j i ) }
where r j i = r j r i is the inter-site vector, r j i = | r j i | , j ( d i ) are the directional derivatives with respect to r j and where we have used the more general form containing the B 0 ( r j i ) kernel.
Similarly to how we found that every order term in the repeated derivatives of B 0 ( r ) contain a series in B l ( r ) , it is not difficult to see that the same must be true for the interaction energy, U j i ( r j i ) , and, following Smith, we can make this clear by collecting terms in B l ( r j i ) to write
U j i ( r j i ) = l = 0 B l ( r j i ) G j i l ( r j i )
where the G j i l ( r j i ) functions can be thought of as coefficients in B l ( r j i ) .
Evaluating these functions would seem to require calculating and summing over the ( n ) { B ( r ) } terms ‘by hand’, as it were, which would involve much tedious algebra. However, a closed form solution has been given by Lin [7], (cf. equation 4.3 in Lin’s paper) and we simply state without proof that it is given by
G j i l ( r j i ) = d i + d c + d j = l C d i , d c , d j ( M i ( d i + d c ) . d i . R j i ( d i ) ) , ( M j ( d j + d c ) . d j . R j i ( d j ) ) t ,
where R ( n ) = r r r . . (see Section 4.1); the multipoles are all assumed to be traceless; the notation A . d . B indicates a d-fold contraction over the tensor indices of A and B (again, see Section 4.1); d i is the number of contractions in the bracket containing M i ; d j is the number of contractions in the bracket containing M j ; d c is the number of contractions acting in the centre, between the two brackets, which we have expressed as an inner product; and where C d i , d c , d j are integer combinatorial coefficients, given by
C d i , d c , d j = ( 1 ) d j ( d c + d i ) ! ( d c + d j ) ! d i ! d c ! d j ! .
We also have that the sum in Equation (31) is over all d i , d j , d c , where d i + d c + d j = l ; d i , d c , d j 0 , i.e., the sum is over all possible terms having l contractions.
We will refer to Equation (31) as the multipole interaction generating formula, as it generates all the terms in the multipole-multipole expansion of the electrostatic energy. Its derivation is not too difficult, if a little tedious, and essentially involves expanding out the repeated derivatives of the B 0 ( r ) functions, and using combinatorics to find the number of symmetrically equivalent terms.
The G j i l ( r ) functions up to rank 3 are given in Section 4.1, from which it is readily apparent that the total number of dots, i.e., the number of contractions, in each term of the l th G j i l ( r j i ) function is equal to l , which is also apparent from the structure of Equation (31).
Claim 1.
The traces of both the M tensors and the R tensors make no contribution to the multipole interaction generating formula.
Sketch of Proof: For the multipoles, this follows straightforwardly from the trace condition that all multipole tensors must be traceless. Furthermore, that the same applies to the R tensors follows from the fact that their indices are completely contracted with the traceless M tensors, and then using a similar argument to that used in Section 1 for the traceless multipoles. Q.E.D.
We have shown that it is possible to detrace the R tensors in the sum of Equation (31). However, we will generally prefer to work with the tensors in their simpler, untraced, form, unless we have cause otherwise.
One of the real advantages of the Smith and Lin method for deriving the multipole interactions is that it provides a clean separation between the G j i l ( r j i ) functions, which depend on the traceless tensor components, and the spherically symmetric kernel dependent part, which are described by the B l ( r j i ) functions. This suggests that the Smith and Lin approach may provide a useful starting point for converting the multipole interaction into spherical harmonics, and later on, we shall show how this can be done.

2.5. The Diagrammatic Representation

It is possible to construct a diagrammatic representation of the multipole interaction generating formula of Equation (31), where one such diagram is shown in Figure 1. The figure shows one term in the formula for l = 6 , corresponding to ( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) . The rules being that each node represents a different tensor, where its rank is given by the number of spokes radiating from the node in question; the number of spokes shared between two nodes is equal to the degree of the contraction acting between the corresponding tensors; and the sign of the diagram is taken to be negative when there are an odd number of bonds connecting the j multipole with its R tensor.
Theorem 1.
The complete expression for the l th G j i l ( r j i ) term involves the sum over all l -bond diagrams, where the spokes on each multipole tensor are treated as distinct, and where no tensor is allowed to bond to itself.
Proof. 
The total number of bonds is equal to the total number of contractions which is given by d i + d c + d j = l , which is the range of the sum in Equation (31). Assume that the spokes on each multipole are distinct, such that it is possible to label the spokes on both multipoles. Then the C d i , d c , d j integer coefficients of Equation (32) are seen to be the number of unique ways of arranging the spokes on both the i and j multipoles for the topology described by contractions d i , d c , d j . Furthermore, the negative sign mentioned above is a consequence of the ( 1 ) d j factor in Equation (32). Q.E.D. □
We also stated that no tensor may bond to itself. Given that a self-bond corresponds to taking the partial trace of a tensor, this rule follows directly from the fact that the traces of the M and R tensors make no contribution to the multipole interaction generating formula, as established in the last section.
The diagrammatic representation is by no means essential for following the math in this work, but it does provide a useful mnemonic for keeping track of the various terms in the multipole interaction. Furthermore, it will be interesting to see whether such a simple picture can still be constructed when we come to convert these expressions into spherical harmonics.

2.6. Forces, Fields, Angular Derivatives and Torques

We are generally interested in more than just calculating the total energy, and for completeness, this section will detail how to calculate the forces, multipole fields, angular derivatives and torques, all of which are commonly required when implementing multipole interactions into molecular-simulation code.
We begin with the forces. Let F j i ( r j i ) = F i j ( r j i ) be the force on multipole site j due to its interaction with multipoles site i , where the total force on j is given by F j = i N F j i ( r j i ) .
The force is found through taking the gradient of Equation (30) and evaluates to
F j i ( r j i ) = r j U j i ( r j i ) = r j i l = 0 B l + 1 ( r j i ) G j i l ( r j i ) l = 0 B l ( r j i ) r j G j i l ( r j i )
where we have used Equation (26) to find the gradient of the B l ( r j i ) function, and where the G j i l ( r j i ) / r j functions are found from taking the gradient of Equation (31), and are given by
r j G j i l ( r j i ) = d i + d c + d j = l C d i , d c , d j [ d i ( M i ( d i + d c ) . d i 1 . R j i ( d i 1 ) ) . d c . ( M j ( d j + d c ) . d j . R j i ( d j ) ) + d j ( M i ( d i + d c ) . d i . R j i ( d i ) ) . d c . ( M j ( d j + d c ) . d j 1 . R j i ( d j 1 ) ) ] .
The G j i l ( r j i ) / r j functions up to rank 3 are listed in Section 4.2.
A diagrammatic representation of one force term is shown in Figure 2, which corresponds to taking the gradient of the interaction from Figure 1. Comparing Figure 1 and Figure 2, it can be seen that taking the gradient results in breaking one of the bonds connecting either the i or j multipole with its R tensor. This leaves the multipole with a bare (or unbonded) spoke, which means that, taken as a whole, we have a diagrammatic representation of a rank 1 vector.
We have already provided an expression for the total energy of the system, but an arguably more elegant expression for the energy is in terms of multipole field tensors, according to
U = 1 2 i N n = 0 M i ( n ) , ϕ i ( n ) t ,
where ϕ i ( n ) is the rank n field tensor on site i , which is defined from
ϕ i ( n ) = U M i ( n )
Equation (35), which is written in terms of multipole fields has the distinct advantage that it allows for an automatic decomposition of the total energy into contributions from the different multipole ranks, i.e., charge, dipole, quadrupole etc. Furthermore, another reason why we may want to calculate the fields is that it greatly simplifies calculation of angular derivatives and torques, to be given in the next section.
The fields can be calculated by finding the derivative of the energy with respect to each multipole. Looking at just one pair of multipole sites, the field on multipole site j due to the multipoles on site i is given by
ϕ j i ( n ) = U j i ( r j i ) M j ( n ) = l = 0 B l ( r j i ) M j ( n ) G j i l ( r j i )
where, taking the derivative of Equation (31) with respect to the multipoles we obtain
M j ( n ) G j i l ( r j i ) = SYMM [ d i + d c + d j = l d c + d j = n C d i , d c , d j ( M i ( d i + d c ) . d i . R j i ( d i ) ) R j i ( d j ) ]
where SYMM indicates that the resulting tensor elements are to be symmetrised over all index permutations, and for their traces to be removed.
This final step is necessary to ensure that the field tensors have the same symmetries as their corresponding multipoles, given that per their definition, the field tensors must be unchanged with respect to any permutation of their indices. Furthermore, the removal of the traces is because the field traces make no contribution to the energy, and so it makes sense that these are set to zero.
A diagrammatic representation of the field calculation is shown in Figure 3, in which the rank 5 field on M i ( 5 ) and the rank 3 field on M j ( 3 ) , corresponding to the multipole interaction in Figure 1, are shown. Both diagrams can be thought of as cutting a multipole free from Figure 1, which corresponds to taking the derivative with respect to that multipole.
In order that we may calculate the angular derivatives of the energy, let O α β be orthogonal rotation matrices which transform vector components from the reference frame to the laboratory frame (see Section 4.1). Furthermore, suppose that O α β = O α β ( ϕ , θ , ψ ) , where ( ϕ , θ , ψ ) are (three) Euler angles (e.g., see ref. [19]) and we wish to find the energy derivatives with respect to these angles. Taking the Euler angle ψ as an example, use the chain rule to obtain the contribution from the rank n multipole as
U ψ = n = 1 α β γ . . U M α β γ . . ( n ) M α β γ . . ( n ) ψ = n = 1 n α β γ . . ϕ α β γ . . ( n ) α β γ . . ψ { O α α } O β β O γ γ . . M α β γ . . r e f ( n )
where we have used Equation (78) from Section 4.1 to relate the components of the multipole tensor to their components in the reference frame, and where the factor of n in the above derives from the index permutation symmetry of ϕ α β γ . . ( n ) and M α β γ . . r e f ( n ) , such that it can be shown that each of the n terms involving derivatives of the rotation matrices are identical, and so can be added together.
The torques may be evaluated from the energy derivatives with respect to rotations about each axis. First consider an infinitesimal rotation by Δ θ α about the α axis. If a vector r has the value r ( Δ θ α ) after the rotation, then we have r ( Δ θ α ) = r + Δ θ α α ̂ × r , which has components
r β ( Δ θ α ) = r β + Δ θ α δ ϵ β α δ r δ
where ϵ α β γ is the Levi-Civita symbol, ϵ x y z = ϵ y z x = ϵ z x y = 1 , ϵ z y x = ϵ y x z = ϵ x z y = 1 , and ϵ = 0 otherwise.
It will prove useful to recast Equation (40) in terms of a rotation matrix. We have r β ( Δ θ α ) = γ O β γ ( Δ θ α ) r γ , where O β γ ( Δ θ α ) is given by
O β γ ( Δ θ α ) = δ β , γ + Δ θ α ϵ β α γ
The components of the torque, t α , are obtained from substitution of the above into Equation (39) to give
t α = U θ α | θ α = 0 = n = 1 n β γ δ ϵ ν . . ϵ α β γ M δ ϵ ν . . β ( n ) ϕ δ ϵ ν . . γ ( n )
where we have used O β γ ( θ α ) / θ α = ϵ β α γ , and O β γ ( 0 ) = δ β , γ , both of which can be deduced from Equation (41).
A diagrammatic representation of the torque for one multipole is given in Figure 4.

2.7. Polynomials and Symmetric Tensors

This section explores the deep connection between homogeneous polynomials and symmetric tensors, covering similar ground to the treatment by Applequist [15].
We begin with introducing some useful notation. Suppose that A α β γ . . ( n ) is a symmetric Cartesian tensor component where the α β γ . . index contains n x occurrences of x , n y occurrences of y and n z occurrences of z . Defining n = ( n x , n y , n z ) , it will be useful to introduce what Applequist refers to as compressed tensor notation, in which we write
A α β γ . . ( n ) = A β α γ . . ( n ) = A β γ α . . ( n ) = . . = A ( n x , n y , n z ) ( n ) = A n ( n )
where, in total, there is a multinomial of n ! / ( n x ! n y ! n z ! ) permutations of the α β γ . . indices belonging to a particular n .
Now suppose that p ( n ) ( r ) is a homogeneous polynomial of degree n, such that p ( n ) ( λ r ) = λ n p ( n ) ( r ) , where λ is a scalar. For example, a degree 3 homogenous polynomial is given by p a ( 3 ) ( r ) = 4 x 3 + 2 y 2 x 5 y 3 .
To express p ( n ) ( r ) in general form, we use compressed notation to write R n ( n ) = x n x y n y z n z , and we will label the monomial coefficient in the R n ( n ) component as P ¯ n ( n ) . The bar is used to signify that the P ¯ n ( n ) are monomial coefficients, although we will shortly see that the P ¯ n ( n ) can also be interpreted as tensor components.
In terms of the polynomial coefficients P ¯ n ( n ) , we can express any degree n homogeneous polynomial as
p ( n ) ( r ) = | n | = n P ¯ n ( n ) R n ( n ) = α β γ . . P α β γ . . ( n ) R α β γ . . ( n ) ,
where the sum is over all values of n = ( n x , n y , n z ) for which n x + n y + n z = n , and where we have also introduced the symmetric Cartesian tensor, P ( n ) .
To clarify the above, it may help to take an example. The second order polynomial, p ( 2 ) ( r ) , can be written as either
p ( 2 ) ( r ) = P ¯ ( 2 , 0 , 0 ) ( 2 ) x 2 + P ¯ ( 0 , 2 , 0 ) ( 2 ) y 2 + P ¯ ( 0 , 0 , 2 ) ( 2 ) z 2 + P ¯ ( 1 , 1 , 0 ) ( 2 ) x y + P ¯ ( 1 , 0 , 1 ) ( 2 ) x z + P ¯ ( 0 , 1 , 1 ) ( 2 ) y z
or
p ( 2 ) ( r ) = P x x ( 2 ) x 2 + P y y ( 2 ) y 2 + P z z ( 2 ) z 2 + 2 P x y ( 2 ) x y + 2 P x z ( 2 ) x z + 2 P y z ( 2 ) y z
where we have used the permutation symmetry of P ( 2 ) .
Equating terms in the polynomial, we have P ¯ ( 2 , 0 , 0 ) ( 2 ) = P x x ( 2 ) , and P ¯ ( 1 , 1 , 0 ) ( 2 ) = 2 P x y ( 2 ) , and similarly for other terms. In general, P α β γ . . ( n ) is related to P ¯ n ( n ) by
P α β γ . . ( n ) = n x ! n y ! n z ! n ! P ¯ n ( n )
where the inverse multinomial coefficients are required due to the permutation symmetry of the α β γ . . indices.
We can also form inner products, P ( n ) , A ( n ) t , which can be evaluated as
P ( n ) , A ( n ) t = α β γ . . P α β γ . . ( n ) A α β γ . . ( n ) = | n | = n P ¯ n ( n ) A n ( n )
Given that P ( n ) encodes all the information in the polynomial coefficients, i.e., there is a one to one mapping between the polynomial coefficients and the tensor components, we can think of P ( n ) as being the symmetric tensor form of P ¯ n ( n ) .
Technically, P ( n ) is a so-called covariant tensor, which transforms under rotations in the opposite sense to R ( n ) . To see why, consider a rotation of the coordinate system
p ( O r ) = α β γ P α β γ . . ( n ) α β γ . . O α β γ . . , α β γ . . ( n ) R α β γ . . ( n ) = α β γ . . ( α β γ O ( n ) α β γ . . , α β γ . . T P α β γ . . ( n ) ) R α β γ . . ( n )
where O ( n ) is the orthogonal tensor rotation matrix, O α β γ . . , α β γ ( n ) = O α α O β β O γ γ . . (See Section 4.1.)
This shows that we can find p ( O r ) from either transforming the components of R ( n ) by the usual orthogonal rotation O ( n ) , or, we can do it by transforming the components of P ( n ) by the inverse rotation O ( n ) T = O ( n ) 1 .
The P ( n ) tensor may also be obtained from the polynomial itself by way of a linear operator, L ̂ = ( 1 / n ! ) ( n ) , according to
P ( n ) = L ̂ p ( n ) ( r ) = 1 n ! ( n ) p ( n ) ( r )
which may be seen by applying the above gradient operator to Equation (44). Note that because we are taking n derivatives of a degree-n homogeneous polynomial that the LHS above is independent of r .
Furthermore, we have that the inverse to Equation (50) is given by
p ( n ) ( r ) = P ( n ) , R ( n ) t .
We now introduce the so-called harmonic polynomials, h ( n ) ( r ) , which are a subset of the p ( n ) ( r ) polynomials which have a vanishing Laplacian, 2 h ( n ) ( r ) = 0 . As an example, one such polynomial is given by h a ( 3 ) = 2 x 3 z + 3 x 2 y 6 x y 2 z y 3 , for which it may be confirmed that Δ h a ( 3 ) = 0 .
The harmonic polynomials are of particular interest, as their corresponding symmetric tensors, given by H ( n ) = ( 1 / n ! ) ( n ) h ( n ) ( r ) , are traceless, due to the vanishing Laplacian condition on h ( n ) ( r ) , i.e.,
γ H α β . . γ γ ( n ) = 1 n ! n 2 r α r β . . 2 h ( n ) ( r ) = 0 .
Thus, the linear operator, L ̂ = ( 1 / n ! ) ( n ) , together with its inverse in Equation (51), establishes an isomorphism between the vector spaces of harmonic polynomials of degree n, and symmetric traceless tensors of rank n.
The harmonic polynomials, or equivalently the rank n traceless tensors are spanned by 2n + 1 linearly independent vectors. To see this, first consider the components, A n , of a rank n symmetric Cartesian tensor for which it is a simple matter to show that there are N s = ( n + 1 ) ( n + 2 ) / 2 possible values of n = ( n x , n y , n z ) for which n x + n y + n z = n . Furthermore, the trace condition imposes N t = n ( n 1 ) / 2 constraints. To see this, take the trace tensor, T r ( A ( n ) ) from Equation (9), which is a degree n − 2 symmetric tensor, having components T r ( A ( n ) ) α β γ . . = χ A α β γ . . χ χ ( n ) , where clearly, each component is independent, and as such the trace tensor is described by n ( n 1 ) / 2 linearly independent vectors, all of which must be independently equal to zero in order that A ( n ) be traceless. This leaves us with N s t = N s N t = 2 n + 1 degrees of freedom for both the rank n traceless tensors and the degree n harmonic polynomials.

2.8. Spherical Harmonics as a Basis for Traceless Symmetric Tensors

The discussion at the end of the last section referred to the fact that symmetric traceless tensors can in principle be spanned by a minimal set of 2n + 1 linearly independent vectors. It would obviously be advantageous to work in a representation in which just this number of components are used, and in this section we shall show how this can be done using spherical harmonics, which provide a natural orthonormal basis for traceless tensors.
We begin by defining what we will refer to as the spherical inner product, , s , not to be confused by our tensor inner product, , t , which is given by
p a ( m ) , p b ( n ) ) s = p a ( m ) ( ϕ , θ ) p b ( n ) ( ϕ , θ ) d S
where the superscripts a and b label two homogeneous polynomials of order m and n, respectively, and we have switched to spherical coordinates. (Also note, here we are using real polynomials, but either one of p a ( n ) , or p b ( n ) in the integral would need to be replaced by its complex conjugate in the full complex case, in order that , s be a true inner product.)
We now state a theorem which will allow us to convert between the tensor inner product of traceless tensors and the spherical inner product of harmonic polynomials.

A Theorem on the Equivalence of Two Inner Products

Suppose that h ( n ) ( r ) is a degree n harmonic polynomial, and H ( n ) = ( 1 / n ! ) ( n ) h ( n ) ( r ) is its traceless tensor equivalent, then the spherical inner product, h a ( n ) , h b ( n ) s , and the tensor inner product, H a ( n ) , H b ( n ) t , are in a constant ratio for each rank, according to
h a ( n ) , h b ( n ) s = 4 π n ! ( 2 n + 1 ) ! ! H a ( n ) , H b ( n ) t .
The above theorem may seem like it would be easy to derive through standard algebraic methods, but in fact, it is surprisingly hard to obtain and our derivation ended up being quite technical. Thus, we will leave the mathematical details to Section 4.4 through Section 4.6; Section 4.5, we show that the two inner products are proportional, whilst in Section 4.6 we derive the proportionality constant. We should also note that similar expressions to Equation (54) have been developed by Ehrentraut and Muschik, [20] (especially Section 4 in this reference) although using a quite different approach to the one taken here.
From the theory of spherical harmonics, a complete orthogonal basis (with respect to the spherical inner product) for degree harmonic polynomials is provided by the spherical harmonics (technically, the regular solid harmonics), which comprise a set of 2n + 1 real harmonic polynomials orthogonal over the unit sphere, such that, writing the spherical harmonic polynomials as q i ( n ) ( r ) , we have that
q i ( m ) , q j ( n ) s q i ( m ) s q j ( n ) s = δ i , j δ m , n
where q i ( m ) s = q i ( m ) , q i ( m ) s is the norm of q i ( m ) ( r ) , and similarly for q j ( n ) ( r ) .
A note on the nomenclature. Strictly speaking, a spherical harmonic can be used to describe any harmonic polynomial confined to the unit sphere. However, here we will use the term spherical harmonic polynomial to refer specifically to the set of q i ( n ) ( r ) polynomials, which are orthogonal over the unit sphere.
By application of Equation (50), we can also define the traceless tensor form of the spherical harmonics, which we will call Q i ( n ) , from
Q i ( n ) = 1 n ! ( n ) q i ( n ) ( r ) .
which, using Equation (51), has an inverse given by
q i ( n ) ( r ) = Q i ( n ) , R ( n ) t = | n | = n Q ¯ n i ( n ) R n ( n )
The spherical harmonic polynomials up to rank 3 are given in Table 1, adapted from Stone [13].
Given the orthogonality of the spherical harmonic polynomials from Equation (55) and given the inner product equivalence from Equation (54), we also have that, under suitable normalisation,
Q i ( n ) , Q j ( n ) t = δ i , j .
A note on the normalisation: Here, we are choosing the normalisation such that Equation (58) above holds, i.e., Q i ( n ) 2 = 1 . So that the q i ( n ) ( r ) are consistent with the Q i ( n ) according to Equation (56), we have, by way of Equation (54), that the q i ( n ) ( r ) polynomials should be normalised according to q i ( n ) 2 = 4 π n ! / ( 2 n + 1 ) ! ! .
Thus the Q i ( n ) provide an orthogonal basis for the traceless symmetric rank n tensors, and as such, we can express any symmetric traceless rank n tensor as a linear sum in Q i ( n ) , according to
A ( n ) = k = 1 2 n + 1 A k ( n ) Q k ( n )
and taking the inner product of both sides of Equation (59) above with respect to Q i ( n ) shows that A i ( n ) , the components of A ( n ) in the spherical harmonic basis are given by
A i ( n ) = Q i ( n ) , A ( n ) t = | n | = n Q ¯ n i ( n ) A n ( n )
where we use the convention that spherical harmonic components are to be indexed by modern roman lower case letters, as opposed to Greek for the Cartesian indices.
Conversion of traceless tensors from Cartesians to spherical harmonics according to Equation (60) is perhaps most easily done through consulting tables of spherical harmonics polynomials, such as those given by Stone [13]. Furthermore, for convenience, the spherical harmonic polynomials up to rank 3 are listed in Table 1, which is adapted from Stone.
As an example, from Table 1 (Section 4.7), we have that the spherical harmonic q 4 ( 3 ) = 3 / 2 z ( x 2 y 2 ) , which gives, A 4 ( 3 ) = 3 / 2 ( A z x x A z y y ) , and given that q 1 ( 2 ) = ( 6 / 6 ) ( 3 z 2 r 2 ) , we have that A 1 ( 2 ) = ( 6 / 6 ) ( 3 A z z ( A x x + A y y + A z z ) ) , and so on.
The spherical harmonic representation comes in particularly useful for calculating inner products; for, we can use the orthogonality of spherical harmonics to write
A ( n ) , B ( n ) t = i , j = 1 2 n + 1 A i ( n ) B j ( n ) Q i ( n ) , Q j ( n ) t = i = 1 2 n + 1 A i ( n ) B i ( n )
Thus, it can be seen that calculating an inner product in spherical harmonics requires the minimal 2n + 1 operations for that rank, which is an enormous saving over the 3 n multiplications required for naively multiplying all of the A α β γ . . ( n ) B α β γ . . ( n ) matrix Cartesian components together [21,22].
We have seen how the Q n i ( n ) coefficients allow for transformation of Cartesians into spherical harmonics. There is also an inverse transformation, given by R k α β γ . . ( n ) , which are the components of R α β γ . . ( n ) projected onto the spherical harmonic basis, and which can be used to transform the components in the spherical harmonic basis back to Cartesians.
Furthermore, once again, Stone has provided tables which give a very convenient way for carrying out these transformations; Table 2, which is also adapted from Stone, provides the relevant information.
As an example, from Table 2, we have that x y 2 = ( 1 / 2 ) q 6 ( 3 ) ( 15 / 30 ) q 2 ( 3 ) , from which it follows that, if we have spherical harmonic components A k ( 3 ) , then A x y y ( 3 ) = ( 1 / 2 ) A 6 ( 3 ) ( 15 / 30 ) A 2 ( 3 ) .
We conclude this section with a discussion of what Applequist [15] has called the detracing operator.
Suppose that T ( n ) is an in-general non-traceless symmetric tensor. Given that the spherical harmonics form a complete orthonormal basis for the subspace of traceless rank n tensors, the detracing operator D ̂ n can be written in spherical harmonics as
D ̂ T ( n ) = i = 1 2 n + 1 T ( n ) , Q i ( n ) t Q i ( n )
One application of D ̂ is in particular worth noting. Applying the above expression for R ( n ) , and using Equation (57) to make the substitution R ( n ) , Q i ( n ) t = q i ( n ) ( r ) gives via Equation (60) that
R i t ( n ) = q i ( n ) ( r ) .
where R t ( n ) = D ̂ R are the traceless projections of the R ( n ) tensors (see Equation (11)), and where we have used R ( n ) , Q i ( n ) t = D ̂ R ( n ) , Q i ( n ) t , which holds because only the traceless component of R ( n ) can contribute to the inner product with the traceless Q i ( n ) .
Thus, the spherical harmonic components of the Maxwell Cartesian spherical harmonics are just the spherical harmonic polynomials themselves.

3. Discussion

3.1. The Multipole Interaction in Spherical Harmonics

In this section, we will aim to convert the various expressions so far developed in Cartesians into their spherical harmonic equivalents.
In the last section, we showed how to convert inner products into spherical harmonics. Furthermore, in this regard, it is unfortunate the multipole interaction generating formula of Equation (31) cannot be expressed entirely in terms of such products, involving as it does problematic contractions of the form C ( d c ) = M ( d i + d c ) . d i . R ( d i ) .
However, even when dealing with such contractions, there is a way of still using the inner product method, which we shall now describe. We introduce what we will refer to as the split-component representation of a symmetric tensor, using the notation T ( n a , n b ) , where n = n a + n b is the full rank of the tensor, T ( n a + n b ) , of which T ( n a , n b ) is but one representation. Taking n a = 3 , n b = 2 as an illustrative example, we write the symmetric traceless multipole tensor, M ( 3 , 2 ) , which has Cartesian components
M α β γ , δ ϵ ( 3 , 2 ) = M α β γ δ ϵ ( 5 )
where M ( 3 , 2 ) transforms as a symmetric traceless Cartesian tensor with respect to (i) its before-comma components, (ii) its after-comma components, and (iii) in all its components as a whole. In this representation, an example contraction can now be written as
C α β γ ( 3 ) = δ ϵ M α β γ δ ϵ ( 5 ) R δ ϵ ( 2 ) = δ ϵ M α β γ , δ ϵ ( 3 , 2 ) R δ ϵ ( 2 )
which behaves like an inner product with respect to the after-comma components, and, as such, can be readily evaluated in spherical harmonics.
We proceed by separately transforming the before-comma and after-comma components of M α β γ , δ ϵ ( 3 , 2 ) into spherical harmonics, and, using transformations of the sort described by Equation (60), we have that
M i , j ( 3 , 2 ) = α β γ δ ϵ Q α β γ i ( 3 ) Q δ ϵ j ( 2 ) M α β γ δ ϵ ( 5 ) ,
where Q δ ϵ j ( 2 ) is used to transform M α β γ , δ ϵ ( 3 , 2 ) M α β γ , k ( 3 , 2 ) , and Q α β γ i ( 3 ) is used to transform M α β γ , k ( 3 , 2 ) M j , k ( 3 , 2 ) . (As discussed in the last section, these transformations are easiest done by way of tables of spherical harmonics, suitably implemented into code.)
Also, and referring to the discussion of the detracing operator of Equation (62), the R ( n ) tensor components are transformed as R α β ( n ) R i t ( n ) = q i ( n ) ( r ) , and so the desired contraction can now be written in spherical harmonics as
C a ( 3 ) = b = 1 5 M a , b ( 3 , 2 ) q b ( 2 ) ( r )
Notes:
(i)
The concept of a split component representation can be made quite general. If we wished to, we could use a mixed Cartesian-spherical harmonic representation, such as M α β γ , k ( 3 , 2 ) , or we could choose to use more than one; for instance, M a , b , c ( 3 , 2 , 1 ) is a valid split of M ( 6 ) . However, no matter how we choose the split, or the base, it is still referring to the same underlying tensor, and, if necessary, one can always recover all the original components from the by taking the appropriate inverse transformations.
(ii)
The rank-1 spherical harmonics are just x, y and z (see Table 1, in Section 4.7), from which it follows that a rank 1 tensor has spherical harmonic components T a ( 1 ) = T x ( 1 ) , T y ( 1 ) , T z ( 1 ) , the same as in Cartesians. Furthermore, in general, we have that T α , β , γ , . ( 1 , 1 , 1 , . . ) = T α β γ . . ( n ) .
(iii)
The split component representation is symmetric with regards to any permutation of its components, e.g., T a , b ( m , n ) = T b , a ( n , m ) , and T a , b , c ( l , m , n ) = T c , a , b ( n , l , m ) = T c , b , a ( n , m , l ) , and so on.
(iv)
The transformations can all be done by way of the table method explained in the last section. That is, we do not have to carry out tedious matrix multiplications, but can instead just use Table 1 suitably implemented into code to convert the Cartesians into spherical harmonic components.
At this stage it will prove useful to return to the diagrammatic representation.
Figure 5’s top illustrates the equivalence between different representations of the tensors in spherical harmonics and Cartesian coordinates. The example given is of a traceless symmetric rank 4 tensor, which can be represented as either T ( 1 , 1 , 1 , 1 ) , or T ( 2 , 1 , 1 ) , or T ( 2 , 2 ) , or T ( 3 , 1 ) , or T ( 4 ) , where the Cartesian coordinates are, as usual, represented by spokes, and where the transformation to spherical harmonics is depicted by braiding any number of spokes together. Of course, this is just a visual metaphor, but it is intended to convey how the transformation into spherical harmonics intertwines (through taking linear combinations of) multiple Cartesian indices into one spherical harmonic index.
The next line, in Figure 5’s middle, shows how energy term, ( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) , depicted in Figure 1, can be converted to spherical harmonics, through performing the braidings M α β γ δ ϵ i ( 5 ) M a , b i ( 3 , 2 ) , M α β γ j ( 3 ) M a , b j ( 2 , 1 ) , R α β j i ( 1 ) q a ( 1 ) ( r j i ) and R α β γ j i ( 3 ) q a ( 3 ) ( r j i ) , and then calculating the contractions according to
( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) = a = 1 7 b = 1 5 q b ( 3 ) ( r j i ) M b , a i ( 3 , 2 ) c = 1 3 M a , c j ( 2 , 1 ) q c ( 1 ) ( r j i ) .
Furthermore, the final diagrammatic equation, in Figure 5’s bottom, shows how to convert the gradient of the above term into spherical harmonics, which requires the additional braiding M α β γ δ ϵ i ( 5 ) M a , ν , c i ( 2 , 1 , 2 ) .
The methods developed here can be used to transform any contraction, and thus, we are now in a position to transform the entire multipole interaction, energies and forces and fields, into spherical harmonics. We begin with the multipole interaction generating formula of Equation (31), which in spherical harmonics is given by
G j i l ( r j i ) = d i + d c + d j = l C d i , d c , d j a = 1 2 d c + 1 b = 1 2 d i + 1 q b ( d i ) ( r j i ) M b , a i ( d i , d c ) c = 1 2 d j + 1 M a , c j ( d c , d j ) q c ( d j ) ( r j i ) .
The spherical harmonic analogue to Equation (34), which gives the gradient terms necessary for the force calculations (per Equation (31)) is given by
r γ j G j i l ( r j i ) = d i + d c + d j = l C d i , d c , d j a 2 d c + 1 [ d i b = 1 2 d i 1 q b ( d i 1 ) ( r j i ) M b , γ , a i ( d i 1 , 1 , d c ) c = 1 2 d j + 1 M a , c j ( d c , d j ) q c ( d j ) ( r j i ) + d j c = 1 2 d i + 1 q c ( d i ) ( r j i ) M c , a i ( d i , d c ) b = 1 2 d j 1 M a , γ , b j ( d c , 1 , d j 1 ) q b ( d j 1 ) ( r j i ) ]
and the spherical harmonic analogue to Equation (38), which gives the derivatives necessary for the multipole fields (per Equation (37)) is given by
M j ( n ) G j i l ( r j i ) = SYMM [ d i + d j + d c = l d c + d j = n C d i , d c , d j ( b = 1 2 d i + 1 q b ( d i ) ( r j i ) M b , a i ( d i , d c ) ) q c ( d j ) ( r j i ) ] .
This last expression needs some explanation. Each term in the sum has a tensor representation of type T a , c ( d c , d j ) , but given that the sum is over d c , d j , the quantity in square brackets will result in a sum in different split component representations, e.g., for rank 4, the sum will have the form S ( 4 ) = c 4 T ( 4 ) + c 3 , 1 T ( 3 , 1 ) + c 2 , 2 T ( 2 , 2 ) , where the representations do not in general refer to symmetric tensors. However, once the full sum has been evaluated, it can be symmetrised by converting the result back into Cartesians, before averaging over all permutations of the Cartesian indices.
The electrostatic potential at r , from a multipole expansion at the origin can be found from the above by taking the rank 0 multipole derivative and then using Equation (37) to obtain
ϕ ( r ) = l = 0 B l ( r ) a = 1 2 l + 1 q a ( l ) ( r ) M a ( l ) = l = 0 B l ( r ) M ( l ) , R ( l ) t
where the last term can be derived from the first, or obtained from taking the rank 0 multipole derivative of Equation (38), and where we note that it reduces to Equation (22) for the kernel B 0 ( r ) = 1 / r .
Finally, the spherical harmonic analogue for Equation (42), giving the total torque on a multipole site is given by
t α = n = 1 n i = 1 2 n 1 β γ ϵ α β γ M i , β ( n 1 , 1 ) ϕ i , γ ( n 1 , 1 )
Equations (69)–(73) then comprise our final expressions for the multipole interaction in spherical harmonics, in a form suitable for implementation into the Ewald sum. Here, we should admit that we have not given spherical harmonic equivalents for rotation of the multipoles, or for calculation of the angular derivatives (Equation (39)). We currently prefer to keep these in Cartesians for simplicity, but given that both these calculations can be performed outside the main ij particle loop, there is no significant computational cost to their calculation.

3.2. Implementation

It may be a cause for worry that implementing the expressions in the last section is technically very difficult, or computationally costly; however, neither of these things is true.
As far as the implementation goes, it is true that, due to the amount of ‘book-keeping’ required, implementing the multipole interaction in either Cartesians or spherical harmonics is a moderately difficult coding task, but implementing Equations (69)–(73), does not need to be any more difficult than implementing the same sums in Cartesians.
As for computational cost, note that, contrary to a perennial myth, implementation of the multipole interaction in spherical harmonics does not require the calculation of any expensive trigonometric functions. All of the necessary coordinate transformations can be done using Table 1, suitably implemented into code, obviating the need for any explicit matrix multiplication or calculation of trigonometric functions (see Section 4.7). It is true that the spherical harmonic transformations may need to be evaluated afresh each step of a simulation, but the required transformations can be done exclusively outside the main ij particle loop, which almost always takes up the vast majority of time in a calculation. These transformations can be done in a time that’s linear with the number of particles, and which, in any case require no operations more complex than the multiplication of real numbers. Furthermore, the final expressions in spherical harmonics require fewer operations than their Cartesian equivalents to calculate, thus providing an overall saving in computational time.
Implementation is greatly aided by the use of tests to verify the results at each stage.
We begin with the energies, where numerical differentiation can be used to check that the multipole interactions are giving the right energies for each rank.
Suppose we are confident that the multipole interactions are accurate to rank n. Then, it can be checked that the rank n + 1 multipoles are also giving the right results by comparing the analytic energies for rank n + 1 multipoles against numerical results found from numerical differentiation of the rank n multipoles.
One way of doing this is, given rank-n multipole M ( n ) , we construct a fictitious diatom of bond-length Δ r , in which the first site holds a multipole M ( n ) / Δ r , and the second site holds a multipole M ( n ) / Δ r . Then, as Δ r 0 , a multipole expansion of the diatom as a whole will give a pure rank n + 1 multipole moment. We can now check to see how the energy of this diatom in the field of other rank n multipoles compares to the energy of the system when replacing it by an analytic multipole of rank n + 1, where the analytic multipole is assigned the rank n + 1 multipole moments of the diatom.
If Δ r is made small enough, it should be possible to obtain exact agreement up to numerical precision. Furthermore, in this way, it is possible to boot-strap our way to checking multipoles of arbitrary rank. We begin with charges, which can be added together to make numerical dipoles. Furthermore, once the analytic dipoles are confirmed, pairs of analytic dipoles can be added to together to make numerical quadrupoles, and so on.
We have implemented our expressions for the energies, fields, forces and torques in spherical harmonics into an Ewald sum code, going up to rank 3 in the multipole expansion. The analytic forces’ torques and angular derivatives were checked by comparison to numerical derivatives.
The reciprocal space and self-interaction parts of the Ewald sum are given in Section 4.7, and given that both these terms involve simple to convert inner products over the multipoles, it is absolutely straightforward to convert the Cartesian multipole form of these expressions as given by Smith [1] into their spherical harmonic equivalents.
We tested our code on a system of 32 molecules each containing 26 nuclei and interacting under periodic boundary conditions, and found about a 22% speed-up upon converting the full Ewald sum to spherical harmonics for multipoles up to rank 3, where the Cartesian form had already been heavily optimised to remove all obviously redundant operations. This is a not insignificant saving, and the difference would only be expected to grow with increasing rank.
We have made a copy of our code available on the Internet [21]. It includes all the gradient tests mentioned in this section, and also includes the aforementioned multipole consistency test, in which numerical rank n + 1 multipoles are created from displacing rank n multipoles.

3.3. Scaling

The implementation of site multipole expansions does not alter the fundamental scaling with respect to the number of particles over that of a calculation involving just point charges, but there is a scaling with respect to the maximum multipole rank used in the expansion, and it is to this we now turn.
To obtain an estimate of this scaling, we will try enumerating the number of multiplications involved in calculating the G j i l ( r ) functions from Equation (31) up to a given rank.
Recall that the inner product of two rank-n tensors requires a minimum of ( n + 1 ) ( n + 2 ) / 2 multiplications in Cartesians (accounting for permutation symmetry), and 2n + 1 multiplications in spherical harmonics. Then, the inner product of Equation (31), which has d i left-bracket contractions, d j right-bracket contractions, and d c between-bracket contractions requires
X d i , d c , d j c a r t = ( ( d i + 1 ) ( d i + 2 ) + ( d c + 1 ) ( d c + 2 ) + ( d j + 1 ) ( d j + 2 ) ) / 2 δ d i , 0 δ d j , 0
multiplications in Cartesians and
X d i , d c , d j S H = ( 2 d i + 1 ) + ( 2 d c + 1 ) + ( 2 d j + 1 ) δ d i , 0 δ d j , 0
multiplications in spherical harmonics, where the δ d i , 0 δ d j , 0 terms in the above two expressions arise from the fact that if d i = 0 , then the corresponding R j i tensor is equal to unity and no multiplication is required (and similarly for d j = 0 ).
To obtain the total number of multiplications involved in calculating the G j i l ( r ) functions for multipoles up to a given rank, we wrote a simple code to sum the values
X ( n ) = l d i + d j + d c = l d i + d c , d j + d c n X d i , d c , d j ,
where X ( n ) is the total number of multiplications, and where we are only summing over terms with multipole ranks d i + d c , d j + d c n .
Finally, to obtain the scaling, we fit the curves Δ X ( n ) = X ( n ) X ( 0 ) up to a maximum rank of n = 8 , with the form Δ X = a n s , where a , s are fitting coefficients, with s being the scaling power.
The result of this exercise was that we found Δ X c a r t ( n ) = 3.5 n 3.8 for Cartesians and Δ X S H ( n ) = 5.8 n 3.3 in spherical harmonics. Thus, the spherical harmonics are expected to have better scaling than the Cartesian case ( s = 3.3 for spherical harmonics vs. 3.8 for Cartesians.)
It is hard to imagine many users would want to go beyond n = 8, but repeating the above in the range n = 1…16 gives a scaling of s = 3.6 for spherical harmonics vs. 4.3 for Cartesians.
This analysis is admittedly quite crude. It does not consider the cost of calculating the forces, the fields, or the cost of array look-ups. It also ignores the fact that at least some of the inner products occur more than once in the calculation of the G j i l ( r ) functions, and so only need to be evaluated once and stored for later use. In light of this, it is worth discussing how our actual implementations perform.
To this end, we ran a 32-molecule test case with each molecule having 26 atoms, for both periodic and non-periodic boundary conditions, and for both spherical harmonics and Cartesian implementations of the multipole interactions, where the periodic simulations employed a full Ewald sum.
We recognise that some groups will be interested in calculations using much larger system sizes, but our code is optimised for crystal-structure prediction using relatively small numbers of molecules, as it often makes sense to look for crystal structures with relatively small simulation cells. Here, we also mention that, unlike many codes, our code allows for arbitrary cut-off radii, [22] where the cut-off sphere is allowed to be larger than can fit in the simulation cell, which means that we can converge energies for even small unit cells, and in this case we employed a real space cut-off of 16 Å .
For the periodic calculation we obtained scalings of s = 3.7 for spherical harmonics, and s = 4.5 for Cartesians, and for the non-periodic calculation we obtained s = 2.7 for spherical harmonics and s = 3.3 for Cartesians; results that are not too dissimilar from our relatively crude theoretical predictions.

4. Materials and Methods

We discuss in this section, by way of technical sub-sections, the underlying intellectual and mathematical infrastructure underpinning the above-discussed novel contributions of the present work outlined in Section 2 and discussed further in Section 3, before summarising and concluding the article in Section 5 below.

4.1. Some Mathematical Properties of Cartesian Tensors and Notation

Let v be a Cartesian vector in R3, which has Cartesian components v . α ̂ = v α , where α is one of x , y or z , and α ̂ is a unit vector in the α direction. If x , y , z is an orthogonal axis set, then α ̂ . β ̂ = δ α , β , where δ α , β = 1 if α = β , and δ α , β = 0 otherwise. Thus, we can write v = α v α α ̂ , where the sum is over the three directional indices, x , y and z .
Now suppose we also have a reference set of axes, given by x ̂ r e f , y ̂ r e f and z ̂ r e f , where α ̂ r e f . β ̂ r e f = δ α , β , then O α β = α ̂ . β ̂ r e f is the orthogonal 3 × 3 rotation matrix, which takes the reference-frame components to the components in the laboratory frame via
v α = β O α β v β r e f
Now, let T ( n ) = α β . . T α β γ . . ( n ) α ̂ β ̂ γ ̂ . . be a tensor of rank n, which has Cartesian components T α β γ . . ( n ) , where the number of indices is equal to its rank, and where the tensor components transform according to
T α β γ . . ( n ) = α β γ . . O α α O β β O γ γ . . T α β γ . . r e f ( n ) = α β γ . . O α β γ . . , α β γ ( n ) T α β γ . . r e f ( n ) ,
where there are n occurrences of the rotation matrix in the above, and where we have defined the orthogonal tensor rotation matrix O ( n ) , with components
O α β γ . . , α β γ ( n ) = O α α O β β O γ γ . . ,
We will generally use the superscript notation (n) to indicate the rank of each tensor, except in a small number of cases where the rank can be inferred from counting its indices. To distinguish different tensors of the same kind and rank, we will often also use the superscript to give labels to the tensors, e.g., if we have two rank-n tensors we wish to label a and b, then we will use the notation T a ( n ) and T b ( n ) , which have components T α β γ . . a ( n ) and T α β γ . . b ( n ) .
Almost all of the tensors used in this work are symmetric with respect to the permutation of their indices, e.g., T α β γ = T α γ β = T β γ α = T β α γ = T γ α β = T γ β α , and we will refer to such tensors as symmetric.
We now turn to a discussion of tensor contractions. We will only give a brief overview, but we note that Applequist has written extensively on this topic, and the interested reader should consult his work [15].
Suppose that A ( i ) and B ( j ) are two such symmetric tensors. We introduce the notation A : n : B to indicate a contraction over n indices of two such tensors, e.g.,
G γ δ ϵ ( 3 ) = ( A ( 3 ) . 2 . B ( 4 ) ) γ δ ϵ = α β A α β γ ( 3 ) B α β δ ϵ ( 4 ) ,
is a contraction over 2 indices, and
G δ ( 1 ) = ( A ( 3 ) . 3 . B ( 4 ) ) δ = α β γ A α β γ ( 3 ) B α β γ δ ( 4 ) ,
is a contraction over 3 indices.
Furthermore, in general, the contraction A ( i ) . n . B ( j ) results in a symmetric tensor of rank i + j − 2n.
For small numbers of contractions, we can use the alternative notation that a contraction is indicated by vertical dots, where the number of dots is equal to the degree of the contraction, e.g., A ( i ) . B ( j ) = A ( i ) . 1 . B ( j ) , A ( i ) : B ( j ) = A ( i ) . 2 . B ( j ) , and A ( i ) B ( j ) = A ( i ) . 3 . B ( j ) .
Now consider the contraction s = A ( n ) . n . B ( n ) , where A ( n ) , and B ( n ) are traceless rank (n) tensors, and the result, s , is a scalar. It is easy to show that this contraction forms an inner product on the vector space of all rank-d tensors. Thus, we will use the notation
A ( n ) , B ( n ) t = A ( n ) . n . B ( n ) = α β γ . . A α β γ . . ( n ) B α β γ . . ( n ) .
To prove that the above is a genuine inner product, we first use the fact that symmetric rank-n tensors form a vector space, that is, the addition of any two rank-n symmetric tensors results in another rank-n symmetric tensor, and the multiplication of any symmetric rank-n tensor by a scalar also results in another rank-n symmetric tensor. Then, we can show that on this vector space, (i) A ( n ) , B ( n ) t is always a scalar. (ii) for any scalar, s : s A ( n ) , B ( n ) t = s A ( n ) , B ( n ) t (linearity), (iii) A ( n ) , B ( n ) t = B ( n ) , A ( n ) t (symmetry), and (iv) A ( n ) , A ( n ) t 0 . (positive defiteness). Which are the four conditions required for A ( n ) , B ( n ) t to be an inner product.
It remains to be shown that the inner product is the same in any axis frame, such that it operates on the tensors, and not just their components.
Firstly, working in the lab-axis frame, if a , b , c , d are any rank 1 Cartesian vectors, then a b : c d = ( a . c ) ( b . d ) . From which it follows that if we have axes defined by orthogonal unit vectors α ̂ and α ̂ , where one is rotated with respected to the other, then α ̂ β ̂ : γ ̂ δ ̂ = A α γ A β δ , where A α γ = α . γ ̂ are the components of the rotation matrix which transforms between the two frames.
Now, suppose we expand out the inner product of two rank 2 tensors C ( 2 ) and D ( 2 ) , where the latter’s components are calculated in the α ̂ frame, then, writing D α β for the components in this frame we have
α β C α β α ̂ β ̂ : γ δ D γ δ γ ̂ δ ̂ = α β C α β γ δ A α γ A β δ D γ δ = α β C α β D α β
which is the same as if both tensors components were calculated in the same frame. Thus, C ( n ) , D ( n ) t is the same no matter the frame each tensor’s components are calculated in, and the same goes for all tensor inner products in general.
Finally, it is useful to define the tensors
R ( n ) = r r r r . . ,
with components R α β γ . . ( n ) = r α r β r γ r δ . . , where the number of r s is equal to its rank. It can be readily seen that R ( m ) R ( n ) = R ( m + n ) , which implies that R ( 0 ) = 1 .
Similarly, we define the tensors
( n ) = . . ,
where α = / r α , and α β γ . . ( n ) = n / r α r β r γ . .   F u r t h e r m o r e , again, we have that ( m ) ( n ) = ( m + n ) , which implies that ( 0 ) = 1 .

4.2. The G j i l ( r ) Functions up to Rank 3

The following lists the G j i l ( r ) functions defined from Equation (31) (and surrounding text) up to multipoles of rank 3. These formulae agree with those derived by Smith, [1] who calculated terms up to rank 3, except that here we list only those terms which occur for traceless multipole tensors.
G j i 0 ( r j i ) = ( M i ( 0 ) ) ( M j ( 0 ) )
G j i 1 ( r j i ) = ( M i ( 1 ) . R j i ( 1 ) ) ( M j ( 0 ) ) ( M j ( 1 ) . R j i ( 1 ) ) ( M i ( 0 ) ) + ( M i ( 1 ) ) . ( M j ( 1 ) )
G j i 2 ( r j i ) = ( M i ( 1 ) . R j i ( 1 ) ) ( M j ( 1 ) . R j i ( 1 ) ) + 2 ( M i ( 2 ) . R j i ( 1 ) ) . ( M j ( 1 ) ) 2 ( M j ( 2 ) . R j i ( 1 ) ) . ( M i ( 1 ) ) + ( M i ( 2 ) : R j i ( 2 ) ) ( M j ( 0 ) ) + ( M j ( 2 ) : R j i ( 2 ) ) ( M i ( 0 ) ) + 2 ( M i ( 2 ) ) : ( M j ( 2 ) )
G j i 3 ( r j i ) = 4 ( M i ( 2 ) . R j i ( 1 ) ) . ( M j ( 2 ) . R j i ( 1 ) ) ( M i ( 2 ) : R j i ( 2 ) ) ( M j ( 1 ) . R j i ( 1 ) ) + ( M j ( 2 ) : R j i ( 2 ) ) ( M i ( 1 ) . R j i ( 1 ) ) + ( M i ( 3 ) R j i ( 3 ) ) M j ( 0 ) ( M j ( 3 ) R j i ( 3 ) ) M i ( 0 ) + 3 ( M i ( 1 ) ) . ( M j ( 3 ) : R j i ( 2 ) ) + 3 ( M j ( 1 ) ) . ( M i ( 3 ) : R j i ( 2 ) ) 6 ( M i ( 2 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) + 6 ( M j ( 2 ) ) : ( M i ( 3 ) . R j i ( 1 ) ) + 6 ( M i ( 3 ) ) ( M j ( 3 ) )
G j i 4 ( r j i ) = ( M i ( 2 ) : R j i ( 2 ) ) ( M j ( 2 ) : R j i ( 2 ) ) ( M i ( 3 ) R j i ( 3 ) ) ( M j ( 1 ) . R j i ( 1 ) ) ( M j ( 3 ) R j i ( 3 ) ) ( M i ( 1 ) . R j i ( 1 ) ) 6 ( M i ( 3 ) : R j i ( 2 ) ) . ( M j ( 2 ) . R j i ( 1 ) ) + 6 ( M j ( 3 ) : R j i ( 2 ) ) . ( M i ( 2 ) . R j i ( 1 ) ) 18 ( M i ( 3 ) . R j i ( 1 ) ) : ( M j ( 3 ) . R j i ( 1 ) )
G j i 5 ( r j i ) = ( M i ( 3 ) R j i ( 3 ) ) ( M j ( 2 ) : R j i ( 2 ) ) ( M j ( 3 ) R j i ( 3 ) ) ( M i ( 2 ) : R j i ( 2 ) ) + 9 ( M i ( 3 ) : R j i ( 2 ) ) . ( M j ( 3 ) : R j i ( 2 ) )
G j i 6 ( r j i ) = ( M i ( 3 ) R j i ( 3 ) ) ( M j ( 3 ) R j i ( 3 ) )

4.3. The G j i l ( r j i ) / r j Functions up to Rank 3

The following lists the G j i l ( r j i ) / r j functions given by Equation (34), up to rank 3 in the multipoles. These formulae agree with those derived by Smith, [1] who calculated terms up to rank 3, except that here we list only those terms which occur for traceless multipole tensors.
G j i 0 ( r j i ) / r j = 0
G j i 1 ( r j i ) / r j = ( M i ( 1 ) ) ( M j ( 0 ) ) ( M j ( 1 ) ) ( M i ( 0 ) )
G j i 2 ( r j i ) / r j = ( M i ( 1 ) ) ( M j ( 1 ) . R j i ( 1 ) ) ( M i ( 1 ) . R j i ( 1 ) ) ( M j ( 1 ) ) + 2 ( M i ( 2 ) ) . ( M j ( 1 ) ) 2 ( M j ( 2 ) ) . ( M i ( 1 ) ) + 2 ( M i ( 2 ) . R j i ( 1 ) ) ( M j ( 0 ) ) + 2 ( M j ( 2 ) . R j i ( 1 ) ) ( M i ( 0 ) )
G j i 3 ( r j i ) / r j = 4 ( M i ( 2 ) ) . ( M j ( 2 ) . R j i ( 1 ) ) 4 ( M i ( 2 ) . R j i ( 1 ) ) . ( M j ( 2 ) ) 2 ( M i ( 2 ) . R j i ( 1 ) ) ( M j ( 1 ) . R j i ( 1 ) ) ( M i ( 2 ) : R j i ( 2 ) ) ( M j ( 1 ) ) + 2 ( M j ( 2 ) . R j i ( 1 ) ) ( M i ( 1 ) . R j i ( 1 ) ) + ( M j ( 2 ) : R j i ( 2 ) ) ( M i ( 1 ) ) + 3 ( M i ( 3 ) : R j i ( 2 ) ) M j ( 0 ) 3 ( M j ( 3 ) : R j i ( 2 ) ) M i ( 0 ) + 6 ( M i ( 1 ) ) . ( M j ( 3 ) . R j i ( 1 ) ) + 6 ( M j ( 1 ) ) . ( M i ( 3 ) . R j i ( 1 ) ) 6 ( M i ( 2 ) ) : ( M j ( 3 ) ) + 6 ( M j ( 2 ) ) : ( M i ( 3 ) )
G j i 4 ( r j i ) / r j = 2 ( M i ( 2 ) . R j i ( 1 ) ) ( M j ( 2 ) : R j i ( 2 ) ) + 2 ( M i ( 2 ) : R j i ( 2 ) ) ( M j ( 2 ) . R j i ( 1 ) ) 3 ( M i ( 3 ) : R j i ( 2 ) ) ( M j ( 1 ) . R j i ( 1 ) ) ( M i ( 3 ) R j i ( 3 ) ) ( M j ( 1 ) ) 3 ( M j ( 3 ) : R j i ( 2 ) ) ( M i ( 1 ) . R j i ( 1 ) ) ( M j ( 3 ) R j i ( 3 ) ) ( M i ( 1 ) ) 12 ( M i ( 3 ) . R j i ( 1 ) ) . ( M j ( 2 ) . R j i ( 1 ) ) 6 ( M i ( 3 ) : R j i ( 2 ) ) . ( M j ( 2 ) ) + 12 ( M j ( 3 ) . R j i ( 1 ) ) . ( M i ( 2 ) . R j i ( 1 ) ) + 6 ( M j ( 3 ) : R j i ( 2 ) ) . ( M i ( 2 ) ) 18 ( M i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) 18 ( M i ( 3 ) . R j i ( 1 ) ) : ( M j ( 3 ) )
G j i 5 ( r j i ) / r j = 3 ( M i ( 3 ) : R j i ( 2 ) ) ( M j ( 2 ) : R j i ( 2 ) ) + 2 ( M i ( 3 ) R j i ( 3 ) ) ( M j ( 2 ) . R j i ( 1 ) ) 3 ( M j ( 3 ) : R j i ( 2 ) ) ( M i ( 2 ) : R j i ( 2 ) ) 2 ( M j ( 3 ) R j i ( 3 ) ) ( M i ( 2 ) . R j i ( 1 ) ) + 18 ( M i ( 3 ) . R j i ( 1 ) ) . ( M j ( 3 ) : R j i ( 2 ) ) + 18 ( M i ( 3 ) : R j i ( 2 ) ) . ( M j ( 3 ) . R j i ( 1 ) )
G j i 6 ( r j i ) / r j = 3 ( M i ( 3 ) : R j i ( 2 ) ) ( M j ( 3 ) R j i ( 3 ) ) 3 ( M i ( 3 ) R j i ( 3 ) ) ( M j ( 3 ) : R j i ( 2 ) )

4.4. The General Decomposition for Homogeneous Polynomials

This sub-section introduces a standard decomposition for polynomials into mutually orthogonal rotationally invariant subspaces. The results will be used below in Section 4.5, in which we explain how to convert between the tensor and spherical inner products.
A result from the theory of spherical harmonics (e.g., see chapter 2 of ref. [23]): Any degree n homogeneous polynomial, p ( n ) ( r ) , has a unique decomposition given by
p ( n ) ( r ) = m = 0 n / 2 r 2 m h m ( n 2 m ) ( r )
where h m ( n 2 m ) ( r ) is the mth harmonic polynomial, and where, as usual, the degree of the polynomial is placed in brackets, so that h m ( n 2 m ) ( r ) describes a polynomial of degree n−2m. Furthermore, where, the n / 2 in Equation (77) is the smallest integer less than or equal to n / 2 , e.g., 8 / 2 = 4 and 11 / 2 = 5 .
The decomposition of Equation (100) is unique, because each term in the sum resides in a subspace which is mutually orthogonal under the spherical inner product.
To show this, use the result from the theory of spherical harmonics (e.g., chapter 2 of ref. [23]) that for any two harmonic polynomials of degree m and n , the spherical inner product h a ( m ) , h b ( n ) s is zero, unless m = n . Thus, if p m ( n ) ( r ) = r 2 m h m ( n 2 m ) ( r ) , and p m ( n ) ( r ) = r 2 m h m ( n 2 m ) ( r ) , then the spherical inner product, p m ( n ) , p m ( n ) s = h m ( n 2 m ) , h m ( n 2 m ) s is zero unless m = m .
The decomposition of Equation (100) is also complete, because the dimension of the m th subspace is 2 ( n 2 m ) + 1 , and summing over all subspaces gives a dimension of ( n + 1 ) ( n + 2 ) / 2 (which can be proved by induction), which is the full dimension of the vector space of degree n homogeneous polynomials. (For example, if n = 7 , then 2 n + 1 = 15 , and the total dimension is 15 + 11 + 7 + 3 = 36 = ( 7 + 1 ) ( 7 + 2 ) / 2 .)
Now consider a polynomial in the mth subspace, and so of the form p ( n ) ( r ) = r 2 m h ( n 2 m ) ( r ) , and what happens when that polynomial is rotated.
We can rotate the polynomial through calculating p ( n ) ( O r ) , where O is an orthogonal rotation matrix, and where the result of which is p ( n ) ( O r ) = r 2 m h ( n 2 m ) ( O r ) . However, given that the rotation of any harmonic polynomial is still a harmonic polynomial of the same degree, we have that p ( n ) ( O r ) must still belong to the same subspace as p ( n ) ( r ) . Thus, any polynomial which belongs to the mth subspace is guaranteed to remain in that subspace after any rotation.
Furthermore, it can be shown (e.g., chapter 2 of ref. [23]) that each subspace is irreducible, in the sense that it cannot be further divided into rotationally invariant orthogonal subspaces. (Spherical harmonic polynomials of degree n form a 2n + 1 dimensional basis for the irreducible representation of SO(3), the group of all rotations in three dimensions. See also, for example, chapter 8 in ref. [24]).
We can also define associated projection operators, d ̂ m , such that the mth projection operator projects a homogeneous polynomial into the mth subspace, according to.
d ̂ m p ( n ) ( r ) = r 2 m h m ( n 2 m ) ( r )
It was shown in Equation (44) that a degree-n polynomial can be written in the form
p ( n ) ( r ) = α β γ . . P α β γ . . ( n ) R α β γ . . ( n ) .
which allows us to define the associated tensor operators, D ̂ m , according to
d ̂ m p ( n ) ( r ) = α β γ . . ( D ̂ m P ( n ) ) α β γ . . R α β γ . . ( n )
where Equation (103) must define uniquely the D ̂ m , because the polynomial d ̂ m p ( n ) ( r ) is uniquely defined, and there is a one to one correspondence between polynomials and their equivalent tensors.
One iteration of Equation (103) gives
d ̂ m d ̂ m p ( n ) ( r ) = α β γ . . ( D ̂ m D ̂ m P ( n ) ) α β γ . . R α β γ . . ( n )
Consider the case m = m , for which we have d ̂ m = d ̂ m d ̂ m , given that d ̂ m are projection operators. In this case, equating Equations (103) and (104) then implies that D ̂ m D ̂ m = D ̂ m , and so D ̂ m is also a projection operator.
Conversely, for m m , we have that d ̂ m d ̂ m = 0 , because d ̂ m are orthogonal projectional operators, in which case, Equation (104) must equal zero, which can only be possible for all P ( n ) , R ( n ) if D ̂ m D ̂ m = 0 , again for m m ; from which we conclude that the D ̂ m are orthogonal projection operators.
It can be seen from Equation (101) that the d ̂ 0 operator projects polynomials into the space of harmonic polynomials of the same degree, with d ̂ 0 h ( n ) ( r ) = h ( n ) ( r ) for any h ( n ) ( r ) . Given that the tensor equivalent to a harmonic polynomial is traceless, the corresponding D ̂ 0 operator must project tensors into the space of traceless tensors, i.e., we have that D ̂ 0 = D ̂ , the detracing operator.

4.5. Conversion between the Tensor and Spherical Inner Products

This sub-section gives the conversion between the spherical inner product p a ( n ) , p b ( n ) s , defined in Equation (53), and the tensor inner product, P a ( n ) , P b ( n ) t , where P a ( n ) is the tensor equivalent to p a ( n ) ( r ) , and similarly for P b ( n ) and p b ( n ) ( r ) .
We begin by recalling from Equation (44) that any degree n homogeneous polynomial can be written as
p ( n ) ( r ) = α β γ . . P α β γ . . ( n ) R α β γ . . ( n )
Substituting the above into the p a ( n ) , p b ( n ) s spherical inner product gives
p a ( n ) , p b ( n ) s = α β γ . . P α β γ . . a ( n ) α β γ . . R α β γ . . ( n ) , R α β γ . . ( n ) s P α β γ . . b ( n ) ,
which can be rewritten as
p a ( n ) , p b ( n ) s = P a ( n ) , K ̂ P b ( n ) t
where the self-adjoint tensor operator K ̂ is defined from its action on a degree n Cartesian tensor, P ( n ) , according to
( K ̂ P ( n ) ) α β γ . . = α β K α β γ . . , α β γ . . P α β γ . . ,
where K ̂ has matrix elements
K α β γ . . , α β , γ . . = R α β γ . . ( n ) , R α β γ . . ( n ) s .
The components of K ̂ are easiest expressed in compressed notation, in which they are given by
K m , n = x m x + n x y m y + n y z m z + n z d S = 4 π ( m x + n x 1 ) ! ! ( m y + n y 1 ) ! ! ( m z + n z 1 ) ! ! ( 2 n + 1 ) ! ! e m + n
where = m x + m y + m z = n x + n y + n z , and e m + n = 1 if m x + n x , m y + n y and m z + n z are all even, and e m + n = 0 otherwise, and where the integral above was solved using the methods for integrating polynomials over the unit sphere in ref. [25].
Although Equation (110) defines completely the matrix elements of K ̂ , it is not in a very useful form. In the remainder of this section we will show how K ̂ can be put in a more useful form by writing it as a spectral sum in the projection operators, D ̂ m , defined in Section 4.5.
Let R ̂ = R ̂ ( ϕ , θ , ψ ) be a rotation operator, parameterised in terms of Euler angles ϕ , θ , ψ say, which acts to rotate the system, where R ̂ acting on a polynomial rotates the polynomial by Euler angles ϕ , θ , ψ , i.e., R ̂ p ( r ) = p ( R ̂ 1 r ) , where rotation of r can be achieved using orthogonal rotation matrices as described in Section 4.1. We also define the action of R ̂ on tensors, such that if P ( n ) is the tensor equivalent of the polynomial p ( n ) ( r ) , then R ̂ P ( n ) is the tensor equivalent of the polynomial R ̂ p ( n ) ( r ) .
We will now establish that both D ̂ m and R ̂ , and K ̂ and R ̂ always commute, i.e., [ D ̂ m , R ̂ ] = 0 and [ K ̂ , R ̂ ] = 0 . Furthermore, this will allow us to show that K ̂ must be a linear combination of D ̂ m .
We first show that [ D ̂ m , R ̂ ] = 0 . Recall from Section 4.4 that no rotation can move a polynomial, d ̂ m p ( n ) ( r ) , in the mth subspace out of its subspace, which implies that d ̂ m R ̂ = R ̂ d ̂ m , or [ d ̂ m , R ̂ ] = 0 .
Now, given that any polynomial in the mth subspace (with associated projection operator d ̂ m ) is equivalent to a tensor in its mth subspace (with associated projection operator D ̂ m ), it also follows that no rotation of a tensor in its mth subspace can move that tensor out of the mth subspace. (If it could, we could transform a polynomial in the mth subspace into its corresponding tensor, rotate that tensor out of the mth subspace, and then transform back, which would mean that the mth subspace is not rotationally invariant.)
Thus, we also have that D ̂ m R ̂ = R ̂ D ̂ m , or [ D ̂ m , R ̂ ] = 0 , which was to be shown.
We will now show that [ K ̂ , R ̂ ] = 0 . First note that because the spherical inner product is the integral of the product of two polynomials over the unit sphere, we have that rotating both polynomials by the same Euler angles must leave the inner product unchanged. We thus have that
p a ( r ) , p b ( r ) s = R ̂ p a ( r ) , R ̂ p b ( r ) s .
From Equation (107), the LHS above can be rewritten as P a ( n ) , K ̂ P b ( n ) t . Further, we also have that the RHS above can be rewritten as
R ̂ p a ( r ) , R ̂ p b ( r ) s = R ̂ P a ( n ) , K ̂ R ̂ P b ( n ) t = P a ( n ) , R ̂ 1 K ̂ R ̂ P b ( n ) t
where the last part of Equation (112) above comes from applying the inverse rotation, R ̂ 1 , to both sides of the inner product. We thus have that
P a ( n ) , K ̂ P b ( n ) t = P a ( n ) , R ̂ 1 K ̂ R ̂ P b ( n ) t
which implies that K ̂ = R ̂ 1 K ̂ R ̂ , or [ K ̂ , R ̂ ] = 0 , which was to be shown.
We will now show that since [ K ̂ , R ̂ ] = 0 and [ D ̂ m , R ̂ ] = 0 , it follows that K ̂ must be a linear combination of D ̂ m .
Suppose that v is an eigenvector of K ̂ with eigenvalue α . Given that [ K ̂ , R ̂ ] = 0 , we have that
K ̂ R ̂ v = R ̂ K ̂ v = α R ̂ v
It follows that R ̂ v is also an eigenvector of K ̂ , also with eigenvalue α . Thus, v must belong to a degenerate subspace of K ̂ spanned by all eigenvectors of K ̂ with eigenvalue α . Furthermore, this subspace is rotationally invariant, i.e., for any vector v in that subspace R ̂ v also belongs to that subspace. However, we have seen that the orthogonal irreducible rotationally invariant subspaces on the vector space of tensors are described by projection operators D ̂ m , so each one of the mutually orthogonal degenerate eigenspaces of K ̂ is one of the m spaces associated with the D ̂ m projection operators.
Now, given that any symmetric matrix can be expressed as a linear sum: A = i λ i P ̂ i , where P ̂ i is the projection into the ith degenerate eigenspace, with associated eigenvalue λ i , we have that K ̂ can be written in the form
K ̂ = m α m D ̂ m
with the α m to be determined.
As a check, we can take the commutator of both sides of Equation (115) above with respect to R ̂ , which gives
[ K ̂ , R ̂ ] = m α m [ D ̂ m , R ̂ ] = 0
as expected.
Finally, substitution of Equation (116) above into Equation (107) gives
m d ̂ m p a ( n ) , d ̂ m p b ( n ) s = m α n , m D ̂ m P a ( n ) , D ̂ m P b ( n ) t
where we have now included the index n in α n , m given that it is possible these scalars also have a dependence on n, and where we have used
p a ( n ) , p b ( n ) s = m d ̂ m p a ( n ) , d ̂ m p b ( n ) s
However, Equation (117) must hold separately for each value of m, for the mth term on the LHS can only depend on the mth term on the RHS. So we have that
d ̂ m p a ( n ) , d ̂ m p b ( n ) s = α n , m D ̂ m P a ( n ) , D ̂ m P b ( n ) t
which, apart from the α n , m to be determined in the next sub-section (i.e., 4.6) for the m = 0 case, is our final form for the conversion between inner products.

4.6. Proportionality Constants for Conversion between the Tensor and Spherical Inner Products for the Case of Traceless Tensors and Harmonic Functions

In Section 4.5, we developed a general expression (Equation (119)) for the conversion between the spherical and tensor inner products. We will only need the m = 0 case for this present work, for which the D ̂ 0 projection operator is the detracing operator, D ̂ = D ̂ 0 , and the associated d ̂ 0 operator describes a projection onto the space of harmonic polynomials. Thus, for m = 0, Equation (119) can be written as
h a ( n ) , h ( n ) s = α n , 0 H a ( n ) , H b ( n ) t
where H ( n ) are traceless tensors, and h ( n ) ( r ) are their associated harmonic polynomials.
In the present sub-section, it will be shown that the rank-dependent proportionality constants α n , 0 are given by
α n , 0 = 4 π n ! ( 2 n + 1 ) ! !
Note that as the multipole interaction formulae are written in terms of traceless tensors, only the m = 0 case is required for this present work. However, the general approach described here should be extensible to results for higher orders.
Our ‘plan of attack’ is to fix its value by choosing the simplest rank n harmonic polynomials we can think of, which are arguably provided by the so-called zonal spherical harmonics, r n l n ( z / r ) , where l n ( z ) is the nth Legendre polynomial, and where Δ { r n l n ( z / r ) } = 0 . We also have that the zonal spherical harmonics are symmetric about the z axis, which should make them particularly simple to work with.
Again, aiming for simplicity, we will set both h a ( n ) ( r ) and h b ( n ) ( r ) to the same zonal spherical harmonic.
h a ( n ) ( r ) = h b ( n ) ( r ) = r n l n ( z / r )
Now, using the properties of Legendre polynomials, we have that the LHS of Equation (120) is given by
l n , l n s = ϕ = 0 2 π θ = 0 π l n 2 ( c o s ( θ ) ) s i n ( θ ) d θ d ϕ = 2 π z = 1 1 l n 2 ( z ) d z = 4 π 2 n + 1
where we have used the standard formula for Legendre polynomials that the integral of l m ( x ) l n ( x ) over z = 1 to 1 is given by 2 / ( 2 n + 1 ) δ m , n .
We next turn to calculating the equivalent inner product on the RHS of Equation (120). Let L ( n ) be the zonal spherical harmonics in Cartesian tensor form, which using Equation (50) are given by L ( n ) = ( 1 / n ! ) ( n ) { r n l n ( z / r ) } . Given the z symmetry of the zonal harmonics, we have that the L ( n ) must be proportional to D ̂ Z ( n ) , where Z ( n ) = z ̂ z ̂ z ̂ . . . (No other choice would have the right symmetry.)
Taking the inner product of a rank n tensor, e.g., A ( n ) , with Z ( n ) returns the A z z z . . ( n ) component, i.e., A ( n ) , Z ( n ) t = A z z z . . ( n ) , and we will now state two such inner products (to be proved at the end of this section), which will come in useful for the following.
L ( n ) , Z ( n ) t = 1
D ̂ Z ( n ) , Z ( n ) t = n ! ( 2 n 1 ) ! !
Using the last two identities above fixes the proportionality constant between D ̂ Z ( n ) and L ( n ) to give
L ( n ) = ( 2 n 1 ) ! ! n ! D ̂ Z ( n ) .
We can then write
L ( n ) , L ( n ) t = ( 2 n 1 ) ! ! n ! L ( n ) , D ̂ Z ( n ) t = ( 2 n 1 ) ! ! n ! L ( n ) , Z ( n ) t = ( 2 n 1 ) ! ! n !
where we have (i) used Equation (126) to exchange L ( n ) for D ̂ Z ( n ) , (ii) used the fact that L ( n ) is inside the traceless subspace to allow us to exchange D ̂ Z ( n ) for Z ( n ) , and (iii) used Equation (124) above.
Finally, substituting Equations (127) and (123) into Equation (120) fixes α n , 0 = 4 π n ! / ( 2 n + 1 ) ! ! , which is Equation (121).
As promised, we will now provide the proofs of Equations (124) and (125).
To prove Equation (124), we use the identity
z { r n l n ( z / r ) } = n r n 1 l n 1 ( z / r )
which can be proved by algebraic differentiation using the standard identity for the derivative of a Legendre polynomial: l n ( x ) = ( n / ( x 2 1 ) ) ( x l n ( x ) l n 1 ( x ) ) .
Thus, we have that
L ( n ) , Z ( n ) t = L z z z . . ( n ) = 1 n ! n z n { r n l n ( z / r ) } = 1 .
To prove Equation (125), we use the standard generating function for Legendre polynomials
1 ( 1 2 x t + t 2 ) 1 / 2 = n = 0 l n ( x ) t n
Substituting x = c o s ( θ ) and t = r , where c o s ( θ ) = z / r , and recognising that, under these substitutions, the LHS above is now equivalent to | r z ̂ | 1 , we have
1 | r z ̂ | = n = 0 l n ( c o s ( θ ) ) r n
However, the LHS above can also be Taylor-expanded as
1 | r z ̂ | = n = 0 ( 1 ) n n ! Z ( n ) ) , ( n ) t { 1 r } = ( 2 n 1 ) ! ! n ! r 2 n + 1 n = 0 Z ( n ) ) , R t ( n ) t
where we have made use of the expression for the Maxwell Cartesian spherical harmonics from Equation (11).
Comparing Equations (131) and (132), we deduce that
Z ( n ) ) , R t ( n ) t = n ! r 2 n + 1 ( 2 n 1 ) ! ! l n ( c o s ( θ ) ) r n
Now, setting r = 1 and θ = 0 means the LHS becomes equal to Z ( n ) , D ̂ Z ( n ) t , and RHS is given by n ! / ( 2 n 1 ) ! ! , which gives the required identity.

4.7. Ewald-Sum Terms

For completeness, the full Ewald sum is given by (following Smith [1]).
U = 1 2 V k 0 A ( k ) | j N f j ( k ) e x p ( i k . r j ) | 2 + 1 4 π ϵ 0 l = 1 i = 1 N j > i G j i l ( r j i ) B l ( r j i ) + 1 2 i N ϕ i S
where the G j i l ( r j i ) terms are given by Equation (31) for Cartesians, and by Equation (69) for spherical harmonics, and where the kernel B 0 ( r ) = e r f c ( ϵ r ) / r is used, where ϵ is a width parameter, which controls the Gaussian width of the Ewald screening charges, and where the higher order B functions generated by Equation (25).
The k in Equation (134) are reciprocal-lattice vectors: k = 2 π ( n a / L a , n b / L b , n c / L c ) for an orthogonal unit cell of dimensions L a , L b , L c .
f j ( k ) = l = 0 ( i ) l M ( l ) , K ( l ) t
where K ( l ) is the tensor product K ( l ) = k k k . .
The ϕ i S in Equation (134) are so-called self terms, given by
ϕ i S = 1 4 π ϵ 0 l = 0 ( 2 ζ 2 ) l + 1 ( 2 l + 1 ) ζ π M ( l ) , M ( l ) t
Note: A recent paper by Stamm et al. [26] provides a mathematically rigorous derivation of the self terms as given by Smith.
Both Equations (135) and (136) are in the form of inner products, and so can be readily expressed in either Cartesians or in spherical harmonics using Equation (61).

5. Conclusions

We have presented a non-technical—indeed, almost trivial—derivation of the multipole interaction in spherical harmonics, in a form suitable for use with Ewald-sum methods.
We began by summarising one derivation of the multipole interaction in Cartesians, most of which is not new to us, but goes back to the work of Smith and earlier, and continues up to Lin’s derivation of what we refer to as the multipole interaction generating formula.
We then introduced a diagrammatic method for visualising the multipole interactions, in where it was shown that the entire multipole interaction can be represented as a ‘sum over diagrams’, which arguably makes for a much more appealing representation of the interaction than thinking in terms of mathematical formulae alone.
Here, we admit that the results in this work could have been obtained without the aid of diagrams, but given that the diagrams show so clearly the structure of the interaction, we think they provide a valuable insight into what our various algebraic manipulations are actually doing.
Using what we believe to be a novel approach, the remainder of this work showed how the multipole interaction can be converted from Cartesians into spherical harmonics. This involved what was perhaps the key part of this paper, which was (i) the recognition that the multipole interaction in Cartesians involve expressions that can be written as inner products over tensors, (ii) showing that these tensor inner products are proportional to an inner product over the vector space of harmonic polynomials on the unit sphere, (iii) using this relation to convert the Cartesian tensor inner products to spherical inner products involving spherical harmonic polynomials.
The key expression here is Equation (54), which gives the proportionality relation between tensor and spherical inner products. Deriving this relation turns out to be a surprisingly non-trivial problem, but once it has been shown, it becomes a relatively straightforward task to convert the entire multipole interaction from Cartesians into spherical harmonics.
Our method relies on the use of existing tables of spherical harmonics to Cartesian transformations, which have already been given by Stone, and whose properties have been analysed extensively by Stone and others.
Another novelty of our method is that our ‘end-result’ formulae are not pure functions of the spherical harmonic multipoles, like seen in other approaches. Instead, our formulae are functions of split tensor components, which may have several indices, all of which are separately represented in spherical harmonics. However, what really distinguishes our approach from others is that our approach involves fully transforming the between-tensor contractions (bonds in the diagrams) into their spherical harmonic form, while respecting the underlying structure of the contractions; this structure which is particularly evident from the diagrammatic form.
It is surprising to us that such a straightforward conversion method appears to have been overlooked in the literature. It is not clear to us if this method will prove to give superior efficiency when compared to standard approaches, but it is faster than the Cartesian scheme, and it appears to us that our method is comparatively more straightforward and easier to implement than previous approaches. Furthermore, it is our hope that this work will prove a ‘less-painful’ route for the implementation of spherical-harmonic multipole expansions in computational-chemistry codes.

Author Contributions

Conceptualisation, C.J.B.; methodology, C.J.B.; software, C.J.B.; validation, C.J.B.; resources, N.J.E.; writing—original draft preparation, C.J.B.; writing—review and editing, N.J.E.; supervision, N.J.E.; project administration, N.J.E.; funding acquisition, N.J.E. All authors have read and agreed to the published version of the manuscript.

Funding

This research and APC was funded by Enterprise Ireland, grant number CF 2017 0777-P.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Smith, W. Point Multipoles in the Ewald Summation (Revisited). CCP5 Newsl. 1998, 46, 18. [Google Scholar]
  2. Stone, A.J. Distributed Multipole Analysis, or How to Describe a Molecular Charge Distribution. Chem. Phys. Lett. 1981, 83, 233. [Google Scholar] [CrossRef]
  3. Stone, A.J. Distributed Multipole Analysis. Methods and Applications. Mol. Phys. 1985, 56, 1047. [Google Scholar] [CrossRef]
  4. Stone, A.J. Distributed Multipole Analysis: Stability for Large Basis Sets. JCTC 2005, 1, 1128. [Google Scholar] [CrossRef] [PubMed]
  5. Todorov, I.T.; Smith, W. The DL_POLY_4 User Manual. Available online: ftp://ftp.dl.ac.uk/ccp5/DL_POLY/DL_POLY_4.0/DOCUMENTS/USRMAN4.pdf (accessed on 26 December 2019).
  6. Al, J.P.E. Tinker Software Package. Available online: https://dasher.wustl.edu/tinker/ (accessed on 26 December 2019).
  7. Lin, D. Generalized and Efficient Algorithm for Computing Multipole Energies and Gradients Based on Cartesian Tensors. J. Chem. Phys. 2015, 143, 114115. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  8. Sagui, C.; Pedersen, L.G.; Darden, T.A. Towards an accurate representation of electrostatics in classical force fields: Efficient implementation of multipolar interactions in biomolecular simulations. J. Chem. Phys. 2004, 120, 73. [Google Scholar] [CrossRef] [PubMed]
  9. Boateng, H.A.; Todorov, I.T. Arbitrary order permanent Cartesian multipolar electrostatic interactions. J. Chem. Phys. 2015, 142, 034117. [Google Scholar] [CrossRef] [PubMed]
  10. Huang, H.; Shanker, B. Maxwell Cartesian Harmonics and the Static Fast Multipole Method. IEEE Antennas Propag. Soc. Int. Symp. 2006, 4099. [Google Scholar] [CrossRef]
  11. Huang, H.; Luo, L.-S.; Li, R.; Chen, J.; Zhang, H. Improve the Efficiency of the Cartesian Tensor Based Fast Multipole Method for Coulomb Interaction Using the Traces. J. Comput. Phys. 2018, 371, 122–136. [Google Scholar] [CrossRef]
  12. Leslie, M. Dl_Multi—A Molecular Dynamics Program to Use Distributed Multipole Electrostatic Models to Simulate the Dynamics of Organic Crystals. Mol. Phys. 2010, 106, 1567. [Google Scholar] [CrossRef] [Green Version]
  13. Stone, A.J. The Theory of Intermolecular Forces; Oxford University Press: Oxford, UK, 2016. [Google Scholar]
  14. Simmonett, A.C.; Pickard, F.C., IV; Schaefer, H.F., III; Brooks, B.R. An efficient algorithm for multipole energies and derivatives based on spherical harmonics and extensions to particle mesh Ewald. J. Chem. Phys. 2014, 140, 184101. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  15. Applequist, J. Traceless Cartesian Tensor Forms for Spherical Harmonic Functions: New Theorems and Applications to Electrostatics of Dielectric Media. J. Phys. A Math. Gen. 1989, 22, 4303. [Google Scholar] [CrossRef]
  16. Applequist, J. Maxwell Cartesian Spherical Harmonics in Multipole Potentials and Atomic Orbitals. Theor. Chem. Acc. 2001, 107, 103. [Google Scholar] [CrossRef]
  17. Hobson, E.W. The Theory of Spherical and Ellipsoidal Harmonics; Springer: Vienna, Austria, 1931. [Google Scholar]
  18. Maxwell, J.C. A Treatise on Electricity and Magnetism; Macmillan and Co.: New York, NY, USA, 1873. [Google Scholar]
  19. Allen, M.P.; Tildesley, D.J. Computer Simulation of Liquids; Oxford Science Publications: New York, NY, USA, 1987. [Google Scholar]
  20. Ehrentraut, T.H.; Muschik, W. On Symmetric irreducible tensors in d-dimensions. ARI 1998, 51, 149. [Google Scholar] [CrossRef]
  21. Burnham, C.J. XMULTI. Available online: https://github.com/christianjburnham/xmulti (accessed on 26 December 2019).
  22. Burnham, C.J.; English, N.J. Crystal Structure Prediction via Basin-Hopping Global Optimization Employing Tiny Periodic Simulation Cells, with Application to Water−Ice. JCTC 2019, 15, 3889. [Google Scholar] [CrossRef] [PubMed]
  23. Atkinson, K.; Han, W. Spherical Harmonics and Approximations on the Unit Sphere: An Introduction; Springer: Berlin, Germany, 2012. [Google Scholar]
  24. Vvedesnky, D. Group Theory (Course). Available online: http://www.cmth.ph.ic.ac.uk/people/d.vvedensky/courses.html (accessed on 26 December 2019).
  25. Folland, G.B. How to integrate a polynomial over a sphere. Am. Math. Mon. 2001, 108, 446. [Google Scholar] [CrossRef]
  26. Stamm, B.; Lagardère, L.; Polack, E.; Maday, Y.; Piquemal, J.-P. A coherent derivation of the Ewald summation for arbitrary orders of multipoles: The self-terms. J. Chem. Phys. 2018, 149, 124103. [Google Scholar] [CrossRef] [PubMed] [Green Version]
Figure 1. A term in the multipole interaction generating formula for l = 6 , corresponding to ( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) , where the nodes from left to right represent R j i (black circle), M i (red circle), M j (green circle) and R j i (black circle).
Figure 1. A term in the multipole interaction generating formula for l = 6 , corresponding to ( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) , where the nodes from left to right represent R j i (black circle), M i (red circle), M j (green circle) and R j i (black circle).
Ijms 21 00277 g001
Figure 2. A force term obtained from taking the gradient of the term in Figure 1, which equates to 3 ( M i ( 5 ) : R j i ( 2 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) + ( M i ( 5 ) R j i ( 3 ) ) : M j ( 3 ) .
Figure 2. A force term obtained from taking the gradient of the term in Figure 1, which equates to 3 ( M i ( 5 ) : R j i ( 2 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) + ( M i ( 5 ) R j i ( 3 ) ) : M j ( 3 ) .
Ijms 21 00277 g002
Figure 3. Representation of the multipole field terms for the interaction in Figure 1. The spokes radiating from coloured squares represent multipole fields tensors, of rank given by their number of spokes. The star with the central red square represents the rank-5 field tensor on the i site, and the star with the central green square represents the rank-3 field tensor on the j site.
Figure 3. Representation of the multipole field terms for the interaction in Figure 1. The spokes radiating from coloured squares represent multipole fields tensors, of rank given by their number of spokes. The star with the central red square represents the rank-5 field tensor on the i site, and the star with the central green square represents the rank-3 field tensor on the j site.
Ijms 21 00277 g003
Figure 4. The (negative of) the torque on a rank-3 multipole. The red circle represents the multipole, the red square is its rank-3 field, and the circle with the cross represents a rank-1 vector cross product.
Figure 4. The (negative of) the torque on a rank-3 multipole. The red circle represents the multipole, the red square is its rank-3 field, and the circle with the cross represents a rank-1 vector cross product.
Ijms 21 00277 g004
Figure 5. Equivalence of Cartesian and spherical harmonic representations. Top line: Four equivalent ways of representing a rank-4 symmetric traceless tensor. Middle line: two equivalent ways of representing the ( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) tensor product from Figure 1. Bottom: two equivalent ways of representing the gradient of this tensor product. The unbraided spokes represent Cartesian vectors, and the braided spokes are spherical harmonics.
Figure 5. Equivalence of Cartesian and spherical harmonic representations. Top line: Four equivalent ways of representing a rank-4 symmetric traceless tensor. Middle line: two equivalent ways of representing the ( M i ( 5 ) R j i ( 3 ) ) : ( M j ( 3 ) . R j i ( 1 ) ) tensor product from Figure 1. Bottom: two equivalent ways of representing the gradient of this tensor product. The unbraided spokes represent Cartesian vectors, and the braided spokes are spherical harmonics.
Ijms 21 00277 g005
Table 1. Spherical harmonics q i ( n ) ( r ) in Cartesians up to rank 3. Adapted from Stone, and normalised such that Q i ( n ) = 1 , where Q i ( n ) are the tensor forms of the q i ( n ) ( r ) polynomials (see text for details). Here, we are using a simplified labelling scheme, in which the spherical harmonics, q i ( n ) , are identified by their degree, ( n ) , and an index, i , within each degree, where the index runs from 1..2 n + 1 , and the ordering within each degree is (for our purposes) arbitrary.
Table 1. Spherical harmonics q i ( n ) ( r ) in Cartesians up to rank 3. Adapted from Stone, and normalised such that Q i ( n ) = 1 , where Q i ( n ) are the tensor forms of the q i ( n ) ( r ) polynomials (see text for details). Here, we are using a simplified labelling scheme, in which the spherical harmonics, q i ( n ) , are identified by their degree, ( n ) , and an index, i , within each degree, where the index runs from 1..2 n + 1 , and the ordering within each degree is (for our purposes) arbitrary.
Degree 0
q i ( 0 ) = 1
Degree 1
q 1 ( 1 ) = x q 2 ( 1 ) = y q 3 ( 1 ) = z
Degree 2
q 1 ( 2 ) = ( 6 / 6 ) ( 3 z 2 r 2 ) q 2 ( 2 ) = ( 2 ) x z q 3 ( 2 ) = ( 2 ) y z
q 4 ( 2 ) = ( 2 / 2 ) ( x 2 y 2 ) q 5 ( 2 ) = ( 2 ) x y
Degree 3
q 1 ( 3 ) = ( 10 / 10 ) z ( 5 z 2 3 r 2 )    q 2 ( 3 ) = ( 15 / 10 ) x ( 5 z 2 r 2 )
q 3 ( 3 ) = ( 15 / 10 ) y ( 5 z 2 r 2 )    q 4 ( 3 ) = 3 / 2 z ( x 2 y 2 )
q 5 ( 3 ) = 6 x y z    q 6 ( 3 ) = ( 1 / 2 ) x ( x 2 3 y 2 )
q 7 ( 3 ) = ( 1 / 2 ) y ( 3 x 2 y 2 )
Table 2. Cartesians in terms of spherical harmonics, up to rank 3. Adapted from Stone, such that the transformation is the inverse of Table 1.
Table 2. Cartesians in terms of spherical harmonics, up to rank 3. Adapted from Stone, such that the transformation is the inverse of Table 1.
Degree 2
x 2 = ( 6 / 6 ) q 1 ( 2 ) + ( 2 / 2 ) q 4 ( 2 ) y 2 = ( 6 / 6 ) q 1 ( 2 ) ( 2 / 2 ) q 4 ( 2 )
z 2 = ( 6 / 3 ) q 1 ( 2 )     x y = ( 2 / 2 ) q 5 ( 2 )
x z = ( 2 / 2 ) q 2 ( 2 )     y z = ( 2 / 2 ) q 3 ( 2 )
Degree 3
x 3 = ( 1 / 2 ) q 6 ( 3 ) ( 15 / 10 ) q 2 ( 3 )    x 2 y = ( 1 / 2 ) q 7 ( 3 ) ( 15 / 30 ) q 3 ( 3 )
x y 2 = ( 1 / 2 ) q 6 ( 3 ) ( 15 / 30 ) q 2 ( 3 )    y 3 = ( 1 / 2 ) q 7 ( 3 ) ( 15 / 10 ) q 3 ( 3 )
x 2 z = ( 6 / 6 ) q 4 ( 3 ) ( 10 / 10 ) q 1 ( 3 ) x y z = ( 6 / 6 ) q 5 ( 3 ) y 2 z = ( 6 / 6 ) q 4 ( 3 ) ( 10 / 10 ) q 1 ( 3 ) x z 2 = 2 ( 15 / 15 ) q 2 ( 3 ) y z 2 = 2 ( 15 / 15 ) q 3 ( 3 )     z 3 = ( 2 / 5 ) q 1 ( 3 )

Share and Cite

MDPI and ACS Style

Burnham, C.J.; English, N.J. A New Relatively Simple Approach to Multipole Interactions in Either Spherical Harmonics or Cartesians, Suitable for Implementation into Ewald Sums. Int. J. Mol. Sci. 2020, 21, 277. https://doi.org/10.3390/ijms21010277

AMA Style

Burnham CJ, English NJ. A New Relatively Simple Approach to Multipole Interactions in Either Spherical Harmonics or Cartesians, Suitable for Implementation into Ewald Sums. International Journal of Molecular Sciences. 2020; 21(1):277. https://doi.org/10.3390/ijms21010277

Chicago/Turabian Style

Burnham, Christian J., and Niall J. English. 2020. "A New Relatively Simple Approach to Multipole Interactions in Either Spherical Harmonics or Cartesians, Suitable for Implementation into Ewald Sums" International Journal of Molecular Sciences 21, no. 1: 277. https://doi.org/10.3390/ijms21010277

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop