Expand this Topic clickable element to expand a topic
Skip to content
Optica Publishing Group

Symplectic numerical methods in optics and imaging: ray tracing in spherical gradient-index lenses and computer-generated image rendering

Open Access Open Access

Abstract

This paper provides an introduction to symplectic numerical integration techniques and examines various optical applications. We first outline the fundamentals of Hamiltonian optics and detail the construction of a symplectic method via the splitting technique. Numerical experiments involving a selection of spherically symmetric gradient-index lenses compare the accuracy of various first-, second-, and fourth-order symplectic methods with equivalent nonsymplectic methods. The best-performing methods are then further tested as part of an image rendering task involving nonlinear ray tracing, comparing the trace time required by each method. Future improvements, recommendations, and uses for symplectic ray tracing are also considered.

Published by Optica Publishing Group under the terms of the Creative Commons Attribution 4.0 License. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI.

1. INTRODUCTION

Symplectic ray tracing was born out of Hamiltonian optics, first described by William Rowan Hamilton in his 1828 paper, Theory of Systems of Rays [1]. Indeed, Hamilton’s formalism was then applied to dynamics more generally [2], where it is now a fundamental component of undergraduate courses in both classical and quantum mechanics [3,4]. While several volumes have been published specifically on Hamiltonian optics [57], Hamilton’s analysis is seldom exploited to its full potential, typically being neglected in favor of an equivalent Lagrangian framework, which has indeed proved useful for ray tracing in gradient-index (GRIN) media [810].

Nonetheless, by adopting the Hamiltonian perspective, we may construct numerical techniques for ray tracing in GRIN media that are both accurate and computationally inexpensive. Since the calculation of ray trajectories in GRIN lenses typically requires the solution of a hyperbolic nonlinear partial differential equation whose solution is analytical only in certain cases [11], numerical methods prove to be indispensable for nonlinear ray tracing [12].

Unfortunately, however, symplectic ray tracing has not been given much consideration over the past two decades, despite numerous advances being made in the underlying theory [1315]. Furthermore, most papers examining the application of symplectic numerical techniques to optical problems require that the reader be familiar with differential geometry [16]. Additional publications demand a decent knowledge of group theory to fully appreciate a proposed Hamiltonian alternative to Seidel aberrations for the creation of freeform optical systems [17,18].

This paper instead aims to provide a useful working knowledge of symplectic integration techniques, thereby enabling these numerical methods to be used for GRIN ray tracing without requiring prior familiarity with differential geometry or group theory. In particular, we also include second-order methods in our analysis, which are often omitted in other publications, presumably on the assumption that fourth-order methods give more accurate results [16,19]. The remainder of this paper has six additional sections plus an appendix. Section 2 provides a brief overview of the mathematical preliminaries necessary for Hamiltonian optics. Section 3 then describes the construction of a symplectic numerical method via the splitting technique. Section 4 compares the accuracy of symplectic and nonsymplectic methods when ray tracing a selection of lenses with spherically symmetric index profiles. The computation times required by the most accurate methods identified in Section 4 are examined when rendering a test image in Section 5. A more detailed discussion takes place in Section 6. Section 7 concludes the paper. Appendix A contains numerical recipes for each integration method used in Section 4.

2. OVERVIEW OF HAMILTONIAN OPTICS

Numerous treatments of Hamiltonian optics begin by deriving an optical Lagrangian as a consequence of Fermat’s principle before performing a Legendre transform on this Lagrangian to obtain the associated optical Hamiltonian [2022]. While interested readers are directed to [23] for a more thorough derivation, we dispense with this procedure for the sake of brevity, choosing instead to derive the necessary optical Hamiltonian directly from the eikonal equation [24]

$${\left({\frac{{\partial S}}{{\partial x}}} \right)^2} + {\left({\frac{{\partial S}}{{\partial y}}} \right)^2} + {\left({\frac{{\partial S}}{{\partial z}}} \right)^2} = {n^2}(x,y,z),$$
where $n(x,y,z)$ is the refractive index, and $S$ is the optical path length, defined as ${\rm d}S = n\;{\rm d}s$, with ${\rm d}s = ({\rm d}{x^2} + {\rm d}{y^2} + {\rm d}{z^2}{)^{1/2}}$ representing an infinitesimal change in the geometric path length. Taking the total differential ${\rm d}S$ of the optical path via the chain rule, we find
$${\rm d}S = \nabla S \cdot {\rm d}{\textbf q},$$
where $\nabla S$ is the gradient of the optical path vector and ${\rm d}{\textbf q}$ is the differential of the position vector ${\textbf q} = (x,y,z{)^T}$. Recalling that by definition ${\rm d}S = n\;{\rm d}s$, therefore we may write
$$n\;{\rm ds} = \nabla S \cdot {\rm d}{\textbf q},$$
then, multiplying both sides by $n/{\rm d}s$
$${n^2} = \nabla S \cdot n\frac{{{\rm d}{\textbf q}}}{{{\rm d}s}},$$
and ${n^2} = |\nabla S{|^2} = \nabla S \cdot \nabla S$ from Eq. (1),
$$\nabla S = n\frac{{{\rm d}{\textbf q}}}{{{\rm d}s}},$$
which provides us with a definition for the optical momentum ${\textbf p} = ({p_x},{p_y},{p_z}{)^T}$, so called due to its similarity to momentum in mechanics
$${\textbf p}: = n\frac{{{\rm d}{\textbf q}}}{{{\rm d}s}}.$$

Now, differentiating ${\textbf p}$ with respect to $s$

$$\begin{split}\frac{{\rm d}}{{{\rm d}s}}\left({n\frac{{{\rm d}{\textbf q}}}{{{\rm d}s}}} \right) &= \frac{{\rm d}}{{{\rm d}s}}(\nabla S) \\ &= \frac{{{\rm d}{\textbf q}}}{{{\rm d}s}} \cdot \nabla (\nabla S).\end{split}$$
Then, rearranging Eq. (5) $(\nabla S)/n = {\rm d}{\textbf q}/{\rm d}s$, we get
$$\begin{split}\frac{{\rm d}}{{{\rm d}s}}\left({n\frac{{{\rm d}{\textbf q}}}{{{\rm d}s}}} \right) &= \frac{{\nabla S}}{n} \cdot \nabla (\nabla S) \\ &= \frac{{\nabla (\nabla {S^2})}}{{2n}}.\end{split}$$

Recalling $|\nabla S{|^2} = {n^2}$ from Eq. (1), once again

$$\frac{{\rm d}}{{{\rm d}s}}\left({n\frac{{{\rm d}{\textbf q}}}{{{\rm d}s}}} \right) = \frac{{\nabla {n^2}}}{{2n}}.$$

Finally, multiplying both sides by $n$, we get

$$n\frac{{{\rm d}{\textbf p}}}{{{\rm d}s}} = \nabla \left({\frac{{{n^2}}}{2}} \right).$$

Defining ${\rm d}t = {\rm d}s/n$, we now reformulate Eq. (1) as a system of six ordinary differential equations

$$\begin{split}\frac{{{\rm d}x}}{{{\rm d}t}} &= {p_x},\quad \frac{{{\rm d}{p_x}}}{{{\rm d}t}} = \frac{\partial}{{\partial x}}\left({\frac{{{n^2}}}{2}} \right), \\ \frac{{{\rm d}y}}{{{\rm d}t}} &= {p_y},\quad \frac{{{\rm d}{p_y}}}{{{\rm d}t}} = \frac{\partial}{{\partial y}}\left({\frac{{{n^2}}}{2}} \right), \\ \frac{{{\rm d}z}}{{{\rm d}t}} &= {p_z},\quad \frac{{{\rm d}{p_z}}}{{{\rm d}t}} = \frac{\partial}{{\partial z}}\left({\frac{{{n^2}}}{2}} \right).\end{split}$$

However, to avoid confusion, some caution is warranted. Although the parameter $t$ is analogous to time in a dynamical system and is even referred to as time in existing literature [13,25], it does not represent physical time. Nevertheless, by making this change of variables, the optical momenta simply become the direction cosines for their respective axes. Furthermore, by choosing to parameterize our system in terms of $t$, we transform Eq. (1) from a partial differential equation into a system of Hamilton’s equations for some optical Hamiltonian $H$. Thus, we may now write

$$\begin{split}{p_x} &= \frac{{\partial H}}{{\partial {p_x}}},\quad \frac{\partial}{{\partial x}}\left({\frac{{{n^2}}}{2}} \right) = - \frac{{\partial H}}{{\partial x}}, \\ {p_y} &= \frac{{\partial H}}{{\partial {p_y}}},\quad \frac{\partial}{{\partial y}}\left({\frac{{{n^2}}}{2}} \right) = - \frac{{\partial H}}{{\partial y}}, \\ {p_z} &= \frac{{\partial H}}{{\partial {p_z}}},\quad \frac{\partial}{{\partial z}}\left({\frac{{{n^2}}}{2}} \right) = - \frac{{\partial H}}{{\partial z}}.\end{split}$$

Solving for $H$ in Eq. (12) is then a straightforward exercise that provides the optical Hamiltonian

$$H = \frac{1}{2}\left[{p_x^2 + p_y^2 + p_z^2 - {n^2}(x,y,z)} \right].$$

The merits of Hamilton’s formulation of geometric optics become more apparent by examining the dissimilarities in the behavior of symplectic and nonsymplectic numerical methods. Figure 1 illustrates how a ray’s position and optical momentum calculated during each iteration are handled differently by each method. A nonsymplectic method will update a ray’s optical momentum and position using data obtained exclusively from the previous iteration, while a symplectic method initially calculates the ray’s optical momentum. Then, with this updated momentum, it obtains the ray’s position during the same iteration. Hence, the error of a symplectic method is bounded for a greater number of iterations when compared to an equivalent nonsymplectic one [14,15,26]. A useful consequence of this result is that symplectic numerical methods are typically more accurate than their nonsymplectic counterparts, particularly when using a relatively large step between successive iterations [14,15].

 figure: Fig. 1.

Fig. 1. Differences between symplectic and nonsymplectic methods, with ${\textbf p}$ and ${\textbf q}$ representing a ray’s optical momentum and position vectors, respectively. By using the momentum calculated during the same iteration to update the ray’s position, symplectic methods typically produce more accurate results.

Download Full Size | PDF

3. CONSTRUCTING A SYMPLECTIC NUMERICAL METHOD

The application of symplectic methods to ray tracing in GRIN media is made possible by the fact that Eq. (13) is of the form $H = P({p_x},{p_y},{p_z}) + N(x,y,z)$, making it separable. This allows the terms dependent on the ray’s position and optical momentum to be treated independently. Symplectic numerical methods for separable Hamiltonians are constructed via splitting, giving two separate iterative schemes to calculate the position and optical momentum of a given ray. Constructing the relevant iterative schemes first requires us to solve Hamilton’s equations in matrix form. First, we combine the position and momentum vectors for a given ray into a single matrix ${\textbf z} = ({\textbf p},{\textbf q})$ and define the Liouville operator ${D_H}$ [27] to act on ${\textbf z}$, so

$${D_H}{\textbf z}: = \sum\limits_{i = 1}^3 \left({\frac{{\partial {\textbf z}}}{{\partial {q_i}}}\frac{{\partial H}}{{\partial {p_i}}} + \frac{{\partial {\textbf z}}}{{\partial {p_i}}}\frac{{\partial H}}{{\partial {q_i}}}} \right),$$
where ${\textbf z} = ({\textbf p},{\textbf q})$, with ${\textbf p}$ and ${\textbf q}$, as before, representing a ray’s position and optical momentum vectors for a given ray. The system in Eq. (12) may now be written more concisely as
$$\frac{{{\rm d}{\textbf z}}}{{{\rm d}t}} = {D_H}{\textbf z}.$$

Treating ${D_H}$ as a vector operator, the solution to Eq. (15) takes the form of a matrix exponential

$${\textbf z}(t) = \left[{\exp (t{D_H})} \right]{\textbf z}(0).$$

Recalling that Eq. (13) is separable, if we further define

$$\begin{split}{{D_P}{\textbf z}}&: = {\sum\limits_{i = 1}^3 \left({\frac{{\partial {\textbf z}}}{{\partial {q_i}}}\frac{{\partial H}}{{\partial {p_i}}}} \right),}\\{{D_N}{\textbf z}}&: = {\sum\limits_{i = 1}^3 \left({\frac{{\partial {\textbf z}}}{{\partial {p_i}}}\frac{{\partial H}}{{\partial {q_i}}}} \right),}\end{split}$$
we then observe ${D_H} \cdot = {D_P} \!\cdot + \;{D_N} \cdot$, where “$\cdot$” represents the vector operand. By choosing sets of coefficients $\{{c_i}\} $ for the optical momentum and $\{{d_i}\}$ for the ray’s position, we subdivide the difference between 0 and $t$ into $m$ equal parts, where $m$ is known as the order of the numerical method. For our numerical method to be consistent (i.e., useful), we require $\sum_{i = 1}^{m}c_{i} = \sum_{i=1}^m d_{i}=1$. Hence, assuming an infinitesimally small $t$, we now write
$$\exp [t({D_P} + {D_N})] = \prod\limits_{i = 1}^m \exp (t{c_i}{D_P})\exp (t{d_i}{D_N}) + O({t^{m + 1}}).$$

However, this does not exclude the possibility of negative coefficients in the case where the sums of $\{{c_i}\}$ and $\{{d_i}\}$ would otherwise be greater than unity. Forest and Ruth [28], for instance, provide a concrete example of a fourth-order method with negative coefficients and is considered in Appendix A. Next, carrying out first-order Taylor series expansions of $\exp (t{c_i}{D_P})$ and $\exp (t{d_i}{D_N})$, we get

$$\exp (t{c_i}{D_P}) = I + t{D_P} + O({t^2}),$$
$$\exp (t{d_i}{D_N}) = I + t{D_N} + O({t^2}).$$

In the simplest case of a first-order method (i.e., taking ${c_i} = {d_i} = 1$), if we know the state of a given ray ${{\textbf z}_n}$ at $t = n$, we may calculate ${{\textbf z}_{n + 1}}\,\,{\rm at}\,\,{t_{n + 1}} = {t_n} + \Delta t$, where $\Delta t$ is some small, finite difference between subsequent iterations, by multiplying Eq. (19) by ${{\textbf z}_n}$ before substituting the result into Eq. (20). We then obtain the symplectic Euler method [15]

$$\begin{split}{{p_{{i_{n + 1}}}}}& = { {p_{{i_n}}} - \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\Delta t,}\\{{q_{{i_{n + 1}}}}}& = { {q_{{i_n}}} + \frac{{\partial P({p_{{i_{n + 1}}}})}}{{\partial {p_i}}}\Delta t.}\end{split}$$

Higher-order symplectic methods can then be constructed by choosing appropriate values for ${c_i}$ and ${d_i}$. However, finding the optimal values for these coefficients often involves a large system of equations that may not have an exact solution [2830].

Tables Icon

Table 1. Lenses Used in These Numerical Experiments and Their Respective Index Profilesa

4. RESULTS OF NUMERICAL EXPERIMENTS

To test the validity of symplectic methods to solve optical problems, simulated traces with a monochromatic light source of wavelength $\lambda = 589.3\;{\rm nm}$ were carried out within a selection of spherical, radially symmetric lenses, each of radius ${R_0} = 1\;{\rm mm}$, all of which have been extensively studied in existing optical literature. The Luneburg [31] and Maxwell fish-eye [32] lenses are classical GRIN elements that have found applications as directional antennae for radio and microwave devices [33,34] and more recently at optical wavelengths [35]. While the Luneburg lens will direct a collimated bundle of rays to a single focus on its surface, the Maxwell fish-eye is described as an absolute optical instrument, theoretically capable of ideal point-to-point imaging in a three-dimensional space [36].

The Eaton lens [37] and the optical black hole (also referred to as a concentrator lens) [25] differ from the Luneburg and Maxwell fish-eye lenses with refractive index profiles that are singular at their centers, providing a significant challenge to numerical methods that may be used to traces these lenses. Thankfully, however, we may take advantage of analogies that exist between such singular GRIN lenses and systems examined in other fields; the ray path within the Eaton lens, for instance, is effectively identical to the trajectory of a body in the Kepler problem of celestial mechanics [38]. The Eaton lens is gradually finding applications as a beam deflector [39], while the optical black hole could prove useful for laboratory astrophysics [40].

Table 1 provides further details about each of the four lenses used during numerical experiments where six numerical methods were chosen to trace each lens. However, for the Eaton lens, the symplectic Chin-Chen 4A method [41] developed for celestial mechanics was also tested because of the Eaton lens’ behavior as an optical analogue for celestial mechanics. Table 2 provides information on the order and symplecticity of each method used, with their associated numerical recipes presented in Appendix A.

Tables Icon

Table 2. Numerical Methods Used to Ray Trace Each Lensa

Since the Luneburg and Maxwell fish-eye lenses directed all rays to a single focal point, it was possible to trace multiple rays and examine their behavior simultaneously. However, as the Eaton lens and optical black hole direct each individual ray to a unique focus, only a single ray was traced in these lenses. The initial ray heights for the single rays in the Eaton lens and optical black hole were ${y_0} = 0.58{R_0}$ and ${y_0} = 0.94{R_0}$, respectively. These values were chosen so each numerical method would be challenged to maintain its accuracy in the vicinity of the singularity and avoid producing erroneous unphysical results.

Figure 2 depicts numerical ray traces through the Luneburg and Maxwell fish-eye lenses, with the first and third columns depicting the traces in their entirety while the second and fourth columns present a detailed view of the focal points. The step-size values range from $\Delta t = \lambda $ to $\Delta t = 100\lambda $, where $\lambda = 589.3\;{\rm nm}$. The exact solution is depicted in each case by a continuous blue line. As one might expect, the disparity between the numerical methods decreases with a reduction in $\Delta t$ and an increase in method order $m$. For the Luneburg lens, all methods with the exception of the Euler method are indistinguishable from each other and the exact solution for $\Delta t = \lambda$. Significant discrepancies between each of the methods are not readily visible until $\Delta t = 100\lambda$, where each of the methods can be easily identified, though significant overlap is still observed between RK2, RK4, and Forest and Ruth’s method. For Maxwell’s fish-eye, however, both the Euler method and the symplectic Euler method deviate noticeably at $\Delta t = \lambda$, with both methods disappearing from the inset when $\Delta t$ is increased to $100\lambda$. Each of the second- and fourth-order methods then follow suit, accumulating greater errors also deviating significantly from the expected focal point as $\Delta t$ reaches $100\lambda$. RK2, in particular, appears to significantly underestimate the focal distance, while the velocity Verlet method displays the opposite behavior, overestimating the focal distance, thought not to the same extent. RK4 and Forest and Ruth’s method both appear to underestimate the focal distance by approximately same amount, indicating unsurprisingly that any differences between symplectic and nonsymplectic methods appear to diminish with an increase in method order for the same choice of step size.

 figure: Fig. 2.

Fig. 2. Numerical traces through Luneburg (left) and Maxwell fish-eye (right) lenses, each of radius ${R_0}$. The region shown in each right-hand column is marked on each trace in the left-hand column by a black rectangle and depicts the focal point in greater detail.

Download Full Size | PDF

For both the Luneburg and Maxwell fish-eye lenses, Fig. 4 indicates that symplectic methods tend to exhibit lower focus errors than their nonsymplectic counterparts of the same order, with the focus error being defined as the difference between the numerical and exact focus along the lens perimeter, divided by the lens circumference, normalized in terms of the lens radius ${R_0}$. The dashed horizontal line represents the Airy disk radius, providing a benchmark for diffraction-limited imaging. Consequently, any error values below this line may be considered exact. Most noticeably, the symplectic Euler method vastly outperforms the standard Euler method by several orders of magnitude for the Luneburg lens and approximately one order of magnitude for the Maxwell fish-eye. The initial conditions presented in Fig. 4 for the Luneburg and Maxwell fish-eye lenses are associated with the rays in Fig. 2 whose optical momentum experiences the greatest rate of change. Differences between the fourth-order methods are much less drastic, with both RK4 and Forest and Ruth’s method producing errors on the same order of magnitude. However, for second-order methods, the results are much more surprising; the velocity Verlet method is the only method for which the numerical trace is diffraction limited for all step sizes examined. It not only outperforms RK2, but also RK4 and Forest and Ruth’s method, particularly when $\Delta t \gt 5\lambda$ for the Luneburg lens and when $\Delta t = 2.5\lambda $ or $25\lambda$ for the Maxwell fish-eye, suggesting that the increased computational expense incurred by using higher-order methods is not necessarily justified by greater accuracy. This is especially true of the Luneburg lens when $\Delta t = \lambda$, where the velocity Verlet method is exact to within machine precision.

A similar analysis is presented for the Eaton lens and optical black hole in Fig. 3, where the symplectic methods once again generally appear to offer superior performance to nonsymplectic methods, particularly at larger step sizes. For the Eaton lens with $\Delta t = 10\lambda$, the symplectic Euler method not only outperforms the standard Euler method (which is only contained within the inset for $\Delta t = \lambda$) but also proves more accurate than RK2. For $\Delta t = 100\lambda$, both RK4 and the Chin-Chen 4A method appear to offer the most accurate solutions, suggesting that the use of methods developed outside optics also could be of benefit for numerical ray tracing. Although it does not dominate all other methods to the same extent as it did with the Luneburg lens and Maxwell fish-eye, the velocity Verlet method still appears to perform somewhat well, particularly when compared to RK2, with the velocity Verlet method focusing just outside the inset. In contrast, Forest and Ruth’s method performs somewhat poorly here, requiring a smaller step size to match the results produced by RK4 and the velocity Verlet method. Nonetheless, Forest and Ruth’s method does mimic their behavior at least in a qualitative sense by overestimating the focusing ability of the Eaton lens. The Chin-Chen 4A method instead follows trajectories similar to all other methods, where the focusing ability of the lens is underestimated. Thus, the combination of an overestimating method with an underestimating one would perhaps form the basis for a successful predictor–corrector scheme, although this would presumably come at an elevated computational cost, especially if the methods chosen are not symplectic.

 figure: Fig. 3.

Fig. 3. Numerical traces through the Eaton lens (left) and optical black hole (right), each of radius ${R_0}$. The region shown in each right-hand column is marked on each trace in the left-hand column by a black rectangle and depicts the focal point in greater detail.

Download Full Size | PDF

In contrast to the retroreflecting behavior of the Eaton lens, the singular index profile of the optical black hole directs rays along an infinite inward spiral. However, the shaded gray circle in Fig. 3 provides a practical stopping condition and represents the event horizon of a Schwarzschild black hole with radius $0.67{R_0}$. Despite the necessary truncation of the ray paths, some surprising results may still be observed. For instance, RK4 exhibits uncharacteristically poor performance across all step sizes. Moreover, it is surpassed by all symplectic methods and even the standard Euler method when $\Delta t = 100\lambda$. Unlike the Eaton lens, however, RK2 performs similarly to the velocity Verlet method across all step sizes, providing a marked difference in its ray tracing capabilities for the two singular-index lenses. Finally, the symplectic Euler method outperforms the nonsymplectic Euler method by a considerable margin, particularly for $\Delta t \ge 10\lambda$, further emphasising the gains in accuracy that may be made through the use of symplectic numerical methods, particularly if a low-order method is desired. Furthermore, as was the case with the Eaton lens, the combination of methods that both overestimate and underestimate the focal distance (such as the velocity Verlet and Forest and Ruth’s methods, for instance) could once again form a useful predictor–corrector method, enabling a larger step size to be used.

On the whole, symplectic methods demonstrate more consistent performance across both singular lenses. Although the higher-order methods do not necessarily dominate nonsymplectic methods to the same extent as they did for the Luneburg and Maxwell fish-eye lenses, they tend to at least perform as well as the more established nonsymplectic algorithms at smaller step sizes. This is especially true of the optical black hole, where Forest and Ruth’s method exhibits the lowest error of all methods for $\Delta t = \lambda$, while RK4’s focus error remains almost constant for all chosen step sizes, as depicted in Fig. 4. Differences in the error between the symplectic and standard Euler methods for both the Eaton lens and optical black hole follow a similar general trend of decreasing with the step size, although the error values tend to oscillate less than those of the Luneburg lens and Maxwell fish-eye. A noteable exception, however, is Forest and Ruth’s method with $\Delta t = 2.5\lambda$ for the optical black hole, where the error increases once again for $\Delta t = \lambda$. By constrast, for the Eaton lens, RK4 still appears to be the most accurate choice for most step sizes, being the only method that offers a diffraction-limited image for a step size greater than $10\lambda$. Nonetheless, differences in the accuracy between RK4 and Forest and Ruth’s method for the Eaton lens become almost negligible when $\Delta t = \lambda$. Additionally, the Chin-Chen 4A method appears to underperform at smaller step sizes, with the velocity Verlet method making it almost redundant by offering similarly accurate solutions while demanding less computational resources.

 figure: Fig. 4.

Fig. 4. Error in ray tracing the Luneburg, Maxwell fish-eye, Eaton, and optical black hole lenses for numerous step sizes. The error is defined as the distance between the exact and numerical focus along the lens perimeter, divided by the lens circumference, normalized in terms of the lens radius ${R_0}$. The dashed horizontal black line represents the diffraction limit in each instance. Values below this line may be considered exact.

Download Full Size | PDF

Nevertheless, performing calculations at quadruple rather than double precision would enable us to examine any trends further and ascertain whether or not RK4 continues to hold its own versus Forest and Ruth’s method for ray tracing within the Eaton lens and also check the constancy of its focus error when tracing the optical black hole. Likewise, any differences between RK2 and the velocity Verlet method within the optical black hole could also be considered in greater detail. Indeed, the impressive performance of the velocity Verlet method within the Luneburg and Maxwell fish-eye lenses could also be further tested by higher-precision numerical experiments.

5. APPLYING SYMPLECTIC METHODS TO IMAGE RENDERING

Although it may be some time before the GRIN lenses considered in the previous section are incorporated into consumer optical devices, symplectic ray tracing finds a more immediate application in nonlinear ray tracing for rendering computer images. Considering the consistent performance of both the velocity Verlet method and Forest and Ruth’s method in the previous section, we now examine their suitability for ray tracing a black hole test image, with RK4 given as a nonsymplectic comparison. The ray trace program, written in Python, was originally made available on GitHub [42], requiring some modifications to remove dependencies on deprecated functions and the inclusion of velocity Verlet and Forest and Ruth’s methods within the existing program.

Figure 5 shows 1080 p samples of the black hole test images. In a Cartesian coordinate system whose origin is at the center of the black hole’s event horizon, the observer is located at $(x,y,z) = (0,{r_S}, - 20{r_S})$, where ${r_S}$ is the black hole’s Schwarzschild radius (i.e., the radius of its event horizon). All image rendering took place on a Dell Inspiron 5570 computer with an Intel Core i7 CPU and 8 GB of DDR4 RAM. Each ray was then traced from the observer’s location for a total of 250 iterations with a step size of $0.16{r_S}$. The rendering workload was balanced as equally as possible between four threads, with each thread running in parallel, assigned to one of the four CPU cores. At first glance, no significant differences can be seen between each of the three images in Fig. 5. However, Fig. 6 presents a normalized pixel-wise difference map between both symplectic methods and RK4. Some noticeable differences between the velocity Verlet method and RK4 may then be observed, especially in the vicinity of the black hole’s event horizon and at the edge of its accretion disk. By contrast, any discrepancies between Forest and Ruth’s method and RK4 are substantially more difficult to distinguish. The radius of the event horizon in pixels for each image was then calculated, with the results displayed in Table 3. We see that the resolutions for RK4 and Forest and Ruth’s method are identical, each resulting in an angular resolution per pixel of 64.0041 arcseconds for our observer. The angular resolution per pixel for the velocity Verlet method is marginally lower at 64.4041 arcseconds, although Fig. 5 has already demonstrated that this reduction in resolution is practically negligible.

 figure: Fig. 5.

Fig. 5. Test images (1080 p) of a Schwarzschild black hole, showing no significant difference in image quality between the three numerical methods shown. The observer is located at $(x,y,z) = (0,{r_S}, - 20{r_S})$, where the origin of this coordinate system is at the center of the black hole’s event horizon and ${r_S}$ represents its Schwarzschild radius.

Download Full Size | PDF

 figure: Fig. 6.

Fig. 6. Normalized pixel-wise difference map for Forest and Ruth’s method and the velocity Verlet method when compared to RK4. Any differences between RK4 and the velocity Verlet method are significantly more noticeable than those of Forest and Ruth’s method.

Download Full Size | PDF

Tables Icon

Table 3. Angular Resolution Per Pixel for Each of the Three Numerical Methods Used to Render 1080p Images as Observed from $(x,y,z) = (0,{r_S}, - 20{r_S})$a

 figure: Fig. 7.

Fig. 7. Plot of the necessary trace time versus image height for images with 16:9 and 4:3 aspect ratios. Both Forest and Ruth’s method and the velocity Verlet method require less time than RK4 to ray trace the same test image.

Download Full Size | PDF

Symplectic methods further demonstrate their advantage in Fig. 7, where both the velocity Verlet and Forest and Ruth’s methods provide modest reductions in the computation times required to trace the test images at various resolutions with both 16:9 and 4:3 aspect ratios. The same computer, step size, number of iterations, and observer position used to render the 1080p images in Fig. 5 were again used to render each image here. Owing to a greater number of pixels overall, each 4:3 ratio image took longer to render than a 16:9 image at the same approximate resolution. Independent of the aspect ratio, we notice that RK4 consistently requires more time to trace the same image when compared to Forest and Ruth’s method and the velocity Verlet method, with RK4 taking over 30 min to trace the largest image, yet the velocity Verlet method needs only half that time to carry out the same task. Furthermore, the difference in the time required by these two methods appears to grow with a decrease in image resolution. Forest and Ruth’s method also offers a modest reduction in the time required to trace the test image when compared to RK4. However, the fact that its image quality is virtually identical to that of the velocity Verlet method makes it a somewhat redundant choice for our task. Nonetheless, this still proves that symplectic methods prove to be a more optimal choice for nonlinear ray tracing, especially, as in our case, where the program may be executed in parallel, since parallel implementations of symplectic methods should not need extensive modification of the serial code.

Although the use of the Python language for this ray tracer made its modification straightforward, additional speed increases could be achieved by using a just-in-time Python compiler such as Cython or Numba [43,44], or even rewriting the program completely in a compiled language such as C, with multiprocessing aspects being handled by well-established parallel computing APIs such as OpenMP or MPI [45,46]. The ray tracer would presumably also stand to benefit greatly from GPU acceleration. Since only a CPU was available for the numerical experiments presented here, performance benchmarking on a GPU-enabled system would provide an interesting comparison with our present results. Symplectic numerical methods could also be tested against fast marching methods [47], another type of algorithm commonly employed to solve the eikonal equation. Nevertheless, the existing Python ray tracer could still serve as a valuable educational resource to introduce students to topics that include nonlinear ray tracing, numerical integration, and high-performance computing.

6. DISCUSSION

In general, symplectic methods offer a consistently accurate performance when ray tracing GRIN elements and often outperform popular nonsymplectic numerical techniques such as RK4. Although optics currently lags behind fields such as celestial mechanics and molecular dynamics in its adoption of symplectic methods, the velocity Verlet method appears to provide a useful template for the development of symplectic numerical methods specifically for ray tracing. Indeed, more complex optical elements such as natural and artificial eyes, for which analytical ray traces may not exist, could indeed benefit from the application of tailor-made symplectic methods. In addition to standard GRIN elements, freeform GRIN (F-GRIN) optics offer another degree of freedom in optical design, taking advantage of a lack of rotational invariance as well as a GRIN profile that may or may not be continuous [48]. A selection of bespoke symplectic numerical methods could accelerate the design and prototyping of useful F-GRIN lenses. The ability to accurately trace arbitrary F-GRIN elements would hopefully, in turn, lead to developments in fabrication and metrology, addressing in particular a current lack of useful testing methods for conventional GRIN and F-GRIN elements alike.

Moreover, each of the symplectic methods considered in this paper are explicit methods, meaning each subsequent step relies on position and optical momentum data previously obtained. Several implicit symplectic methods, often renowned for their increased numerical stability, remain to be studied. However, these methods typically require a root-solving algorithm to calculate the relevant data during each iteration, substantially increasing the computational cost required in their implementation. Nevertheless, certain index profiles could exist for which implicit methods may be used without the need for a root solver, thus eliminating any extra computational expenses incurred. Numerical methods, symplectic or otherwise, with adaptive step sizes and their application to GRIN ray tracing is another area that has yet to be explored.

7. CONCLUSION

This work emphasizes the value of symplectic numerical techniques for ray tracing GRIN media, demonstrating their increased accuracy when compared to popular nonsymplectic methods. The velocity Verlet method shows particular promise, performing better than expected when ray tracing the Luneburg lens, Maxwell fish-eye, and optical black hole. The RK4 method still performs well when tracing the Eaton lens, though the performance of Forest and Ruth’s method is equally adequate for $\Delta t = \lambda$. In all, the results presented here make a strong case for the development of specialized symplectic methods for GRIN optics where analytical ray traces may not exist. However, it is also clear that the focus error for each ray is related to that ray’s initial height. Finding an expression, empirical or otherwise, to describe the rate of change of the focus error with respect to the ray height could indeed be an area for further study. Nonetheless, in addition to future applications in optical design, symplectic methods greatly reduce the computational cost of nonlinear ray tracing, which may also be of some use to those outside the scientific community, particularly for visual effects in computer games, movies, and other forms of entertainment media.

APPENDIX A: NUMERICAL RECIPES FOR EACH METHOD USED

This appendix provides the numerical recipes for each of the methods used in this paper so that the results may be reproduced. The notation given here will be identical to that in Section 4, where $\Delta t$ represents a small step between iterations, with $P = (p_x^2 + p_y^2 + p_z^2)/2\,\,{\rm and}\,\,N = {n^2}(x,y,z)/2$.

Nonsymplectic Methods

The Euler method is given by

$${p_{{i_{n + 1}}}} = {p_{{i_n}}} - \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\Delta t, \\ {q_{{i_{n + 1}}}} = {q_{{i_n}}} + \frac{{\partial P({p_{{i_n}}})}}{{\partial {p_i}}}\Delta t.$$

The RK2 (second-order Runge–Kutta) method, an improvement in accuracy over the standard Euler method, is represented by

$$\begin{split}{p_{{i_{n + 1}}}} &= {p_{{i_n}}} - \left({\frac{{{{\hat k}_{{i_1}}} + {{\hat k}_{{i_2}}}}}{2}} \right), \\ {q_{{i_{n + 1}}}} &= {q_{{i_n}}} + \left({\frac{{{{\tilde k}_{{i_1}}} + {{\tilde k}_{{i_2}}}}}{2}} \right),\end{split}$$
where
$$\begin{split}{\hat k_{{i_1}}} &= \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\Delta t,\quad {\tilde k_{{i_1}}} = \frac{{\partial P({p_{{i_n}}})}}{{\partial {p_i}}}\Delta t, \\ {\hat k_{{i_2}}} &= \Delta t({p_{{i_n}}} + {\hat k_{{i_1}}}),\quad {\tilde k_{{i_2}}} = \Delta t({q_{{i_n}}} + {\tilde k_{{i_1}}}).\end{split}$$

The RK4 (fourth-order Runge–Kutta) method is itself an improvement in accuracy over RK2 by further subdividing the interval between successive iterations and the use of a weighted average by

$$\begin{split}{p_{{i_{n + 1}}}} &= {p_{{i_n}}} - \left({\frac{{{{\hat k}_{{i_1}}} + 2{{\hat k}_{{i_2}}} + 2{{\hat k}_{{i_3}}} + {{\hat k}_{{i_4}}}}}{6}} \right), \\ {q_{{i_{n + 1}}}} &= {q_{{i_n}}} + \left({\frac{{{{\tilde k}_{{i_1}}} + 2{{\tilde k}_{{i_2}}} + 2{{\tilde k}_{{i_3}}} + {{\tilde k}_{{i_4}}}}}{6}} \right),\end{split}$$
where
$$\begin{split}{\hat k_{{i_1}}} &= \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\Delta t,\quad {\tilde k_{{i_1}}} = \frac{{\partial P({p_{{i_n}}})}}{{\partial {p_i}}}\Delta t, \\ {\hat k_{{i_2}}} &= \Delta t\left({{p_{{i_n}}} + \frac{{{{\hat k}_{{i_1}}}}}{2}} \right),\quad {\tilde k_{{i_2}}} = \Delta t\left({{q_{{i_n}}} + \frac{{{{\tilde k}_{{i_1}}}}}{2}} \right), \\ {\hat k_{{i_3}}} &= \Delta t\left({{p_{{i_n}}} + \frac{{{{\hat k}_{{i_2}}}}}{2}} \right),\quad {\tilde k_{{i_3}}} = \Delta t\left({{q_{{i_n}}} + \frac{{{{\tilde k}_{{i_3}}}}}{2}} \right), \\ {\hat k_{{i_4}}} &= \Delta t\left({{p_{{i_n}}} + \frac{{{{\hat k}_{{i_3}}}}}{2}} \right),\quad {\tilde k_{{i_4}}} = \Delta t\left({{q_{{i_n}}} + \frac{{{{\tilde k}_{{i_3}}}}}{2}} \right).\end{split}$$

Symplectic Methods

The symplectic Euler method differs from the standard Euler method by first calculating a ray’s optical momentum and then using this newly calculated momentum to compute the ray’s position by

$$\begin{split}{p_{{i_{n + 1}}}} &= {p_{{i_n}}} - \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\Delta t, \\ {q_{{i_{n + 1}}}} &= {q_{{i_n}}} + \frac{{\partial P({p_{{i_{n + 1}}}})}}{{\partial {p_i}}}\Delta t.\end{split}$$

The velocity Verlet method is created by taking two symplectic Euler method iterations with the step size $\Delta t/2$ to get

$$\begin{split}{q_{{i_{n + 1}}}} &= {q_{{i_n}}} + \frac{{\partial P({p_{{i_n}}})}}{{\partial {p_i}}}\Delta t + \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\frac{{{{(\Delta t)}^2}}}{2}, \\ {p_{{i_{n + 1}}}} &= {p_{{i_n}}} - \left[{\frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}} + \frac{{\partial N({q_{{i_{n + 1}}}})}}{{\partial {q_i}}}} \right]\frac{{\Delta t}}{2}.\end{split}$$

This method is symmetric, meaning it is invariant under positive or negative step sizes.

Forest and Ruth’s method was initially developed for molecular dynamics simulations. Like the velocity Verlet method, it is also symmetric, described by

$$\begin{split}{p_{{i_{n + 1/4}}}} &= {p_{{i_n}}} + \left({\frac{{{2^{1/3}} + {2^{- 1/3}} + 2}}{6}} \right)\frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\Delta t, \\ {q_{{i_{n + 1/3}}}} &= {q_{{i_n}}} + \left({\frac{{{2^{1/3}} + {2^{- 1/3}} + 2}}{3}} \right){p_{{i_{n + 1/4}}}}\Delta t, \\ {p_{{i_{n + 1/2}}}} &= {p_{{i_{n + 1/4}}}} - \left({\frac{{{2^{1/3}} + {2^{- 1/3}} - 1}}{6}} \right)\frac{{\partial N({q_{{i_{n + 1/3}}}})}}{{\partial {q_i}}}\Delta t, \\ {q_{{i_{n + 2/3}}}} &= {q_{{i_{n + 1/3}}}} - \left({\frac{{{2^{7/3}} + {2^{5/3}} + 2}}{6}} \right){p_{{i_{n + 1/2}}}}\Delta t, \\ {p_{{i_{n + 3/4}}}} &= {q_{{i_{n + 2/3}}}} - \left({\frac{{{2^{1/3}} + {2^{- 1/3}} - 1}}{6}} \right)\frac{{\partial N({q_{{i_{n + 2/3}}}})}}{{\partial {q_i}}}\Delta t, \\ {q_{{i_{n + 1}}}} &= {q_{{i_{n + 2/3}}}} + \left({\frac{{{2^{1/3}} + {2^{- 1/3}} + 2}}{3}} \right){p_{{i_{n + 3/4}}}}\Delta t, \\ {p_{{i_{n + 1}}}} &= {p_{{i_{n + 3/4}}}} + \left({\frac{{{2^{1/3}} + {2^{- 1/3}} + 2}}{6}} \right)\frac{{\partial N({q_{{i_{n + 1}}}})}}{{\partial {q_i}}}\Delta t.\end{split}$$

It is perhaps worth drawing attention to the positive signs before the bracketed coefficients in the expressions for ${p_{{i_{n + 1/4}}}}$ and ${p_{{i_{n + 1}}}}$. These are not errors, but rather are the results of the coefficients being negative, as mentioned previously in Section 3.

Finally, the Chin-Chen 4A method is one of a series of symmetric fourth-order numerical methods created to solve few-body gravitational problems, which are almost mathematically identical to ray trajectories within the Eaton lens. The method itself is written as

$$\begin{split}{p_{{i_{n + 1/3}}}} &= {p_{{i_n}}} - \frac{{\partial N({q_{{i_n}}})}}{{\partial {q_i}}}\frac{{\Delta t}}{6}, \\ {q_{{i_{n + 1/2}}}} &= {q_{{i_n}}} + {p_{{i_{n + 1/3}}}}\frac{{\Delta t}}{2}, \\ {p_{{i_{n + 2/3}}}} &= {p_{{i_{n + 1/3}}}} - \left[{\frac{{\partial N({q_{{i_{n + 1/2}}}})}}{{\partial {q_i}}} - \frac{{{\partial ^2}N({q_{{i_{n + 1/2}}}})}}{{\partial q_i^2}}\frac{{{{(\Delta t)}^2}}}{{48}}} \right]\frac{{2\Delta t}}{3}, \\ {q_{{i_{n + 1}}}} &= {q_{{i_{n + 1/2}}}} + {p_{{i_{n + 2/3}}}}\frac{{\Delta t}}{2}, \\ {p_{{i_{n + 1}}}} &= {p_{{i_{n + 2/3}}}} - \frac{{\partial N({q_{{i_{n + 1}}}})}}{{\partial {q_i}}}\frac{{\Delta t}}{6}.\end{split}$$

Funding

University of Galway; Irish Research eLibrary.

Acknowledgment

Open access funding provided by Irish Research eLibrary.

B. McKeon acknowledges the work of Riccardo Antonelli in preparing and maintaining the original black hole image rendering codebase. We are also very grateful to the anonymous reviewers, whose feedback greatly improved this paper.

Disclosures

The authors declare no conflicts of interest.

Data availability

Data underlying the results presented in this paper are not publicly available at this time but may be obtained from the authors upon reasonable request.

REFERENCES

1. W. R. Hamilton, “Theory of systems of rays,” Trans. R. Irish Acad. 15, 69–174 (1828).

2. W. R. Hamilton, On a General Method in Dynamics (Richard Taylor, 1834).

3. H. Goldstein, C. Poole, and J. Safko, Classical Mechanics (American Association of Physics Teachers, 2002).

4. D. Griffiths and D. Schroeter, Introduction to Quantum Mechanics (Cambridge University Press, 2018).

5. H. Buchdahl, An Introduction to Hamiltonian Optics (Courier Corporation, 1993).

6. R. Pegis, “I. The modern development of Hamiltonian optics,” in Progress in Optics (Elsevier, 1961), vol. 1, pp. 1–29.

7. J. Synge, Geometrical Optics: An Introduction to Hamilton’s Method (Cambridge University Press, 1937).

8. W. Liu, H. Hu, F. Liu, and H. Zhao, “Manipulating light trace in a gradient-refractive-index medium: a Lagrangian optics method,” Opt. Express 27, 4714–4726 (2019). [CrossRef]  

9. J. Nichols, “Approximate solutions for propagating light beams in a material with quadratic, exponential, and quartic transverse refractive index profiles,” J. Opt. 22, 045601 (2020). [CrossRef]  

10. A. Rangwala, A. Ghodgaonkar, and R. Tewari, “Paraxial ray tracing in inhomogeneous optical media,” Opt. Eng. 37, 1025–1032 (1998). [CrossRef]  

11. E. Merchand, Gradient Index Optics (Elsevier, 2012).

12. H. Gross, Handbook of Optical Systems (Wiley Online Library, 2005), Vol. 1, Fundamentals of Technical Optics.

13. T. Satoh, “Symplectic ray tracing: a new approach to nonlinear ray tracing by using hamiltonian dynamics,” Proc. SPIE 5009, 277–285 (2003). [CrossRef]  

14. E. Hairer, C. Lubich, and G. Wanner, Geometric Numerical Integration: Structure-preserving Algorithms for Ordinary Differential Equations (Springer, 2006).

15. E. Hairer and G. Wanner, “Euler methods, explicit, implicit, symplectic,” in Encyclopedia of Applied and Computational Mathematics (Springer, 2015), pp. 451–455.

16. H. Ohno, “Symplectic ray tracing based on Hamiltonian optics in gradient-index media,” J. Opt. Soc. Am. A 37, 411–416 (2020). [CrossRef]  

17. J. Babington, “Freeform aberrations in phase space: an example,” J. Opt. Soc. Am. A 34, 1045–1053 (2017). [CrossRef]  

18. J. Babington, “Phase space aberrations in freeform and gradient index imaging systems,” Opt. Eng. 57, 105106 (2018). [CrossRef]  

19. A. Sharma, D. V. Kumar, and A. K. Ghatak, “Tracing rays through graded-index media: a new method,” Appl. Opt. 21, 984–987 (1982). [CrossRef]  

20. V. Lakshminarayanan, A. Ghatak, and K. Thyagarajan, Lagrangian Optics (Springer, 2002).

21. A. Torre, Linear Ray and Wave Optics in Phase Space: Bridging Ray and Wave Optics Via the Wigner Phase-space Picture (Elsevier, 2005).

22. K. Wolf, Geometric Optics on Phase Space (Springer, 2004).

23. A. Small and K. S. Lam, “Simple derivations of the Hamilton–Jacobi equation and the eikonal equation without the use of canonical transformations,” Am. J. Phys. 79, 678–681 (2011). [CrossRef]  

24. J. Rebordao and M. Grosmann, “Exact solutions of Eikonal equation and their relation to Hamilton characteristic functions,” Proc. SPIE 399, 178–185 (1983). [CrossRef]  

25. H. Ohno and T. Usui, “Gradient-index dark hole based on conformal mapping with etendue conservation,” Opt. Express 27, 18493–18507 (2019). [CrossRef]  

26. K. Feng and D. Wang, “Variations on a theme by Euler,” J. Comput. Math. 16, 97–106 (1998).

27. D. Donnelly and E. Rogers, “Symplectic integrators: an introduction,” Am. J. Phys. 73, 938–945 (2005). [CrossRef]  

28. E. Forest and R. Ruth, “Fourth-order symplectic integration,” Physica D 43, 105–117 (1990). [CrossRef]  

29. R. McLachlan, “Symplectic integration of Hamiltonian wave equations,” Numer. Math. 66, 465–492 (1993). [CrossRef]  

30. H. Yoshida, “Construction of higher order symplectic integrators,” Phys. Lett. A 150, 262–268 (1990). [CrossRef]  

31. R. K. Lüneburg, Mathematical Theory of Optics (University of California, 1966).

32. J. Maxwell, The Scientific Papers of James Clerk Maxwell (University Press, 1890), vol. 2.

33. A. Demetriadou and Y. Hao, “Slim Luneburg lens for antenna applications,” Opt. Express 19, 19925–19934 (2011). [CrossRef]  

34. C. Mateo-Segura, A. Dyke, H. Dyke, S. Haq, and Y. Hao, “Flat Luneburg lens via transformation optics for directive antenna applications,” IEEE Trans. Antennas Propag. 62, 1945–1953 (2014). [CrossRef]  

35. Y.-Y. Zhao, Y.-L. Zhang, M.-L. Zheng, X.-Z. Dong, X.-M. Duan, and Z.-S. Zhao, “Three-dimensional Luneburg lens at optical frequencies,” Laser Photon. Rev. 10, 665–672 (2016). [CrossRef]  

36. T. Tyc and A. Danner, “Frequency spectra of absolute optical instruments,” New J. Phys. 14, 085023 (2012). [CrossRef]  

37. J. Eaton, “An extension of the Luneberg-type lenses,” Tech. rep. (Naval Research Lab, 1953).

38. H. Buchdahl, “Kepler problem and Maxwell fish-eye,” Am. J. Phys. 46, 840–843 (1978). [CrossRef]  

39. G. Du, M. Liang, R. A. Sabory-Garcia, C. Liu, and H. Xin, “3-D printing implementation of an X-band Eaton lens for beam deflection,” IEEE Antennas Wireless Propag. Lett. 15, 1487–1490 (2016). [CrossRef]  

40. M. Kang, H. Huang, H. Xu, and F. Liu, “Optical black-hole analog in inhomogeneous photonic lattice,” in APS March Meeting Abstracts (2019), vol. 2019, pp. G70–G219.

41. S. A. Chin and C. Chen, “Forward symplectic integrators for solving gravitational few-body problems,” Celestial Mech. Dynam. Astronom. 91, 301–322 (2005). [CrossRef]  

42. R. Antonelli, “Python black hole raytracer,” GitHub (2015) [accessed 1 November 2023], https://github.com/rantonels/starless.

43. S. Behnel, R. Bradshaw, C. Citro, L. Dalcin, D. S. Seljebotn, and K. Smith, “Cython: the best of both worlds,” Comput. Sci. Eng. 13, 31–39 (2010). [CrossRef]  

44. S. K. Lam, A. Pitrou, and S. Seibert, “Numba: a LLVM-based python JIT compiler,” in Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC (2015), pp. 1–6.

45. L. Dagum and R. Menon, “OpenMP: an industry standard API for shared-memory programming,” IEEE Comput. Sci. Eng. 5, 46–55 (1998). [CrossRef]  

46. L. Clarke, I. Glendinning, and R. Hempel, “The MPI message passing interface standard,” in Programming Environments for Massively Parallel Distributed Systems: Working Conference of the IFIP WG 10.3 (Springer, 1994), pp. 213–218.

47. J. A. Sethian, “A fast marching level set method for monotonically advancing fronts,” Proc. Natl. Acad. Sci. USA 93, 1591–1595 (1996). [CrossRef]  

48. D. H. Lippman, N. S. Kochan, T. Yang, G. R. Schmidt, J. L. Bentley, and D. T. Moore, “Freeform gradient-index media: a new frontier in freeform optics,” Opt. Express 29, 36997–37012 (2021). [CrossRef]  

49. L. Verlet, “Computer ‘experiments’ on classical fluids. I. Thermodynamical properties of Lennard-Jones molecules,” Phys. Rev. 159, 98 (1967). [CrossRef]  

Data availability

Data underlying the results presented in this paper are not publicly available at this time but may be obtained from the authors upon reasonable request.

Cited By

Optica participates in Crossref's Cited-By Linking service. Citing articles from Optica Publishing Group journals and other participating publishers are listed here.

Alert me when this article is cited.


Figures (7)

Fig. 1.
Fig. 1. Differences between symplectic and nonsymplectic methods, with ${\textbf p}$ and ${\textbf q}$ representing a ray’s optical momentum and position vectors, respectively. By using the momentum calculated during the same iteration to update the ray’s position, symplectic methods typically produce more accurate results.
Fig. 2.
Fig. 2. Numerical traces through Luneburg (left) and Maxwell fish-eye (right) lenses, each of radius ${R_0}$. The region shown in each right-hand column is marked on each trace in the left-hand column by a black rectangle and depicts the focal point in greater detail.
Fig. 3.
Fig. 3. Numerical traces through the Eaton lens (left) and optical black hole (right), each of radius ${R_0}$. The region shown in each right-hand column is marked on each trace in the left-hand column by a black rectangle and depicts the focal point in greater detail.
Fig. 4.
Fig. 4. Error in ray tracing the Luneburg, Maxwell fish-eye, Eaton, and optical black hole lenses for numerous step sizes. The error is defined as the distance between the exact and numerical focus along the lens perimeter, divided by the lens circumference, normalized in terms of the lens radius ${R_0}$. The dashed horizontal black line represents the diffraction limit in each instance. Values below this line may be considered exact.
Fig. 5.
Fig. 5. Test images (1080 p) of a Schwarzschild black hole, showing no significant difference in image quality between the three numerical methods shown. The observer is located at $(x,y,z) = (0,{r_S}, - 20{r_S})$, where the origin of this coordinate system is at the center of the black hole’s event horizon and ${r_S}$ represents its Schwarzschild radius.
Fig. 6.
Fig. 6. Normalized pixel-wise difference map for Forest and Ruth’s method and the velocity Verlet method when compared to RK4. Any differences between RK4 and the velocity Verlet method are significantly more noticeable than those of Forest and Ruth’s method.
Fig. 7.
Fig. 7. Plot of the necessary trace time versus image height for images with 16:9 and 4:3 aspect ratios. Both Forest and Ruth’s method and the velocity Verlet method require less time than RK4 to ray trace the same test image.

Tables (3)

Tables Icon

Table 1. Lenses Used in These Numerical Experiments and Their Respective Index Profilesa

Tables Icon

Table 2. Numerical Methods Used to Ray Trace Each Lensa

Tables Icon

Table 3. Angular Resolution Per Pixel for Each of the Three Numerical Methods Used to Render 1080p Images as Observed from ( x , y , z ) = ( 0 , r S , 20 r S ) a

Equations (30)

Equations on this page are rendered with MathJax. Learn more.

( S x ) 2 + ( S y ) 2 + ( S z ) 2 = n 2 ( x , y , z ) ,
d S = S d q ,
n d s = S d q ,
n 2 = S n d q d s ,
S = n d q d s ,
p := n d q d s .
d d s ( n d q d s ) = d d s ( S ) = d q d s ( S ) .
d d s ( n d q d s ) = S n ( S ) = ( S 2 ) 2 n .
d d s ( n d q d s ) = n 2 2 n .
n d p d s = ( n 2 2 ) .
d x d t = p x , d p x d t = x ( n 2 2 ) , d y d t = p y , d p y d t = y ( n 2 2 ) , d z d t = p z , d p z d t = z ( n 2 2 ) .
p x = H p x , x ( n 2 2 ) = H x , p y = H p y , y ( n 2 2 ) = H y , p z = H p z , z ( n 2 2 ) = H z .
H = 1 2 [ p x 2 + p y 2 + p z 2 n 2 ( x , y , z ) ] .
D H z := i = 1 3 ( z q i H p i + z p i H q i ) ,
d z d t = D H z .
z ( t ) = [ exp ( t D H ) ] z ( 0 ) .
D P z := i = 1 3 ( z q i H p i ) , D N z := i = 1 3 ( z p i H q i ) ,
exp [ t ( D P + D N ) ] = i = 1 m exp ( t c i D P ) exp ( t d i D N ) + O ( t m + 1 ) .
exp ( t c i D P ) = I + t D P + O ( t 2 ) ,
exp ( t d i D N ) = I + t D N + O ( t 2 ) .
p i n + 1 = p i n N ( q i n ) q i Δ t , q i n + 1 = q i n + P ( p i n + 1 ) p i Δ t .
p i n + 1 = p i n N ( q i n ) q i Δ t , q i n + 1 = q i n + P ( p i n ) p i Δ t .
p i n + 1 = p i n ( k ^ i 1 + k ^ i 2 2 ) , q i n + 1 = q i n + ( k ~ i 1 + k ~ i 2 2 ) ,
k ^ i 1 = N ( q i n ) q i Δ t , k ~ i 1 = P ( p i n ) p i Δ t , k ^ i 2 = Δ t ( p i n + k ^ i 1 ) , k ~ i 2 = Δ t ( q i n + k ~ i 1 ) .
p i n + 1 = p i n ( k ^ i 1 + 2 k ^ i 2 + 2 k ^ i 3 + k ^ i 4 6 ) , q i n + 1 = q i n + ( k ~ i 1 + 2 k ~ i 2 + 2 k ~ i 3 + k ~ i 4 6 ) ,
k ^ i 1 = N ( q i n ) q i Δ t , k ~ i 1 = P ( p i n ) p i Δ t , k ^ i 2 = Δ t ( p i n + k ^ i 1 2 ) , k ~ i 2 = Δ t ( q i n + k ~ i 1 2 ) , k ^ i 3 = Δ t ( p i n + k ^ i 2 2 ) , k ~ i 3 = Δ t ( q i n + k ~ i 3 2 ) , k ^ i 4 = Δ t ( p i n + k ^ i 3 2 ) , k ~ i 4 = Δ t ( q i n + k ~ i 3 2 ) .
p i n + 1 = p i n N ( q i n ) q i Δ t , q i n + 1 = q i n + P ( p i n + 1 ) p i Δ t .
q i n + 1 = q i n + P ( p i n ) p i Δ t + N ( q i n ) q i ( Δ t ) 2 2 , p i n + 1 = p i n [ N ( q i n ) q i + N ( q i n + 1 ) q i ] Δ t 2 .
p i n + 1 / 4 = p i n + ( 2 1 / 3 + 2 1 / 3 + 2 6 ) N ( q i n ) q i Δ t , q i n + 1 / 3 = q i n + ( 2 1 / 3 + 2 1 / 3 + 2 3 ) p i n + 1 / 4 Δ t , p i n + 1 / 2 = p i n + 1 / 4 ( 2 1 / 3 + 2 1 / 3 1 6 ) N ( q i n + 1 / 3 ) q i Δ t , q i n + 2 / 3 = q i n + 1 / 3 ( 2 7 / 3 + 2 5 / 3 + 2 6 ) p i n + 1 / 2 Δ t , p i n + 3 / 4 = q i n + 2 / 3 ( 2 1 / 3 + 2 1 / 3 1 6 ) N ( q i n + 2 / 3 ) q i Δ t , q i n + 1 = q i n + 2 / 3 + ( 2 1 / 3 + 2 1 / 3 + 2 3 ) p i n + 3 / 4 Δ t , p i n + 1 = p i n + 3 / 4 + ( 2 1 / 3 + 2 1 / 3 + 2 6 ) N ( q i n + 1 ) q i Δ t .
p i n + 1 / 3 = p i n N ( q i n ) q i Δ t 6 , q i n + 1 / 2 = q i n + p i n + 1 / 3 Δ t 2 , p i n + 2 / 3 = p i n + 1 / 3 [ N ( q i n + 1 / 2 ) q i 2 N ( q i n + 1 / 2 ) q i 2 ( Δ t ) 2 48 ] 2 Δ t 3 , q i n + 1 = q i n + 1 / 2 + p i n + 2 / 3 Δ t 2 , p i n + 1 = p i n + 2 / 3 N ( q i n + 1 ) q i Δ t 6 .
Select as filters


Select Topics Cancel
© Copyright 2024 | Optica Publishing Group. All rights reserved, including rights for text and data mining and training of artificial technologies or similar technologies.