The modern history of Lambert W began in the 1980s, when a version of the function was built into the Maple computer-algebra system and given the name W. Why W? An earlier publication by F. N. Fritsch, R. E. Shafer and W. P. Crowley of the Lawrence Livermore Laboratory had written the defining equation as wew = x. The Maple routine was written by Gaston H. Gonnet of the Institut für Wissenschaftliches Rechnen in Zurich, who adopted the letter w but because of typographic conventions in Maple had to capitalize it.

Wolffenbuttel, R. F. State-of-the-art in integrated optical microspectrometers. IEEE Trans. Instrum. Meas. 53, 197–202 (2004).

Additionally, the resolution of peak separation of the bimodal spectrum may also degenerate from the decoherence of the pre-captured diffraction, which is used to generate the PSFs over the full spectrum range. The better the coherency of the quasi-monochromatic diffraction, the higher the resolution of spectral peak separation (details in Supplementary S5).

Miniaturizing spectrometers for compact and cost-effective mobile platforms is a major challenge in current spectroscopy research, where conventional spectrometers are impractical due to their bulky footprint. Existing miniaturized designs primarily rely on precalibrated response functions of nanophotonic structures to encode spectral information captured in a snapshot by detector arrays. Accurate spectrum reconstruction is achieved through computational techniques, but this requires precise component design, high-precision fabrication, and calibration. We propose an ultra-simplified computational spectrometer that employs a one-to-broadband diffraction decomposition strategy facilitated by a numerical regularized transform that depends only on the spectrum of the diffracted radiation. The key feature of our design is the use of a simple, arbitrarily shaped pinhole as the partial disperser, eliminating the need for complex encoding designs and full spectrum calibration. Our spectrometer achieves a reconstructed spectral peak location accuracy of better than 1 nm over a 200 nm bandwidth and excellent resolution for peaks separated by 3 nm in a bimodal spectrum, all within a compact footprint of under half an inch. Notably, our approach also reveals a breakthrough in broadband coherent diffractive imaging without requiring any prior knowledge of the broadband illumination spectrum, assumptions of non-dispersive specimens, or correction for detector quantum efficiency.

On the other hand, the equation above is not totally worthless. If we have a guess about the value of W, then we can plug it into the right hand side of the equation to get an even better guess, then repeat the process until we're satisfied with the accuracy of the approximation. For some values of x—well away from 0—this simple iterative scheme converges quickly on the correct result. The algorithms used in computer-algebra software are more efficient, accurate and robust, but they still rely on successive approximations.

Figure 4. When W and x are interpreted as complex numbers (with real and imaginary components), the Lambert W function is defined throughout the complex plane. The two surfaces shown here represent the real part (left) and the imaginary part (right) of W(x) for values of x near the origin of the complex plane. The white stripe running along each surface from right to left is the projection of the real axis—the line along which numbers have zero imaginary part. On the real surface, values of W along the portion of this line to the right of the point x = –1/e correspond to the graphs in Figures 2 and 3. The complex surface has a wide discontinuity beginning at the same point. The graphs are based in part on Mathematica programs published at http://functions.wolfram.com.

In the years between Euler and Maple, the W function did not disappear entirely. The Dutch mathematician N. G. de Bruijn analyzed the equation in 1958, and the British mathematician E. M. Wright wrote on the subject at about the same time. In the 1970s and 80s there were several more contributions, including that of Fritsch, Shafer and Crowley. Nevertheless, the literature remained widely scattered and obscure until the function acquired a name. In a 1993 article, Corless, Gonnet, Hare and Jeffrey remark: "For a function, getting your own name is rather like Pinocchio getting to be a real boy."

We have succeeded in getting W off by itself on the left side, but unfortunately there's still a log(W) on the right. Thus we don't have a closed-form solution, a formula that would allow us to plug in an x and immediately get back the corresponding W. This failure is not merely a result of my ineptitude; no algebraic wizardry will yield a finite closed-form solution.

The equation eU = x also defines an inverse function; we just need to read the equation backward. Whereas the forward function maps a value of U to a value of x, the inverse function takes a value of x as input and returns the corresponding value of U. In other words, the inverse function finds the power to which e must be raised to yield a given value of x. This is another well-known, textbook function: the natural logarithm, written log(x) or ln(x). The log function has the same graph as the exponential function but reflected across the diagonal, as shown in the right part of Figure 1.

Noting that the proposed one-to-broadband diffraction-based computational spectrometer is ultra-simplified and only relies on a single-shot of broadband diffraction IB of an arbitrary shaped microstructure as input combined with a shot of monochromatic diffraction Im pre-captured in situ without any movement parts or complex calibrations over full spectrum, it is designed with an ultra-compact form. As shown in Fig. 1c, the experimental prototype of such spectrometer was formed by coupling a Φ20 μm pinhole in front of the CMOS array detector. The system was integrated into a digital camera, with a size comparable footprint of 10 mm × 10 mm in size.

Spectrometer

Figure 2. The Lambert W function (red curves) is defined by the equation WeW = x. The direct function (left) maps values of W to values of x, whereas the inverse function (right), which is of greater mathematical interest, takes x as the input and computes the corresponding value of W. The exponential and logarithmic functions (gray curves) are shown for comparison. The red and gray curves cross at the point W = 1, x = e.

A diffraction pattern of a hollow microstructure (with a constant transmission over the whole concerned spectrum) with broadband radiation in an arbitrary state of coherence can be interpreted as a linear superposition of a discrete set of monochromatic diffraction patterns within the source spectrum. The diffraction intensity in each coherent mode is inherently wavelength-dependent and depends on the spectrum of the diffracted radiation40. It is possible to retrieve the spectrum from the broadband diffraction pattern with the knowledge of all spectral components of monochromatic diffractions, which can be treated as an ill-posed MLE. This means that the radiation spectrum could be calculated only if the transmittance coefficients of each monochromatic diffraction for different wavelengths are pre-characterized as the encoding information. However, this calibration process is usually cumbersome, sometimes even not achievable in practical applications. The key point of our method is that each individual-wavelength diffraction profile Iλ at wavelength λ can be achieved from a single shot of a monochromatic diffraction pattern Im at a given wavelength λm by utilizing the one-to-broadband PSF mapping scheme (Fig. 1a). Applied with this information, the input spectrum can be reconstructed from a single-shot broadband diffraction combined with its corresponding PSFs. For a given application in diffraction optics (Fig. 1b), a wave propagated from an object couples the amplitude and phase of a diffraction field U(x’, y’, 0) through the Fraunhofer diffraction. Since the detector only records the amplitude of diffraction and drops the phase information, \({I}_{\lambda }\) can be described as43:

Some of the recent publications on W go beyond mere explication of mathematics; they carry a whiff of evangelical fervor. Those for whom W is a favorite function want to see it elevated to the canon of standard textbook functions, alongside log and sine and square root. I am reminded of another kind of canonization—a campaign for the recognition of a local saint, with testimonials to good works and miracles performed.

W has another cameo role in the "omega constant," which is a distant of cousin of the golden ratio. The latter constant, with a value of about 1.618, is a solution of the quadratic equation 1/x= x-1. The omega constant is the solution of an exponential variant of this equation, to wit: 1/ex = x. And what is the value of that solution? It is W(1), equal to about 0.567143.

Figure 4c plots the spectral correlation functions \(C(\delta \lambda )\) of the PSFs for different pixel sizes and diffraction devices as a function of \(\delta \lambda\) in wavelength space. Seeing that the spectral correlation functions of the Siemens star drop more steeply than those of the pinhole, the decrease in pixel size will also be helpful in reducing the spectral correlation function. Since the PSFs are performed as the regressors over the full spectral range in the proposed MLR scheme, that’s to say, the lower the correlation of the PSFs, the more spectrum power components can be recovered. Experimental results shown in Fig. 4d, e provide evidence to support this point. Figure 4d comparatively shows the counts of the calculated spectrum components over 10 trails of calculations from the Siemens star and the pinhole, respectively. it can be observed that 180 discrete counts are calculated from the Siemens star, whereas only about 120 counts from the pinhole, which eventually results in a much more precise reconstructed spectrum for the Siemens star than that for the pinhole, as shown in Fig. 4e. The refined design of the diffraction disperser boosts diffraction efficiency, consequently enhancing the quality of spectrum reconstruction. Meanwhile, the spectral response bandwidth of the spectrometer is predominantly limited by the detector QE.

Mitrouli, M. & Roupa, P. Estimates for the generalized cross-validation function via an extrapolation and statistical approach. Calcolo 55, 24 (2018).

Still another example comes from electrical engineering, where T. C. Banwell of Telcordia Technologies and A. Jayakumar of Anadigics show that a W function describes the relation between voltage, current and resistance in a diode. In a simple resistor, this relation is given by Ohm's law, I=V/R, where I is the current, V the voltage and R the resistance. In a diode, however, the relation is nonlinear: Although current still depends on voltage and resistance, the resistance in turn depends on current and voltage. Banwell and Jayakumar note that no explicit formula for the diode current can be constructed from the elementary functions, but adding W to the repertory allows a solution.

Spectrometry

No, not that W. I won't be drawn into presidential politics here. The W I want to discuss is something else entirely: the Lambert W function, a mathematical contrivance that has been getting a fair amount of attention lately. The buzz began in the world of computer-algebra systems such as Macsyma, Maple and Mathematica, but word of W has also been spreading through journal articles, preprints, conference presentations and Internet news groups. The W function even has its own poster (see http://www.orcca.on.ca/LambertW).

Witte, S. et al. Lensless diffractive imaging with ultra-broadband table-top sources: from infrared to extreme-ultraviolet wavelengths. Light 3, e163 (2014).

Emadi, A. et al. Design and implementation of a sub-nm resolution microspectrometer based on a Linear-Variable Optical Filter. Opt. Express 20, 489–507 (2012).

where, PSF(λ) represents the sum of PSFs from the reference diffraction Im, and ω(λ) is the power spectrum of the diffracted light. Equation (2) indicates that a broadband diffraction pattern IB captured by a detector with M × N pixels can be represented as the integral of ω(λ)[PSF(λ)]2 over the wavelength range, including of M × N multi-linear simultaneous equations with n variables of discrete spectral components over full spectrum range (details in Supplementary S1). Due to the measurement noise in both IB and Im combined with the approximation errors in PSF mapping that make the equations ill-posed, it is generally impossible to solve these equations straightforwardly by ordinary noniterative methods. Herein, a least-square-based multi-variable linear regression (MLR) scheme applying an adaptive Tikhonov regularization is employed to reconstruct the power spectrum ω(λ) and suppress the noises and errors during reconstruction. Additionally, generalized cross-validation (GCV) statistics are applied to balance the requirements of robustness and resolution44 (details in Supplementary S2).

Spectrophotometry

Momeni, B., Hosseini, E. S. & Adibi, A. Planar photonic crystal microspectrometers in silicon-nitride for the visible range. Opt. Express 17, 17060–17069 (2009).

A fancy application of broadband lensless imaging was further implemented to demonstrate the prospect of the proposed novel spectrometer in practical applications. Figure 5 shows the layout of a broadband CDI set-up (details in Supplementary S6) and the reconstructions by utilizing the developed approach compared with results based on conventional phase retrieval techniques. It should be mentioned that the strict requirement of narrowband radiation with high coherency in current CDI architectures poses a significant obstacle to achieving efficient photon utilization across the full spectrum45. Numerous studies have been conducted to overcome this trade-off for broadband CDI in recent years39,40,46,47,48,49,50, but encounter several formidable challenges, including the stringent constraints for non-dispersive specimens over full spectrum, the need for accurate spectrum measurement as input, and the requirement for the solutions to converge within the band limit to be valid. These issues severely hamper the advancement in CDI for the ultra-wide spectrum. At the same time, the proposed approach can break through these limitations and enable high-quality CDI even using broadband (i.e., incoherent) illumination without the requirement of any prior spectra (e.g., broadband illumination, the spectral transfer function of the specimen, or detector QE).

Buchberger, A. R. et al. Mass spectrometry imaging: a review of emerging advancements and future insights. Anal. Chem. 90, 240–265 (2018).

Chen, C., Gu, H. & Liu, S. Ultra-simplified diffraction-based computational spectrometer. Light Sci Appl 13, 9 (2024). https://doi.org/10.1038/s41377-023-01355-4

spectrophotometer中文

a The coherent monochromatic diffraction Im by a 633 nm band-filter. b The broadband diffraction IB captured by a wide spectrum illumination. c The measured spectrum (solid curve), the calculated power spectrum components (yellow dots), and the linear fitting with a uniform interval of 5 nm (red dots). d Recovered diffraction IB_hat from the calculated spectra power scatters. e Vertical line cuts along the center of the diffraction patterns, and red, black, and blue curves correspond to the patterns in subfigures a, b, and ds, respectively. f 3D distribution of an RR map between the measured diffraction IB and its prediction IB_hat, and the insert shows the zoom-in RR map in the region of blue boxes. All diffraction patterns are scaled to 1/2 power

Kwa, T. A. & Wolffenbuttel, R. F. Integrated grating/detector array fabricated in silicon using micromachining techniques. Sens. Actuators A 31, 259–266 (1992).

Nitkowski, A., Chen, L. & Lipson, M. Cavity-enhanced on-chip absorption spectroscopy using microring resonators. Opt. Express 16, 11930–11936 (2008).

Massspectrometry

where propagation travels a distance of z, λ is the wavelength of the radiation and \({\mathscr{F}}\) denotes the 2D spatial Fourier transform of the sample U(x’, y’, 0) at z = 0, with u and v the spatial frequencies. Equation (1) indicates that the Fraunhofer diffraction intensity distribution depends only on the propagation distance z and wavelength λ in an identical way, showing a wavelength-dependent scaling factor c/λz, which allows us to map a coherent diffraction Iλ at an arbitrary wavelength from a single shot of monochromatic diffraction Im at a given wavelength λm by PSF propagation between different spectral components (Fig. 1a). Owing to the microfeature size of the pinhole, the incident radiation can be considered as a spatial coherent illumination, which preserves a uniformity of the spectral intensity. Since the detector array captures a diffraction pattern with a much longer integration time than the coherence time of radiation, the broadband diffraction pattern IB can be treated as the incoherent sum of all spectrum components, written as:

Cheben, P. et al. A high-resolution silicon-on-insulator arrayed waveguide grating microspectrometer with sub-micrometer aperture waveguides. Opt. Express 15, 2299–2306 (2007).

A recent article by Edward W. Packel and David S. Yuen of Lake Forest College applies the W function to the classical problem of describing the motion of a ballistic projectile in the presence of air resistance. In a vacuum, as Galileo knew, the ballistic path is a parabola, and the maximum range is attained when the projectile is launched at an angle of 45 degrees. Air resistance warps the symmetry of the curve and greatly complicates its mathematical description. Packel and Yuen show that the projectile's range can be given in terms of a W function, although the expression is still forbiddingly complex. (They remark: "Honesty compels us to admit at this point that the idea for using Lambert W to find a closed-form solution was really Mathematica's and not ours.")

It's all very well to express the solutions of problems in terms of W, but then how do we find the value of the resulting function? In the case of logarithms and trigonometric functions, the standard method for many years was to look up the answer in a big printed table; now we push the appropriate button on a calculator. For W, however, there are no published tables, and so far no scientific calculator has a built-in Lambert W key. Several computer algebra systems know how to evaluate the W function, but if you don't have access to such software, you're on your own.

where Г is the regularization coefficient, ‖.‖2 is the l2 norm. Note that the efficiency of these estimates depends on the appropriate choice of the regularization coefficient Г, which should be carefully selected to balance the results of robustness and resolution. Here, we use the GCV statistic to select the regularization coefficient adaptively52. As a result, we can have the power spectrum estimates \(\hat{{\boldsymbol{\omega }}}\) from Tikhonov regularization Eq. (7).

C.C. conceived the project, conducted the experiments, performed the algorithm derivation, and analyzed the spectroscopic data. L.S. and G.H. conceived and supervised the project. C.C., L.S., and G.H. drafted the paper.

Since the total components in a measurement of power spectrum \(\hat{{\boldsymbol{\omega }}}\) distributes sparsely, corresponding to its spectral sampling interval \(\delta \lambda\) in Eq. (3), a linear fitting with a uniform interval is processed to resample the calculated dataset. Finally, the finer reconstruction of an incident spectrum is optimized by a convolution operator with a Hann window to suppress high-frequency interference. The workflow of the proposed computational diffraction-based microspectrometer is detailed in Supplementary S2.

Suppose we already know how to calculate exponentials and logarithms; can we then solve the equation WeW = x? As noted above, the forward version is easy: just evaluate eW and then multiply by W. At first glance, the inverse function looks like it might be wrestled to submission by a similar tactic. If we can solve for x by calculating an exponential and then multiplying, can't we solve for W by dividing and then taking a logarithm?

a, b Broadband (left) and narrowband (right, wavelength of 710 nm with 10 nm FWHM) diffractions of a pinhole and a Siemens star, respectively. c The calculated spectral correlation function of the PSF for different diffraction devices and pixel sizes of the detector. d The counts of the calculated spectrum components over 10 trails of calculations from the diffraction data of the Siemens star and pinhole, respectively. e Reconstructed spectra for the Siemens star and the pinhole, corresponding to a pixel size of 7 μm, compared with the measurement (black curve)

This equation defines the exponential function, also written exp(U). The function maps each given value of U to a corresponding value of x, namely e raised to the power U. If U is a positive integer, we can calculate the function's value by simple arithmetic: Just multiply e by itself U times. For nonintegral U, the procedure is not quite so obvious but is still well-defined; the left part of Figure 1 shows the elegant curve generated.

Figure 3. Detailed view of the inverse W function shows its most distinctive feature: the region between x = –1/e and x = 0 where the function has two values at each point. For example, at x = –0.2, W(x) evaluates to either -0.259 or –0.543. There are many such two-valued functions, including square root, but W is the simplest in which there is no trivial relation between corresponding values on the two branches.

A few years later Robert M. Corless and David J. Jeffrey of the University of Western Ontario launched a discussion of W and its applications in what has turned out to be a long series of journal articles and less-formal publications. The most influential paper, issued as a preprint in 1993 but not published until 1996, was written by Corless and Jeffrey in collaboration with Gonnet, David E. G. Hare of the University of Waterloo and Donald E. Knuth of Stanford University. This was the paper that named the function in honor of the 18th-century savant Johann Heinrich Lambert.

For a mathematical function, multiple values are an embarrassment of riches; a well-bred function is supposed to map each value in its domain to a single value in its range. But in practice multiple values are not uncommon, particularly with inverse functions. The square root is a familiar example: Whereas squaring 2 yields the unique result 4, the square root of 4 could be either +2 or -2. Some of the trigonometric functions are even worse. Every angle has just one sine, but the inverse function, the arc sine, wraps around to produce infinitely many values.

He, J. J. et al. Monolithic integrated wavelength demultiplexer based on a waveguide Rowland circle grating in InGaAsP/lnP. J. Lightwave Technol. 16, 631–638 (1998).

Taking the inverse of this function—solving WeW = x for W instead of for x—finally brings us to the Lambert W function. Just how to solve for W is a matter I'll return to below, but for now it's enough to flip the graph of the function about its diagonal, as in the right side of Figure 2; the inverse graph is drawn in more detail in Figure 3. Just as the forward function resembles the exponential curve, the inverse function appears similar to the logarithm. The curves for log(x) and W(x) cross at x=e, where both are equal to 1. Where things get most interesting, again, is to the left of x=0. Whereas log(x) is undefined for any x ≤ 0, W(x) continues to have a value down to x=-1/e, or about -0.37. Indeed, when x lies in the range between -1/e and 0, W(x) has not just a value but two values. For example, W(-0.2) could be equal to either -0.26 or -2.54. Plugging either of these W values into the formula WeW yields the x value -0.2.

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

Figure 1. Exponential and logarithmic functions, defined by the equation eU = x, can be taken as simplified models of Lambert W. The exponential curve (left) gives x as a function of U; the logarithmic curve (right) is the inverse, finding the value of U corresponding to any given x. Flipping either graph along the diagonal yields the other graph.

What does that mean? Some readers of this column will grasp it instantly, but I am not going to pretend that I am one of them. It took me a while to figure out how W works, and even longer to see why the concept might be considered interesting or important. At the risk of inflicting severe tedium on those who are more adept at algebra and analysis, I want to retrace my own path toward understanding what W is all about. It's a fairly long and wiggly path.

Note that the formula of Eq. (6) is a system of M × N multi-linear simultaneous equations with \(n\)-dimensional parameter vector, where A is a given M × N × n matrix with elements of each column of a flattened PSF(λi) matrix in 1D array corresponding to the ith slice of spectrum and b is a known vector of a recorded broadband diffraction flattened in 1D array, ω is the vector of unknown spectrum coefficients for the function. Practically, it is usually impossible to solve the MLR by ordinary noniterative methods due to its ill-posed nature. To tackle such instabilities, a method of residual norm minimization is applied with a weighting regularization factor, as known as Tikhonov regularization, to reconstruct the power spectrum ω and suppress the noise signals during reconstruction. The least square of the sum of squared residuals with a regularization item is minimized as

To discuss our articles or comment on them, please share them and tag American Scientist on social media platforms. Here are links to our profiles on Twitter, Facebook, and LinkedIn.

Golub, G. H., Heath, M. & Wahba, G. Generalized cross-validation as a method for choosing a good ridge parameter. Technometrics 21, 215–223 (1979).

Experimental verification of our developed spectrometer demonstrates a reconstructed spectral peak location accuracy better than 1 nm over a 200 nm bandwidth and spectral resolution for a bimodal spectrum with peaks of 3 nm separation, all within a compact footprint of under half an inch. This represents the first demonstration of a spectrometer design that integrates an ultra-simplified and arbitrarily shaped diffraction structure. Our design eliminates the need for pre-encoding designs, high-precision fabrication, or complex calibration processes. It enables single-shot spectrum measurements across a wide wavelength range, from ultraviolet to infrared, with miniaturized lab-on-chip integration. This advancement is crucial for portable applications, offering high robustness, low cost, and long-term stability. Furthermore, the proposed method also reveals a significant breakthrough in broadband CDI without requiring any prior knowledge of the broadband illumination spectrum, assumptions of non-dispersive specimens, or correction of detector quantum efficiency (QE).

For assistance with this article I offer warm thanks to Jonathan M. Borwein, David W. Cantrell, Robert M. Corless, David J. Jeffrey and Tim Royappa.

How to use spectrophotometer

The advocates of W do make a strong case. In a 2002 paper, Corless and Jeffrey argue that W is in some sense the smallest step beyond the present set of elementary functions. "The Lambert W function is the simplest example of the root of an exponential polynomial; and exponential polynomials are the next simplest class of functions after polynomials."

Other applications of W have been discovered in statistical mechanics, quantum chemistry, combinatorics, enzyme kinetics, the physiology of vision, the engineering of thin films, hydrology and the analysis of algorithms.

Fröch, J. E. et al. Dual band computational infrared spectroscopy via large aperture meta-optics. ACS Photonics 10, 986–992, (2023).

Tittl, A. et al. Imaging-based molecular barcoding with pixelated dielectric metasurfaces. Science 360, 1105–1109 (2018).

It's not too late to right the wrong. On a bus in Italy—a country that doesn't even have a w in its alfabeto—I overheard a fragment of a conversation: Someone was reading a URL and pronounced the first part "woo woo woo." It's a shrewd accommodation to linguistic wimperialism. We should all adopt it. Let us keep the letter but change the way we say it. Whether it's Lambert W or George W. or www, it's woo all the way.

Johnson, A. S. et al. Quantitative hyperspectral coherent diffractive imaging spectroscopy of a solid-state phase transition in vanadium dioxide. Sci. Adv. 7, eabf1386 (2021).

Goldberger, D. et al. Single-pulse, reference-free, spatiospectral measurement of ultrashort pulse-beams. Optica 9, 894–902 (2022).

For large x, this expression soars off to infinity faster than we can follow it, but Euler showed that the tower converges to a finite value in the domain between x = e-e (about 0.07) and x = e1/e (about 1.44). Within this realm, the value to which the infinite tower converges is W(-log(x))/-log(x).

The aftermost transmission spectrum of the system at the detector plane (Fig. 5d) can be successfully resolved from the pre-captured coherent quasi-monochromatic diffraction pattern (Fig. 5b) and the broadband diffraction pattern in-situ with a bandwidth of 20%, spanning from 480 nm to 600 nm (Fig. 5c) by the proposed method. Then, as demonstrated in Fig. 5e, the monochromatized diffraction pattern can be retrieved from the corresponding broadband diffraction utilizing a numerical monochromatization method39 (details in Supplementary S7). Noting that the broadband pattern displayed a significant reduction in coherence compared to the coherent pattern. This decrease in coherence ultimately resulted in a convergence failure during the CDI reconstruction process (Fig. 5f). However, the monochromatization by the proposed method effectively addresses this decoherence issue arising from the broadband radiation. Furthermore, a comparison of CDI results was eventually performed by 500 iterations of RAAR51 from the broadband pattern and monochromatized pattern, respectively. Compared with the CDI result from the broadband pattern (Fig. 5f), the monochromatized CDI (Fig. 5g) showcases a remarkable improvement in the quality of the reconstruction with high fidelity. The good spectral agreement and high quality of the broadband CDI results demonstrate the superiority of the proposed approach, implying huge potential applications not only in broadband spectrum metrology with high resolution but also in fields of rising computational imaging techniques.

There is an obvious family resemblance between single-U and W, between the equations eU = x and WeW = x. In the case of the forward W function, if we know how to calculate eW , then it's a trivial matter to calculate WeW : just multiply by W. The resulting curve is shown in the left part of Figure 2. In overall shape it looks much like the exponential curve, although for large W it rises more steeply. Where eW and WeW really part company is to the left of W=0. Whereas eW is always positive, WeW dips into negative territory, reaching a minimum at the point W=-1, x=-1/e. As W tends toward negative infinity, both eW and WeW approach 0, but one from above and the other from below.

In practical applications, the reconstructed spectrum is usually more sensitive to the diffraction efficiency of the disperser device. We further conducted two groups of validations by applying a Φ20 μm pinhole and a Φ100 μm Siemens star as the diffracted disperser, respectively. Noting that the diffractions from the Siemens star (Fig. 4b) retain more abundant information in frequency with high SNR than these from the pinhole (Fig. 4a), which can improve the generalization ability and the accuracy of the proposed diffraction-based computational spectrometer. here, we introduce the spectral correlation function of the PSF to determine the spectral resolution, as given by:

Xu, H. N. et al. Breaking the resolution-bandwidth limit of chip-scale spectrometry by harnessing a dispersion-engineered photonic molecule. Light 12, 64 (2023).

If you ask the same question of more familiar functions such as exp and log and square root, the answer is that those functions are tools useful in solving broad classes of mathematical problems. With just the four basic operations of arithmetic, you can represent the solution of any linear equation. Adding square roots to the toolbox allows you to solve quadratic equations as well. Expanding the kit to include the trigonometric, exponential and logarithmic functions brings still more problems within reach. All of these well-known functions, and perhaps a few more, are classified as "elementary." The exact membership of this category is not written in stone, but it excludes more specialized tools such as Bessel functions.

Miniaturized spectrometers, characterized by their compact size and improved performance compared to conventional spectrometers, offer significant potential in various applications such as spectral characterization1,2, materials analysis3, and hyperspectral imaging4. Recent advancements in high-precision lithographic micro-fabrication5 and computational techniques6,7 have led to the development of a range of miniaturized spectrometers based on nanophotonic dispersive structures or spectral filter sensors. These spectrometers can be broadly categorized into two design approaches. The first approach involves one-to-one spectral-to-spatial mapping, where different bands of the light spectrum are separated spatially or temporally and then detected sequentially by a sensor array. Such spectrometers are generally based on conventional grating-based dispersions8,9,10,11, meta-surface dispersions12,13,14,15, waveguide propagations16,17,18, digital planar holography19,20, dispersive photonic crystals21,22, narrowband filters23,24,25,26,27, microfiber taper28, and microcrystal resonators29,30,31,32. However, these instruments typically have limitations in terms of narrowband spectral dispersions across a wide spectrum range and suffer from low photon throughput. An alternative approach relies on broadband-to-broadband spectra mapping combined with computational retrieval algorithms. In this design, the intensities of multiple spectral bands are simultaneously detected after passing through different broadband filters, and the input spectrum is computationally reconstructed. Quantum dot arrays33,34, nanowire sensors35, and disordered multi-scatterings36,37,38 have been explored in such designs. Nonetheless, the aforementioned systems require meticulous designs, and their performance is highly susceptible to fabrication errors and environmental disturbances. Complex calibration procedures and long-term instability also limit the resolution and robustness of these methods. The representative state-of-the-art computational spectrometers over the past decade are summarized in Table 1.

Lambert, who wrote on everything from cartography to photometry to philosophy, never published a word on the function that now bears his name. It was his eminent colleague Leonhard Euler who first described a variant of the W function in a paper published in 1779, two years after Lambert's death. So why isn't it called the Euler W function? For one thing, Euler gave credit to Lambert for the earliest work on the subject. Perhaps more to the point, Corless, Jeffrey and Knuth note that "naming yet another function after Euler would not be useful."

The authors thank the technical support from the Experiment Centre for Advanced Manufacturing and Technology in the School of Mechanical Science &Engineering of HUST. This work was supported by the National Natural Science Foundation of China (52130504), Key Research and Development Program of Hubei Province (2021BAA013), Innovation Project of Optics Valley Laboratory (OVL2023PY003), Natural Science Foundation of Hubei Province (2021CFB322), Fundamental Research Funds for the Central Universities (2021XXJS113), and Guangdong Basic and Applied Basic Research Foundation (2023A1515030149).

DeCorby, R. G. et al. Chip-scale spectrometry based on tapered hollow Bragg waveguides. Opt. Express 17, 16632–16645 (2009).

Li, W. et al. Lensless imaging through thin scattering layers under broadband illumination. Photonics Res. 10, 2471–2487 (2022).

In summary, we have proposed a novel scheme of computational spectrometer based on the one-to-broadband diffraction applying a simplified and arbitrarily shaped diffraction microstructure as the disperser, which makes the device ultra-compact and low-cost and paves the way towards single-shot spectrum metrology. Different from other computational spectrometer designs, the proposed spectrometer is based on the PSF mapping from a single shot of pre-captured coherent monochromatic diffraction to generate a full spectral response function, and it does not require pre-encoding design, complex fabrication with high precision, or full spectral response function calibration. Experiments conducted on a proof-of-concept have verified the methodology, and results indicate that the proposed computational spectrometer provides a spectral resolution better than 3 nm and the accuracy of the spectral peak is better than 1 nm over a 200 nm bandwidth. Benefiting from its generality of principle, simple architecture, and compact size, the proposed approach has great potential in a huge range of applications in broadband spectrum metrology and computational imaging with miniaturized, cost-effective, and lab-on-chip integration. A broadband CDI prototype is successfully implemented based on the proposed approach to practically demonstrate a fancy application in broadband lensless imaging, which successfully tackles all the challenges of the current state-of-the-art broadband phase retrieval techniques (e.g., the ultra-broadband illumination with unknown spectrum, free of spectral correction of the specimen or detector QE). The proposed method can be easily extended and applied to optical techniques and systems related to multi-state coherent diffraction superposition, such as phase-retrieval-based computational imaging systems with broadband or multi-wavelength illumination.

It should be noticed that all these results are normalized to their peak intensities and the QE coefficient of the detector is eliminated from the reconstructions. a Calculated discrete scatters (yellow circles) of a spectrum with 4 narrowband peaks corresponding to 532 nm, 580 nm, 633 nm, and 710 nm, compared with the measurement. b The reconstructed spectrum (red line) from the calculated discrete data in (a). c Calculated discrete scatters and the reconstructions of a bimodal spectrum with peaks of 8 nm apart under different Hann kernel sizes compared with the measurement. d The reconstruction of a bimodal spectrum with peaks of 3 nm separation. e, f Reconstructions of two different broadband spectra modulated by filters from a supercontinuum light source with the bandwidth of 100 nm and 230 nm, respectively. In f, the mean spectrum of five trials of measurements and the corresponding error bar (standard deviation)

Hansen, P. C. REGULARIZATION TOOLS: a matlab package for analysis and solution of discrete ill-posed problems. Numer. Algorithms 6, 1–35 (1994).

Wang, P. & Menon, R. Computational spectrometer based on a broadband diffractive optic. Opt. Express 22, 14575–14587 (2014).

But the elevation of W has not won universal assent. R. William Gosper, Jr., has suggested that a better choice might be the square of W, that is, WeW2 = x, which eliminates the multivalued branching on the real line. (In a play on "Lambert W," Gosper calls this the Dilbert lambda function.) And Dan Kalman of American University has suggested a formulation based on eW/W = c, with an inverse function he calls glog.

The data and codes that support the plots within this paper and other findings of this study are available from the corresponding author upon reasonable request. Source data are provided in this paper.

The bandwidth of the incident spectrum is uniformly divided into n slices λ1, λ2,…, λn, the PSF at an arbitrary wavelength λi distributes as a scale from a monochromatic diffraction pattern Im at a wavelength λm:

A few years ago, a brief, unsigned editorial in Focus, the newsletter of the Mathematical Association of America, asked: "Time for a new elementary function?" The function proposed for promotion to the core set was Lambert W. Whether W ultimately attains such canonical status will depend on whether the mathematical community at large finds it sufficiently useful, which won't be clear for some years. In the meantime, I can list a few applications of W discovered so far.

In trying to make sense of the expression WeW , the first question is not "why W?" but "why e?" The e in the formula is Euler's number, the second-most-famous constant in all of mathematics, often introduced as "the base of the natural logarithms"; but then the natural logarithms are usually defined as "logarithms taken to the base e," which is not much help. Another way of defining e, originally derived from the study of compound interest, avoids this circularity: e is the limiting value of the expression (1+1/n) n as n tends to infinity. Thus we can approximate the value of e by setting n equal to some arbitrary, large number. With n=1,000,000, for example, we get six correct digits of e: 2.71828.

a Schematic of the operation principle from a monochromatic diffraction to a broadband diffraction, i.e., one-to-broadband diffraction. A broadband diffraction \({I}_{B}\) captured in-situ can be represented as a superposition of wavelength-dependent PSFs from a single-shot monochromatic diffraction \({I}_{m}\) at wavelength \({\lambda }_{m}\) times the corresponding power spectrum components \({\rm{\omega }}\left(\lambda \right)\) over full spectrum. The incident spectrum \({\rm{\omega }}\left(\lambda \right)\) can be reconstructed using adaptive Tikhonov regularization. b Geometry of the proposed diffraction-based spectrometer. c A photograph of the ultra-compact computational spectrometer developed based on the proposed principle, which is integrated into a tiny CMOS panel (10 mm × 10 mm in size)

Figure 3 presents five arbitrary spectra reconstructed by the above process (red curves) compared with the corresponding measurements (black curves). It should be mentioned that a quasi-monochromatic diffraction Im from a given narrowband filter is pre-captured to generate the PSFs before each spectrum reconstruction, as mentioned above. Results in Fig. 3a were reconstructed from the corresponding pre-captured pattern Im at the wavelength of 633 nm with a full width at half maximum (FWHM) of 3 nm, Fig. 3c, d from that at the wavelength of 532 nm with an FWHM of 3 nm and 1 nm, respectively, Fig. 3e from that at the wavelength of 750 nm with a FWHM of 10 nm, and Fig. 3f from that at the wavelength of 710 nm with a FWHM of 10 nm, respectively. In the first case, a wide spectrum with 4 narrowband peaks around the wavelength of 532 nm, 580 nm, 633 nm, and 710 nm was concerned, which was reconstructed from these calculated power spectrum components (Fig. 3a) via uniform resampling and convolution procedures. It indicates that the reconstructed spectrum exhibits a peak location accuracy better than 1 nm over the concerned 200 nm spectral range (Fig. 3b). In practice, the convolution with a Hann window is used to process the reconstructed spectrum, and the Hann kernel shapes the spectrum curves enormously (Fig. 3c), resulting in notable mismatch to the measurement in ground truth. It indicates that the convolution kernel should be carefully selected to improve the precision of spectrum reconstruction in practical applications. Furthermore, as illustrated in Fig. 3d, the proposed spectrometer presents a high spectral resolution and can easily distinguish a bimodal spectrum with peaks of 3 nm separation from the corresponding pre-captured narrowband diffraction with a FWHM of 1 nm. Moreover, to verify the robustness against the bandwidth, reconstructions of arbitrarily shaped broadband spectra with bandwidths of 100 nm and 230 nm were carried out, and results are respectively shown in Fig. 3e, f. Note that the reconstructed spectral peaks agree well with the measurements in ground truth by a commercial grating-based spectrometer (Horiba iHR550), and the spectral curves are also well-traced with relatively low error bars. Tiny mismatches occur occasionally on steep turning points of the spectra when subjected to ultra-broadband spectrum, as indicated with the blue dashed box in Fig. 3f.

Goldman, D. S., White, P. L. & Anheier, N. C. Miniaturized spectrometer employing planar waveguides and grating couplers for chemical analysis. Appl. Opt. 29, 4583–4589 (1990).

The data and codes that support the plots within this paper and other findings of this study are available from the corresponding author upon reasonable request. Source data are provided in this paper.

To verify the superposition of broadband diffraction via PSF mapping, we first captured a coherent monochromatic diffraction shot Im (Fig. 2a) in situ at a 633 nm wavelength to generate a series of PSFs as the regressors over full band spectrum components and a shot of broadband diffraction IB (Fig. 2b) from radiation with 350 nm bandwidth spectrum (Fig. 2c solid curve) as the spectrum-response variable. Then, 334 discrete counts of the power spectrum ω(λ) were calculated at different wavelength positions by solving Eq. (2) with the MLR scheme (Fig. 2c yellow dots). Then, a linear fitting with a uniform interval of 5 nm is processed to resample the calculated dataset (Fig. 2c red dots). Note that the distribution of the calculated power spectrum presents a high alignment with the measurement, even notably when subjected to specified step changes of the power spectrum. Thereafter, we recovered a prediction of the broadband diffraction IB_hat by summing up the calculated spectral components times the corresponding PSFs (Fig. 2d). The recovered diffraction pattern matches well with the measured broadband diffraction, especially in the low orders of diffraction, while the intensities in high orders are blurred due to the inherent nature of temporal decoherence and the read noise of camera (Fig. 2e). Moreover, we used the residual rate (RR) (IB − IB_hat)/IB to evaluate the alignment between the captured broadband diffraction and its prediction (Fig. 2f). Seeing that the RR increases along with the order of the diffraction since only first several orders of broadband diffraction are recorded with high SNR (signal-to-noise ratio), corresponding to RR < 0.1.

A broadband diffraction IB is the integral of ω(λ)[PSF(λi)]2 over the wavelength range, which can be performed as an MLR model by summing n discrete slices in spectra range for approximation, rewritten to a matrix form in simplicity:

Dividing both sides of the equation by W gives eW = x/W. Then, taking the logarithm of both sides produces log(eW) = log(x/W). On the left hand side, the logarithm of eW is simply W. On the right hand side we can rewrite the logarithm of a quotient as the difference of two logarithms, and so we wind up with this equation:

a The schematic layout of the broadband CDI set-up. b The pre-captured coherent pattern at 532 nm with 5 ms exposure time. c The corresponding broadband pattern captured in situ with up to 20% bandwidth (spectrum ranging from 480 nm to 600 nm) with only 0.05 ms exposure time. d The aftermost calculated spectrum components of the system at the detector plane from the diffraction datasets given in (b, c). e The monochromatized pattern recovered from the broadband data in (c) applying the calculated spectrum components in (d). f CDI results from the broadband data in (c). g CDI results from the monochromatized data in (e). All diffraction patterns are log-scaled

Liapis, A. C. et al. On-chip spectroscopy with thermally tuned high-Q photonic crystal cavities. Appl. Phys. Lett. 108, 021105 (2016).

The proposed one-to-broadband diffraction-based computational spectrometer is based on PSF mapping. Therefore, ideally, the spectral resolution is limited by the spectral sampling interval of the PSF mapping for a constant diffraction distance z:

UV-Vis spectrophotometer

Little, B. E. et al. Ultra-compact Si-SiO2 microring resonator optical channel dropping filters. IEEE Photonics Technol. Lett. 10, 549–551 (1998).

where npixel is the sum of pixels within the active sensor array size in the detector, λ1 and λn denote the boundaries of the broadband spectrum. Equation (3) indicates that the spectral resolution is reciprocally related to the number of sampling pixels in the active detector sensor array, primarily determined by the detector’s dynamic range. Since higher diffraction orders typically exhibit lower intensity, resulting in poor SNR. To address this, we intentionally overexpose and subsequently filter out the zero-order diffraction to fully utilize the sensor’s dynamic range. Additionally, we eliminate background noise in the detector to enhance the diffraction SNR. In our diffraction-based spectrometer, utilizing larger active sensor arrays enhances spectrum measurement precision but also comes with a significant increase in computational expense. Consequently, we carefully bin the pixels to strike a balance between the quality of spectrum measurement and computational expenses. For a more detailed analysis, please refer to Supplementary S4.

State Key Laboratory of Intelligent Manufacturing Equipment and Technology, Huazhong University of Science and Technology, Wuhan, Hubei, 430074, China

where xi, yi denotes the coordinates of the diffraction pattern at a wavelength λi, and M, N is the total number of pixels in the captured diffraction pattern along the X, Y direction, respectively. Seeing that the PSF(λi) is an affine transformation from a reference diffraction field \(\sqrt{{I}_{m}}\) where λi/λm is the scaling factor to describe the PSF mapping and (M(λm − λi)/λm, N(λm − λi)/λm) is the translation factor to center the scaled diffraction orders. It is worth noting that since each pixel’s readout value represents the sum of diffraction intensities across all spectral channels, the PSF mapping matrix should be resampled by performing interpolation such that the spatial resolution of PSF(λi) matches the sensor pixel size. Additionally, λm would be carefully selected around the mass of the center of the broadband spectrum to reduce the PSF mapping error from interpolation (details in Supplementary S8).

Tikhonov, A. N. On the solution of ill-posed problems and the method of regularization. Dokl. Akad. Nauk SSSR 151, 501–504 (1963).

Spectrophotometer

Debaes, C. et al. Deep proton writing: a rapid prototyping polymer micro-fabrication tool for micro-optical modules. N. J. Phys. 8, 270 (2006).

Recently, broadband diffraction with partial coherence brought new insight into both coherent diffractive imaging (CDI)39,40 and spectrum metrology41,42. This principle relies on the linear superposition of a broadband diffraction pattern, composed of coherent diffraction components that are inherently wavelength-dependent and characterized through the propagation of the spatial-spectral point-spread function (PSF) in the source spectrum. However, for diffraction-based spectrometers, the design of diffractive optics for encoding and the characterization of the PSF over the entire spectrum range requires careful calculations. These considerations introduce trade-offs that limit the performance of spectrometers in terms of simplicity and miniaturization.

Sander, D. & Müller, J. Selffocussing phase transmission grating for an integrated optical microspectrometer. Sens. Actuators A: Phys. 88, 1–9 (2001).

Wang, S. W. et al. Concept of a high-resolution miniature spectrometer using an integrated filter array. Opt. Lett. 32, 632–634 (2007).

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.

Gao, B. S., Shi, Z. M. & Boyd, R. W. Design of flat-band superprism structures for on-chip spectroscopy. Opt. Express 23, 6491–6496 (2015).

Of more practical import, W also appears in solutions to a large family of equations known as delay differential equations, which describe situations where the present rate of change in some quantity depends on the value of the quantity at an earlier moment. Behavior of this kind can be found in population dynamics, in economics, in control theory and even in the bathroom shower, where the temperature of the water now depends on the setting of the mixing valve a few moments ago. Many delay differential equations can be solved in terms of W; in some cases the two branches of the W function correspond to distinct physical solutions.

The Lambert W function may make a pretty curve, but what's it good for? Why should anyone care? By mixing up a few symbols we could generate an endless variety of function definitions. What makes this one stand out from all the rest?

Bacon, C. P., Mattley, Y. & DeFrece, R. Miniature spectroscopic instrumentation: applications to biology and chemistry. Rev. Sci. Instrum. 75, 1–16 (2004).

My own misgivings about Lambert W pertain not to the function itself but to the name. Again: Why W? Over the years, English-speaking people have inflicted far too many Ws on the rest of the world, from the Wicked Witch of the West to the W boson to the World Wide Web. (Again I forgo comment on the current occupant of the White House.) We purse our lips painfully to pronounce doubleyou, doubleyou, doubleyou. With 26 letters to choose from, why do we keep fixing upon the only letter in the English alphabet with a polysyllabic name? (I acknowledge that I have made matters worse by writing this column, in which every sentence of the text includes at least one instance of the letter w.)

Shi, Z. M. & Boyd, R. W. Fundamental limits to slow-light arrayed-waveguide-grating spectrometers. Opt. Express 21, 7793–7798 (2013).

To illustrate the performance of the proposed spectrometer, a group of experimental validations was performed using a supercontinuum light source (YSL Photonics SC-Pro-M) and a set of optical filters (Thorlabs F series) to modulate the shape of incident spectra. The light scattered from a Φ20 μm pinhole was recorded by a digital camera (MV-CA050) to capture a coherent quasi-monochromatic diffraction shot Im from a narrowband spectrum and a broadband diffraction shot IB in situ from an unknown wide spectrum, respectively (set-up detailed in Supplementary S3).

Here, we report a novel and straightforward spectrometer design based on one-to-broadband diffraction mapping. Our innovative approach incorporates an arbitrarily shaped pinhole as a diffraction-based partial-disperser positioned in front of the detector. This eliminates the need for pre-encoding designs, making the spectrometer ultra-simplified. By solving a multi-variable linear equation (MLE), we can determine the incident light’s spectrum accurately. The MLE is solved using coherent mode decomposition, employing a numerical regularized transform based on a single-shot measurement of quasi-monochromatic diffraction, which serves as the point-spread function (PSF). Importantly, the PSF relies solely on the diffracted radiation spectrum.

The concept at the root of W can be traced back through more than two centuries of the mathematical literature, but the function itself has had a name only for the past 10 years or so. (A few years longer if you count a name used within the Maple software but otherwise unpublished.) When it comes to mathematical objects, it turns out that names are more important than you might guess.

The problem with multivalued functions is knowing which value, or branch, to choose. Most calculators and programming languages give precedence to positive roots and to arc sine values between -90 and +90 degrees, but there is no fundamental justification for these choices. In the case of Lambert W, the part of the curve with W>-1 has been labeled the "principal branch," but again this is mainly a matter of convention. (In the complex plane, W has infinitely many branches.)