This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Pathwise Differentiation of Worldline Path Integrals

Jonathan B. Mackrory Department of Physics and Oregon Center for Optical, Molecular and Quantum Science, 1274 University of Oregon, Eugene, Oregon 97403-1274    He Zheng Department of Physics and Oregon Center for Optical, Molecular and Quantum Science, 1274 University of Oregon, Eugene, Oregon 97403-1274    Daniel A. Steck Department of Physics and Oregon Center for Optical, Molecular and Quantum Science, 1274 University of Oregon, Eugene, Oregon 97403-1274
Abstract

The worldline method is a powerful numerical path-integral framework for computing Casimir and Casimir–Polder energies. An important challenge arises when one desires derivatives of path-integral quantities—standard finite-difference techniques, for example, yield results of poor accuracy. In this work we present methods for computing derivatives of worldline-type path integrals of scalar fields to calculate forces, energy curvatures, and torques. In Casimir–Polder-type path integrals, which require derivatives with respect to the source point of the paths, the derivatives can be computed by a simple reweighting of the path integral. However, a partial-averaging technique is necessary to render the differentiated path integral computationally efficient. We also discuss the computation of Casimir forces, curvatures, and torques between macroscopic bodies. Here a different method is used, involving summing over the derivatives of all the intersections with a body; again, a different partial-averaging method makes the path integral efficient. To demonstrate the efficiency of the techniques, we give the results of numerical implementations of these worldline methods in atom–plane and plane–plane geometries. Being quite general, the methods here should apply to path integrals outside the worldline context (e.g., financial mathematics).

I Introduction

The Casimir effect is a fundamental consequence of quantum fields interacting with boundaries [1]. It typically arises as an attractive force between material bodies due to modifications of vacuum fluctuations by the presence of the bodies [2, 3]. An important experimental technique for measuring Casimir-type forces monitors the change in the frequency of a mechanical oscillator due to the presence of another dielectric body: such experiments are sensitive to the curvature of the Casimir energy. This technique has been applied, for example, to Casimir-force measurements in microelectromechanical systems [4], and also to Casimir–Polder measurements with Bose-Einstein condensates in a magnetic trap near a dielectric mirror [5]. Theoretical predictions of Casimir forces (and corresponding frequency shifts in experiments) require the computation of gradients of the Casimir energy. In general geometries, this requires a numerical approach.

The worldline path-integral method in particular is a promising framework for the numerical computation of Casimir energies [6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]. It continues to be a useful method in various areas of quantum field theory [20, 21, 22, 23, 24]. In this method one generates an ensemble of closed stochastic paths and evaluates the Casimir energy as a functional average over the material properties along the paths. The worldline method has been thus far primarily applied in the case of scalar fields interacting with Dirichlet boundary conditions [7, 8, 9, 10, 11]. For example, this work has been applied to computing Casimir forces and torques for cylinder-plate, sphere-plate, and inclined-plate geometries [12, 14], as well as to computing the stress-energy tensor for parallel planes [16, 18]. More recently, the worldline method has been extended to incorporate the coupling of the electromagnetic field to magnetodielectric media [19]. In that reference, the electromagnetic worldline path integrals are only exact in symmetric geometries where the vector electromagnetic field splits into two uncoupled scalar fields.

In connecting the worldline method to experiments, where one is interested in forces and curvatures as numerical quantities, it is therefore important to consider the numerical differentiation of worldline path integrals. Additionally, the worldline path integral for the part of the Casimir–Polder potential corresponding to the transverse-magnetic (TM) polarization involves the second derivative of a worldline path integral [19]. Similarly, the calculation of the stress-energy tensor via worldline methods involves derivatives of worldline path integrals [25, 16, 18]. Due to the importance of estimating gradients of Monte Carlo path averages in other areas such as mathematical finance, there has already been a substantial effort towards developing general methods for differentiating path integrals [26, 27]. Since the methods in this paper apply quite generally, they may be applicable to such problems.

The most straightforward way to compute a numerical derivative is the finite-difference method. While finite-difference approximations are quite general and easy to implement, they have poor convergence properties for gradients of stochastic quantities [26, 27]. In computing a first derivative, for example, one needs to compare functional values of two slightly different paths, and then divide by a small parameter that characterizes the difference between them. In such averages over stochastic paths, the difference in the contributions of these paths may be large—in a worldline path integral, for example, one path may intersect a dielectric while its slightly shifted counterpart misses it, but these differences are precisely what determine the Casimir force. Thus, the finite-difference method can lead to a path average with a large sample variance, requiring extensive averaging—and thus excessive computing resources—to arrive at an accurate result. The problem is even worse for successive derivatives.

In this paper we present numerically efficient methods for computing gradients of worldline path integrals in two classes of problems. First, we consider derivatives of Casimir–Polder path integrals, where the derivatives are taken with respect to the source point of the paths. In this case, a reweighted path integral serves to compute the derivatives, but a partial-averaging technique is needed to avoid convergence problems in the limit of continuous-time paths. This method applies rather generally to numerical path integrals differentiated with respect to the source point. For example, it applies whenever the path functional is independent of the motion of the path in some neighborhood of the source point. It also applies if the path functional may be approximately averaged over some time interval around the source point.

In the second class of problems, we consider the calculation of Casimir forces, curvatures, and torques due to extended material bodies. A particularly relevant method is that of Weber and Gies, who computed forces in the sphere–plane and cylinder–plane geometries with Dirichlet boundary conditions [14]. In that work paths are shifted until they graze the planar surface, taking advantage of the freedom of the integral over 𝐱0\mathbf{x}_{0}. The force on the planar surface is then computed by integrating over the times when the path intersects the spherical or cylindrical surface. By contrast, we consider a generally valid method that sums over the derivative of an estimate of the path average or value between two successive points in the discrete path. Again, a partial-averaging method accelerates convergence.

II Derivatives of Worldline Casimir–Polder Energies

To serve as a concrete example of path-integral differentiation, we will consider Casimir-type energies for the scalar field corresponding to the transverse-electric (TE) polarization of the electromagnetic field coupled to a dielectric [19]. In the strong-coupling (perfect-conductor) limit, this path integral imposes the same Dirichlet boundary conditions as in the path integrals considered by Gies et. al [6].

The basic expression for the Casimir energy of this scalar field in a dielectric-permittivity background ϵ(𝐫)\epsilon(\mathbf{r}) is (without renormalization)

E\displaystyle E =c2(2π)D/20d𝒯𝒯1+D/2all space𝑑𝐱0\displaystyle=-\frac{\hbar c}{2(2\pi)^{D/2}}\int_{0}^{\infty}\frac{d\mathcal{T}}{\mathcal{T}^{1+D/2}}\int_{\text{all space}}\!\!\!\!\!d\mathbf{x}_{0}
×1ϵr(𝐱)1/2𝐱(t),\displaystyle\hskip 71.13188pt\times{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}\frac{1}{\langle\epsilon_{\mathrm{r}}(\mathbf{x})\rangle^{1/2}}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)}, (1)

or equivalently,

E\displaystyle E =(2π)(D+1)/20𝑑s0d𝒯𝒯(D+1)/2all space𝑑𝐱0\displaystyle=-\frac{\hbar}{(2\pi)^{(D+1)/2}}\int_{0}^{\infty}\!ds\int_{0}^{\infty}\frac{d\mathcal{T}}{\mathcal{T}^{(D+1)/2}}\int_{\text{all space}}\!\!\!\!\!d\mathbf{x}_{0}
×es2𝒯ϵr(𝐱)/2c2𝐱(t).\displaystyle\hskip 71.13188pt\times{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}e^{-s^{2}\mathcal{T}\langle\epsilon_{\mathrm{r}}(\mathbf{x})\rangle/2c^{2}}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)}. (2)

In these expressions, DD is the number of spacetime dimensions, but the temporal dimension has been explicitly removed at this stage. This expression also assumes a dispersion-free dielectric at zero temperature, but it (and the following treatment) are readily generalized to incorporate dispersion and temperature effects [19]. In this expression, the double angle brackets \langle\!\langle\cdots\rangle\!\rangle denote an ensemble average over closed Brownian paths 𝐱(t)\mathbf{x}(t) (in D1D-1 spatial dimensions) that begin and end at 𝐱(0)=𝐱(𝒯)=𝐱0\mathbf{x}(0)=\mathbf{x}(\mathcal{T})=\mathbf{x}_{0}. The single-angle-bracket notation ϵr(𝐱)\,\!\left\langle{\epsilon_{\mathrm{r}}(\mathbf{x})}\right\rangle indicates an average of the relative dielectric permittivity ϵr:=ϵ/ϵ0\epsilon_{\mathrm{r}}:=\epsilon/\epsilon_{0} along the path 𝐱(t)\mathbf{x}(t):

ϵr:=1𝒯0𝒯𝑑tϵr[𝐱(t)].\langle\epsilon_{\mathrm{r}}\rangle:=\frac{1}{\mathcal{T}}\int_{0}^{\mathcal{T}}\!\!dt\,\epsilon_{\mathrm{r}}[\mathbf{x}(t)]. (3)

The path increments d𝐱(t)d\mathbf{x}(t) are Gaussian, with moments d𝐱(t)=0\langle\!\langle d\mathbf{x}(t)\rangle\!\rangle=0 and dxi(t)dxj(t)=δijdt\langle\!\langle dx_{i}(t)\,dx_{j}(t)\rangle\!\rangle=\delta_{ij}\,dt. The energy in these expressions must still be renormalized by subtracting the zero-body energy (obtained by replacing 𝐱\mathbf{x} by 𝐱0\mathbf{x}_{0} in the stochastic average) and the one-body energy (obtained as a limit of widely separated bodies), removing the divergence at 𝒯=0\mathcal{T}=0. Physically, the zero-body term represents the energy associated with a uniform dielectric background of permittivity ϵ(𝐱0)\epsilon(\mathbf{x}_{0}).

The Casimir–Polder potential for an atom interacting with a dielectric body arises by treating the atom as a localized perturbation to the dielectric, ϵr(𝐱)ϵr(𝐱)+α0δ(𝐱𝐱0)/ϵ0\epsilon_{\mathrm{r}}(\mathbf{x})\longrightarrow\epsilon_{\mathrm{r}}(\mathbf{x})+\alpha_{0}\delta(\mathbf{x}-\mathbf{x}_{\mathrm{0}})/\epsilon_{0}, and keeping the energy change to linear order in the (static) atomic polarizability α0\alpha_{0}. Again, this prescription ignores dispersion and temperature, but such effects are straightforward to include [19]. The resulting path integral following from (1) is

VCP(𝐱0)=\displaystyle V_{\mathrm{\scriptscriptstyle CP}}(\mathbf{x}_{\mathrm{0}})= cα04(2π)D/2ϵ0d𝒯𝒯1+D/21ϵr3/2𝐱(t).\displaystyle\,\frac{\hbar c\alpha_{0}}{4(2\pi)^{D/2}\epsilon_{0}}\int\frac{d\mathcal{T}}{\mathcal{T}^{1+D/2}}{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}\frac{1}{\langle\epsilon_{\mathrm{r}}\rangle^{3/2}}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)}\!\!\!. (4)

Again, this expression must be renormalized by subtracting the zero-body energy, which amounts to subtracting 1, assuming that the atom is not embedded in a dielectric medium (i.e., ϵr=1\epsilon_{\mathrm{r}}=1 in a neighborhood of 𝐱0\mathbf{x}_{0}). This expression for the Casimir–Polder potential is similar to that of the Casimir energy (1), but the potential here is solely a function of paths emanating from the atomic position 𝐱0\mathbf{x}_{0}.

II.1 Finite Differences

In path integrals such as Eq. (4) for the Casimir–Polder potential, one can compute the Casimir–Polder force 𝐅CP=ECP\mathbf{F}_{\mathrm{\scriptscriptstyle CP}}=-\nabla E_{\mathrm{\scriptscriptstyle CP}} by differentiating with respect to the source point 𝐱0\mathbf{x}_{0} of the paths. A simple, direct way to compute such a gradient numerically is the finite-difference method. In this technique the derivative is computed in terms of the contribution of each path 𝐱(t)\mathbf{x}(t) and its shifted counterparts of the form 𝐱(t)+r^iδ\mathbf{x}(t)+\hat{r}_{i}\delta, where δ\delta is a small number, and r^i\hat{r}_{i} form an orthonormal basis for the configuration space. The simplest finite difference for the first derivative, for example, yields the following path integral for the force, from Eq. (4):

𝐅(𝐱0)=\displaystyle\mathbf{F}(\mathbf{x}_{\mathrm{0}})= cα04(2π)D/2ϵ0ir^i0d𝒯𝒯1+D/2\displaystyle-\frac{\hbar c\alpha_{0}}{4(2\pi)^{D/2}\epsilon_{0}}\sum_{i}\hat{r}_{i}\int_{0}^{\infty}\frac{d\mathcal{T}}{\mathcal{T}^{1+D/2}}
×ϵr[𝐱(t)+r^iδ]3/2ϵr[𝐱(t)]3/2δ𝐱(t).\displaystyle\times{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}\frac{\langle\epsilon_{\mathrm{r}}[\mathbf{x}(t)+\hat{r}_{i}\delta]\rangle^{-3/2}-\langle\epsilon_{\mathrm{r}}[\mathbf{x}(t)]\rangle^{-3/2}}{\delta}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)}\!\!. (5)

Unfortunately, as a numerical method this path integral performs poorly. Specifically, in the case of interfaces between regions of otherwise uniform dielectric permittivity, the contribution to the force path integral for a given path 𝐱(t)\mathbf{x}(t) vanishes except when ϵr\smash{\!\left\langle{\epsilon_{\mathrm{r}}}\right\rangle} differs for the shifted and original paths 𝐱(t)+r^iδ\mathbf{x}(t)+\hat{r}_{i}\delta and 𝐱(t)\mathbf{x}(t), respectively. Depending on how ϵr\smash{\!\left\langle{\epsilon_{\mathrm{r}}}\right\rangle} is computed numerically, this difference may vary substantially among the possible paths 𝐱(t)\mathbf{x}(t) in the limit of small δ\delta. For example, in the limit of an interface between vacuum and a perfect conductor, the contribution for a given path 𝐱(t)\mathbf{x}(t) vanishes except in the (unlikely) case that 𝐱(t)+r^iδ\mathbf{x}(t)+\hat{r}_{i}\delta crosses the interface but 𝐱(t)\mathbf{x}(t) does not. For small δ\delta, only a small subset of the paths make a nonvanishing contribution to the path integral, and the sample variance diverges as δ0\delta\longrightarrow 0. This problem becomes progressively worse when computing additional derivatives. Thus, it is important to consider alternative methods for computing derivatives.

Because of the presence of the 𝒯\mathcal{T} integral in the path integrals (1) and (4), it is possible in particular geometries to implement finite differences in a way that avoids the convergence problems noted above. This follows from noting that, for example, in the case of a planar dielectric interface, a shift in the source point of a path is equivalent to a change in the path’s running time 𝒯\mathcal{T}, as far as computing  ϵr\smash{\!\left\langle{\epsilon_{\mathrm{r}}}\right\rangle} is concerned. Thus, the finite difference can effectively act on the 𝒯1D/2\mathcal{T}^{-1-D/2} factor instead of the path average. However, the rest of this paper will focus on methods that apply in general geometries and to path averages that lack the 𝒯\mathcal{T} integral.

II.2 Partial Averages in the Vicinity of the Source Point

To handle derivatives with respect to the atomic position in the Casimir–Polder energy (4), consider the general, schematic form of the path integral

I\displaystyle I =Φ[𝐱(t)]𝐱(t)\displaystyle={\big{\langle}\kern-2.29996pt\big{\langle}}\Phi[\mathbf{x}(t)]{\big{\rangle}\kern-2.29996pt\big{\rangle}}_{\mathbf{x}(t)}
=n=1N1d𝐱nP[𝐱(t)]Φ[𝐱(t)]\displaystyle=\int\prod_{n=1}^{N-1}d\mathbf{x}_{n}\,P[\mathbf{x}(t)]\,\Phi[\mathbf{x}(t)] (6)

in terms of an arbitrary path functional Φ[𝐱(t)]\Phi[\mathbf{x}(t)] and probability measure P[𝐱(t)]P[\mathbf{x}(t)] for the paths. The relevant paths for Casimir–Polder energies are closed, Gaussian paths (Brownian bridges) starting and ending at 𝐱(0)=𝐱(𝒯)=𝐱0\mathbf{x}(0)=\mathbf{x}(\mathcal{T})=\mathbf{x}_{0}; in discrete form with NN discrete path samples, the probability density for these paths in D1D-1 dimensions is

P[𝐱(t)]=\displaystyle P[\mathbf{x}(t)]=\, (2πΔ𝒯)N(D1)/2e(𝐱0𝐱N1)2/2Δ𝒯\displaystyle(2\pi\Delta\mathcal{T})^{-N(D-1)/2}\,e^{-(\mathbf{x}_{0}-\mathbf{x}_{N-1})^{2}/2\Delta\mathcal{T}}
×e(𝐱0𝐱1)2/2Δ𝒯j=1N2e(𝐱j+1𝐱j)2/2Δ𝒯,\displaystyle\times e^{-(\mathbf{x}_{0}-\mathbf{x}_{1})^{2}/2\Delta\mathcal{T}}\prod_{j=1}^{N-2}e^{-(\mathbf{x}_{j+1}-\mathbf{x}_{j})^{2}/2\Delta\mathcal{T}}, (7)

where Δ𝒯=𝒯/N\Delta\mathcal{T}=\mathcal{T}/N. To proceed, we will assume the path functional Φ\Phi to be approximately independent of 𝐱0\mathbf{x}_{0} (Φ/𝐱00\partial\Phi/\partial\mathbf{x}_{0}\approx 0). This is appropriate, for example, in Casimir–Polder calculations where the dielectric permittivity is constant in the vicinity of the atom (e.g., as in the case of an atom in vacuum, at a finite distance from a dielectric interface). In this case, derivatives of the path integral (6) with respect to 𝐱0\mathbf{x}_{0} act only on the probability density PP. For the Gaussian density (7), the derivatives along a particular spatial direction have the form

nx0nP[x(t)]=(Δ𝒯)n/2Hn(x¯1x0Δ𝒯)P[x(t)],\frac{\partial^{n}}{\partial x_{0}^{n}}P[{x}(t)]=(\Delta\mathcal{T})^{-n/2}H_{n}\bigg{(}\frac{\bar{x}_{1}-x_{0}}{\sqrt{\Delta\mathcal{T}}}\bigg{)}P[{x}(t)], (8)

where we are now indicating the spatial dependence in only the relevant direction for notational simplicity, x¯1=(x1+xN1)/2\bar{x}_{1}=(x_{1}+x_{N-1})/2, and the Hermite polynomials HnH_{n} are defined according to the convention

dndxnex2=(1)nHn(x)ex2.\frac{d^{n}}{dx^{n}}e^{-x^{2}}=(-1)^{n}H_{n}(x)\,e^{-x^{2}}. (9)

Note that we have written out the derivatives only for one-dimensional paths to simplify the expressions, but the results here generalize straightforwardly to multiple spatial dimensions (including multiple derivatives in one direction as well as cross-derivatives), in addition to non-Gaussian path measures (e.g., for paths corresponding to more general Lévy processes).

Combining Eq. (8) with the path integral (6) gives the expression

nx0nI\displaystyle\frac{\partial^{n}}{\partial x_{0}^{n}}I =(Δ𝒯)n/2Hn(x¯1x0Δ𝒯)Φ[x(t)]x(t)\displaystyle=(\Delta\mathcal{T})^{-n/2}{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}H_{n}\bigg{(}\frac{\bar{x}_{1}-x_{0}}{\sqrt{\Delta\mathcal{T}}}\bigg{)}\Phi[{x}(t)]{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{{x}(t)} (10)

for the path integral derivatives. However, this expression is problematic as a numerical derivative estimate because of the factor Δ𝒯n/2\Delta\mathcal{T}^{-n/2}, which diverges in the continuum limit Δ𝒯0\Delta\mathcal{T}\longrightarrow 0. This factor indicates large sample variances and cancellations between paths in this limit, resulting in inefficient numerical computations.

One approach to ameliorating this problematic behavior comes from the observation that if the path functional Φ\Phi is approximately independent of 𝐱0\mathbf{x}_{0}, then in the limit of large NN, Φ\Phi will also be approximately independent of neighboring points, such as 𝐱1\mathbf{x}_{1}, 𝐱N1\mathbf{x}_{N-1}, and other nearby points. In this case, it is possible to carry out the integrals with respect to these points, to obtain a “partially averaged” path integral. (Note that this method is distinct from other partial-averaging methods [28, 29].) Carrying out the integrals over x1,,xm1x_{1},\ldots,x_{m-1} and xNk+1,,xN1x_{N-k+1},\ldots,x_{N-1}, Eq. (10) becomes

nx0nI\displaystyle\frac{\partial^{n}}{\partial x_{0}^{n}}I (2νmk)n/2Hn(x¯mkx02νmk)Φ[𝐱(t)]x(t),\displaystyle\approx(2\nu_{mk})^{-n/2}{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}H_{n}\bigg{(}\frac{\bar{x}_{mk}-x_{0}}{\sqrt{2\nu_{mk}}}\bigg{)}\Phi[\mathbf{x}(t)]{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{{x}(t)}, (11)

where νmk\nu_{mk} and x¯mk\bar{x}_{mk} are defined by

νmk\displaystyle\nu_{mk} :=mkΔ𝒯m+k\displaystyle:=\frac{mk\Delta\mathcal{T}}{m+k} (12)
x¯mk\displaystyle\bar{x}_{mk} :=kxm+mxNkm+k,\displaystyle:=\frac{kx_{m}+mx_{N-k}}{m+k}, (13)

for k,m1k,m\geq 1. The probability density for the paths in the partially averaged expression (11) is

P¯[x(t)]\displaystyle\bar{P}[{x}(t)] :=𝑑x1𝑑xm1𝑑xNk+1𝑑xN1P[x(t)]\displaystyle:=\int dx_{1}\ldots dx_{m-1}dx_{N-k+1}\ldots dx_{N-1}\,P[x(t)]
=e(x0xNk)2/2kΔ𝒯e(x0xm)2/2mΔ𝒯\displaystyle=e^{-({x}_{0}-{x}_{N-k})^{2}/2k\Delta\mathcal{T}}e^{-({x}_{0}-{x}_{m})^{2}/2m\Delta\mathcal{T}}
×j=mNk1e(xj+1xj)2/2Δ𝒯,\displaystyle\hskip 14.22636pt\times\prod_{j=m}^{N-k-1}e^{-({x}_{j+1}-{x}_{j})^{2}/2\Delta\mathcal{T}}, (14)

which has “large steps” from x0x_{0} to xmx_{m} and xNkx_{N-k} to x0x_{0}. For closed paths, it is generally most sensible to choose m=km=k to apply the same partial averaging to the beginning and end of the path, such that νm:=νmm\nu_{m}:=\nu_{mm} and x¯m:=x¯mm\bar{x}_{m}:=\bar{x}_{mm} simplify to

νm\displaystyle\nu_{m} =mΔ𝒯2=m𝒯2N\displaystyle=\frac{m\Delta\mathcal{T}}{2}=\frac{m\mathcal{T}}{2N} (15)
x¯m\displaystyle\bar{x}_{m} =xm+xNm2,\displaystyle=\frac{x_{m}+x_{N-m}}{2}, (16)

and the steps at the beginning and end of the path are equally large on average, as shown schematically (omitting the Brownian nature of the path for visual clarity) in Fig. 1.

Since the prefactor in the derivative (11) now scales as νmn/2\smash{\nu_{m}^{-n/2}}, there is clearly some reduction in the sample variance in a numeric computation as mm increases. However, the critical point is this: when chosen appropriately, this prefactor becomes independent of NN, curing the divergent sample variance in the continuum limit. To choose the number mm of points to partially average, the main consideration is that the averaging should not introduce significant error. Returning to the assumption that Φ\Phi is approximately independent of 𝐱0\mathbf{x}_{0}, at this point we will have to be somewhat more precise and assume that Φ\Phi depends on the path 𝐱(t)\mathbf{x}(t) via a scalar function V(𝐱)V(\mathbf{x}) in the form Φ[V(𝐱)]\Phi[V(\mathbf{x})]. Then the key assumption is that V(𝐱)V(\mathbf{x}) is constant (or approximately constant) within a radius dd of the source point 𝐱0\mathbf{x}_{0}. The error in averaging over the point 𝐱m\mathbf{x}_{m}, while ignoring the corresponding dependence of Φ\Phi, is small so long as there is a small probability for 𝐱m\mathbf{x}_{m} to leave the constant region. Assuming mm will be chosen to be small compared to NN, the path from x0x_{0} to xmx_{m} (and the corresponding path segment at the end) will behave approximately as an ordinary Wiener path. Since the probability for a one-dimensional Wiener path to cover a distance d>0d>0 from x0x_{0} in time τ\tau is given by

Pcross=erfc(d2τ).P_{\text{cross}}=\mathrm{erfc}\left(\frac{d}{\sqrt{2\tau}}\right). (17)

For τd2\tau\ll d^{2}, this expression is bounded above by ed2/2τe^{-d^{2}/2\tau}. Then to keep the error acceptably small, the crossing probability is chosen to be below some small tolerance ε>0\varepsilon>0. This condition can be solved to find the total average step time τ=mΔ𝒯\tau=m\Delta\mathcal{T} such that PtouchεP_{\text{touch}}\leq\varepsilon. The fraction of the path one can acceptably average over is then given by

mN=d22𝒯ln(1/ε).\frac{m}{N}=\frac{d^{2}}{2\mathcal{T}\ln(1/\varepsilon)}. (18)

(In practice we choose ε\varepsilon to be much smaller than suggested by this formula.) Note that m/Nm/N is constant even as the path resolution NN increases, so that the numerical fluctuations, governed by νm=m𝒯/2N\nu_{m}=m\mathcal{T}/2N, are independent of NN, as required. A bound for the numerical error then follows from multiplying the tolerance ε\varepsilon by the amount over which V(x)V(x) varies from 𝐱0\mathbf{x}_{0} to the exterior of the constant region.

Refer to caption
Figure 1: Schematic path showing partial averaging up to the mmth discrete path increment up to and after the source point 𝐱0\mathbf{x}_{0}. The diagram shows the example geometry of the Casimir–Polder potential for an atom in vacuum near a planar interface with a dielectric material of susceptibility χ\chi.

These apply readily to the computation of derivatives of the Casimir–Polder potential. For example, the path integral for the Casimir–Polder force becomes

𝐅=\displaystyle\mathbf{F}= cα04(2π)D/2d𝒯𝒯1+D/22𝐱0𝐱m𝐱NmmΔ𝒯\displaystyle\,\frac{\hbar c\alpha_{0}}{4(2\pi)^{D/2}}\int\frac{d\mathcal{T}}{\mathcal{T}^{1+D/2}}{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}\frac{2\mathbf{x}_{0}-\mathbf{x}_{m}-\mathbf{x}_{N-m}}{m\Delta\mathcal{T}}
×(ϵr3/2[ϵr(𝐱0)]3/2)𝐱(t)\displaystyle\hskip 71.13188pt\times\Big{(}\langle\epsilon_{\mathrm{r}}\rangle^{-3/2}-[\epsilon_{\mathrm{r}}(\mathbf{x}_{0})]^{-3/2}\Big{)}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)} (19)

after partial averaging, where an appropriate estimator for the path average of the permittivity is

ϵr=\displaystyle\langle\epsilon_{\mathrm{r}}\rangle= 1N[mϵr(𝐱0)+m2ϵr(𝐱m)+m2ϵr(𝐱Nm)\displaystyle\,\frac{1}{N}\Bigg{[}m\epsilon_{\mathrm{r}}(\mathbf{x}_{0})+\frac{m}{2}\epsilon_{\mathrm{r}}(\mathbf{x}_{m})+\frac{m}{2}\epsilon_{\mathrm{r}}(\mathbf{x}_{N-m})
+j=m+1Nm1ϵr(𝐱j)].\displaystyle\hskip 71.13188pt+\sum_{j=m+1}^{N-m-1}\epsilon_{\mathrm{r}}(\mathbf{x}_{j})\Bigg{]}. (20)

Note that the details of how the points 𝐱m\mathbf{x}_{m} and 𝐱Nm\mathbf{x}_{N-m} enter this estimator are not critical, since for small tolerances ε\varepsilon the dielectric permittivity at these points should be equal to the source-point permittivity for the vast majority of paths. Fig. 1 shows an example of the physical setup for this path integral for an atom near a planar dielectric surface. In evaluating this path integral numerically here, the distance scale dd is simply the distance between the atom and the dielectric interface, and a small tolerance ε\varepsilon guarantees that the points xmx_{m} and xNmx_{N-m} are unlikely to cross over the interface.

In this differentiated path integral for the force, in principle no renormalization term is required—any renormalization term is independent of the position of the atom, and thus vanishes under the derivative. That is, the ϵr(𝐱0)\epsilon_{\mathrm{r}}(\mathbf{x}_{0}) term in Eq. (19) does not ultimately contribute, because it vanishes under the ensemble average for any value of 𝒯\mathcal{T}. However, on a path-wise basis this renormalization term is critical in a numerical implementation of this path integral, because it cuts off the divergence at 𝒯=0\mathcal{T}=0 and dramatically reduces the sample variance of finite ensemble averages, particularly for small 𝒯\mathcal{T}.

II.3 Partial Averages Close to One Body

The partial-averaging approach is also useful in computing derivatives in a geometry with two or more material bodies, when the source point of the path integral is close to one of the bodies. This situation applies, for example, when computing the two-body stress-energy tensor in the vicinity of one of the bodies [25, 16, 18], or when extracting the nonadditive, multibody contribution to the Casimir–Polder potential.

As a concrete example, consider differentiating the Casimir–Polder potential of an atom between two dielectric half-spaces, where the atom is close to one interface (Fig. 2). In this problem there are two relevant scales for the path running time 𝒯\mathcal{T}: the first time 𝒯1\mathcal{T}_{1} that the path touches either body, and the first time 𝒯2\mathcal{T}_{2} that the path touches both bodies. For the atom at position x0x_{0} between interfaces at positions d1d_{1} and d2d_{2}, these times are on the order of 𝒯1(d1x0)2\mathcal{T}_{1}\sim(d_{1}-x_{0})^{2} and 𝒯2(d2d1)2\mathcal{T}_{2}\sim(d_{2}-d_{1})^{2}, respectively. If the atom is particularly close to one body, the dominant contribution to the worldline path integral comes from paths where 𝒯𝒯2𝒯1\mathcal{T}\sim\mathcal{T}_{2}\gg\mathcal{T}_{1}. The approach of the previous section is limited in this case, because it relies on the dielectric permittivity being approximately constant in a neighborhood of the source point, with the effectiveness of the method increasing with the radius of this neighborhood. The method thus only effects partial averaging to a limited extent, for 𝒯m:=mΔ𝒯𝒯1\mathcal{T}_{m}:=m\Delta\mathcal{T}\ll\mathcal{T}_{1}.

Refer to caption
Figure 2: Schematic of an atom between two dielectric half-spaces with respective susceptibilities χ1\chi_{1} and χ2\chi_{2}, illustrating the prototype problem for the partial-averaging technique of Section II.3 close to one body. The dashed spheres show the typical extent of the paths at various running times 𝒯\mathcal{T} (i.e., times over which the paths can diffuse). At 𝒯1\mathcal{T}_{1} the paths typically touch only the nearer body, while at 𝒯2\mathcal{T}_{2} they typically touch both bodies. The time interval for partial averaging the paths is 𝒯m\mathcal{T}_{m}. The method of Section II.2 requires the background dielectric to be approximately uniform in the vicinity of the atom, and thus that 𝒯m𝒯1\mathcal{T}_{m}\ll\mathcal{T}_{1} so that the paths are unlikely to touch either interface during the partial-averaging time. However, because the path integral can be evaluated in the presence of a single, planar interface, the partial averaging can be extended such that 𝒯m𝒯1\mathcal{T}_{m}\sim\mathcal{T}_{1}, provided 𝒯m𝒯2\mathcal{T}_{m}\ll\mathcal{T}_{2}, so that most paths only hit the nearer interface during the partial-averaging time.

The partial-averaging method extends to this case if there are approximate analytical solutions available for the path integral. As in the case of the TE-polarization path integral [19], it is possible to find analytical solutions for path integrals corresponding to certain material geometries, and then to recast more general worldline path integrals in a form that leverages those solutions. In particular, the (un-renormalized) Casimir–Polder energy can be written as an ensemble average over paths divided into NN segments. The ensemble average in the path integral must then include an average over the positions of NN points that define a discrete path, as well as averages over all possible path segments connecting each pair of neighboring points:

VCP(TE)(𝐱0)=cα0(2π)D/2πϵ00d𝒯𝒯1+D/20𝑑ss2es2\displaystyle V_{\mathrm{\scriptscriptstyle CP}}^{\mathrm{\scriptscriptstyle(TE)}}(\mathbf{x}_{\mathrm{0}})=\frac{\hbar c\alpha_{0}}{(2\pi)^{D/2}\sqrt{\pi}\epsilon_{0}}\int_{0}^{\infty}\!\!\,\frac{d\mathcal{T}}{\mathcal{T}^{1+D/2}}\,\int_{0}^{\infty}\!\!ds\,s^{2}\,e^{-s^{2}}\,
×j=0N1exp[s2𝒯𝒯j𝒯j+1𝑑τχ[𝐱(τ)]]Δxj𝐱(τ).\displaystyle\hskip 2.84526pt\times{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\prod_{j=0}^{N-1}{\kern 0.0pt\Bigg{\langle}\kern-6.60004pt\scalebox{0.66}[1.0]{$-$}\kern-2.20001pt\Bigg{\langle}\kern 0.0pt}\exp\!\Bigg{[}-\!\frac{s^{2}}{\mathcal{T}}\,\int_{\mathcal{T}_{j}}^{\mathcal{T}_{j+1}}\!\!d\tau\,\chi[\mathbf{x}(\tau)]\Bigg{]}{\kern 0.0pt\Bigg{\rangle}\kern-2.20001pt\scalebox{0.66}[1.0]{$-$}\kern-6.60004pt\Bigg{\rangle}\kern 0.0pt}_{\!\!\Delta x_{j}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}(\tau)}\!\!\!\!. (21)

Here, the connected-double-angle brackets Δxj\smash{{\langle\kern-2.79999pt\scalebox{0.35}[1.0]{$-$}\kern-1.79993pt\langle}\;{\rangle\kern-1.79993pt\scalebox{0.35}[1.0]{$-$}\kern-2.79999pt\rangle}_{\Delta x_{j}}} denote an ensemble average over all bridges between 𝐱j\smash{\mathbf{x}_{j}} and 𝐱j+1\smash{\mathbf{x}_{j+1}}, 𝒯j=jΔ𝒯=(j/N)𝒯\mathcal{T}_{j}=j\Delta\mathcal{T}=(j/N)\mathcal{T}, and the dielectric susceptibility for the two bodies is χ[𝐱(τ)]=χ1[𝐱(τ)]+χ2[𝐱(τ)]\chi[\mathbf{x}(\tau)]=\chi_{1}[\mathbf{x}(\tau)]+\chi_{2}[\mathbf{x}(\tau)]. With this ordering of brackets, the averages over all path segments between points 𝐱j\smash{\mathbf{x}_{j}} and 𝐱j+1\smash{\mathbf{x}_{j+1}} occur for a fixed set of discrete points, and then the average must be taken over all possible discrete paths 𝐱j\mathbf{x}_{j}. The key point of this section is that for simple geometries, such as a single planar interface, it is possible to carry out the average over the path segments analytically. In the example of a single, planar interface, the solution corresponds to the generating function of the sojourn time of a Brownian bridge (see Ref [19], App. B).

For sufficiently small time steps (Δ𝒯𝒯2\Delta\mathcal{T}\ll\mathcal{T}_{2}), the probability for the path to interact with both bodies on a given discrete step jj is small, so the path integral over bridges is well-approximated by accounting only for the nearest body. For path increments Δ𝐱j\Delta\mathbf{x}_{j} close to the χ2\chi_{2} body, the path-segment average is then

-e(s2/𝒯)𝑑τ(χ1+χ2)-Δ𝐱j-e(s2/𝒯)𝑑τχ2-Δ𝐱j.{\kern 0.0pt\Big{\langle}\kern-4.90005pt\scalebox{0.38}[1.0]{{\hbox{-}}}\kern-1.79993pt\Big{\langle}\kern 0.0pt}e^{-(s^{2}/\mathcal{T})\int d\tau\,(\chi_{1}+\chi_{2})}{\kern 0.0pt\Big{\rangle}\kern-1.79993pt\scalebox{0.38}[1.0]{{\hbox{-}}}\kern-4.90005pt\Big{\rangle}\kern 0.0pt}_{\!\!\Delta\mathbf{x}_{j}}\approx{\kern 0.0pt\Big{\langle}\kern-4.90005pt\scalebox{0.38}[1.0]{{\hbox{-}}}\kern-1.79993pt\Big{\langle}\kern 0.0pt}e^{-(s^{2}/\mathcal{T})\int d\tau\,\chi_{2}}{\kern 0.0pt\Big{\rangle}\kern-1.79993pt\scalebox{0.38}[1.0]{{\hbox{-}}}\kern-4.90005pt\Big{\rangle}\kern 0.0pt}_{\!\!\Delta\mathbf{x}_{j}}. (22)

The crucial point is that this path integral (including the Gaussian probability measure for the path increment), which we can write as

U(𝐱j,𝐱j+1;t)\displaystyle U(\mathbf{x}_{j},\mathbf{x}_{j+1};t) =e(𝐱j𝐱j+1)2/2t(2πt)(D1)/2es20t𝑑τχ[𝐱(τ)]/τΔ𝐱j,\displaystyle=\frac{e^{-(\mathbf{x}_{j}-\mathbf{x}_{j+1})^{2}/2t}}{(2\pi t)^{(D-1)/2}}{\kern 0.0pt\Big{\langle}\kern-4.90005pt\scalebox{0.38}[1.0]{$-$}\kern-1.79993pt\Big{\langle}\kern 0.0pt}e^{-s^{2}\!\int_{0}^{t}\!d\tau\,\chi[\mathbf{x}(\tau)]/\tau}{\kern 0.0pt\Big{\rangle}\kern-1.79993pt\scalebox{0.38}[1.0]{$-$}\kern-4.90005pt\Big{\rangle}\kern 0.0pt}_{\Delta\mathbf{x}_{j}}, (23)

corresponds to a propagator for an associated diffusion equation [30, 31, 32, 33], so the solutions between adjacent steps can be composed into the solution for a larger, combined step. The partial averaging can then be carried out as in the method of the previous section by composing mm steps together. To ensure that the error associated with the partial averaging is small, the probability to touch the more-distant body in time 𝒯m=m𝒯/N\mathcal{T}_{m}=m\mathcal{T}/N should remain below some small tolerance ε\varepsilon. In the example of two planar interfaces, this condition has the explicit form

mN=(d2x0)22𝒯ln(1/ε),\frac{m}{N}=\frac{(d_{2}-x_{0})^{2}}{2\mathcal{T}\ln(1/\varepsilon)}, (24)

using the same argument that led to Eq. (18). In more general material geometries, the analytical path integral must also approximate the shape of the nearest body. For example, a smooth but nonplanar interface (e.g., the surface of a spherical body) can be approximated locally by a plane for the purposes of the path-segment average in a given path increment. However, in this case, 𝒯m\mathcal{T}_{m} is also constrained because the geometric approximation must hold over the typical extent of the path up to time 𝒯m\mathcal{T}_{m}. For example, in a local planar approximation, the distance that paths typically explore in time 𝒯m\mathcal{T}_{m} must be small on the curvature scale of the interface.

After averaging, the derivatives are readily computed, although in general they will not yield the same Hermite-polynomial weighting factors as in Eq. (10):

nx0nVCP(TE)(𝐱0)=cα0(2π)D/2πϵ00d𝒯𝒯1+D/20𝑑ss2es2\displaystyle\frac{\partial^{n}}{\partial x_{0}^{n}}V_{\mathrm{\scriptscriptstyle CP}}^{\mathrm{\scriptscriptstyle(TE)}}(\mathbf{x}_{\mathrm{0}})\!=\!\frac{\hbar c\alpha_{0}}{(2\pi)^{D/2}\sqrt{\pi}\epsilon_{0}}\int_{0}^{\infty}\!\!\frac{d\mathcal{T}}{\mathcal{T}^{1+D/2}}\int_{0}^{\infty}\!\!ds\,s^{2}\,e^{-s^{2}}\,
×k=mNmd𝐱kj=mNm1U(𝐱j,𝐱j+1;Δ𝒯)\displaystyle\hskip 14.22636pt\times\int\prod_{k=m}^{N-m}d\mathbf{x}_{k}\prod_{j=m}^{N-m-1}U(\mathbf{x}_{j},\mathbf{x}_{j+1};\Delta\mathcal{T})
×nx0n[U(𝐱0,𝐱m;mΔ𝒯)U(𝐱Nm,𝐱0;mΔ𝒯)].\displaystyle\hskip 14.22636pt\times\frac{\partial^{n}}{\partial x_{0}^{n}}[U(\mathbf{x}_{0},\mathbf{x}_{m};m\Delta\mathcal{T})\,U(\mathbf{x}_{N-m},\mathbf{x}_{0};m\Delta\mathcal{T})]. (25)

As discussed at the end of the previous section, this expression should be renormalized as necessary. Note that in the path integral here, the derivatives act on both the Gaussian path measure and the subaverages over path segments [via the bracketed factor in Eq. (23)]. In addition, the functional form of UU may vary depending on the local path position 𝐱j\mathbf{x}_{j}, because it should reflect only the presence of the interface nearest 𝐱j\mathbf{x}_{j}. Although the approximate solution near the source point 𝐱0\mathbf{x}_{0} of the path is crucial for the partial averaging, it is not necessary to use such analytical results for the entire path. For example, one could also use the simpler trapezoidal estimator [19] for the average of the dielectric function around the remainder of the path.

The averaging approach described here helps to improve the sample variance in a numerical average when the source point of the paths is close to an interface, even though the functional integral cannot be treated as approximately constant, as assumed in the previous method of Section II.2. Both this and the previous methods of path-averaging described can be thought of as choosing non-uniform time steps in the discrete path. It is important to note, however, that in most path integrals, all of the time steps should be vanishingly small for good accuracy; but in the partially averaged path integrals here, the “large” first and last steps should be of fixed time step, even in the limit as the remaining step sizes become vanishingly small. Since the derivatives act on the first and last path steps, the sample variance decreases as their respective time steps increase. In order to improve the statistical convergence of the path average, the first and last steps should therefore be as large as possible, while controlling the errors associated with the simplified, approximate integrands. The methods here still allow a high resolution for the middle section of the path, in order to accurately capture the geometry dependence of the path integral.

III Differentiation of Worldline Casimir Energies

Path integrals of the form of Eqs. (1) or (2) correspond to Casimir energies between macroscopic bodies. The computation of their derivatives requires a different set of methods because they involve an integral over all possible source points for the paths. To compute forces, curvatures of potentials, and torques within this framework, it is necessary to differentiate with respect to generalized coordinates, such as distances and angles between bodies, in contrast to the derivatives with respect to path source points that we considered above. Here we will develop a general method to handle such derivatives of path integrals.

For the purposes of differentiation, the critical component of the Casimir-energy path integral has the form

E=Φ[f(χ(𝐱(t),𝐑1,𝐑2))]𝐱(t),E={\bigg{\langle}\kern-3.50006pt\bigg{\langle}}\Phi\Big{[}f\Big{(}\big{\langle}\chi(\mathbf{x}(t),\mathbf{R}_{1},\mathbf{R}_{2})\big{\rangle}\Big{)}\Big{]}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)}, (26)

where Φ\Phi is a linear functional of a function ff of the path average (3) of the susceptibility χ(𝐫)\chi(\mathbf{r}), and where 𝐑1\mathbf{R}_{1} labels a generalized coordinate of the first body (or collection of bodies), and 𝐑2\mathbf{R}_{2} labels a generalized coordinate of the second body (or collection thereof). For example, a typical arrangement is depicted in Fig. 3, where uniform dielectric bodies are separated by vacuum, although the treatment here may be straightforwardly generalized to nonuniform dielectric media. In this case, the susceptibility χ(𝐫)\chi(\mathbf{r}) is given generally by

χ(𝐫)=jχjΘ[σj(𝐫𝐑j)],\chi(\mathbf{r})=\sum_{j}\chi_{j}\Theta[\sigma_{j}(\mathbf{r}-\mathbf{R}_{j})], (27)

where χj\chi_{j} is the dielectric susceptibility of body jj; σj(𝐫)=0\sigma_{j}(\mathbf{r})=0 defines the surface of the jjth body, with σj>0\sigma_{j}>0 and σj<0\sigma_{j}<0 on the interior and exterior of the body, respectively; and 𝐑j\mathbf{R}_{j} is the center of the jjth body. The integral still averages over the paths 𝐱(t)\mathbf{x}(t) via the path average. Recall that Φ\Phi depends implicitly on 𝒯\mathcal{T} via the path statistics, because 𝐱(0)=𝐱(𝒯)=𝐱0\mathbf{x}(0)=\mathbf{x}(\mathcal{T})=\mathbf{x}_{0}.

Refer to caption
Figure 3: Geometry for interacting dielectric bodies of susceptibility χj\chi_{j}, centered at 𝐑j\mathbf{R}_{j} relative to the origin. The normal vectors n^j\hat{n}_{j} to the surface of the jjth body are also shown.

III.1 Force

The force on a body follows from the gradient of the Casimir energy, where the derivatives are taken with respect to the body’s position. For example, the force on body 11 is given by differentiating the path integral in Eq. (26) with respect to the body position 𝐑1\mathbf{R}_{1}:

𝐅1=𝐑1E=Φf𝐑1f𝐱(t).\mathbf{F}_{1}=-\nabla_{\mathbf{R}_{1}}E=-\,{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}\frac{\partial\Phi}{\partial f}\,\nabla_{\mathbf{R}_{1}}f{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{\mathbf{x}(t)}. (28)

In this expression, Φ/f\partial\Phi/\partial f is independent of ff (since Φ\Phi is a linear function of ff). In the case where ff is exponential, we can divide the path average into two steps: first, averaging over the NN discrete, uniform steps Δ𝐱j:=𝐱j+1𝐱j\Delta\mathbf{x}_{j}:=\mathbf{x}_{j+1}-\mathbf{x}_{j}, and second, averaging over all the subpaths between 𝐱j\mathbf{x}_{j} and 𝐱j+1\mathbf{x}_{j+1}:

𝐅1=Φf𝐑1j=0N1-f-Δ𝐱j𝐱n.\mathbf{F}_{1}=-\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,\nabla_{\mathbf{R}_{1}}\prod_{j=0}^{N-1}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{j}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}. (29)

Here, the connected-double-angle brackets Δ𝐱j\smash{{\langle\kern-2.79999pt\scalebox{0.35}[1.0]{$-$}\kern-1.79993pt\langle}~{}{\rangle\kern-1.79993pt\scalebox{0.35}[1.0]{$-$}\kern-2.79999pt\rangle}_{\Delta\mathbf{x}_{j}}} denotes an average over all such bridges between 𝐱j\mathbf{x}_{j} and 𝐱j+1\mathbf{x}_{j+1}, as in Sec. II.3, and the subscript 𝐱n\mathbf{x}_{n} indicates an average over all discrete paths of NN steps. Then applying the derivative to the product of subpaths,

𝐅1=Φffj=0N1𝐑1-f-Δ𝐱j-f-Δ𝐱j𝐱n.\mathbf{F}_{1}=-\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,f\sum_{j=0}^{N-1}\frac{\nabla_{\mathbf{R}_{1}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{j}}}{{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{j}}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}. (30)

There are typically NN terms here, but if fΔ𝐱j\smash{{\langle\kern-2.79999pt\scalebox{0.35}[1.0]{$-$}\kern-1.79993pt\langle}f{\rangle\kern-1.79993pt\scalebox{0.35}[1.0]{$-$}\kern-2.79999pt\rangle}_{\Delta\mathbf{x}_{j}}} is associated with a sharp surface, only O(N1/2)\smash{O(N^{1/2})} of them will contribute to the sum. Again, this form of the path integral is specific to an exponential ff; for example, Eq. (2) is of the form

f(χ)=es2𝒯(1+χ)/2c2\displaystyle f\big{(}\langle\chi\rangle\big{)}=e^{-s^{2}\mathcal{T}(1+\langle\chi\rangle)/2c^{2}} (31)
Φ=(2π)5/20𝑑s0d𝒯𝒯5/2𝑑𝐱0f(χ),\displaystyle\Phi=-\frac{\hbar}{(2\pi)^{5/2}}\int_{0}^{\infty}\!\!ds\int_{0}^{\infty}\!\frac{d\mathcal{T}}{\mathcal{T}^{5/2}}\int d\mathbf{x}_{0}\,f(\langle\chi\rangle),

and works with this method. Other path integrals, for example of the form of Eq. (1),

f(χ)=(1+χ)1/2\displaystyle f(\langle\chi\rangle)=(1+\langle\chi\rangle)^{-1/2} (32)
Φ=c8π20d𝒯𝒯3𝑑𝐱0f(χ),\displaystyle\Phi=-\frac{\hbar c}{8\pi^{2}}\int_{0}^{\infty}\!\frac{d\mathcal{T}}{\mathcal{T}^{3}}\int d\mathbf{x}_{0}\,f(\langle\chi\rangle),

can be handled using the alternate form for the force,

𝐅1=Φffj=0N1𝐑1-χ-Δ𝐱j𝐱n,\mathbf{F}_{1}=-\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,f^{\prime}\sum_{j=0}^{N-1}\nabla_{\mathbf{R}_{1}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-3.80005pt\big{\langle}\kern 2.29996pt}\chi{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{j}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}, (33)

where 𝒯j=jΔ𝒯=j𝒯/N\mathcal{T}_{j}=j\Delta\mathcal{T}=j\mathcal{T}/N. Qualitatively, the Casimir force on a body arises from paths that pierce its surface, with a vector path weight in the direction of the surface normal at the path source point. Although the surface of an arbitrary body involves surface normals pointing in all directions, each surface normal obtains a different geometry-dependent weight via the path ensemble. The result is, in general, a nonzero net force.

As in Sec. II.2, a partial-averaging procedure accelerates convergence. If one surface is located at d1d_{1}, then the condition is

(xj+1d1)(xjd1)ε(x_{j+1}-d_{1})(x_{j}-d_{1})\leq\varepsilon (34)

for a positive tolerance ε\varepsilon [typically 104/(N𝒯)10^{4}/(N\sqrt{\mathcal{T}}); note that setting ε=0\varepsilon=0 simply detects a surface crossing]. When this condition is satisfied for any boundary, the solution advances forward by m>1m>1 points, and the estimate of the function fΔ𝐱j{\langle\kern-2.79999pt\scalebox{0.35}[1.0]{$-$}\kern-1.79993pt\langle}f{\rangle\kern-1.79993pt\scalebox{0.35}[1.0]{$-$}\kern-2.79999pt\rangle}_{\Delta\mathbf{x}_{j}} or the susceptibility χΔ𝐱j{\langle\kern-2.79999pt\scalebox{0.35}[1.0]{$-$}\kern-1.79993pt\langle}\chi{\rangle\kern-1.79993pt\scalebox{0.35}[1.0]{$-$}\kern-2.79999pt\rangle}_{\Delta\mathbf{x}_{j}} is calculated with respect to this larger path length.

III.2 Potential Curvature

This method can be easily extended to the second derivative of the worldline energy, which yields the potential curvature,

Cij:=(r^i𝐑1)(r^j𝐑1)E,C_{ij}:=(\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{1}})(\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}})E, (35)

in basis r^i\hat{r}_{i}. Applying this to the path integral (26) gives

Cij=Φf(r^i𝐑1)(r^j𝐑1)k=0N1-f-Δ𝐱k𝐱n,C_{ij}={\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,(\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{1}})(\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}})\prod_{k=0}^{N-1}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}, (36)

and applying the derivatives in the case where ff is exponential yields

Cij=\displaystyle C_{ij}= Φff[,k=0kN1r^i𝐑1fΔ𝐱fΔ𝐱r^j𝐑1fΔ𝐱kfΔ𝐱k\displaystyle{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,f\Bigg{[}\sum_{\begin{subarray}{c}\ell,k=0\\ \ell\neq k\end{subarray}}^{N-1}\frac{\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{1}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{\ell}}}{{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{\ell}}}\frac{\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}{{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}} (37)
+k=0N1(r^i𝐑1)(r^j𝐑1)fΔ𝐱kfΔ𝐱k]𝐱n.\displaystyle\hskip 28.45274pt+\sum_{k=0}^{N-1}\frac{(\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{1}})(\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}}){\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}{{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}\Bigg{]}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}.

However, it is possible to recast one derivative with respect to the other surface,

Cij=Φf(r^i𝐑2)(r^j𝐑1)k=0N1-f-Δ𝐱k𝐱n,C_{ij}=-\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,(\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{2}})(\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}})\prod_{k=0}^{N-1}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{{\hbox{-}}}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}, (38)

in which case, applying the derivatives, in the case where ff is exponential, and making the approximation Δ𝐱jd\Delta\mathbf{x}_{j}\ll d for well separated bodies, where dd characterizes the body separation, we obtain

Cij\displaystyle C_{ij}\approx Φff[kr^i𝐑2fΔ𝐱kfΔ𝐱k]\displaystyle-\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,f\Bigg{[}\sum_{k}\frac{\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{2}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}{{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}\Bigg{]} (39)
×[kr^j𝐑1fΔ𝐱kfΔ𝐱k]𝐱n.\displaystyle\hskip 42.67912pt\times\Bigg{[}\sum_{k}\frac{\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}{{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}f{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}}}\Bigg{]}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}.

In the general case, where ff is any function, in the same approximation we obtain

Cij\displaystyle C_{ij}\approx Φff′′kr^i𝐑2χΔ𝐱k\displaystyle-\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,f^{\prime\prime}\sum_{k}\hat{r}_{i}\cdot\nabla_{\mathbf{R}_{2}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}\chi{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{k}} (40)
×r^j𝐑1χΔ𝐱𝐱n.\displaystyle\hskip 42.67912pt\times\sum_{\ell}\hat{r}_{j}\cdot\nabla_{\mathbf{R}_{1}}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}\chi{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{\ell}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}_{n}}.

Partial averaging is then carried out as in Sec. III.1.

III.3 Torque

The Casimir torque on a body follows in a similar way by considering the energy shift due to a small rotation. Specifically, consider an infinitesimal rotation of body 1 about the point 𝐑1\mathbf{R}_{1}, with axis m^\hat{m}, and through angle ϕ\phi:

χ(𝐫)=χ1Θ{σ1[(ϕ)(𝐫𝐑1)]}+χ2Θ[σ2(𝐫𝐑2)].\chi(\mathbf{r})=\chi_{1}\Theta\big{\{}\sigma_{1}[\mathcal{R}(\phi)(\mathbf{r}-\mathbf{R}_{1})]\big{\}}+\chi_{2}\Theta[\sigma_{2}(\mathbf{r}-\mathbf{R}_{2})]. (41)

For a small rotation angle, the rotation matrix has the form

ij(ϕ)=δijmkϵijkϕ+O(ϕ2),\mathcal{R}_{ij}(\phi)=\delta_{ij}-m_{k}\epsilon_{ijk}\phi+O(\phi^{2}), (42)

where δij\delta_{ij} is the Kronecker delta and ϵijk\epsilon_{ijk} is the Levi–Civita symbol; repeated indices are summed throughout this section. The torque for a rotation about axis m^\hat{m} can be written as Km:=m^𝐊=ϕEK_{m}:=\hat{m}\cdot\mathbf{K}=-\partial_{\phi}E. The ϕ\phi-derivative acts only on the path-averaged dielectric part of the energy integral,

ϕχ\displaystyle\partial_{\phi}\langle\chi\rangle =χ1ϕij(ϕ)[𝐱(t)𝐑1]j[r^iΘ(σ1)]\displaystyle=\chi_{1}\big{\langle}\partial_{\phi}\mathcal{R}_{ij}(\phi)[\mathbf{x}(t)-\mathbf{R}_{1}]_{j}[\hat{r}_{i}\cdot\nabla\Theta(\sigma_{1})]\big{\rangle}
=χ1mkϵkij[𝐱(t)𝐑1]j[r^iΘ(σ1)]\displaystyle=-\chi_{1}\big{\langle}m_{k}\epsilon_{kij}[\mathbf{x}(t)-\mathbf{R}_{1}]_{j}[\hat{r}_{i}\cdot\nabla\Theta(\sigma_{1})]\big{\rangle}
=χ1m^[𝐱(t)𝐑1]Θ(σ1),\displaystyle=\chi_{1}\hat{m}\cdot\big{\langle}[\mathbf{x}(t)-\mathbf{R}_{1}]\wedge\nabla\Theta(\sigma_{1})\big{\rangle}, (43)

where in the last step we introduced the usual vector cross-product (𝐚𝐛)i=ϵijkajbk(\mathbf{a}\wedge\mathbf{b})_{i}=\epsilon_{ijk}a_{j}b_{k}. Substituting this into Eq. (26), the resulting path integral for the torque, after dropping the arbitrary axis m^\hat{m}, is

𝐊\displaystyle\mathbf{K} =Φffχ1j=0N1Θ(σ1)[𝐱(t)𝐑1]Δ𝐱j𝐱(t)\displaystyle=\,{\Bigg{\langle}\kern-3.50006pt\Bigg{\langle}}\frac{\partial\Phi}{\partial f}\,f^{\prime}\chi_{1}\sum_{j=0}^{N-1}{\kern 2.29996pt\big{\langle}\kern-5.89996pt\scalebox{0.35}[1.0]{$-$}\kern-3.80005pt\big{\langle}\kern 2.29996pt}\nabla\Theta(\sigma_{1})\wedge[\mathbf{x}(t)-\mathbf{R}_{1}]{\kern 2.29996pt\big{\rangle}\kern-3.80005pt\scalebox{0.35}[1.0]{$-$}\kern-5.89996pt\big{\rangle}\kern 2.29996pt}_{\Delta\mathbf{x}_{j}}{\Bigg{\rangle}\kern-3.50006pt\Bigg{\rangle}}_{\mathbf{x}(t)} (44)

This expression for the torque has the intuitive interpretation where the contribution from each surface element is the cross-product of the displacement vector from the rotation center to the surface point with the Casimir force density associated with that surface element.

IV Numerical Results

In this section we demonstrate the feasibility and good performance of the above methods for numerically differentiating worldline path integrals. As in previous work [19], the basic Casimir–Polder calculation of an atom interacting with a planar dielectric interface, along with the Casimir energy of two thin, parallel, planar dielectric membranes, will serve as the test cases for these methods.

IV.1 Partial Averaging

Fig. 4 demonstrates the utility of the Hermite-weighting method of Eq. (11) for computing derivatives of path integrals. The plot shows the results of the numerical evaluation of the path integral (4) for the Casimir–Polder potential of an atom near a dielectric half-space, along with the computed spatial derivatives up to the tenth. Since the potential and its derivatives are normalized to the potential in the perfect-conductor limit, the analytic result is distance-independent, and has the same form in each case, given by the expression

ηTE(χ)=16+1χ1+χ2χsinh1χ2χ3/2,\eta_{\mathrm{\scriptscriptstyle TE}}(\chi)=\frac{1}{6}+\frac{1}{\chi}-\frac{\sqrt{1+\chi}}{2\chi}-\frac{\sinh^{-1}\!\sqrt{\chi}}{2\chi^{3/2}}, (45)

as discussed in Ref. [19] (while not completely realistic [34], this model suffices for a numerical test).

Some aspects of the calculations in this figure are worth discussing here. These computations nominally employed N=105N=10^{5} points per path. However, at finite NN, the error analysis in Ref. [19] indicates that numerical accuracy suffers, particularly at large values of the susceptibility χ\chi, because the finitely sampled path does not have the same “extent” as the same path in the continuum limit. To help maintain accuracy at large χ\chi, the paths employ some limited, finer sampling: the two path intervals on either side of the point closest to the dielectric interface are each sampled with 10310^{3} more points (see App. A for the algorithm to generate these sub-paths). This strategy substantially alleviates the major source of sampling error at large χ\chi, while negligibly impacting the computational effort. In terms of the number m=km=k of partial averages, we make the simplistic choice of choosing a fixed value of mm for each calculation (m=10m=10, 20, 200, 200, and 500 partial averages were employed for n=1n=1, 2, 4, 7, and 10 derivatives, respectively), despite the indication of Eq. (18) that the number of partial averages should be chosen to be inversely proportional to 𝒯\mathcal{T} to maintain a controlled error. This is justified by noting that the partial averages can be chosen to have small errors for small values of 𝒯\mathcal{T}, and the effects of the resulting larger error for large values of 𝒯\mathcal{T} will be suppressed by the factor 𝒯3\mathcal{T}^{-3} in the path integral (4). (For high-accuracy evaluation of the path integral, the partial averages should instead be chosen in a 𝒯\mathcal{T}-dependent way.)

Another major numerical challenge that arises in Fig. 4 in the case of high-order derivatives comes from the Hermite-polynomial factor in Eq. (11). One issue here is that the Hermite polynomial takes on large values for large values of |x¯mx0||\bar{x}_{m}-x_{0}|. But the Gaussian path measure in the path integral only generates such large values rarely. This means that, with ordinary Gaussian paths, rare events make large contributions to the ensemble, leading to poor statistical accuracy in the numerical computations. In these calculations, we employed the direct solution of sampling x¯m\bar{x}_{m} from the Hermite–Gaussian density

PHn(x¯m)=ηnπmΔ𝒯|Hn(x¯mx0mΔ𝒯)|e(x¯mx0)2/mΔ𝒯,P_{H_{n}}(\bar{x}_{m})=\frac{\eta_{n}}{\sqrt{\pi m\Delta\mathcal{T}}}\left|H_{n}\!\left(\frac{\bar{x}_{m}-x_{0}}{\sqrt{m\Delta\mathcal{T}}}\right)\right|e^{-(\bar{x}_{m}-x_{0})^{2}/m\Delta\mathcal{T}}, (46)

where the factor

ηn1:=2π0𝑑x|Hn(x)|ex2\eta_{n}^{-1}:=\frac{2}{\sqrt{\pi}}\int_{0}^{\infty}\!\!dx\,\left|H_{n}(x)\right|\,e^{-x^{2}} (47)

normalizes the probability distribution. Then a Gaussian deviate δxm\delta x_{m} of zero mean and variance m(12m/N)Δ𝒯/2m(1-2m/N)\Delta\mathcal{T}/2 allows the first and last path steps to be generated according to xm=x¯m+δxmx_{m}=\bar{x}_{m}+\delta x_{m} and xNm=x¯mδxmx_{N-m}=\bar{x}_{m}-\delta x_{m}, and the remainder of the path is generated as a Brownian bridge running from xmx_{m} to xNmx_{N-m} in time (N2m)Δ𝒯(N-2m)\Delta\mathcal{T} (see App. A for the bridge-generating algorithm). With these modified paths, the path average (11) should be modified to read

nx0nI\displaystyle\frac{\partial^{n}}{\partial x_{0}^{n}}I ηn1(mΔ𝒯)n/2Φ[𝐱(t)]sgn[Hn(z¯)]Hn,\displaystyle\approx\eta_{n}^{-1}(m\Delta\mathcal{T})^{-n/2}\,{\bigg{\langle}\kern-3.50006pt\bigg{\langle}}{\Phi[\mathbf{x}(t)]\,\mathrm{sgn}\big{[}H_{n}(\bar{z})\big{]}}{\bigg{\rangle}\kern-3.50006pt\bigg{\rangle}}_{H_{n}}, (48)

where z¯:=(x¯mx0)/mΔ𝒯\bar{z}:=(\bar{x}_{m}-x_{0})/\sqrt{m\Delta\mathcal{T}}. Because the Hermite polynomial can take either sign, a great deal of cancellation occurs in Eq. (48) among the paths, which can again lead to poor statistical performance for high-order derivatives, when the Hermite polynomial has multiple regions of opposing sign. To combat this, for a given path, the path functional can be averaged over multiple values of x¯m\bar{x}_{m} (holding the rest of the path fixed) to effect this cancellation on a pathwise basis. The calculations in Fig. 4, used averages over 1, 5, 100, 5000, and 5000 values of x¯m\bar{x}_{m} per path for n=1n=1, 2, 4, 7, and 10 derivatives, respectively, where the x¯m\bar{x}_{m} were sampled from a sub-random (1D van der Corput) sequence to enhance the accuracy of this subaverage.

The numerical performance in Fig. 4 is generally quite good, although performance suffers for high-order derivatives. All of the data here represent statistical averages over 10810^{8} paths (except for n=10n=10 derivatives, which averages over 10910^{9} paths). The points at a given derivative order nn were computed using the same random numbers, so the points within a curve are not statistically independent. The error bars (delimiting one standard error) are invisibly small on the plot, and amount to a relative statistical error of at most 0.2%0.2\%, 0.5%0.5\%, 0.7%0.7\%, 0.8%0.8\%, 2%2\%, and 2%2\% for n=0n=0, 1, 2, 4, 7, and 10 derivatives, respectively. The observed accuracy of the results is comparable to the standard error in each case except for the 10th derivative, where the observed error is at worst 14%, despite the extra computational effort. However, note that a comparable computation of the 10th derivative via the finite-difference method would be completely unfeasible. For an effective resolution of N=108N=10^{8} points per path (with N=105N=10^{5} and subsampling of 10310^{3} points as described above), a length scale of the order N1/2=104N^{-1/2}=10^{-4} is appropriate for the finite difference, but this leads to a standard deviation in the path values of the order of 104010^{40} relative to the mean.

Refer to caption
Figure 4: Numerical evaluation of the path integral (4) for the (normalized, dimensionless) Casimir–Polder potential of an atom near a dielectric half-space, as a function of the (dimensionless) dielectric susceptibility χ\chi (data shown as circles). The remaining curves, each successively offset by a factor of 10210^{-2} for clarity, show spatial derivatives of the potential according to the method of Eq. (11), for n=1n=1 (squares), 22 (diamonds), 44 (triangles), 77 (inverted triangles), and 1010 (stars) derivatives. The solid lines give the analytic result (45) for comparison in each case. Error bars delimit one standard error. Details of the calculations are given in the text, but the computational difficulty increases with increasing nn, and accuracy noticeably suffers by the n=10n=10 case. The same random numbers are used for all the points in the same curve.

IV.2 Convergence: Finite Differences vs. Partial Averages

Refer to caption
Figure 5: Magnitude of the relative error in the computation of (a) one spatial derivative and (b) two derivatives of the atom–surface Casimir–Polder potential, for a surface dielectric susceptibility χ=100\chi=100. The plots compare the performance of the finite-difference (circles) and partial-averaging (triangles) methods. The finite-difference data are plotted with respect to the spatial displacement δ\delta, normalized to the atom–surface distance dd, while the partial-averaging results are plotted as a function of the averaging fraction m/Nm/N, where mm appears in Eq. (16) and NN is the number of points per discrete path. The calculations employed paths with N=104N=10^{4} points per path, averaging over 101110^{11} paths. Error bars delimit one standard error. The lines are fits to the data (except for the second derivative in the finite-difference case), and the intersection (marked by a star) gives the estimated best performance of the method. Data points within each method are statistically independent.
Refer to caption
Figure 6: Magnitude of the relative error in the computation of (a) one spatial derivative and (b) two derivatives of the atom–surface Casimir–Polder potential. The calculations here are similar to those in Fig. 5, except here the surface is a perfect conductor (χ\chi\longrightarrow\infty). Also, the calculations here employed paths with N=106N=10^{6} points per path (with subpaths of 10510^{5} points on either side of the point closest to the surface), averaging over 10910^{9} paths. Other details are as in Fig. 5.

To study the numerical error of the partial-averaging method in more detail, we performed the same calculations as in the previous section for one and two spatial derivatives of the Casimir–Polder potential for an atom near a planar interface, while varying the number mm of partial averages (Figs. 5 and 6). To simplify the analysis, mm is held constant (independent of 𝒯\mathcal{T}), ignoring the error-control criterion (18). For comparison, the plots also show the corresponding errors when computing the derivatives via finite differences. The first derivative employs the second-order, centered-difference formula VCP(d)=[VCP(d+δ)VCP(dδ)]/2δ+O(δ2)V^{\prime}_{\mathrm{\scriptscriptstyle CP}}(d)=[V_{\mathrm{\scriptscriptstyle CP}}(d+\delta)-V_{\mathrm{\scriptscriptstyle CP}}(d-\delta)]/2\delta+O(\delta^{2}), where δ\delta is a small spatial displacement. The second derivative exploits the analogous difference formula VCP′′(d)=[VCP(d+δ)2VCP(d)+VCP(dδ)]/δ2+O(δ2)V^{\prime\prime}_{\mathrm{\scriptscriptstyle CP}}(d)=[V_{\mathrm{\scriptscriptstyle CP}}(d+\delta)-2V_{\mathrm{\scriptscriptstyle CP}}(d)+V_{\mathrm{\scriptscriptstyle CP}}(d-\delta)]/\delta^{2}+O(\delta^{2}). In implementing the finite-difference methods, it is important to apply these difference formulae on a path-wise basis (or equivalently, apply the difference formulae on ensemble averages over equivalent path samples) for this method to produce any kind of reasonable result. In applying the finite-difference method, the numerical details (path generation, calculation of path averages, etc.) otherwise match those of previous work (see Ref. [19], Section V). Although the error for both the partial-averaging and finite-difference methods behaves similarly in the plots, note that the quantities m/Nm/N and δ/d\delta/d from the two methods are not directly comparable. In the partial-averaging method, mm sets a length scale mΔ𝒯=(m/N)𝒯\sqrt{m\Delta\mathcal{T}}=\sqrt{(m/N)\mathcal{T}} that varies with 𝒯\mathcal{T} in the integral in Eq. (4). However, it is customary practice for the finite-difference method to use a displacement δ\delta independent of the details of the rest of the calculation, so δ\delta represents a fixed length scale, independent of 𝒯\mathcal{T}. Nevertheless, the plots provide a useful visual comparison of the performance of the two methods.

The performance of the two methods for a dielectric susceptibility χ=100\chi=100 (Fig. 5) is similar in minimizing the relative error in the case of one derivative. However, the partial-averaging method performs clearly better in the two-derivative case. Although χ1\chi\gg 1 in this computation, for numerical purposes this calculation is in a “small-χ\chi” regime because NχN\gg\chi [19]. In terms of the path integral, this means that, in the first-derivative case, when comparing two slightly displaced copies of the same path that overlaps the dielectric interface, the difference in the path-average functional ϵr3/2\langle\epsilon_{\mathrm{r}}\rangle^{-3/2} from the path integral (4) will be small, of the order 1/N1/N for sufficiently small displacements. Finite differences tend to work well when operating on smooth functions, and this is exactly what Fig. 5(a) shows: despite the noisy nature of the paths, the path integral in this regime is relatively well behaved, allowing the finite differences to exhibit performance comparable to that of the partial-averaging method. The clear separation between the methods in Fig. 5(b) highlights the better performance of the partial-averaging method for derivatives beyond the first.

Figure 5 also shows fits to the data (the range of each fit is shown in App. C, Table 1). On the side of small (δ/d)(\delta/d) or (m/N)(m/N), the data are fit to a(δ/d)1/2a(\delta/d)^{-1/2} or a(m/N)1/2a(m/N)^{-1/2} in Fig. 5a, and to a(m/N)1a(m/N)^{-1} in Fig. 5b. This reflects the (δ/d)n/2(\delta/d)^{-n/2} or (m/N)n/2(m/N)^{-n/2} scaling expected of the statistical error in the case of nn derivatives [particularly in the latter case, where Eq. (11) has a prefactor that scales in this way]. On the side of large (δ/d)(\delta/d) or (m/N)(m/N), the logarithms of the data (on both axes) are fit to a second-order polynomial. The crossings of the corresponding curves are marked by stars, which give the best error expected from the method. The relative errors in the first-derivative methods are both around 2×1052\times 10^{-5} and the relative error in the second-derivative partial-average method is around 4×1054\times 10^{-5}. The first-derivative error also exhibits a spurious dip (actually a zero), as noted above, for δ/d\delta/d near 0.20.2. However, this does not represent a reliable error minimum in a more general calculation. Rather, the asymptotic (δ/d)2(\delta/d)^{2} scaling only just becomes visible in a relatively narrow interval (near the center of the interval marked between δ/d=103\delta/d=10^{-3} and 10110^{-1}) before the statistical error takes over. This region represents the true best-case error of this method in this calculation.

The difference in performance between the methods is even more clear in the perfect-conductor (χ\chi\longrightarrow\infty) limit (Fig. 6). In both the first- and second-derivative cases the partial-averaging method achieves substantially better accuracy than the finite-difference method. The contrast is particularly striking for the second derivative, where the finite difference achieves a minimum error of around 20%, making the method effectively useless in this regime. (Note that in the finite difference of the first derivative, there is a spurious zero near δ/d=0.2\delta/d=0.2, as discussed above.) The poor performance of the finite difference is consistent with the argument in the introduction. In the perfect-conductor regime, slightly shifted paths can produce path-functional values that differ by much more than δ\delta—the path-average functional ϵr3/2\langle\epsilon_{\mathrm{r}}\rangle^{-3/2} from the path integral (4), after renormalization, leads to a null value for paths that do not overlap the interface, but a value of unity for overlapping paths. This leads to large statistical errors in a finite, numerical path average, because finite differences lead to path-functional values switching between zero and δn\delta^{-n} for nn derivatives. Also, as is evident in the data, the systematic errors become relatively large in this regime as well, especially in the case of the second derivative. In fact, because we know from prior work [19] that the calculations in the perfect-conductor limit are subject to larger systematic errors than small-χ\chi (i.e., NχN\gg\chi) calculations, we used substantially more points per path in the large-χ\chi calculations (N=106N=10^{6} compared to N=104N=10^{4} for χ=100\chi=100, with the addition here of sub-path sampling, using 10510^{5} points per interval near the path point closest to the surface, as described in the previous section; to keep the numerical effort comparable in the two cases, the large-χ\chi results average over 10910^{9} paths, compared to the 101110^{11} paths in the χ=100\chi=100 case).

The same curve fits were applied in Fig. 6 (fit ranges in App. C, Table 1). For the first derivative, the finite-difference best relative error is 5×1045\times 10^{-4}, while the partial-average best relative error is 1×1041\times 10^{-4}, a difference of a factor of 5. In the second-derivative case, the partial-average method performs much better than the finite-difference, with a relative error of 3×1043\times 10^{-4}.

At this point it is worth reiterating one of the main motivations for developing the partial-averaging method for numerical differentiation. The computation of the Casimir–Polder potential in the case of transverse-magnetic (TM) polarization involves the second derivative of a path integral with a path-integral potential that is highly singular at a dielectric interface. Indeed, the TM potential at an interface between finite-χ\chi dielectric materials turns out to be far more pathological than the above behavior of the TE path integral for an interface in the χ\chi\longrightarrow\infty limit. This pathological behavior is problematic when applying the finite-difference method to the numeric differentiation of the TM path integral. However, as we will show in a future publication, the partial-averaging method is a serviceable alternative method for computing the TM-polarization potential.

IV.3 Casimir Force and Curvature

Refer to caption
Figure 7: Numerical evaluation of the derivatives of the path integral (2) for the (normalized, dimensionless) Casimir potential of two dielectric thin planes, as a function of the (dimensionless) susceptibility parameter χ^\hat{\chi} (data shown as circles). The first (n=1n=1) derivative is shown (circles) along with the second (n=2n=2) derivative (squares, offset by a factor 10210^{-2} for clarity). The solid lines give the derivatives of the analytic result (50) for comparison in each case. The calculation used 10910^{9} paths of 10510^{5} points per path. Error bars delimit one standard error (on the order of a few times 10410^{-4} to a few times 10310^{-3} in this plot). The same random numbers are used for the points in each curve.
Refer to caption
Figure 8: Magnitude of the relative error in the computation of (a) one spatial derivative and (b) two derivatives of the Casimir potential for 2 thin planes, for susceptibility parameter χ^=1\hat{\chi}=1. The plots compare the performance of the finite-difference (circles) and partial-averaging (triangles) methods; the second derivative additionally has one finite difference applied to each surface (squares). The finite-difference data are plotted with respect to the spatial displacement δ\delta, normalized to the atom–surface distance dd, while the partial-averaging results are plotted as a function of the averaging fraction m/Nm/N, where mm appears in Eq. (16) and NN is the number of points per discrete path. The calculations employed paths with N=105N=10^{5} points per path, averaging over 10910^{9} paths. Error bars delimit one standard error. The lines are fits to the data, and the intersection (marked by a star) gives the estimated best performance of the method. Data points within each method are statistically independent.
Refer to caption
Figure 9: Magnitude of the relative error in the computation of (a) one spatial derivative and (b) two derivatives of the Casimir potential for 2 thin planes, for susceptibility parameter χ^=0.01\hat{\chi}=0.01. Details are as in Fig. 8.

The numerical methods of Section III for computing derivatives for Casimir-energy path integrals are similar to the partial-averaging method applied to the Casimir–Polder path integral in the previous section. Fig. 7 shows the results of such a computation, calculating the Casimir force (first derivative of the Casimir energy) and the curvature (second derivative of the Casimir energy) between two thin dielectric plates, where the total susceptibility and the relative permittivity are

χ(z)=χ^δ(z)+χ^δ(zd),ϵr(z)=1+χ(z).\chi(z)=\hat{\chi}\delta(z)+\hat{\chi}\delta(z-d),\qquad\epsilon_{\mathrm{r}}(z)=1+\chi(z). (49)

Here, viewing the delta-function limit as an idealization of a square profile of a dielectric of finite thickness aa, then χ^=χa\hat{\chi}=\chi a, where χ\chi is the susceptibility of the medium. The plot compares the numerical data to the exact Casimir force or curvature. When normalized to the potential in the perfect-conductor limit (EEM/A=π2c/720d3E_{\mathrm{\scriptscriptstyle EM}}/A=-\pi^{2}\hbar c/720d^{3}), the Casimir energy has the form

γTE(χ)=180π40𝑑ξξ21𝑑pplog(1r2epξ)\gamma_{\mathrm{\scriptscriptstyle TE}}(\chi)=-\frac{180}{\pi^{4}}\int_{0}^{\infty}\!d\xi\,\xi^{2}\int_{1}^{\infty}\!dp\,p\log\!\left(1-r^{2}e^{-p\xi}\right) (50)

in terms of the Fresnel coefficient r=ξ(χ^/d)/(2p+ξχ^/d)r=-\xi(\hat{\chi}/d)/(2p+\xi\hat{\chi}/d). This expression depends on χ^\hat{\chi} and dd only in the combination χ^/d\hat{\chi}/d; in the limit dχ^d\gg\hat{\chi}, this efficiency is γTE27χ^2/4π4d2\gamma_{\mathrm{\scriptscriptstyle TE}}\approx{27\hat{\chi}^{2}}/{4\pi^{4}d^{2}}, for a d5d^{-5} far-field distance dependence, while in the limit dχ^d\ll\hat{\chi}, the efficiency is γTE1/2\gamma_{\mathrm{\scriptscriptstyle TE}}\approx 1/2 (i.e., the strong-coupling limit). The data are compared to derivatives of this expression with respect to dd.

The numerical method solves the exponential form (2) of the path integral; the only error that is not statistical is in treating the two surfaces as independent. That is, the error is in treating the occupation time for each delta-function surface independently, not both surfaces together. This explains the much better performance of the finite-difference method compared to Figs. 5 and 6. The numerical tests implement Eqs. (30) and (III.2), as appropriate for an exponential path integral. The discrete paths over NN points are averaged over all sub-paths between the points xj+1x_{j+1} and xjx_{j}; in the one-body approximation, the appropriate quantity is the local time (rather, its generating function) and its derivative, detailed in Appendix B. Values for 𝒯\mathcal{T} and ss are Monte-Carlo sampled. We also take advantage of the fact that any contributing path must cross any plane between the surfaces. That is, we may start paths midway between the two planes, with a reweighting factor of N(x+x)/2N(x_{+}-x_{-})/2, where x+x_{+} is the smallest path coordinate such that x+>x0x_{+}>x_{0} (or just x0x_{0} if no other such point exists), and xx_{-} is the largest path coordinate such that x<x0x_{-}<x_{0} (or just x0x_{0} if no other such point exists).

The partial-averaging method amounts to looking for path segments that get close enough to the boundaries; details are given in Sec. III.1, particularly Eqs. (30), (34), and (III.2). Similar to the Casimir–Polder case, renormalization of the one-body energy is necessary to obtain a finite result. For the first derivative, we compute the one-body energy for the undifferentiated surface, and subtract it from the total energy. For the second derivative (III.2), where one derivative is applied to each surface, no renormalization is necessary.

For the finite-difference method, with renormalization of the one-body energies, the path integral has the form

I(𝐑1,𝐑2)=p(𝐑1,𝐑2)p1(𝐑1)p2(𝐑2),I(\mathbf{R}_{1},\mathbf{R}_{2})=p(\mathbf{R}_{1},\mathbf{R}_{2})-p_{1}(\mathbf{R}_{1})-p_{2}(\mathbf{R}_{2}), (51)

where pp is the two-body energy, pjp_{j} is the one-body energy of body jj, and 𝐑j\mathbf{R}_{j} is the position of body jj. The first derivative is computed according to a standard, second-order finite difference, which for the zz component reads

z^𝐑1I\displaystyle\hat{z}\cdot\nabla_{\mathbf{R}_{1}}I =12δ[p(𝐑1+z^δ,𝐑2)p1(𝐑1+z^δ)\displaystyle=\frac{1}{2\delta}\Big{[}p(\mathbf{R}_{1}+\hat{z}\delta,\mathbf{R}_{2})-p_{1}(\mathbf{R}_{1}+\hat{z}\delta) (52)
p(𝐑1z^δ,𝐑2)+p1(𝐑1z^δ)],\displaystyle\hskip 42.67912pt-p(\mathbf{R}_{1}-\hat{z}\delta,\mathbf{R}_{2})+p_{1}(\mathbf{R}_{1}-\hat{z}\delta)\Big{]},

where δ\delta is some small perturbation. The second derivative is also computed according to a second-order finite difference,

(z^𝐑1)2I\displaystyle(\hat{z}\cdot\nabla_{\mathbf{R}_{1}})^{2}I =1δ2[p(𝐑1+z^δ,𝐑2)p1(𝐑1+z^δ)\displaystyle=\frac{1}{\delta^{2}}\Big{[}p(\mathbf{R}_{1}+\hat{z}\delta,\mathbf{R}_{2})-p_{1}(\mathbf{R}_{1}+\hat{z}\delta)
+p(𝐑1z^δ,𝐑2)p1(𝐑1z^δ)\displaystyle\hskip 34.1433pt+p(\mathbf{R}_{1}-\hat{z}\delta,\mathbf{R}_{2})-p_{1}(\mathbf{R}_{1}-\hat{z}\delta)
2p(𝐑1,𝐑2)+2p1(𝐑1)].\displaystyle\hskip 34.1433pt-2p(\mathbf{R}_{1},\mathbf{R}_{2})+2p_{1}(\mathbf{R}_{1})\Big{]}. (53)

A better comparison with the partially averaged second derivative is

(z^𝐑1)2I\displaystyle(\hat{z}\cdot\nabla_{\mathbf{R}_{1}})^{2}I =14δ2[p(𝐑1+z^δ,𝐑2+z^δ)\displaystyle=-\frac{1}{4\delta^{2}}\Big{[}p(\mathbf{R}_{1}\!+\!\hat{z}\delta,\mathbf{R}_{2}\!+\!\hat{z}\delta)
p(𝐑1z^δ,𝐑2+z^δ)\displaystyle\hskip 42.67912pt-p(\mathbf{R}_{1}\!-\!\hat{z}\delta,\mathbf{R}_{2}\!+\!\hat{z}\delta)
p(𝐑1+z^δ,𝐑2z^δ)\displaystyle\hskip 42.67912pt-p(\mathbf{R}_{1}\!+\!\hat{z}\delta,\mathbf{R}_{2}\!-\!\hat{z}\delta)
+p(𝐑1z^δ,𝐑2z^δ)],\displaystyle\hskip 42.67912pt+p(\mathbf{R}_{1}\!-\!\hat{z}\delta,\mathbf{R}_{2}\!-\!\hat{z}\delta)\Big{]}, (54)

applying one derivative to each interface.

We observe good agreement with the exact results (Fig. 7). The calculations employed 10910^{9} paths, each of 10510^{5} points per path. The first derivative used partial averaging over 300 points, while the second derivative used 250 points. The relative error in the first derivative ranges from 3.5×1033.5\times 10^{-3} for small χ^\hat{\chi} to 4×1044\times 10^{-4} for large χ^\hat{\chi}, and for the second derivative, the relative error ranges from 1.2%1.2\% at the low end to around 3×1033\times 10^{-3} at χ^=1\hat{\chi}=1, though the error rises to about 4%4\% for the highest χ^\hat{\chi}.

Figs. 8 and 9 show the errors of the partial-average method vs. the finite difference (and in the case of the second derivative, of one finite difference applied to each side). These plots display the relative error vs. the normalized separation δ/d\delta/d for the finite-difference methods, or the partial-averaging fraction m/Nm/N, as described in Section III.1. As in Figs. 5 and 6, the lines for small χ^\hat{\chi} are curve fits to a(δ/d)1/2a(\delta/d)^{-1/2} or a(10m/N)1/2a(10m/N)^{-1/2} in Figs. 8a and 9a, and to a(δ/d)1/2a(\delta/d)^{-1/2}, a(10m/N)1/2a(10m/N)^{-1/2}, or a(δ/d)1a(\delta/d)^{-1}, as indicated in Figs. 8b and 9b (fit ranges indicated in App. C, Table 2). For large χ^\hat{\chi}, the curve fits are second-order polynomials to the log of the data (on both axes). The intersection of the small-χ^\hat{\chi} and large-χ^\hat{\chi} curves is marked with a star, and gives an estimate of the best error of the method. The partial-averaging method outperforms the finite-difference method for the first derivative in Fig. 8a, for χ^=1\hat{\chi}=1 (where the best error is 1.5×1041.5\times 10^{-4} for partial averaging, vs. 4.9×1044.9\times 10^{-4} for finite difference). The partial average still outperforms the finite difference for the second derivative in Fig. 8b, again for χ^=1\hat{\chi}=1 (where the best error is 1.4×1031.4\times 10^{-3} for partial averaging, vs. 4.1×1034.1\times 10^{-3} for finite difference, or 2.8×1032.8\times 10^{-3} for finite difference, one derivative applied to each side). For χ^=0.01\hat{\chi}=0.01 (Fig. 9), while the advantage persists for one derivative (where the best error is 5.6×1045.6\times 10^{-4} for partial averaging, vs. 1.0×1031.0\times 10^{-3} for finite difference); however, for the second derivative, the performance is roughly the same (3.8×1033.8\times 10^{-3} for partial averaging, vs. 4.0×1034.0\times 10^{-3} for finite difference, or 4.9×1034.9\times 10^{-3} for finite difference, one derivative applied to each side). For χ^=100\hat{\chi}=100 and the χ^\hat{\chi}\longrightarrow\infty limit (both not shown), the methods are comparable in error for both the first and second derivative. So the partial average sometimes performs substantially better than finite differences, and never performs substantially worse. But it should also be appreciated that this partial average method is much faster than finite differences near the optimum value, because of the large time jumps near the surfaces involved.

The method that we have tested here clearly extends to a general geometry. It involves counting the intersections with one (or both) surfaces, and replacing one intersection (or one for each surface) with its derivative. It is thus not geometry-specific. The only requirement for partial averaging is that the typical distance covered during a large jump is small compared to a length scale where the nearest surface can be considered flat (assuming that a flat-surface approximation is employed, for example, in a sphere-sphere geometry [35]).

V Summary

We have developed methods for computing derivatives of Casimir–Polder and Casimir-type path integrals. Such derivatives are notable for being difficult to compute using finite differences, because they converge badly—a path only contributes if it marginally touches a surface, but has a large contribution, leading to a large sample variance. For Casimir–Polder-type path integrals, our method involves partial averaging over the region around the atom, which cuts off the sample variance from diverging. For Casimir-type integrals, the method involves counting all intersections with surfaces, and differentiating one of the subpaths. The partial averaging method there involves simply skipping large steps in time, leading to a large gain in computation time. In a future publication, we will apply this method to the Casimir–Polder potential for transverse-magnetic modes, which involves a second derivative.

Appendix A Brownian-Bridge Generation

The numerical evaluation of the path integrals in this paper and other work on worldline methods involves the generation of discrete, stochastic paths. The basic stochastic process is the Brownian bridge B(t)B(t), which in its most basic form is subject to initial and final conditions B(0)=B(1)=0B(0)=B(1)=0, and diffuses continuously as a Wiener process for intermediate times [i.e., dB(t)=0\langle\!\langle dB(t)\rangle\!\rangle=0 and dB(t)dB(t)=δ(tt)dt\langle\!\langle dB(t)\,dB(t^{\prime})\rangle\!\rangle=\delta(t-t^{\prime})\,dt for t,t(0,1)t,t^{\prime}\in(0,1)]. The discrete representation of a Brownian bridge follows from the more general probability density (7). Samples BjB_{j} of a Brownian bridge in NN discrete steps may then be generated in a numerical calculation via the recurrence relation

Bj=cjNzj+cjBj1(j=1,,N1),B_{j}=\sqrt{\dfrac{c_{j}}{N}}\,z_{j}+c_{j}B_{j-1}\quad(j=1,\ldots,N-1), (55)

where B0=BN=0B_{0}=B_{N}=0, the zkz_{k} are random deviates sampled from the standard-normal distribution, and the recursion coefficients are

cj:=NjNj+1.c_{j}:=\dfrac{N-j}{N-j+1}. (56)

This algorithm was discussed in previous work [19] (and is a variation of the “v-loop” algorithm of Gies et. al [6]).

In the numerical methods of this paper, it is necessary to generate samples of more general, “open” Brownian bridges that are subject to different initial and final conditions. (Specifically, this applies to the partial-averaging method as discussed in Sec. IV.1, and the finer path sampling around the “extremal” path point in the same section.) Under the conditions B(0)=aB(0)=a and B(t)=bB(t)=b, the above recurrence generalizes to

Bj=\displaystyle B_{j}= cjΔtzj+cj(Bj1b)+b\displaystyle\sqrt{c_{j}\,\Delta t}\,z_{j}+c_{j}(B_{j-1}-b)+b
(j=1,,N1),\displaystyle\hskip 85.35826pt(j=1,\ldots,N-1), (57)

where B0=aB_{0}=a, BN=bB_{N}=b, the bridge takes NN intermediate steps (each of time Δt=t/N\Delta t=t/N), and the cjc_{j} are still given by Eq. (56).

In the partial-averaging construction of paths in Sec. II.2, some portion of a path is constructed according to some consideration, and the generalized bridge recursion serves to fill in the rest of the path. For example, sampling from the Hermite–Gaussian density (46), after partial averaging, gives the first mm path steps at the beginning and end of the path, and a Brownian bridge must then complete the path in N2mN-2m steps. To write out the algorithm more explicitly for this problem, suppose the “whole” path corresponds to an NN-step, discrete Brownian bridge B(t)B(t) with B(1)=B(0)=0B(1)=B(0)=0, and that we take the path coordinate Bk=B(t=k/N)B_{k}=B(t=k/N) after kk steps to be given. The above recursion then constructs a bridge from BkB_{k} to B0B_{0} in Nk:=NkN_{k}:=N-k steps over a running time 1(k/N)=Nk/N1-(k/N)=N_{k}/N. Because there are NkN_{k} time steps of duration Δt=(Nk/N)/Nk=1/N\Delta t=(N_{k}/N)/N_{k}=1/N, the recurrence (57) reads

Bj=\displaystyle B_{j}= cjNzj+cj(Bj1b)+b\displaystyle\sqrt{\dfrac{c_{j}}{N}}\,z_{j}+c_{j}(B_{j-1}-b)+b
(j=k+1,,N1)\displaystyle\hskip 85.35826pt(j=k+1,\ldots,N-1) (58)

when adapted to this situation. The coefficients cj=(Nkj)/(Nkj+1)c_{j}=(N_{k}-j)/(N_{k}-j+1) reduce to the expression (56) in terms of NN if the index jj is shifted by kk, so that jj starts at k+1k+1 [note that this shift has already been applied in the recursion (58)]. Thus, the recursion (58) has the form of the last NkN-k steps of the recursion (57)—an intuitive way to think of “completing” the path once the first kk steps are fixed.

Appendix B Local Time

For a stochastic process y(t)y(t), the local time is defined as [36]

[y(t);d]:=0t𝑑τδ[y(τ)d].\ell[y(t);d]:=\int_{0}^{t}d\tau\delta[y(\tau)-d]. (59)

The local time quantifies the amount of time that the process spends near a boundary at dd during the interval [0,t][0,t]. It is related to the sojourn time TsT_{s}, which measures the amount of time that the process spends in the state y(t)>dy(t)>d, through the derivative

[y(t);d]=dTs[y(t);d].\ell[y(t);d]=-\partial_{d}T_{s}[y(t);d]. (60)

(See Ref. [19] for a definition and some statistics of the sojourn time.) The local times of a Wiener process with y(0)=ay(0)=a and y(t)=by(t)=b are distributed according to the probability density

f(x)\displaystyle f_{\ell}(x) =[1e[(ba)2(|ad|+|bd|)2]/2t]δ(x0+)\displaystyle=[1-e^{[(b-a)^{2}-(|a-d|+|b-d|)^{2}]/2t}]\,\delta(x-0^{+})
+1t(x+|ad|+|bd|)\displaystyle+\frac{1}{t}(x+|a-d|+|b-d|)
×e[(ba)2(x+|ad|+|bd|)2]/2t.\displaystyle\hskip 14.22636pt\times e^{[(b-a)^{2}-(x+|a-d|+|b-d|)^{2}]/2t}. (61)

An important quantity for the local time that we use in the simulations is the moment generating function, which takes the form

es\displaystyle{\Big{\langle}\kern-3.50006pt\Big{\langle}}e^{-s\ell}{\Big{\rangle}\kern-3.50006pt\Big{\rangle}} =1πt2s\displaystyle=1-\sqrt{\frac{\pi t}{2}}\,s\,
×exp[(ba)2+s2t2+2st(|bd|+|ad|)2t]\displaystyle\times\exp\left[\frac{(b-a)^{2}+s^{2}t^{2}+2st(|b-d|+|a-d|)}{2t}\right]
×erfc(|bd|+|ad|+st2t),\displaystyle\times\text{erfc}\left(\frac{|b-d|+|a-d|+st}{\sqrt{2t}}\right), (62)

again with y(0)=ay(0)=a, y(t)=by(t)=b. This expression, along with its derivative with respect to dd, is used in the simulations in Sec. IV.3.

Appendix C Endpoints for Curve Fits

Here the endpoints for the curve fits are listed for Figs. 5 and 6 (Table 1), and 8 and 9 (Table 2). We list these since the fit results may depend somewhat on the choice of endpoint. In many cases, points near the crossover between the two curves are excluded because it is not clear where they should be assigned.

Figure curve small 𝝌\boldsymbol{\chi} large 𝝌\boldsymbol{\chi}
low high low high
5a finite difference (δ/d)(\delta/d) 10410^{-4} 4.5×1034.5\times 10^{-3} 9.1×1039.1\times 10^{-3} 4.096×1014.096\times 10^{-1}
5a partial average (m/N)(m/N) 10410^{-4} 4.5×1034.5\times 10^{-3} 3.62×1023.62\times 10^{-2} 4.096×1014.096\times 10^{-1}
5b partial average (m/N)(m/N) 10410^{-4} 1.81×1021.81\times 10^{-2} 3.62×1023.62\times 10^{-2} 4.096×1014.096\times 10^{-1}
6a finite difference (δ/d)(\delta/d) 10410^{-4} 1.1×1031.1\times 10^{-3} 3.2×1033.2\times 10^{-3} 7.24×1027.24\times 10^{-2}
6a partial average (m/N)(m/N) 10410^{-4} 1.81×1021.81\times 10^{-2} 3.62×1023.62\times 10^{-2} 4.096×1014.096\times 10^{-1}
6b partial average (m/N)(m/N) 10410^{-4} 2.56×1022.56\times 10^{-2} 5.12×1025.12\times 10^{-2} 4.096×1014.096\times 10^{-1}
Table 1: Fit ranges for Figs. 5 and 6.
Figure curve small 𝝌^\boldsymbol{\hat{\chi}} large 𝝌^\boldsymbol{\hat{\chi}}
low high low high
8a finite difference (δ/d)(\delta/d) 10410^{-4} 9.1×1039.1\times 10^{-3} 2.56×1022.56\times 10^{-2} 2.897×1012.897\times 10^{-1}
8a partial average (10m/N)(10m/N) 10410^{-4} 5.12×1025.12\times 10^{-2} 1.024×1011.024\times 10^{-1} 4.096×1014.096\times 10^{-1}
8b finite difference (δ/d)(\delta/d) 10410^{-4} 5.12×1025.12\times 10^{-2} 1.024×1011.024\times 10^{-1} 2.897×1012.897\times 10^{-1}
8b partial average (10m/N)(10m/N) 10410^{-4} 2.56×1022.56\times 10^{-2} 5.12×1025.12\times 10^{-2} 4.096×1014.096\times 10^{-1}
8b fd, 1 derivative each (δ/d)(\delta/d) 10410^{-4} 2.56×1022.56\times 10^{-2} 5.12×1025.12\times 10^{-2} 2.897×1012.897\times 10^{-1}
9a finite difference (δ/d)(\delta/d) 10410^{-4} 1.28×1021.28\times 10^{-2} 2.56×1022.56\times 10^{-2} 2.897×1012.897\times 10^{-1}
9a partial average (10m/N)(10m/N) 10410^{-4} 1.449×1011.449\times 10^{-1} 2.048×1012.048\times 10^{-1} 4.096×1014.096\times 10^{-1}
9b finite difference (δ/d)(\delta/d) 10410^{-4} 1.024×1011.024\times 10^{-1} 2.048×1012.048\times 10^{-1} 2.897×1012.897\times 10^{-1}
9b partial average (10m/N)(10m/N) 10410^{-4} 7.24×1027.24\times 10^{-2} 1.449×1011.449\times 10^{-1} 4.096×1014.096\times 10^{-1}
9b fd, 1 derivative each (δ/d)(\delta/d) 10410^{-4} 7.24×1027.24\times 10^{-2} 1.024×1011.024\times 10^{-1} 2.897×1012.897\times 10^{-1}
Table 2: Fit ranges for Figs. 8 and 9.

References

  • Casimir [1948] H. B. G. Casimir, Proc. K. Ned. Akad. Wet. 51, 793 (1948).
  • Casimir and Polder [1948] H. B. G. Casimir and D. Polder, Phys. Rev. 73, 360 (1948).
  • Lifshitz [1956] E. Lifshitz, J. Exper. Theoret. Phys. USSR 29, 94 (1956).
  • Chan et al. [2001] H. B. Chan, V. A. Aksyuk, R. N. Kleiman, D. J. Bishop, and F. Capasso, Science 291, 1941 (2001).
  • Harber et al. [2005] D. M. Harber, J. M. Obrecht, J. M. McGuirk, and E. A. Cornell, Phys. Rev. A 72, 033610 (2005).
  • Gies, Langfeld, and Moyaerts [2003] H. Gies, K. Langfeld, and L. Moyaerts, J. High Energy Phys. 2003, 018 (2003).
  • Gies and Klingmüller [2006] H. Gies and K. Klingmüller, J. Phys. A 39, 6415 (2006).
  • Gies and Klingmüller [2006a] H. Gies and K. Klingmüller, Phys. Rev. Lett. 96, 220401 (2006a).
  • Gies and Klingmüller [2006b] H. Gies and K. Klingmüller, Phys. Rev. Lett. 97, 220405 (2006b).
  • Gies and Klingmüller [2006c] H. Gies and K. Klingmüller, Phys. Rev. D 74, 045002 (2006c).
  • Klingmüller and Gies [2008] K. Klingmüller and H. Gies, J. Phys. A 41, 164042 (2008).
  • Weber and Gies [2009] A. Weber and H. Gies, Phys. Rev. D. 80, 065033 (2009).
  • Fosco, Lombardo, and Mazzitelli [2010] C. Fosco, F. Lombardo, and F. Mazzitelli, Phys. Lett. B 690, 189 (2010).
  • Weber and Gies [2010] A. Weber and H. Gies, Phys. Rev. Lett. 105, 040403 (2010).
  • Aehlig et al. [2011] K. Aehlig, H. Dietert, T. Fischbacher, and J. Gerhard,  (2011), arXiv:1110.5936 .
  • Schäfer, Huet, and Gies [2012] M. Schäfer, I. Huet, and H. Gies, Int. J. Mod. Phys. Conf. Ser. 14, 511 (2012).
  • Mazur and Heyl [2015] D. Mazur and J. S. Heyl, Phys. Rev. D 91, 065019 (2015).
  • Schäfer, Huet, and Gies [2016] M. Schäfer, I. Huet, and H. Gies, J. Phys. A 49, 135402 (2016).
  • Mackrory, Bhattacharya, and Steck [2016] J. B. Mackrory, T. Bhattacharya, and D. A. Steck, Phys. Rev. A 94, 042508 (2016).
  • Schneider, Torgrimsson, and Schützhold [2018] C. Schneider, G. Torgrimsson, and R. Schützhold, Phys. Rev. D 98, 085009 (2018).
  • Franchino-Viñas and Gies [2019] S. Franchino-Viñas and H. Gies, Phys. Rev. D 100, 105020 (2019).
  • Corradini and Muratori [2020] O. Corradini and M. Muratori, J. High Energy Phys. 2020, 169 (2020).
  • Rajeev [2021] K. Rajeev, Phys. Rev. D 104, 105014 (2021).
  • Bastianelli and Paciarini [2024] F. Bastianelli and M. D. Paciarini, Class. Quantum Grav. 41, 115002 (2024).
  • Scardicchio and Jaffe [2006] A. Scardicchio and R. L. Jaffe, Nucl. Phys. B 743, 249 (2006).
  • Glasserman [2004] P. Glasserman, Monte Carlo Methods in Financial Engineering (Springer, 2004).
  • Asmussen and Glynn [2007] S. Asmussen and P. W. Glynn, Stochastic Simulation (Springer, 2007).
  • Matacz [2002] A. Matacz, J. Comput. Finance 6, 79 (2002).
  • Predescu [2003] C. Predescu, J. Math. Phys. 44, 1226 (2003).
  • Feynman [1948] R. P. Feynman, Rev. Mod. Phys. 20, 367 (1948).
  • Kac [1949] M. Kac, Trans. Amer. Math. Soc. 64, 1 (1949).
  • Durrett [1996] R. Durrett, Stochastic Calculus: A Practial Introduction (CRC Press, 1996).
  • Karatzas and Shreve [1991] I. Karatzas and S. E. Shreve, Brownian Motion and Stochastic Calculus (Spring-Verlag, 1991).
  • Babb, Klimchitskaya, and Mostepanenko [2004] J. F. Babb, G. L. Klimchitskaya, and V. M. Mostepanenko, Phys. Rev. A 70, 042901 (2004).
  • Schoger et al. [2022] T. Schoger, B. Spreng, G.-L. Ingold, A. Lambrecht, P. A. M. Neto, and S. Reynaud, Int. J. Mod. Phys. A 37, 2241005 (2022).
  • Borodin and Salminen [2002] A. N. Borodin and P. Salminen, Handbook of Brownian Motion—Facts and Formulae, 2nd ed. (Birkhäuser, 2002).