5.3. Heisenberg Uncertainty Ray Bending¶
5.3.1. Overview¶
Heisenberg Uncertainty Ray Bending (HURB), also known as Heisenberg Uncertainty Monte Carlo (HUMC), is a statistical method designed to approximate edge diffraction within Monte Carlo raytracing. This approach perturbs the direction of rays near aperture edges. The magnitude of this directional deviation is determined by the ray’s proximity to the edge and is governed by the position-momentum uncertainty principle.
The concept of applying this principle to raytracing was initially proposed by Heinisch and Chou [1], with subsequent modifications introduced by Likeness [2] and Coffey et al. [3]. Numerous studies have demonstrated HURB’s effectiveness in approximating both near-field and far-field diffraction phenomena [1][4][5].
HURB has been implemented in commercial raytracers such as TracePro [6], as well as open-source projects like ISET3D [7]. While extensions exist that incorporate the light’s phase to model interference effects [4][5][8], these are outside the scope of this work.
5.3.2. Directional Distribution¶
The principles of position and momentum can be analyzed by separating them into their respective \(x\) and \(y\) components. For the \(x\)-direction, the uncertainty principle is expressed as [6]:
In this equation, \(\Delta x\) represents the distance from the ray to the nearest aperture edge, \(\Delta p_x\) is the momentum uncertainty in the \(x\)-direction, and \(\hbar\) denotes the reduced Planck constant.
The relative directional uncertainty can be characterized by a tangent relationship [6]:
Here, \(p\) is the total momentum, defined as:
Substituting Equation (5.68) and Equation (5.70) into Equation (5.69) yields the following expression for the tangent of the uncertainty in the \(x\)-direction:
Similarly, for the \(y\)-direction, the tangent of the uncertainty is given by:
A key assumption in this model is that the tangent of the perturbed angles, \(\tan \theta_x\) and \(\tan \theta_y\), follow a bivariate normal distribution with standard deviations \(\tan \sigma_x\) and \(\tan \sigma_y\) respectively [3][5]. The probability density function is therefore:
It is worth noting that some authors [1][6] propose that the angles themselves, rather than their tangents, are normally distributed. For small angles, the small angle approximation renders both approaches equivalent. However, for larger angles, the tangent-based approach is considered more accurate for two primary reasons:
Using the tangent intrinsically limits the new ray direction to the forward half-space.
From a physical perspective, the uncertainty lies in \(\Delta p_x\) and \(\Delta p_y\). Since momentum \(p\) is constant, the uncertainty in direction is proportional to the tangent of the angle (as shown in Equation (5.69)), rather than the angle directly.
5.3.3. Aperture Edge Distances¶
Overview
The fundamental procedure, as outlined by Heinisch and Chou [1], involves identifying the direction associated with the minimum distance to an aperture edge. This shortest distance defines the minor axis of a conceptual distance ellipse. Conversely, the major axis of this ellipse is determined by fitting the largest possible area ellipse within the aperture boundaries.
These ellipse axes will be denoted as \(a\) and \(b\), and their corresponding uncertainties as \(\Delta a\) and \(\Delta b\).
Rectangle
Consider a rectangular aperture with a width of \(2B\) and a height of \(2A\), centered at coordinates \((x_0, y_0, z_0)\) and orthogonal to the z-axis. For a ray traversing the aperture at position \((x, y, z_0)\), the distances to the respective edges are given by [6]:
Fig. 5.11 Example for the HURB ellipse inside a rectangle aperture. The ray position is marked in cyan color, the ellipse in orange.¶
The direction vectors aligned with the edges are equivalent to the unit vectors in the x and y directions:
For a rotated rectangular aperture, the ray’s position must first be transformed into the rotated rectangle’s local coordinate system via a rotation operation. Conversely, the direction vectors \(a\) and \(b\) must be converted from the rotated system back into the absolute coordinate system.
Circle
For a circular aperture with radius \(R\) centered at \((x_0, y_0, z_0)\), the relative polar coordinates of a ray position \((x, y, z_0)\) within the aperture’s coordinate system are defined as:
Fig. 5.12 Example for the HURB ellipse inside a circular aperture. The ray position is marked in cyan color, the ellipse in orange.¶
The minor axis length of the ellipse, \(\Delta b\), is determined by the distance from the ray to the circular edge:
The major axis length, \(\Delta a\), is calculated by matching the curvature of the ellipse to that of the aperture. This relationship leads to the formula \(R = \Delta a^2 / \Delta b\) (as derived here), from which \(\Delta a\) is obtained:
The unit vectors defining the directions of these axes are:
It is noteworthy that the implementation within ISET3D, as observed here, does not utilize the largest-ellipse approach for defining the major axis. Instead, it directly employs the distance to the circular edge as the size of the major ellipse axis. Compared to the presented method, this alternative approach results in smaller uncertainties of \(\tan \sigma_a\).
5.3.4. New Direction Vectors¶
Composing a new direction vector for light propagating perpendicular to the aperture plane is a straightforward process. However, this becomes significantly more challenging when considering arbitrary ray angles.
A tilted incident ray effectively “sees” a projected aperture, which introduces several complexities:
The direction vectors \(a\) and \(b\) are no longer orthogonal to the ray’s propagation vector \(s\).
The calculated \(\Delta a\) and \(\Delta b\) no longer represent the true shortest distances to the aperture edges.
The actual shortest distance to the aperture edge does not necessarily lie within the aperture plane.
The vectors representing the actual shortest distances are generally not orthogonal to each other.
These actual shortest distances can occur at different starting points along the ray’s path.
Our current implementation aims to address the first three of these issues. We define new orthogonal basis vectors, \(a'\) and \(b'\), relative to the ray’s direction vector \(s\):
In this new basis, the vectors \(s\), \(b\), and \(b'\) are coplanar, and \(b'\) aligns with the direction of the shortest distance to the aperture edge. While \(s\) and \(a'\) also lie within a plane, this plane is orthogonal to the one containing \(s, b, b'\). It is important to note that the original vector \(a\) typically does not lie within this second plane. This non-alignment is a consequence of the fact that the true shortest distances to the aperture edges are typically not orthogonal to each other in 3D space when the ray is tilted.
Fig. 5.13 Example of a tilted ray passing through a slit. The ray is tilted around \(a\), so \(a' = a\).¶
The lengths of the actual shortest distances are adjusted by the cosine of the angles between the ray direction and the original axis vectors:
Here, \(\psi_a\) and \(\psi_b\) represent the angles lying in the planes defined by \(s, a\) and \(s, b\) respectively. Assuming \(s\), \(a\), and \(b\) are unit vectors, the cosine terms can be expressed through a dot product, utilizing the identity \(\cos \psi = \sqrt{1 - \sin^2 \psi}\):
This leads to modified tangent expressions for the directional uncertainties:
These modified tangents, \(\tan \sigma_{a'}\) and \(\tan \sigma_{b'}\), are then used to determine the values \(\tan \theta_{b'}\) and \(\tan \theta_{a'}\). With this approach, the distances \(\Delta a'\) and \(\Delta b'\), as well as the vector \(b'\), are calculated correctly. However, the vector \(a'\) is generally not entirely accurate due to the non-orthogonality of the true shortest distance vectors for tilted rays. An exception occurs when the ray is tilted exclusively along the \(a\) or \(b\) direction, in which case both vectors \(a'\) and \(b'\) are correctly determined.
The new perturbed direction vector is constructed by summing the initial ray direction with components scaled by \(\tan \theta_{b'}\) and \(\tan \theta_{a'}\) along the \(b'\) and \(a'\) unit vectors, respectively:
This resultant vector, \(s'_\text{un}\), must then be normalized to obtain the final perturbed unity direction vector \(s'\):
The implementation in ISET3D (as seen here) constructs the new vector directly from \(s\), \(a\), and \(b\). This method can introduce errors for significant ray tilts, as the components \(a\) and \(b\) are no longer orthogonal to each other in the projected plane. While our implementation addresses some of the aforementioned issues, it does not fully resolve all complexities arising from tilted rays. Nevertheless, the residual issues typically manifest noticeably only for rays with large tilt angles, as the projection effects exhibit a cosine dependency that can be neglected for small angles.
5.3.5. Selecting the Uncertainty Factor¶
To provide further parametrization, a scaling factor \(\gamma\) has been introduced into the uncertainty equations (5.71) and (5.72). The modified equations become:
Most authors typically employ a value of \(\gamma = 1\). However, Lin (2015) proposed a scaling factor of \(\gamma = \sqrt{2}\) ([9], page 17) to achieve a better fit for diffraction patterns observed at a circular aperture. This value is also implemented in the PBRT fork used by ISET3D, as can be seen here. It’s worth noting that while these sources might present the fraction as \(\tan \sigma = \frac{1}{\sqrt{2} \ldots}\), this is mathematically equivalent to our formulation of \(\tan \sigma = \frac{\gamma}{2\ldots}\) with \(\gamma = \sqrt{2}\) in equation (5.88).
In optrace, \(\gamma\) can be customized via a parameter, as detailed in Section Section 4.5.3, allowing for fine-tuning to specific simulation scenarios. By default, optrace uses \(\gamma = \sqrt{2}\). The results of this parametrization can be found in the subsequent section.
A value of \(\gamma = 2\) has been observed to provide a superior fit for the main lobe in comparison to graphs generated with \(\gamma = 1\), which are commonly found in existing literature. With \(\gamma = 2\), the simulation asymptotically matches the side lobes for slit, pinhole, and pupil geometries. Conversely, for edge diffraction, the fit is less optimal, producing more pronounced glare to the left of the edge. In such cases, \(\gamma = 1\) is likely to yield better results.
5.3.6. Comparison to Theoretical Curves¶
The following curves were generated using the test scripts located under tests/hurb/.
All simulations were conducted with an uncertainty factor of \(\gamma = \sqrt{2}\).
Fig. 5.14 Comparison of HURB and the theoretical curve for the far field diffraction of a slit.¶
Fig. 5.15 Comparison of HURB and the theoretical curve for the far-field diffraction of a pinhole.¶
Fig. 5.16 Comparison of HURB and the theoretical curve for the focus profile of an ideal lens behind a pupil.¶
Fig. 5.17 Comparison of HURB and the theoretical curve for the profile of edge diffraction.¶
References